Create an ACM Hub Cluster
Use this example procedure to create an ACM hub cluster.
The ACM hub cluster provides centralized management to its managed clusters. You can configure any cluster (including a single node OpenShift cluster) to be the hub cluster. The hub cluster can run any CNI.
We provide this example procedure purely for informational purposes. See Red Hat ACM documentation for the official procedure.
Run this procedure from the installation machine.
-
Create an OCP cluster using the method of your choice. This cluster can run the default
CNI. There is no need to install CN2 on this cluster.
In this example procedure, we assume the following:
-
This cluster is a single node OpenShift cluster running the default CNI and reachable at
172.16.0.11
. We'll refer to this as the hub cluster in the rest of this procedure. -
The kubeconfig for this cluster is at its default location (~/.kube/config) on the installation machine.
-
The cluster SSH key is at its default location (~/.ssh/id_rsa and ~/.ssh/id_rsa.pub) on the installation machine.
-
-
Create network storage that is accessible by this hub cluster and the managed
clusters.
One way to do this is to deploy an NFS server (minimum 120 GB) in conjunction with an external provisioner. For example, you can deploy an NFS Subdir External Provisioner to support dynamic provisioning of persistent volumes using an existing and already configured NFS server. This is described in https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner.
-
Install the multicluster engine (MCE) operator. This is the OCP operator that provides
the ACM hub functionality. (This operator is not related to CN2 multicluster.)
-
Create the multicluster engine operator manifest.
We'll save this as hub-mce.yaml.apiVersion: v1 kind: Namespace metadata: name: multicluster-engine labels: openshift.io/cluster-monitoring: "true" annotations: workload.openshift.io/allowed: management --- apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: multicluster-engine-operatorgroup namespace: multicluster-engine spec: targetNamespaces: - multicluster-engine --- apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: multicluster-engine namespace: multicluster-engine spec: channel: "stable-2.1" name: multicluster-engine source: redhat-operators sourceNamespace: openshift-marketplace
-
Install the operator.
oc create -f hub-mce.yaml
-
Create the multicluster engine operator manifest.
-
Create the MultiClusterEngine custom resource.
-
Create the MultiClusterEngine custom resource manifest.
We'll save this as hub-mce-cr.yaml.apiVersion: multicluster.openshift.io/v1 kind: MultiClusterEngine metadata: name: multiclusterengine spec: {}
-
Create the resource.
oc apply -f hub-mce-cr.yaml
-
Create the MultiClusterEngine custom resource manifest.
-
Configure the assisted service component.
-
Create the assisted service manifest.
For example:
where:apiVersion: hive.openshift.io/v1 kind: ClusterImageSet metadata: name: openshift-v4.12 namespace: multicluster-engine spec: releaseImage: quay.io/openshift-release-dev/ocp-release:4.12.13-x86_64 --- apiVersion: v1 kind: ConfigMap metadata: name: assisted-service-config namespace: multicluster-engine labels: app: assisted-service data: LOG_LEVEL: "debug" --- apiVersion: agent-install.openshift.io/v1beta1 kind: AgentServiceConfig metadata: namespace: multicluster-engine name: agent spec: databaseStorage: accessModes: - ReadWriteOnce resources: requests: storage: 40Gi filesystemStorage: accessModes: - ReadWriteOnce resources: requests: storage: 40Gi imageStorage: accessModes: - ReadWriteOnce resources: requests: storage: 40Gi osImages: - openshiftVersion: "4.12" url: "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/pre-release/latest-4.12/rhcos-live.x86_64.iso" rootFSUrl: "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/pre-release/latest-4.12/rhcos-live-rootfs.x86_64.img" cpuArchitecture: "x86_64" version: "latest-4.12" --- apiVersion: v1 kind: Secret metadata: creationTimestamp: null name: assisted-deployment-ssh-private-key namespace: multicluster-engine type: Opaque stringData: ssh-privatekey: | <ssh-private-key> --- apiVersion: v1 kind: Secret metadata: name: assisted-deployment-pull-secret namespace: multicluster-engine stringData: .dockerconfigjson: '<pull-secret>' type: kubernetes.io/dockerconfigjson
-
<ssh-private-key> is the SSH private key (that is, the contents of ~/.ssh/id_rsa)
-
<pull-secret> is the pull secret that you downloaded from Red Hat
-
-
Create the assisted service component.
oc apply -f hub-assisted-service.yaml
-
Create the assisted service manifest.
-
Verify that all the multicluster engine components are running.
oc get pods -n multicluster-engine