argoproj / argo-rollouts

Progressive Delivery for Kubernetes
https://argo-rollouts.readthedocs.io/
Apache License 2.0
2.78k stars 870 forks source link

Canary Traffic routing based on a header with ALB - managed Route is not created in the LB #2829

Open Borisakov opened 1 year ago

Borisakov commented 1 year ago

Describe the bug

The setHeaderRoute name is created in the Ingress resource with the correct annotations (action and condition) but not created on the load balancer.

To Reproduce

The setHeaderRoute on the steps:

      - setHeaderRoute:
          name: "canary-header-route"
          match:
          - headerName: "version"
            headerValue:
              exact: "2"

The trafficRouting configuration:

      trafficRouting:
        managedRoutes:
          - name: canary-header-route
        alb:
          ingress: ingress
          rootService: root-service
          servicePort: 80

The Ingress configuration:

  - host: "test.test"
    http:
      paths:
        - backend:
            service:
              name: root-service
              port:
                name: use-annotation
          pathType: ImplementationSpecific
          path: /

The ingress annotations in the header step:

    alb.ingress.kubernetes.io/actions.root-service: >-
      {"Type":"forward","ForwardConfig":{"TargetGroups":[{"ServiceName":"boris-test-desired","ServicePort":"80","Weight":0},{"ServiceName":"boris-test-stable","ServicePort":"80","Weight":100}],"TargetGroupStickinessConfig":{"Enabled":true,"DurationSeconds":3600}}}
    alb.ingress.kubernetes.io/actions.canary-header-route: >-
      {"Type":"forward","ForwardConfig":{"TargetGroups":[{"ServiceName":"boris-test-desired","ServicePort":"80","Weight":100}],"TargetGroupStickinessConfig":{"Enabled":true,"DurationSeconds":3600}}}
    alb.ingress.kubernetes.io/conditions.canary-header-route: >-
      [{"field":"http-header","httpHeaderConfig":{"httpHeaderName":"version","values":["2"]}}]

The load balancer rule is not created.

It looks like the new action is not associated with the root-service service name because it works when I add manually a new rule exactly the same as root-service but with "canary-header-route" name and "use-annotation" port.

Expected behavior

A new rule (first one) will be created in the Load balancer with the "canary-header-route" configuration.

Version

Argo rollout: 1.5.0 AWS ALB Controler : 2.5

Logs

time="2023-06-11T13:00:18Z" level=info msg="Started syncing rollout" generation=59 namespace=boris-test resourceVersion=3991227 rollout=boris-testtime="2023-06-11T13:00:18Z" level=info msg="Patched conditions: {\"status\":{\"conditions\":[{\"lastTransitionTime\":\"2023-06-07T09:08:33Z\",\"lastUpdateTime\":\"2023-06-07T09:08:33Z\",\"message\":\"Rollout has minimum availability\",\"reason\":\"AvailableReason\",\"status\":\"True\",\"type\":\"Available\"},{\"lastTransitionTime\":\"2023-06-11T11:58:54Z\",\"lastUpdateTime\":\"2023-06-11T11:58:54Z\",\"message\":\"Rollout is not healthy\",\"reason\":\"RolloutHealthy\",\"status\":\"False\",\"type\":\"Healthy\"},{\"lastTransitionTime\":\"2023-06-11T11:58:54Z\",\"lastUpdateTime\":\"2023-06-11T11:58:54Z\",\"message\":\"RolloutCompleted\",\"reason\":\"RolloutCompleted\",\"status\":\"False\",\"type\":\"Completed\"},{\"lastTransitionTime\":\"2023-06-11T13:00:18Z\",\"lastUpdateTime\":\"2023-06-11T13:00:18Z\",\"message\":\"Rollout is paused\",\"reason\":\"RolloutPaused\",\"status\":\"Unknown\",\"type\":\"Progressing\"},{\"lastTransitionTime\":\"2023-06-11T13:00:18Z\",\"lastUpdateTime\":\"2023-06-11T13:00:18Z\",\"message\":\"Rollout is paused\",\"reason\":\"RolloutPaused\",\"status\":\"True\",\"type\":\"Paused\"}]}}" generation=59 namespace=boris-test resourceVersion=3991227 rollout=boris-testtime="2023-06-11T13:00:18Z" level=info msg="Found 1 TrafficRouting Reconcilers" namespace=boris-test rollout=boris-testtime="2023-06-11T13:00:18Z" level=info msg="Reconciling TrafficRouting with type 'ALB'" namespace=boris-test rollout=boris-testtime="2023-06-11T13:00:18Z" level=info msg="no changes to the ALB Ingress" ingress=boris-test namespace=boris-test rollout=boris-testtime="2023-06-11T13:00:18Z" level=info msg="Reconciling canary pause step (stepIndex: 4/6)" namespace=boris-test rollout=boris-testtime="2023-06-11T13:00:18Z" level=info msg="Not finished reconciling Canary Pause" namespace=boris-test rollout=boris-testtime="2023-06-11T13:00:18Z" level=info msg="No status changes. Skipping patch" generation=59 namespace=boris-test resourceVersion=3991227 rollout=boris-testtime="2023-06-11T13:00:18Z" level=info msg="Start processing" resource=boris-test/boris-testtime="2023-06-11T13:00:18Z" level=error msg="Failed to process: secret \"argo-rollouts-notification-secret\" not found" resource=boris-test/boris-testtime="2023-06-11T13:00:18Z" level=info msg="persisted to informer" generation=59 namespace=boris-test resourceVersion=3991229 rollout=boris-testtime="2023-06-11T13:00:18Z" level=info msg="Reconciliation completed" generation=59 namespace=boris-test resourceVersion=3991227 rollout=boris-test time_ms=27.335842time="2023-06-11T13:00:18Z" level=info msg="Started syncing rollout" generation=59 namespace=boris-test resourceVersion=3991229 rollout=boris-testtime="2023-06-11T13:00:18Z" level=info msg="Found 1 TrafficRouting Reconcilers" namespace=boris-test rollout=boris-testtime="2023-06-11T13:00:18Z" level=info msg="Reconciling TrafficRouting with type 'ALB'" namespace=boris-test rollout=boris-testtime="2023-06-11T13:00:18Z" level=info msg="no changes to the ALB Ingress" ingress=boris-test namespace=boris-test rollout=boris-testtime="2023-06-11T13:00:18Z" level=info msg="Reconciling canary pause step (stepIndex: 4/6)" namespace=boris-test rollout=boris-testtime="2023-06-11T13:00:18Z" level=info msg="Not finished reconciling Canary Pause" namespace=boris-test rollout=boris-testtime="2023-06-11T13:00:18Z" level=info msg="No status changes. Skipping patch" generation=59 namespace=boris-test resourceVersion=3991229 rollout=boris-testtime="2023-06-11T13:00:18Z" level=info msg="Reconciliation completed" generation=59 namespace=boris-test resourceVersion=3991229 rollout=boris-test time_ms=3.741057

Impacted by this bug? Give it a 👍. We prioritize the issues with the most 👍.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 60 days with no activity.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 60 days with no activity.

hansel-christopher1 commented 11 months ago

+1 I am also facing the same issue @Borisakov were you able to get this to work?

timam commented 11 months ago

+1 i am also facing the same issue

Mufaddal5253110 commented 7 months ago

@Borisakov can you once try below change

  - host: "test.test"
    http:
      paths:
        - backend:
            service:
              name: root-service
              port:
                name: use-annotation
          pathType: ImplementationSpecific
          path: /*

It worked for me