Deploying ArgoCD on an Openshift Container Platform Cluster

Preface

Steps to deploying ArgoCD on an Openshift Cluster, the first steps to enter the world of GitOps.

Prerequisite

  • You have access the OCP Cluster;
  • You have enough permission to create namespace (or have the namespace created for you by the admin);
  • You have write access on the namespace.

Procedure

  1. Connect to the Cluster (either via OCP Client CLI orOCP Console);
  2. Make sure your user able to create new resources;
  3. Create new namespace for ArgoCD: oc create namespace argocd
  4. Apply this manifests: https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
    • oc apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
  5. Make some adjustment, either via curl {link} > file-name.yaml to output it into a file, edit it, and then apply the file, or make changes after installing it;
    • I personally changes \it after the fact because I’m too lazy, but in the future please try to edit the file first before applying.
  6. Stuff I’ve changed after install (via OCP Console Web UI):
    • Changed argocd-redis serviceAccount to have higher permission, since it seems like it doesn’t have enough permission to run due to OCP higher security context;
    • Added key-value server.insecure: true to argocd-cmd-params-cm configMap to make the service available on normal HTTP (so I could offload the HTTPS in WAF instead);
    • Added Ingress/Route to the HTTP endpoint manually.

Conclusion

You can access the ArgoCD GUI on the domain you define in Routes/Ingress using default user, with the user being “admin” and the password you can pull using the following command:

oc -n <argocd-namespace> get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d

References