OpenShift 4¶
A installation guide for Argo CD Operator (Helm), Argo CD, Argo CD CLI and the Guestbook Example in OpenShift 4.x (OCP, CRC).
Note
You have to be in the cluster-admin ClusterRole to install all prerequisites, the operator and Argo CD.
Operator Installation¶
It’s possible to install the operator using the Operator Lifecycle Manager or manually.
Note
The operator manages a single namespace installation of Argo CD. Therefore you have to install the operator and Argo CD in the same namespace. For simplicity we recommend creating a namespace argocd.
Operator Lifecycle Manager¶
This installation method installs the operator using an OLM Catalog.
oc apply -f guides/ocp4/olm/namespace.yaml
oc apply -f guides/ocp4/olm/catalog-source.yaml
oc apply -f guides/ocp4/olm/operator-group.yaml
oc apply -f guides/ocp4/olm/subscription.yaml
oc rollout status -w deployment/argocd-operator-helm -n argocd
Manual¶
You can install the operator from local sources without having to install an OLM Catalog. This can be helpful if your cluster runs in an isolated environment with no direct internet access.
Note
No channel subscription and automatic operator updates available with this method.
oc apply -f guides/ocp4/manual/namespace.yaml
oc apply -f guides/ocp4/manual/service-account.yaml
oc apply -f guides/ocp4/manual/role.yaml
oc apply -f guides/ocp4/manual/role-binding.yaml
oc apply -f guides/ocp4/manual/crd.yaml
oc apply -f guides/ocp4/manual/deployment.yaml
oc rollout status -w deployment/argocd-operator-helm -n argocd
Argo CD Installation¶
Install Argo CD server components and Argo CD command line interface.
Argo CD¶
Install Argo CD with OpenShift OAuth integration (recommended) or with the Default Authentication provider.
Note
This operator shares all configuration values from the Argo CD Helm Chart.
OpenShift OAuth¶
oc apply -f examples/ocp-oauth.yaml -n argocd
oc get ArgoCDs argocd -n argocd
oc rollout status -w deployment/argocd-application-controller -n argocd
oc rollout status -w deployment/argocd-dex-server -n argocd
oc rollout status -w deployment/argocd-redis -n argocd
oc rollout status -w deployment/argocd-repo-server -n argocd
oc rollout status -w deployment/argocd-server -n argocd
Default Authentication¶
oc apply -f examples/ocp.yaml -n argocd
oc get ArgoCDs argocd -n argocd
oc rollout status -w deployment/argocd-application-controller -n argocd
oc rollout status -w deployment/argocd-dex-server -n argocd
oc rollout status -w deployment/argocd-redis -n argocd
oc rollout status -w deployment/argocd-repo-server -n argocd
oc rollout status -w deployment/argocd-server -n argocd
Argo CD Route¶
Argo CD web frontend is immediately accessible through an SSL passthrough route.


Note
To access this route in ContainerReady Containers (CRC) from the Argo CD CLI you have to manually add this route to your /etc/hosts
file.
sudo vi /etc/hosts
# End of section
# Added by Docker Desktop
# To allow the same kube context to work on the host and the container:
127.0.0.1 kubernetes.docker.internal
192.168.64.73 api.crc.testing oauth-openshift.apps-crc.testing argocd-server-argocd.apps-crc.testing
Argo CD CLI¶
Argo CD provides a command line interface. To be in sync with your Argo CD version you can download it directly from the Argo CD installation.
Download CLI¶
curl --insecure https://argocd-server-argocd.apps-crc.testing/download/argocd-linux-amd64 -o argocd
Login Argo CD¶
argocd login --insecure --username admin --password admin argocd-server-argocd.apps-crc.testing
Guestbook Example¶
Now lets play and install the Guestbook Example.
New Application¶
argocd app create guestbook \
--repo https://github.com/argoproj/argocd-example-apps.git \
--path helm-guestbook \
--dest-server https://kubernetes.default.svc \
--dest-namespace default
Sync Application¶
argocd app sync guestbook
Cleanup¶
Ants are very clean species too!
Guestbook Example¶
argocd app delete guestbook
Argo CD installation¶
The uninstallation process will remove the Argo CD installation (CR) but NOT the CRD’s. You have to remove them manually:
oc delete ArgoCD argocd -n argocd
oc delete crd appprojects.argoproj.io
oc delete crd applications.argoproj.io
oc delete crd workflowtemplates.argoproj.io
oc delete crd workflows.argoproj.io
Operator Marketplace installation¶
oc delete -f guides/ocp4/olm/subscription.yaml
oc delete csv argocd-operator-helm.v0.0.6 -n argocd
oc delete crd argocds.argoproj.io
oc delete -f guides/ocp4/olm/catalog-source.yaml
oc delete -f guides/ocp4/olm/operator-group.yaml
oc delete -f guides/ocp4/olm/namespace.yaml
Manual installation¶
oc delete -f guides/ocp4/manual/deployment.yaml
oc delete -f guides/ocp4/manual/crd.yaml
oc delete -f guides/ocp4/manual/role-binding.yaml
oc delete -f guides/ocp4/manual/role.yaml
oc delete -f guides/ocp4/manual/service-account.yaml
oc delete -f guides/ocp4/manual/namespace.yaml