GitOps with ArgoCD — first login to first app
GitOps flips deployment around: instead of pushing changes to the cluster, you describe the desired state in Git and a controller continuously reconciles the cluster to match. On OpenShift that controller is ArgoCD, shipped as the OpenShift GitOps operator.
Install and find your way in
Section titled “Install and find your way in”-
Install the Red Hat OpenShift GitOps operator from OperatorHub. It creates an
openshift-gitopsnamespace with a ready-to-use ArgoCD instance. -
Get the console URL from the route:
Terminal window oc get route openshift-gitops-server -n openshift-gitops \-o jsonpath='{.spec.host}' -
Get the initial
adminpassword (stored in a secret):Terminal window oc get secret openshift-gitops-cluster -n openshift-gitops \-o jsonpath='{.data.admin\.password}' | base64 -d
Your first Application
Section titled “Your first Application”An ArgoCD Application says: take source X from Git, and keep destination Y in
sync with it. Here’s one pointing at a Helm chart in a repo:
apiVersion: argoproj.io/v1alpha1kind: Applicationmetadata: name: demo namespace: openshift-gitopsspec: project: default source: repoURL: https://github.com/your-org/your-charts.git targetRevision: main path: charts/demo helm: valueFiles: - values.yaml destination: server: https://kubernetes.default.svc namespace: demo syncPolicy: automated: prune: true # delete resources removed from Git selfHeal: true # revert manual drift back to Git syncOptions: - CreateNamespace=trueApply it, and ArgoCD renders the chart and creates the resources:
oc apply -f demo-application.yamloc get application demo -n openshift-gitopsThe two settings that define GitOps
Section titled “The two settings that define GitOps”The syncPolicy block is where the philosophy lives:
selfHeal: true— if someone edits a live resource by hand, ArgoCD reverts it to match Git. Git becomes the single source of truth, not a suggestion.prune: true— delete something from Git and ArgoCD deletes it from the cluster. Without prune, removals in Git leave orphans behind.
Next: pointing ArgoCD at a private Helm repository, which is where real enterprise setups spend their debugging time.