This demo is based on Red Hat OpenShift and uses the eShop Reference Application from the upstream .NET community as an application base.
The migration and pipeline demo performs the following:
- Containerize the application so that it can be migrated to OpenShift. Required changes can be found in the container-base branch.
- Build the eShop application, tag the resulting image as
devand promote the tag toqawith OpenShift Pipelines. - Deploy both the Development and QA versions of the application with OpenShift GitOps.
- Detect image updates for
devandqatags with ArgoCD Image Updater. - Based on a source code push, Pipelines as Code will automatically run the respective pipelines from step 2 and report the status.
This demo assumes the following have been set up:
- Red Hat OpenShift (tested on 4.19)
- OpenShift Pipelines (tested on 1.19) with Pipelines as Code
- OpenShift GitOps (tested on 1.17) with ArgoCD Image Updater (community version)
- Code repository hosted on GitHub
- Image repository hosted on Quay.io
For the community version of ArgoCD Image Updater, we deployed into the openshift-gitops namespace:
oc apply -n openshift-gitops -f https://raw.githubusercontent.com/argoproj-labs/argocd-image-updater/v0.16.0/manifests/install.yaml
Fork this repository to your own GitHub repository which will be used for the application code base.
For this demo, we configured authentication to the repositories with a GitHub personal access token and Quay.io robot account. Replace the contents of github-secret.yaml and quay-secret.yaml with your own (the secrets in this repository are just dummy values).
In the build and promote pipelines, replace the value of the IMAGE parameter with your own image. Also in the base deployment, replace the value of the container image to be used with your own. Then deploy the pipelines, which can be run manually:
oc apply -k manifests/build
Pipelines as Code is an enhancement from manual pipeline runs by automating pipeline runs based on source code push. To set this up, configure a GitHub app for Pipelines as Code. In the eshop-dev-repository.yaml definition, update the URL with your own Git fork then apply:
oc apply -k manifests/pipelinesascode
The following applications manage the Development and QA versions:
- Development application in
eshop-dotnet-devnamespace - QA application in
eshop-dotnet-qanamespace, also in the same cluster
Replace the image in argocd-image-updater.argoproj.io/image-list with your own, then deploy the ArgoCD applications:
oc apply -k manifests/application
Image Updater detects updates to the image digest for the dev and qa tags and deploys the latest image via ArgoCD.
oc apply -k manifests/imageupdater