OpenShift GitOps¶
Red Hat OpenShift GitOps Documentation
OpenShift GitOps provides ArgoCD for managing application deployments using GitOps workflows.
Install the Operator via WebUI¶
- Go to Ecosystem -> Software Catalog -> filter for "OpenShift GitOps" -> click the tile
- Click Install
- Leave all the defaults and click Install
- Wait for the Operator to install
- The operator automatically creates a default Argo CD instance in the
openshift-gitopsnamespace
Install the Operator via YAML¶
apiVersion: v1
kind: Namespace
metadata:
name: openshift-gitops-operator
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: openshift-gitops-operator
namespace: openshift-gitops-operator
spec:
upgradeStrategy: Default
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: openshift-gitops-operator
namespace: openshift-gitops-operator
spec:
channel: latest
installPlanApproval: Automatic
name: openshift-gitops-operator
source: redhat-operators
sourceNamespace: openshift-marketplace
Wait for the operator CSV, then for the Argo CD pods (they run in openshift-gitops, not in the operator namespace):
oc get csv -n openshift-gitops-operator
oc wait --for=condition=Ready pods --all -n openshift-gitops --timeout=300s
Verify the Installation¶
Access the Argo CD Console¶
- In the WebUI, the Argo CD link will appear in the grid menu (top right) once the operator is installed
- You can log in using OpenShift OAuth
- To get the default
adminpassword via CLI:
Grant Argo CD Access to a Namespace¶
Create an Application¶
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: my-app
namespace: openshift-gitops
spec:
project: default
source:
repoURL: https://github.com/example/my-app.git
targetRevision: main
path: manifests
destination:
server: https://kubernetes.default.svc
namespace: my-app
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true