Skip to content

Instantly share code, notes, and snippets.

@waynedovey
Created October 26, 2022 22:59
Show Gist options
  • Save waynedovey/dc1b74ddde2575a91328a98340feecb7 to your computer and use it in GitHub Desktop.
Save waynedovey/dc1b74ddde2575a91328a98340feecb7 to your computer and use it in GitHub Desktop.
# managedclustersetbinding.yaml
cat << EOF | oc apply -f -
apiVersion: cluster.open-cluster-management.io/v1alpha1
kind: ManagedClusterSetBinding
metadata:
name: production-clusters
namespace: openshift-gitops
spec:
clusterSet: production-clusters
EOF
# managedclusterset.yaml
cat << EOF | oc apply -f -
apiVersion: cluster.open-cluster-management.io/v1alpha1
kind: ManagedClusterSet
metadata:
name: production-clusters
spec: {}
EOF
# gitopscluster.yaml
cat << EOF | oc apply -f -
apiVersion: apps.open-cluster-management.io/v1beta1
kind: GitOpsCluster
metadata:
name: argo-acm-importer
namespace: openshift-gitops
spec:
argoServer:
cluster: notused
argoNamespace: openshift-gitops
placementRef:
kind: Placement
apiVersion: cluster.open-cluster-management.io/v1alpha1
name: production-clusters
namespace: openshift-gitops
EOF
# placement.yaml
cat << EOF | oc apply -f -
apiVersion: cluster.open-cluster-management.io/v1alpha1
kind: Placement
metadata:
name: production-clusters
namespace: openshift-gitops
spec:
predicates:
- requiredClusterSelector:
labelSelector:
matchExpressions:
- key: vendor
operator: "In"
values:
- OpenShift
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment