|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * installing_with_agent_based_installer/preparing-an-agent-based-installed-cluster-for-mce.adoc |
| 4 | + |
| 5 | +:_content-type: PROCEDURE |
| 6 | +[id="preparing-an-inital-cluster-deployment-for-mce-connected_{context}"] |
| 7 | + |
| 8 | += Preparing an agent-based cluster deployment for the multicluster engine for Kubernetes Operator while connected |
| 9 | + |
| 10 | +Create the required manifests for the multicluster engine for Kubernetes Operator, the Local Storage Operator (LSO), and to deploy an agent-based {product-title} cluster as a hub cluster. |
| 11 | + |
| 12 | +.Procedure |
| 13 | + |
| 14 | +. Create a sub-folder named `openshift` in the `<assets_directory>` folder. This sub-folder is used to store the extra manifests that will be applied during the installation to further customize the deployed cluster. |
| 15 | +The `<assets_directory>` folder contains all the assets including the `install-config.yaml` and `agent-config.yaml` files. |
| 16 | ++ |
| 17 | +[NOTE] |
| 18 | +==== |
| 19 | +The installer does not validate extra manifests. |
| 20 | +==== |
| 21 | + |
| 22 | +. For the multicluster engine, create the following manifests and save them in the `<assets_directory>/openshift` folder: |
| 23 | ++ |
| 24 | +.Example `mce_namespace.yaml` |
| 25 | ++ |
| 26 | +[source,yaml] |
| 27 | +---- |
| 28 | + apiVersion: v1 |
| 29 | + kind: Namespace |
| 30 | + metadata: |
| 31 | + labels: |
| 32 | + openshift.io/cluster-monitoring: "true" |
| 33 | + name: multicluster-engine |
| 34 | +---- |
| 35 | ++ |
| 36 | +.Example `mce_operatorgroup.yaml` |
| 37 | ++ |
| 38 | +[source,yaml] |
| 39 | +---- |
| 40 | + apiVersion: operators.coreos.com/v1 |
| 41 | + kind: OperatorGroup |
| 42 | + metadata: |
| 43 | + name: multicluster-engine-operatorgroup |
| 44 | + namespace: multicluster-engine |
| 45 | + spec: |
| 46 | + targetNamespaces: |
| 47 | + - multicluster-engine |
| 48 | +---- |
| 49 | ++ |
| 50 | +.Example `mce_subscription.yaml` |
| 51 | ++ |
| 52 | +[source,yaml] |
| 53 | +---- |
| 54 | + apiVersion: operators.coreos.com/v1alpha1 |
| 55 | + kind: Subscription |
| 56 | + metadata: |
| 57 | + name: multicluster-engine |
| 58 | + namespace: multicluster-engine |
| 59 | + spec: |
| 60 | + channel: "stable-2.1" |
| 61 | + name: multicluster-engine |
| 62 | + source: redhat-operators |
| 63 | + sourceNamespace: openshift-marketplace |
| 64 | +---- |
| 65 | ++ |
| 66 | +[NOTE] |
| 67 | +==== |
| 68 | +You can install a distributed unit (DU) at scale with the {rh-rhacm-first} using the assisted installer (AI). These distributed units must be enabled in the hub cluster. |
| 69 | +The AI service requires persistent volumes (PVs), which are manually created. |
| 70 | +==== |
| 71 | + |
| 72 | +. For the AI service, create the following manifests and save them in the `<assets_directory>/openshift` folder: |
| 73 | ++ |
| 74 | +.Example `lso_namespace.yaml` |
| 75 | ++ |
| 76 | +[source,yaml] |
| 77 | +---- |
| 78 | + apiVersion: v1 |
| 79 | + kind: Namespace |
| 80 | + metadata: |
| 81 | + annotations: |
| 82 | + openshift.io/cluster-monitoring: "true" |
| 83 | + name: openshift-local-storage |
| 84 | +---- |
| 85 | ++ |
| 86 | +.Example `lso_operatorgroup.yaml` |
| 87 | ++ |
| 88 | +[source,yaml] |
| 89 | +---- |
| 90 | + apiVersion: operators.coreos.com/v1 |
| 91 | + kind: OperatorGroup |
| 92 | + metadata: |
| 93 | + name: local-operator-group |
| 94 | + namespace: openshift-local-storage |
| 95 | + spec: |
| 96 | + targetNamespaces: |
| 97 | + - openshift-local-storage |
| 98 | +---- |
| 99 | ++ |
| 100 | +.Example `lso_subscription.yaml` |
| 101 | ++ |
| 102 | +[source,yaml] |
| 103 | +---- |
| 104 | + apiVersion: operators.coreos.com/v1alpha1 |
| 105 | + kind: Subscription |
| 106 | + metadata: |
| 107 | + name: local-storage-operator |
| 108 | + namespace: openshift-local-storage |
| 109 | + spec: |
| 110 | + installPlanApproval: Automatic |
| 111 | + name: local-storage-operator |
| 112 | + source: redhat-operators |
| 113 | + sourceNamespace: openshift-marketplace |
| 114 | +---- |
| 115 | ++ |
| 116 | +[NOTE] |
| 117 | +==== |
| 118 | +After creating all the manifests, your filesystem must display as follows: |
| 119 | +
|
| 120 | +.Example Filesystem |
| 121 | +
|
| 122 | +[source,terminal] |
| 123 | +---- |
| 124 | +<assets_directory> |
| 125 | + ├─ install-config.yaml |
| 126 | + ├─ agent-config.yaml |
| 127 | + └─ /openshift |
| 128 | + ├─ mce_namespace.yaml |
| 129 | + ├─ mce_operatorgroup.yaml |
| 130 | + ├─ mce_subscription.yaml |
| 131 | + ├─ lso_namespace.yaml |
| 132 | + ├─ lso_operatorgroup.yaml |
| 133 | + └─ lso_subscription.yaml |
| 134 | +---- |
| 135 | +==== |
| 136 | + |
| 137 | +. Create the agent ISO image by running the following command: |
| 138 | ++ |
| 139 | +[source,terminal] |
| 140 | +---- |
| 141 | +$ openshift-install agent create image --dir <assets_directory> |
| 142 | +---- |
| 143 | + |
| 144 | +. When the image is ready, boot the target machine and wait for the installation to complete. |
| 145 | + |
| 146 | +. To monitor the installation, run the following command: |
| 147 | ++ |
| 148 | +[source,terminal] |
| 149 | +---- |
| 150 | +$ openshift-install agent wait-for install-complete --dir <assets_directory> |
| 151 | +---- |
| 152 | ++ |
| 153 | +[NOTE] |
| 154 | +==== |
| 155 | +To configure a fully functional hub cluster, you must create the following manifests and manually apply them by running the command `$ oc apply -f <manifest-name>`. |
| 156 | +The order of the manifest creation is important and where required, the waiting condition is displayed. |
| 157 | +==== |
| 158 | + |
| 159 | +. For the PVs that are required by the AI service, create the following manifests: |
| 160 | ++ |
| 161 | +[source,yaml] |
| 162 | +---- |
| 163 | + apiVersion: local.storage.openshift.io/v1 |
| 164 | + kind: LocalVolume |
| 165 | + metadata: |
| 166 | + name: assisted-service |
| 167 | + namespace: openshift-local-storage |
| 168 | + spec: |
| 169 | + logLevel: Normal |
| 170 | + managementState: Managed |
| 171 | + storageClassDevices: |
| 172 | + - devicePaths: |
| 173 | + - /dev/vda |
| 174 | + - /dev/vdb |
| 175 | + storageClassName: assisted-service |
| 176 | + volumeMode: Filesystem |
| 177 | +---- |
| 178 | ++ |
| 179 | +. Use the following command to wait for the availability of the PVs, before applying the subsequent manifests: |
| 180 | ++ |
| 181 | +[source,terminal] |
| 182 | +---- |
| 183 | +$ oc wait localvolume -n openshift-local-storage assisted-service --for condition=Available --timeout 10m |
| 184 | +---- |
| 185 | ++ |
| 186 | +[NOTE] |
| 187 | +==== |
| 188 | + The `devicePath` is an example and may vary depending on the actual hardware configuration used. |
| 189 | +==== |
| 190 | ++ |
| 191 | +. Create a manifest for a multicluster engine instance. |
| 192 | ++ |
| 193 | +.Example `MultiClusterEngine.yaml` |
| 194 | ++ |
| 195 | +[source,yaml] |
| 196 | +---- |
| 197 | + apiVersion: multicluster.openshift.io/v1 |
| 198 | + kind: MultiClusterEngine |
| 199 | + metadata: |
| 200 | + name: multiclusterengine |
| 201 | + spec: {} |
| 202 | +---- |
| 203 | + |
| 204 | +. Create a manifest to enable the AI service. |
| 205 | ++ |
| 206 | +.Example `agentserviceconfig.yaml` |
| 207 | ++ |
| 208 | +[source,yaml] |
| 209 | +---- |
| 210 | + apiVersion: agent-install.openshift.io/v1beta1 |
| 211 | + kind: AgentServiceConfig |
| 212 | + metadata: |
| 213 | + name: agent |
| 214 | + namespace: assisted-installer |
| 215 | + spec: |
| 216 | + databaseStorage: |
| 217 | + storageClassName: assisted-service |
| 218 | + accessModes: |
| 219 | + - ReadWriteOnce |
| 220 | + resources: |
| 221 | + requests: |
| 222 | + storage: 10Gi |
| 223 | + filesystemStorage: |
| 224 | + storageClassName: assisted-service |
| 225 | + accessModes: |
| 226 | + - ReadWriteOnce |
| 227 | + resources: |
| 228 | + requests: |
| 229 | + storage: 10Gi |
| 230 | +---- |
| 231 | + |
| 232 | +. Create a manifest to deploy subsequently spoke clusters. |
| 233 | ++ |
| 234 | +.Example `clusterimageset.yaml` |
| 235 | ++ |
| 236 | +[source,yaml] |
| 237 | +---- |
| 238 | + apiVersion: hive.openshift.io/v1 |
| 239 | + kind: ClusterImageSet |
| 240 | + metadata: |
| 241 | + name: "4.12" |
| 242 | + spec: |
| 243 | + releaseImage: quay.io/openshift-release-dev/ocp-release:4.12.0-x86_64 |
| 244 | +---- |
| 245 | + |
| 246 | +. Create a manifest to import the agent installed cluster (that hosts the multicluster engine and the Assisted Service) as the hub cluster. |
| 247 | ++ |
| 248 | +.Example `autoimport.yaml` |
| 249 | ++ |
| 250 | +[source,yaml] |
| 251 | +---- |
| 252 | + apiVersion: cluster.open-cluster-management.io/v1 |
| 253 | + kind: ManagedCluster |
| 254 | + metadata: |
| 255 | + labels: |
| 256 | + local-cluster: "true" |
| 257 | + cloud: auto-detect |
| 258 | + vendor: auto-detect |
| 259 | + name: local-cluster |
| 260 | + spec: |
| 261 | + hubAcceptsClient: true |
| 262 | +---- |
| 263 | + |
| 264 | +. Wait for the managed cluster to be created. |
| 265 | ++ |
| 266 | +[source,terminal] |
| 267 | +---- |
| 268 | +$ oc wait -n multicluster-engine managedclusters local-cluster --for condition=ManagedClusterJoined=True --timeout 10m |
| 269 | +---- |
| 270 | + |
| 271 | +.Verification |
| 272 | +* To confirm that the managed cluster installation is successful, run the following command: |
| 273 | ++ |
| 274 | +[source,terminal] |
| 275 | +---- |
| 276 | +$ oc get managedcluster |
| 277 | +NAME HUB ACCEPTED MANAGED CLUSTER URLS JOINED AVAILABLE AGE |
| 278 | +local-cluster true https://<your cluster url>:6443 True True 77m |
| 279 | +---- |
0 commit comments