argo-rollouts icon indicating copy to clipboard operation
argo-rollouts copied to clipboard

Implement OpenShift Routes as a Traffic Manager

Open mbhatip opened this issue 3 years ago • 7 comments

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 👍.

mbhatip avatar Jun 08 '21 13:06 mbhatip

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.

jessesuen avatar Jun 09 '21 19:06 jessesuen

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

mbhatip avatar Jun 10 '21 13:06 mbhatip

@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).

Lepird avatar Aug 09 '21 00:08 Lepird

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

github-actions[bot] avatar Dec 06 '22 02:12 github-actions[bot]

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

github-actions[bot] avatar Feb 06 '23 02:02 github-actions[bot]

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 avatar Jun 07 '23 07:06 kostis-codefresh

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

@mbhatip could you check/verify please?

kostis-codefresh avatar Nov 13 '23 15:11 kostis-codefresh

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

kostis-codefresh avatar Aug 09 '24 09:08 kostis-codefresh