Chapter 7. Creating a cluster with Red Hat Advanced Cluster Management for Kubernetes
Learn how to create Red Hat OpenShift Container Platform clusters across cloud providers with Red Hat Advanced Cluster Management for Kubernetes.
- Creating a cluster on Amazon Web Services
- Creating a cluster on Google Cloud Platform
- Creating a cluster on Microsoft Azure
- Creating a cluster on bare metal (Requires Red Hat OpenShift Container Platform version 4.4, or later)
7.1. Creating a cluster on Amazon Web Services
You can use the Red Hat Advanced Cluster Management for Kubernetes console to create a Red Hat OpenShift Container Platform cluster on Amazon Web Services (AWS).
7.1.1. Prerequisites
You must have the following prerequisites before creating a cluster on AWS:
- A deployed Red Hat Advanced Cluster Management for Kubernetes hub cluster
- Internet access for your Red Hat Advanced Cluster Management for Kubernetes hub cluster so it can create the Kubernetes cluster on Amazon Web Services
- AWS provider connection. See Creating a provider connection for Amazon Web Services for more information.
- A configured domain in AWS. See Configuring an AWS account for instructions on how to configure a domain.
- Amazon Web Services (AWS) login credentials, which include user name, password, access key ID, and secret access key. See Understanding and Getting Your Security Credentials.
- A Red Hat OpenShift image pull secret. See Using image pull secrets.
Note: If you change your cloud provider access key, you must manually update the provisioned cluster access key. For more information, see the known issue, Automatic secret updates for provisioned clusters is not supported.
7.1.2. Creating your cluster with the Red Hat Advanced Cluster Management for Kubernetes console
To create clusters from the Red Hat Advanced Cluster Management for Kubernetes console, complete the following steps:
- From the navigation menu, navigate to Automate infrastructure > Clusters.
- On the Clusters page, Click Add Cluster.
Select Create a cluster.
NoteThis procedure is for creating a cluster. If you have an existing cluster that you want to import, see Importing a target managed cluster to the hub cluster for those steps.
Enter a name for your cluster. This name is used in the hostname of the cluster.
TipYou can view the
yaml
content updates as you enter the information in the console by setting the YAML switch to ON.- Select Amazon Web Services for the infrastructure platform.
- Specify a Release image that you want to use for the cluster. This identifies the version of the Red Hat OpenShift Container Platform image that is used to create the cluster. If the version that you want to use is available, you can select the image from the list of images. If the image that you want to use is not a standard image, you can enter the url to the image that you want to use. See Release images for more information about release images.
- Select your provider connection from the available connections on the list. If you do not have one configured, or want to configure a new one, select Add connection. See Creating a provider connection for Amazon Web Services for more information about creating a provider connection.
- Enter the base domain information that you configured for your AWS account. If there is already a base domain associated with the selected provider connection, that value is populated in that field. You can change the value by overwriting it. See Configuring an AWS account for more information. This name is used in the hostname of the cluster.
- Add the Labels that you want to associate with your cluster. These labels help to identify the cluster and limit search results.
Configure the Node pools for your cluster.
The node pools define the location and size of the nodes that are used for your cluster.
The Region specifies where the nodes are located geographically. A closer region might provide faster performance, but a more distant region might be more distributed.
- Master pool: There are three Master nodes that are created for your cluster in the master pool. The master nodes share the management of the cluster activity. You can select multiple zones within the region for a more distributed group of master nodes. You can change the type and size of your instance after it is created, but you can also specify it in this section. The default values are mx4.xlarge - 4 vCPU, 16 GiB RAM - General Purpose with 500 GiB of root storage.
- Worker pools: You can create one or more worker nodes in a worker pool to run the container workloads for the cluster. They can be in a single worker pool, or distributed across multiple worker pools.
- Optional: Configure the cluster networking options.
- Optional: Configure a label for the cluster.
Click Create. You can view your cluster details after the create and import process is complete.
NoteYou do not have to run the
kubectl
command that is provided with the cluster details to import the cluster. When you create the cluster, it is automatically configured under the management of Red Hat Advanced Cluster Management for Kubernetes.
7.1.3. Accessing your cluster
To access a cluster that is managed by Red Hat Advanced Cluster Management for Kubernetes, complete the following steps:
- From the Red Hat Advanced Cluster Management for Kubernetes navigation menu, navigate to Automate infrastructure > Clusters.
- Select the name of the cluster that you created or want to access. The cluster details are displayed.
- Select Reveal credentials to view the user name and password for the cluster. Note these values to use when you log in to the cluster.
- Select Console URL to link to the cluster.
- Log in to the cluster by using the user ID and password that you found in step 3.
- Select the Actions menu for the cluster that you want to access.
Select Launch to cluster.
TipIf you already know the log in credentials, you can access the cluster by selecting the Actions menu for the cluster, and selecting Launch to cluster.
7.1.4. Removing a cluster from management
When you remove a Red Hat OpenShift Container Platform cluster from management that was created with Red Hat Advanced Cluster Management for Kubernetes, you can either detach it or destroy it.
Detaching a cluster removes it from management, but does not completely delete it. You can import it again, if you decide that you want to bring it back under management. This is only an option when the cluster is in a Ready state.
Destroying a cluster removes it from management and deletes the components of the cluster. This is permanent, and it cannot be brought back under management after deletion.
- From the navigation menu, navigate to Automate infrastructure > Clusters.
- Select the option menu beside the cluster that you want to delete.
- Select Destroy cluster or Detach cluster.
You can detach or destroy multiple clusters by selecting the check boxes of the clusters that you want to detach or destroy. Then select Detach or Destroy.
7.2. Creating a cluster on Microsoft Azure
You can use the Red Hat Advanced Cluster Management for Kubernetes console to deploy a Red Hat OpenShift Container Platform cluster on Microsoft Azure.
7.2.1. Prerequisites
You must have the following prerequisites before creating a cluster on Azure:
- A deployed Red Hat Advanced Cluster Management for Kubernetes hub cluster
- Internet access for your Red Hat Advanced Cluster Management for Kubernetes hub cluster so it can create the Kubernetes cluster on Azure
- Azure provider connection. See Creating a provider connection for Microsoft Azure for more information.
- A configured domain in Azure. See Configuring a custom domain name for an Azure cloud service for instructions on how to configure a domain.
- Azure login credentials, which include user name and password. See azure.microsoft.com.
-
Azure service principals, which include
clientId
,clientSecret
, andtenantId
. See azure.microsoft.com. - A Red Hat OpenShift image pull secret. See Using image pull secrets.
Note: If you change your cloud provider access key, you must manually update the provisioned cluster access key. For more information, see the known issue, Automatic secret updates for provisioned clusters is not supported.
7.2.2. Creating your cluster with the Red Hat Advanced Cluster Management for Kubernetes console
To create clusters from the Red Hat Advanced Cluster Management for Kubernetes console, complete the following steps:
- From the navigation menu, navigate to Automate infrastructure > Clusters.
- On the Clusters page, Click Add Cluster.
Select Create a cluster.
NoteThis procedure is for creating a cluster. If you have an existing cluster that you want to import, see Importing a target managed cluster to the hub cluster for those steps.
Enter a name for your cluster. This name is used in the hostname of the cluster.
TipYou can view the
yaml
content updates as you enter the information in the console by setting the YAML switch to ON.- Select Microsoft Azure for the infrastructure platform.
- Specify a Release image that you want to use for the cluster. This identifies the version of the Red Hat OpenShift Container Platform image that is used to create the cluster. If the version that you want to use is available, you can select the image from the list of images. If the image that you want to use is not a standard image, you can enter the url to the image that you want to use. See Release images for more information about release images.
- Select your provider connection from the available connections on the list. If you do not have one configured, or want to configure a new one, select Add connection . See Creating a provider connection for Microsoft Azure for more information about creating a provider connection.
- Enter the base domain information that you configured for your Azure account. If there is already a base domain associated with the selected provider connection, that value is populated in that field. You can change the value by overwriting it. See Configuring a custom domain name for an Azure cloud service for more information. This name is used in the hostname of the cluster.
- Add the Labels that you want to associate with your cluster. These labels help to identify the cluster and limit search results.
Configure the Node pools for your cluster.
The node pools define the location and size of the nodes that are used for your cluster.
The Region specifies where the nodes are located geographically. A closer region might provide faster performance, but a more distant region might be more distributed.
- Master pool: There are three Master nodes that are created for your cluster in the master pool. The master nodes share the management of the cluster activity. You can select multiple zones within the region for a more distributed group of master nodes. You can change the type and size of your instance after it is created, but you can also specify it in this section. The default values are Standard_D2s_v3 - 2 vCPU, 8 GiB RAM - General Purpose with 512 GiB of root storage.
- Worker pools: You can create one or more worker nodes in a worker pool to run the container workloads for the cluster. They can be in a single worker pool, or distributed across multiple worker pools.
- Optional: Configure the cluster networking options.
- Optional: Configure a label for the cluster.
Click Create. You can view your cluster details after the create and import process is complete.
NoteYou do not have to run the
kubectl
command that is provided with the cluster details to import the cluster. When you create the cluster, it is automatically configured under the management of Red Hat Advanced Cluster Management for Kubernetes.
7.2.3. Accessing your cluster
To access a cluster that is managed by Red Hat Advanced Cluster Management for Kubernetes, complete the following steps:
- From the Red Hat Advanced Cluster Management for Kubernetes navigation menu, navigate to Automate infrastructure > Clusters.
- Select the name of the cluster that you created or want to access. The cluster details are displayed.
- Select Reveal credentials to view the user name and password for the cluster. Note these values to use when you log in to the cluster.
- Select Console URL to link to the cluster.
- Log in to the cluster by using the user ID and password that you found in step 3.
- Select the Actions menu for the cluster that you want to access.
Select Launch to cluster.
TipIf you already know the log in credentials, you can access the cluster by selecting the Actions menu for the cluster, and selecting Launch to cluster.
7.2.4. Removing a cluster from management
When you remove a Red Hat OpenShift Container Platform cluster from management that was created with Red Hat Advanced Cluster Management for Kubernetes, you can either Detach it or Destroy it.
Detaching a cluster removes it from management, but does not completely delete it. You can import it again, if you decide that you want to bring it back under management. This is only an option when the cluster is in a Ready state.
Destroying a cluster removes it from management and deletes the components of the cluster. This is permanent, and it cannot be brought back under management after deletion.
- From the navigation menu, navigate to Automate infrastructure > Clusters.
- Select the option menu beside the cluster that you want to delete.
Select Destroy cluster or Detach cluster.
TipYou can detach or destroy multiple clusters by selecting the check boxes of the clusters that you want to detach or destroy. Then select Detach or Destroy.
7.3. Creating a cluster on Google Cloud Platform
Follow the procedure to create a Red Hat OpenShift Container Platform cluster on Google Cloud Platform (GCP). For more information about Google Cloud Platform, see Google Cloud Platform.
7.3.1. Prerequisites
You must have the following prerequisites before creating a cluster on GCP:
- A deployed Red Hat Advanced Cluster Management for Kubernetes hub cluster
- Internet access for your Red Hat Advanced Cluster Management for Kubernetes hub cluster so it can create the Kubernetes cluster on GCP
- GCP provider connection. See Creating a a provider connection for Google Cloud Platform for more information.
- A configured domain in GCP. See Setting up a custom domain for instructions on how to configure a domain.
- GCP login credentials, which include user name and password.
- A Red Hat OpenShift image pull secret. See Using image pull secrets.
Note: If you change your cloud provider access key, you must manually update the provisioned cluster access key. For more information, see the known issue, Automatic secret updates for provisioned clusters is not supported.
7.3.2. Creating your cluster with the Red Hat Advanced Cluster Management for Kubernetes console
To create clusters from the Red Hat Advanced Cluster Management for Kubernetes console, complete the following steps:
- From the navigation menu, navigate to Automate infrastructure > Clusters.
- On the Clusters page, Click Add Cluster.
Select Create a cluster.
NoteThis procedure is for creating a cluster. If you have an existing cluster that you want to import, see Importing a target managed cluster to the hub cluster for those steps.
Enter a name for your cluster. There are some restrictions that apply to naming your GCP cluster. These restrictions include not beginning the name with
goog
or containing a group of letters and numbers that resemblegoogle
anywhere in the name. See Bucket naming guidelines for the complete list of restrictions.This name is used in the hostname of the cluster.
TipYou can view the
yaml
content updates as you enter the information in the console by setting the YAML switch to ON.- Select Google Cloud for the infrastructure platform.
- Specify a Release image that you want to use for the cluster. This identifies the version of the Red Hat OpenShift Container Platform image that is used to create the cluster. If the version that you want to use is available, you can select the image from the list of images. If the image that you want to use is not a standard image, you can enter the url to the image that you want to use. See Release images for more information about release images.
- Select your provider connection from the available connections on the list. If you do not have one configured, or want to configure a new one, select Add connection. See Creating a provider connection for Google Cloud Platform for more information about creating a provider connection.
- Enter the base domain information that you configured for your Google Cloud Platform account. If there is already a base domain associated with the selected provider connection, that value is populated in that field. You can change the value by overwriting it. See Setting up a custom domain for more information. This name is used in the hostname of the cluster.
- Add the Labels that you want to associate with your cluster. These labels help to identify the cluster and limit search results.
Configure the Node pools for your cluster.
The node pools define the location and size of the nodes that are used for your cluster.
The Region specifies where the nodes are located geographically. A closer region might provide faster performance, but a more distant region might be more distributed.
- Master pool: There are three Master nodes that are created for your cluster in the master pool. The master nodes share the management of the cluster activity. You can select multiple zones within the region for a more distributed group of master nodes. You can change the type and size of your instance after it is created, but you can also specify it in this section. The default values are n1-standard-1 - n1-standard-1 1 vCPU - General Purpose with 500 GiB of root storage.
- Worker pools: You can create one or more worker nodes in a worker pool to run the container workloads for the cluster. They can be in a single worker pool, or distributed across multiple worker pools.
- Optional: Configure the cluster networking options.
- Optional: Configure a label for the cluster.
- Click Create.
You can view your cluster details after the create and import process is complete.
+ NOTE: You do not have to run the kubectl
command that is provided with the cluster details to import the cluster. When you create the cluster, it is automatically configured under the management of Red Hat Advanced Cluster Management for Kubernetes.
7.3.3. Accessing your cluster
To access a cluster that is managed by Red Hat Advanced Cluster Management for Kubernetes, complete the following steps:
- From the Red Hat Advanced Cluster Management for Kubernetes navigation menu, navigate to Automate infrastructure > Clusters.
- Select the name of the cluster that you created or want to access. The cluster details are displayed.
- Select Reveal credentials to view the user name and password for the cluster. Note these values to use when you log in to the cluster.
- Select Console URL to link to the cluster.
- Log in to the cluster by using the user ID and password that you found in step 3.
- Select the Actions menu for the cluster that you want to access.
Select Launch to cluster.
TipIf you already know the log in credentials, you can access the cluster by selecting the Actions menu for the cluster, and selecting Launch to cluster.
7.3.4. Removing a cluster from management
When you remove a Red Hat OpenShift Container Platform cluster from management that was created with Red Hat Advanced Cluster Management for Kubernetes, you can either detach it or destroy it.
Detaching a cluster removes it from management, but does not completely delete it. You can import it again, if you decide that you want to bring it back under management. This is only an option when the cluster is in a Ready state.
Destroying a cluster removes it from management and deletes the components of the cluster. This is permanent, and it cannot be brought back under management after deletion.
- From the navigation menu, navigate to Automate infrastructure > Clusters.
- Select the option menu beside the cluster that you want to delete.
Select Destroy cluster or Detach cluster.
TipYou can detach or destroy multiple clusters by selecting the check boxes of the clusters that you want to detach or destroy. Then select Detach or Destroy.
7.4. Creating a cluster on bare metal
Important: The bare metal cluster function is a technology preview,and should not be used in production environments.
You can use the Red Hat Advanced Cluster Management for Kubernetes console to create a Red Hat OpenShift Container Platform cluster in a bare metal environment.
The options for bare metal in the console are a technology preview only, and are hidden by a feature flag by default. See the instructions for enabling the feature flag in the Prerequisites section.
7.4.1. Prerequisites
You need the following prerequisites before creating a cluster in a bare metal environment:
- A deployed Red Hat Advanced Cluster Management for Kubernetes hub cluster on OpenShift Container Platform version 4.5, or later.
- Internet access for your Red Hat Advanced Cluster Management for Kubernetes hub cluster so it can create the Kubernetes cluster in the bare metal environment
- Bare metal provider connection; see Creating a provider connection for bare metal for more information
- Login credentials for your bare metal environment, which include user name, password, and Baseboard Management Controller Address
A Red Hat OpenShift Container Platform image pull secret; see Using image pull secrets.
Note: The bare metal asset, managed bare metal cluster, and its related secret must be in the same namespace.
Bare metal feature flags that are enabled to view the bare metal options. The bare metal options are hidden by feature flags by default. Complete the following steps to enable the feature flags:
- Start the Red Hat OpenShift Container Platform command line interface.
Set the
featureFlags_baremetal
setting to true for theconsole-header
container by entering the following command:oc patch deploy console-header -n <namespace> -p '{"spec":{"template":{"spec":{"containers":[{"name":"console-header","env": [{"name": "featureFlags_baremetal","value":"true"}]}]}}}}'
Replace <namespace> with your Red Hat Advanced Cluster Management project namespace.
After the update, your
consoleui
CRD should look like the following example:spec: ... template: ... spec: ... containers: - env: # Search for env: - name: featureFlags_baremetal value: "true" ...
Set the
featureFlags_baremetal
value to true for thehmc-ui
container:oc patch -n <namespace> $(oc get deploy -o name | grep consoleui) -p '{"spec":{"template":{"spec":{"containers":[{"name":"hcm-ui","env": [{"name": "featureFlags_baremetal","value":"true"}]}]}}}}'
Replace <namespace> with your Red Hat Advanced Cluster Management project namespace.
Your update should look like the following example:
spec: ... template: ... spec: ... containers: - env: # Search for env: - name: featureFlags_baremetal value: "true" ...
Make sure the
console-chart-...-consoleui...
andconsole-header-...
pods are running:oc -n open-cluster-management get pods
- When the pods are running again, log out of the Red Hat Advanced Cluster Management for Kubernetes console and log back in. The bare metal options are now included in the console.
Note: If you change your cloud provider access key, you must manually update the provisioned cluster access key. For more information, see the known issue, Automatic secret updates for provisioned clusters is not supported.
7.4.2. Creating your cluster with the Red Hat Advanced Cluster Management for Kubernetes console
To create clusters from the Red Hat Advanced Cluster Management for Kubernetes console, complete the following steps:
- From the navigation menu, navigate to Automate infrastructure > Clusters.
- On the Clusters page, Click Add Cluster.
Select Create a cluster.
Note: This procedure is for creating a cluster. If you have an existing cluster that you want to import, see Importing a target managed cluster to the hub cluster for those steps.
Enter a name for your cluster. This name is used in the hostname of the cluster.
Tip: You can view the
yaml
content updates as you enter the information in the console by setting the YAML switch to ON.- Select Bare Metal for the infrastructure platform.
- Specify a Release image that you want to use for the cluster. This identifies the version of the Red Hat OpenShift Container Platform image that is used to create the cluster. If the version that you want to use is available, you can select the image from the list of images. If the image that you want to use is not a standard image, you can enter the url to the image that you want to use. See Release images for more information about release images.
- Select your provider connection from the available connections on the list. If you do not have one configured, or want to configure a new one, select Add provider. See Creating a provider connection for bare metal for more information about creating a provider connection.
- Enter the base domain information that you configured in your bare metal environment. If there is already a base domain associated with the selected provider connection, that value is populated in that field. You can change the value by overwriting it. This name is used in the hostname of the cluster.
- Select your hosts from the list of hosts that are associated with your provider connection. Select a minimum of three assets that are on the same bridge networks as the hypervisor.
- Optional: Configure the cluster networking options.
- Optional: Configure a label for the cluster.
- Optional: Update the advanced settings, if you want to change the setting for including a configmap.
Click Create. You can view your cluster details after the create and import process is complete.
Note: You do not have to run the
kubectl
command that is provided with the cluster details to import the cluster. When you create the cluster, it is automatically configured under the management of Red Hat Advanced Cluster Management for Kubernetes.
7.4.3. Accessing your cluster
To access a cluster that is managed by Red Hat Advanced Cluster Management for Kubernetes, complete the following steps:
- From the Red Hat Advanced Cluster Management for Kubernetes navigation menu, navigate to Automate infrastructure > Clusters.
- Select the name of the cluster that you created or want to access. The cluster details are displayed.
- Select Reveal credentials to view the user name and password for the cluster. Note these values to use when you log in to the cluster.
- Select Console URL to link to the cluster.
- Log in to the cluster by using the user ID and password that you found in step 3.
- Select the Actions menu for the cluster that you want to access.
Select Launch to cluster.
Tip: If you already know the log in credentials, you can access the cluster by selecting the Actions menu for the cluster, and selecting Launch to cluster.
7.4.4. Removing a cluster from management
When you remove a Red Hat OpenShift Container Platform cluster from management that was created with Red Hat Advanced Cluster Management for Kubernetes, you can either detach it or destroy it.
Detaching a cluster removes it from management, but does not completely delete it. You can import it again, if you decide that you want to bring it back under management. This is only an option when the cluster is in a Ready state.
Destroying a cluster removes it from management and deletes the components of the cluster. This is permanent, and it cannot be brought back under management after deletion.
- From the navigation menu, navigate to Automate infrastructure > Clusters.
- Select the option menu beside the cluster that you want to delete.
Select Destroy cluster or Detach cluster.
Tip: You can detach or destroy multiple clusters by selecting the check boxes of the clusters that you want to detach or destroy. Then select Detach or Destroy.