Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(routing): make the examples work for marketplace demos #1717

Merged
merged 2 commits into from
Apr 9, 2024

Conversation

slonka
Copy link
Contributor

@slonka slonka commented Apr 9, 2024

The examples in the blogpost / httproute / tcproute look like they should work with the marketplace demo but they actually don't (kuma.io/service is the same, but version tags and prefix is wrong).

This combined with the "catch all" route causes an invalid MeshHTTPRoute to "sort of work" without any warning and can cause confusion down the line.

E.g. if we take the old MeshHTTPRoute with a 90/10 split:

          default:
            backendRefs:
              - kind: MeshServiceSubset
                name: backend_kuma-demo_svc_3001
                tags:
                  version: "1.0"
                weight: 90
              - kind: MeshServiceSubset
                name: backend_kuma-demo_svc_3001
                tags:
                  version: "2.0"
                weight: 10

this produces the following envoy configuration:

      - match:
          path: "/api"
        route:
          weighted_clusters:
            clusters:
            - name: backend_kuma-demo_svc_3001-de1397ec09e96dfb
              weight: 90
            - name: backend_kuma-demo_svc_3001-e0530223b717773a
              weight: 10
      - match:
          prefix: "/api/"
        route:
          weighted_clusters:
            clusters:
            - name: backend_kuma-demo_svc_3001-de1397ec09e96dfb
              weight: 90
            - name: backend_kuma-demo_svc_3001-e0530223b717773a
              weight: 10
          timeout: 15s
      - match:
          prefix: "/"
        route:
          cluster: backend_kuma-demo_svc_3001

the first two matches will not match (not matching version/path) and the "catch all" will make the requests work with 50/50 split.

I think this is a bug in "catch all" mechanism. I think we should add the "prefix" to existing split not create a new "catch all" route. So if there is no match you get a 404 and you immediately know that there is something wrong with MeshHTTPRoute and not silently ignore the not working policy. WDYT? @bartsmykla (original author of kumahq/kuma#6993) @lobkovilya ( kumahq/kuma#6758 ) and @michaelbeaumont ( this docs ) also @lahabana.

Kuma issue: kumahq/kuma#9885

Did you sign your commit? Instructions yes

Have you read Contributing guidelines? yes

Signed-off-by: slonka <slonka@users.noreply.github.com>
@slonka slonka requested a review from a team as a code owner April 9, 2024 11:15
@slonka slonka requested review from kleinfreund, Automaat, lahabana, michaelbeaumont, bartsmykla and lobkovilya and removed request for a team April 9, 2024 11:15
Copy link

netlify bot commented Apr 9, 2024

Deploy Preview for kuma ready!

Name Link
🔨 Latest commit c568167
🔍 Latest deploy log https://app.netlify.com/sites/kuma/deploys/6615269f15535b0008287a7b
😎 Deploy Preview https://deploy-preview-1717--kuma.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 90 (🔴 down 5 from production)
Accessibility: 90 (no change from production)
Best Practices: 100 (no change from production)
SEO: 85 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@slonka slonka merged commit 2f4bf7a into kumahq:master Apr 9, 2024
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants