argoproj / argo-rollouts

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

Implement OpenShift Routes as a Traffic Manager #1258

Closed mbhatip closed 1 month ago

mbhatip commented 3 years ago

Summary

OpenShift routes is an alternative for managing traffic on a service level. It should be available as another Traffic Manager option.

Use Cases

The user has an OpenShift cluster without a service mesh installed. Argo Rollouts can still carry out canary deployments on a service level.

I will be making a PR for this soon, wanted to gauge whether this was practical, relevant, or necessary. I'd appreciate any feedback or advice!


Message from the maintainers:

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

jessesuen commented 3 years ago

The user has an OpenShift cluster without a service mesh installed. Argo Rollouts can still carry out canary deployments on a service level. I will be making a PR for this soon, wanted to gauge whether this was practical, relevant, or necessary. I'd appreciate any feedback or advice!

Supporting OpenShift's canary mechanism would be a great improvement to Rollouts. Since I'm unfamiliar with OpenShift Routes, can you provide some details on how this would work, as well as the proposed spec changes to support this? Links to their docs would also help.

mbhatip commented 3 years ago

https://docs.openshift.com/container-platform/4.7/applications/deployments/route-based-deployment-strategies.html#deployments-ab-testing_route-based-deployment-strategies

This link highlights how to shift traffic from one service to another using routes. Routes have the following format:

kind: Route
apiVersion: route.openshift.io/v1
metadata:
  name: main-route
  ...
spec:
  host: >-
    hostlinkhere
  to:
    kind: Service
    name: stable-service
    weight: 100
  alternateBackends:
    - kind: Service
      name: canary-service
      weight: 0
  port:
    targetPort: http
  wildcardPolicy: None

Where you can specify as many or as little backends as you want using the alternateBackends field, as well as adjust the weight of traffic that goes to each.

The idea is the user would presumably have a route that exposes their stable service initially, then would deploy argo rollouts with:

apiVersion: argoproj.io/v1alpha1
kind: Rollout
...
spec:
  strategy:
    canary:
      stableService: stable-service
      canaryService: canary-service
      trafficRouting:
        openshift:
          routes:
            - main-route
      steps:
      - setWeight: 30
      - pause: {duration: 60s}
      - setWeight: 60
      - pause: {duration: 60s}

and argo rollouts would handle adding the alternateBackend to the route if it doesn't exist already, change the weights according to the step of the deployment, and finally delete the alternateBackend once the deployment is complete (since stable-service would be pointing at the new updated pods)

From existing traffic managers, this process would probably resemble mappings with Ambassador, although openshift only requires one route to handle the traffic shifting

Lepird commented 3 years ago

@mbhatip awesome feature request, was just wondering if you are planning to support routes that are auto-created via ingress objects as described in https://docs.openshift.com/container-platform/4.7/networking/routes/route-configuration.html#nw-ingress-creating-a-route-via-an-ingress_route-configuration ?

I'm asking since we depend on this way of deploying ingresses since it reduces the number of manifests that need to be created since in OpenShift each host and path combination needs a separate route.

As an example we have 1 ingress resource that generates 72 routes (4 hosts over 18 paths).

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.

kostis-codefresh commented 1 year ago

Redhat announced that they are also adopting the Gateway API https://cloud.redhat.com/blog/introducing-gateway-api-with-openshift-networking-developer-preview

So this issue might be solved by https://github.com/argoproj/argo-rollouts/issues/1438

I don't have access to an openshift cluster but if somebody can test https://github.com/argoproj/argo-rollouts/issues/1438 I would be happy to write the docs.

kostis-codefresh commented 9 months ago

Should be solved as part of https://github.com/argoproj-labs/rollouts-plugin-trafficrouter-openshift

@mbhatip could you check/verify please?

kostis-codefresh commented 1 month ago

This routes plugin is now documented in the official openshift documentation.

@mbhatip please re-open if this doesn't work for you

https://docs.openshift.com/gitops/1.13/argo_rollouts/routing-traffic-by-using-argo-rollouts.html