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

edge-stack is failing to route traffic on port 8443 #69

Open
anabih opened this issue Jul 27, 2022 · 0 comments
Open

edge-stack is failing to route traffic on port 8443 #69

anabih opened this issue Jul 27, 2022 · 0 comments

Comments

@anabih
Copy link

anabih commented Jul 27, 2022

edge-stack is failing to route traffic on port 8443 after exposing it, with HTTP 404 error.

Casey did a little bit of digging, and according to him the virtual host and the server names are not propagated correctly for some reason.

The port is exposed to Kubernetes:

kubectl get services
NAME               TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                                     AGE
ambassador         LoadBalancer   11.111.222.111   localhost     80:31769/TCP,443:31982/TCP,8443:31695/TCP   54d

We do use the lua script in the Module that strips the port from authority.

apiVersion: getambassador.io/v3alpha1
kind:  Module
metadata:
  name:  ambassador
  namespace: alpha-ambassador
spec:
  config:
  # Use the items below for config fields
    lua_scripts: |
      function envoy_on_request(request_handle)
        local authority = request_handle:headers():get(":authority")
        if(string.find(authority, ":") ~= nil)
        then
          local authority_index = string.find(authority, ":")
          local stripped_authority = string.sub(authority, 1, authority_index - 1)
          request_handle:headers():replace(":authority", stripped_authority)
        end
      end

This is the Mapping object:

apiVersion: getambassador.io/v2
kind: Mapping
metadata:
  name: guestbook-mapping
spec:
  grpc: false
  host: "^example\\.com:8443$"
  host_regex: true
  prefix: /
  rewrite: ""
  service: guestbook:80

We also tried to add this Host object, but it didn't help:

apiVersion: getambassador.io/v2
kind: Host
metadata:
  name: example.com-8443
spec:
  acmeProvider:
    authority: none
  hostname: '*.example.com:8443'
  selector:
    matchLabels:
      hostname: example.com:8443
  tls:
    alpn_protocols: h2
  tlsSecret:
    name: example-com-server-secret
@anabih anabih changed the title edge-stack is failing to routing traffic on port 8443 edge-stack is failing to route traffic on port 8443 Jul 27, 2022
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

No branches or pull requests

1 participant