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

MeshPassthrough with http remote endpoint #11201

Closed
bcollard opened this issue Aug 23, 2024 · 0 comments · Fixed by #11204
Closed

MeshPassthrough with http remote endpoint #11201

bcollard opened this issue Aug 23, 2024 · 0 comments · Fixed by #11204
Labels
kind/bug A bug triage/accepted The issue was reviewed and is complete enough to start working on it
Milestone

Comments

@bcollard
Copy link

What happened?

Given:

  • mesh passthrough turned off
  • client-1 being a workload in the mesh, that connects to a remote service over HTTP (not in the mesh)
  • and the following policy:
apiVersion: kuma.io/v1alpha1
kind: MeshPassthrough
metadata:
  name: allow-client1-cluster1-to-kgw-cluster2
  namespace: kong-mesh-system
  labels:
    kuma.io/mesh: default
spec:
  targetRef:
    kind: MeshSubset
    proxyTypes:
    - Sidecar
    tags:
      kuma.io/service: client-1_client_svc
  default:
    passthroughMode: Matched
    appendMatch:
    - type: IP
      value: $PROXY_IP
      protocol: http
      port: 80

Then, the generated Envoy config for sidecar attached to client-1 is like:

                  "filters": [
                    {
                      "name": "envoy.filters.network.http_connection_manager",
                      "typed_config": {
                        "@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager",
                        "stat_prefix": "meshpassthrough_http_80",
                        "route_config": {
                          "name": "meshpassthrough_http_80",
                          "virtual_hosts": [
                            {
                              "name": "<public IP ADDRESS>",
                              "domains": [
                                "<public IP ADDRESS>"
                              ],
                              "routes": [
                                {
                                  "match": {
                                    "path": "/"
                                  },
                                  "route": {
                                    "cluster": "meshpassthrough_<public IP ADDRESS>_80"
                                  }
                                }
                              ]
                            },
                            {
                              "name": "no_match",
                              "domains": [
                                "*"
                              ],
                              "routes": [
                                {
                                  "match": {
                                    "prefix": "/"
                                  },
                                  "direct_response": {
                                    "status": 503,
                                    "body": {
                                      "inline_string": "This response comes from Kuma Sidecar. No routes matched this domain - check configuration of your MeshPassthrough policy.\n"
                                    }
                                  }
                                }
                              ]
                            }
                          ]
                        },

The route matcher should be "prefix": "/" and not "path": "/".

@bcollard bcollard added kind/bug A bug triage/pending This issue will be looked at on the next triage meeting labels Aug 23, 2024
@lahabana lahabana added triage/accepted The issue was reviewed and is complete enough to start working on it and removed triage/pending This issue will be looked at on the next triage meeting labels Sep 9, 2024
@lahabana lahabana added this to the 2.9.x milestone Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug triage/accepted The issue was reviewed and is complete enough to start working on it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants