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

GatewayRoute Selector Inconsistent Behavior #688

Open
egkelly opened this issue Mar 10, 2023 · 0 comments
Open

GatewayRoute Selector Inconsistent Behavior #688

egkelly opened this issue Mar 10, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@egkelly
Copy link

egkelly commented Mar 10, 2023

Describe the bug
I have two virtual gateways, one internet-facing and the other internal-facing deployed within the same namespace. I have this setup in two separate environments.

In one environment, the gateway route selector is working as expected; my internal-only gateway route is properly bound to the internal virtual gateway, and all other gateway routes default to the internet-facing virtual gateway. In the other environment however, the internal virtual gateway is ignored, and all gateway routes bind to the internet-facing virtual gateway including my internal gateway route. Both environments are configured in the same way with the same selectors, as shown below:

Broken Env Gateway Route:

apiVersion: appmesh.k8s.aws/v1beta2
kind: GatewayRoute
  labels:
    argocd.argoproj.io/instance: app-staging
    gateway: ingress-gw-internal
    ...
    ...
    ...
  virtualGatewayRef:
    name: ingress-gw-external
    namespace: staging
status:
  gatewayRouteARN: >-
    arn:aws:appmesh:us-east-1:XXXXXXX:mesh/XXXXXX/virtualGateway/ingress-gw-external_staging/gatewayRoute/gatewayroute_staging1

Broken Env Virtual Gateway:

apiVersion: appmesh.k8s.aws/v1beta2
kind: VirtualGateway
  labels:
    argocd.argoproj.io/instance: my-mesh
  name: ingress-gw-internal
  namespace: staging
spec:
  ...
  ...
  gatewayRouteSelector:
    matchLabels:
      gateway: ingress-gw-internal
  meshRef:
    name: my-mesh
  namespaceSelector:
    matchLabels:
      gateway: ingress-gw-internal
  podSelector:
    matchLabels:
      app.kubernetes.io/name: ingress-gw-internal

Working Env Gateway Route

apiVersion: appmesh.k8s.aws/v1beta2
kind: GatewayRoute
  labels:
    argocd.argoproj.io/instance: app-production
    gateway: ingress-gw-internal
    ...
    ...
    ...
  virtualGatewayRef:
    name: ingress-gw-internal
    namespace: production
status:
  gatewayRouteARN: >-
    arn:aws:appmesh:us-east-1:XXXXXXX:mesh/XXXXXX/virtualGateway/ingress-gw-internal_production/gatewayRoute/gatewayroute_production

Working Env Virtual Gateway:

apiVersion: appmesh.k8s.aws/v1beta2
kind: VirtualGateway
  labels:
    argocd.argoproj.io/instance: my-mesh
  name: ingress-gw-internal
  namespace: production
spec:
  ...
  ...
  gatewayRouteSelector:
    matchLabels:
      gateway: ingress-gw-internal
  meshRef:
    name: my-mesh
  namespaceSelector:
    matchLabels:
      gateway: ingress-gw-internal
  podSelector:
    matchLabels:
      app.kubernetes.io/name: ingress-gw-internal

Steps to reproduce
I'm not sure how to reproduce this. It's cropped up several times with little apparent trend. I have fixed this after deleting the entire set of virtual gateways and gateway routes and redeploying several times, but often times it will go back to ignoring the gateway route selector if I need to redeploy after getting it working again.

Expected outcome
The internal gateway route should bind to the internal virtual gateway according to its gatewayrouteselector, and all other gateway routes should default to the virtual gateway with no gatewayrouteselector configured.

Environment

  • App Mesh controller version v1.10.0
  • Envoy version v1.24.0.0-prod
  • Kubernetes version 1.24
  • Using EKS (yes/no), if so version? eks.4
@egkelly egkelly added the bug Something isn't working label Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant