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

Cannot update VirtualRouter listener protocol with defined routes #767

Open
dhild opened this issue Mar 21, 2024 · 0 comments
Open

Cannot update VirtualRouter listener protocol with defined routes #767

dhild opened this issue Mar 21, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@dhild
Copy link
Contributor

dhild commented Mar 21, 2024

Describe the bug
If I replace the listener protocol and a matching route's protocol in a VirtualRouter at the same time, the change is accepted by the API server but fails to reconcile.

Steps to reproduce

  1. Create a VirtualRouter with a listener and a matching route. Wait for the status to show that the VirtualRouter is successfully reconciled.
kind: VirtualRouter
apiVersion: appmesh.k8s.aws/v1beta2
metadata:
  name: example-router
spec:
  listeners:
  - portMapping:
      protocol: http
      port: 8080
  routes:
  - name: web
    httpRoute:
      match:
        prefix: /
        port: 8080
      action:
        weightedTargets:
        - virtualNodeRef:
            name: example-node
          port: 8080
          weight: 1
  1. Change the listener protocol, and update the protocol used for the route to match. This change will be accepted by the API server.
kind: VirtualRouter
apiVersion: appmesh.k8s.aws/v1beta2
metadata:
  name: example-router
spec:
  listeners:
  - portMapping:
      protocol: http2
      port: 8080
  routes:
  - name: web
    http2Route:
      match:
        prefix: /
        port: 8080
      action:
        weightedTargets:
        - virtualNodeRef:
            name: example-node
          port: 8080
          weight: 1
  1. Warning events can be observed on the VirtualRouter, and the status never transitions to observe the latest generation.
  Warning  ReconcileError  5s   VirtualRouter  BadRequestException: 1 Virtual Router listener(s) cannot be removed because they are matched by existing Routes. Listing up to 5 PortMappings: [(Port: 8080, Protocol: HTTP)]

Workaround
Manually sequence the updates, by first removing the route before changing the listener protocol. Once this has reconciled, apply the desired final spec.

kind: VirtualRouter
apiVersion: appmesh.k8s.aws/v1beta2
metadata:
  name: example-router
spec:
  listeners:
  - portMapping:
      protocol: http
      port: 8080
  routes: []

Expected outcome
The controller should perform the API calls in the same sequence as the workaround, leaving the AWS resources in the desired state.

Environment

  • App Mesh controller version: v1.12.1
  • Envoy version: v1.25.4.0-prod
  • Are you using any integrations? X-ray, Jaeger etc. If so versions? N/A
  • Kubernetes version v1.27.10
  • Using EKS (yes/no), if so version? v1.27.10-eks-508b6b3

Additional Context:
The same error can also be reproduced by removing both the listener and the route at the same time.

@dhild dhild added the bug Something isn't working label Mar 21, 2024
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