This repository has an example App packaged with kustomize to test ArgoCD Rollouts with Blue-Green strategy.
- Install Red Hat OpenShift GitOps (a.k.a. ArgoCD) through OperatorHub
- Install
ArgoCD Rollout
, to do this follow the next steps from a terminal window:
$ oc create namespace argo-rollouts
$ oc apply -n argo-rollouts -f https://github.com/argoproj/argo-rollouts/releases/latest/download/install.yaml
Note: is very imporant keep the exactly name of the namespace, otherwise ArgoCD Rollout did not work.
- Create an
Application
inside ArgoCD (+ New App button), and complete the form with this values:
- Application Name: rollouts-demo
- Project: default
- Sync Policy: Manual
- Sync Options: ApplyOutOfSyncOnly | Skip Validations
- Source:
- URL: https://github.com/lozanotux/rollouts-demo.git
- Revision: main
- Path: openshift/overlays/prod
- Destination:
- Cluster URL: https://kubernetes.default.svc
- Namespace:
Complete-here-your-target-namespace
- Type: Kustomize
- Click on the Sync button to force a synchronization.
- Test you Rollout App oppening the URL and seeing blue squares.
- Change the rollout.yaml with another version of the image (yellow, purpple, green, orange, red). And commit your changes.
- Your rollout after your changes are commited, is in pause state (
RolloutPaused
). To promote your Rollout to next version, you need a kubectl plugin to operate it. Para mas información de como instalarlo vea #kubectl-plugin-installation.
Once your plugin has installed you need to run the next command:
$ kubectl argo rollouts promote rollouts-demo -n ${YOUR_TARGET_NAMESPACE}
Note: With that command, the
active-service
switch the version to the new one. And thepreview-service
is become available again to receive a future new version.