This repository bootstraps an OpenShift cluster with the following components:
- OpenShift GitOps (ArgoCD)
- Red Hat Advanced Cluster Management (RHACM)
- Governance Policies
- Extra Operators (example: cert-manager)
The repo is structured with base, overlays, and bootstrap folders to support GitOps-based cluster configuration.
.
βββ base
β βββ gitops/ # GitOps Operator, ArgoCD Instance
β βββ rhacm/ # Advanced Cluster Management Operator + Hub
β βββ policies/ # Example policies (with Placement + Binding)
β βββ cert-manager/ # Example extra operator (cert-manager)
β
βββ overlays
β βββ dev-cluster/ # Overlay for dev cluster (includes GitOps, RHACM, Policies, Cert-Manager)
β
βββ bootstrap
β βββ 00-gitops-subscription.yaml # Bootstrap GitOps operator
β βββ 01-argocd-instance.yaml # Deploy ArgoCD instance
β βββ 02-root-applicationset.yaml # Root ApplicationSet for GitOps, RHACM, Policies, Extras
β βββ bootstrap.sh # Helper script to automate bootstrap
β βββ gitops-creds.yaml # Git credentials for ArgoCD
β
βββ README.md
oc apply -f bootstrap/00-gitops-subscription.yaml
Wait until the GitOps operator CSV is in Succeeded
phase:
oc get csv -n openshift-operators | grep gitops
oc apply -f bootstrap/01-argocd-instance.yaml
Wait until the ArgoCD instance is available:
oc get pods -n openshift-gitops
Once GitOps is ready, deploy the ApplicationSet that generates all ArgoCD Applications:
# Apply the ApplicationSet
oc apply -f bootstrap/02-root-applicationset.yaml -n openshift-gitops
# Verify ApplicationSet is created
oc get applicationsets -n openshift-gitops
# Check generated ArgoCD Applications
oc get applications.argoproj.io -n openshift-gitops
By default, the ApplicationSet will create the following apps for the dev-cluster
overlay:
dev-cluster-gitops
dev-cluster-rhacm
dev-cluster-policies
dev-cluster-cert-manager
You can control which components are deployed by editing 02-root-applicationset.yaml
.
You can run everything with the helper script:
./bootstrap/bootstrap.sh --all
Supported options:
--gitops-only
β Deploy only GitOps--rhacm-only
β Deploy only RHACM--policies-only
β Deploy only Policies--all
β Deploy GitOps, RHACM, Policies, and extras
To add a new operator (example: ServiceMesh, Logging, etc.):
- Create a folder in
base/<operator-name>
- Add
namespace.yaml
,operatorgroup.yaml
,subscription.yaml
- Update
02-root-applicationset.yaml
to include it as a component
Check Application status in ArgoCD:
oc get applications.argoproj.io -n openshift-gitops
Check RHACM components:
oc get pods -n open-cluster-management
Check Policies:
oc get policies -A
Check Cert-Manager:
oc get pods -n cert-manager
- Sync waves (
argocd.argoproj.io/sync-wave
) ensure proper install order:- GitOps β RHACM β Policies β Extras
- Policies require a
ManagedClusterSetBinding
andPlacement
to match clusters - You can scale this pattern to multiple clusters by adding overlays