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 the operator and Argo CD.

Prerequisites

OpenShift Container Platform CodeReady Containers

As usual you need to have access to an up and running OpenShift 4.x cluster.

Operator Installation

It’s possible to install the operator using the Operator Lifecycle Manager or manually.

Operator Lifecycle Manager

This installation method installs the operator using an OLM Catalog.

git clone
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.

Note

No channel subscription and automatic operator updates available with this method.

git clone
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

git clone
oc apply -f examples/ocp-oauth.yaml

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

git clone
oc apply -f examples/ocp.yaml

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.

../_images/ocp4_route.png Point your Browser to ../_images/common_argocd_login_oauth.png

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

Change default password

Following example changes the default password to Password1!

oc -n argocd patch secret argocd-secret \
-p '{"stringData": {
    "admin.password": "$2a$10$hDj12Tw9xVmvybSahN1Y0.f9DZixxN8oybyA32Uy/eqWklFU4Mo8O",
    "admin.passwordMtime": "'$(date +%FT%T%Z)'"
}}'

Login Argo CD

argocd login --insecure --username admin --password Password1! 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.4 -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