openshift-spoke-cluster-join-hub¶
Join spoke cluster to hub using ACM/OCM kustomize manifests
This task runs on a spoke cluster in a hub-spoke OpenShift topology. It registers the spoke cluster with the hub by applying ACM/OCM manifests via kustomize.
Process¶
- Writes the hub cluster kubeconfig to disk from openshift/hub-cluster-kubeconfig
- Renders 5 ACM/OCM manifests into a register-cluster/ directory:
- namespace.yaml — Namespace for the spoke on the hub
- managedcluster.yaml — ManagedCluster resource
- klusterletaddonconfig.yaml — KlusterletAddonConfig resource
- auto-import-secret.yaml — Secret containing the spoke's kubeconfig (base64-encoded JSON)
- kustomization.yaml — Kustomize entry point
- Runs: oc apply -k ./register-cluster/
- Removes the hub kubeconfig from disk
Requirements¶
- Hub cluster must be running with ACM/OCM installed
- Hub cluster kubeconfig must be stored in openshift/hub-cluster-kubeconfig
- Spoke cluster kubeconfig must be available in openshift/kubeconfig
Parameters¶
- openshift/hub-cluster-kubeconfig: Kubeconfig for the hub cluster
- openshift/kubeconfig: Kubeconfig for the spoke cluster (used in auto-import-secret)
Objects that Reference openshift-spoke-cluster-join-hub¶
Not used in current content packs
Objects used by openshift-spoke-cluster-join-hub¶
- templates openshift-spoke-register-namespace.yaml.tmpl in field Templates[1].ID as value openshift-spoke-register-namespace.yaml.tmpl
- templates openshift-spoke-register-managedcluster.yaml.tmpl in field Templates[2].ID as value openshift-spoke-register-managedcluster.yaml.tmpl
- templates openshift-spoke-register-klusterletaddonconfig.yaml.tmpl in field Templates[3].ID as value openshift-spoke-register-klusterletaddonconfig.yaml.tmpl
- templates openshift-spoke-register-auto-import-secret.yaml.tmpl in field Templates[4].ID as value openshift-spoke-register-auto-import-secret.yaml.tmpl
- templates openshift-spoke-register-kustomization.yaml.tmpl in field Templates[5].ID as value openshift-spoke-register-kustomization.yaml.tmpl
- params openshift/hub-cluster-kubeconfig
- templates prelude.tmpl
- templates openshift-cluster-prelude.sh.tmpl
- params openshift/hub-cluster-kubeconfig