1.5. Installing while connected online
Red Hat Advanced Cluster Management for Kubernetes is installed using an operator that deploys all of the required components.
1.5.1. Prerequisites 复制链接链接已复制到粘贴板!
You must meet the following requirements before you install Red Hat Advanced Cluster Management:
- Your Red Hat OpenShift Container Platform must have access to the Red Hat Advanced Cluster Management operator in the OperatorHub catalog.
- OpenShift Container Platform version 4.3, or later, must be deployed in your environment, and you must be logged into it with the CLI. See the OpenShift version 4.3 documentation or OpenShift version 4.4 documentation.
-
Your OpenShift Container Platform command line interface (CLI) must be version 4.3, or later, and configured to run
oc
commands. See Getting started with the CLI for information about installing and configuring the OpenShift Container Platform CLI. - Your Red Hat OpenShift Container Platform permissions must allow you to create a namespace.
- You must have an Internet connection to access the dependencies for the operator.
Create a hub cluster namespace where the operator requirements are contained:
oc create namespace <namespace>
oc create namespace <namespace>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace namespace with a name for your hub cluster namespace. Note: The value for namespace might be referred to as Project in the OpenShift Container Platform environment.
Important: The Red Hat Advanced Cluster Management operator must be installed in its own namespace. A
ServiceAccount
with aClusterRoleBinding
automatically gives cluster administrator privileges to Red Hat Advanced Cluster Management and to any ID with access to the namespace. For security, make sure that anyone who is given access to this namespace already has cluster-administrator access.Switch your project namespace to the one that you created:
oc project <namespace>
oc project <namespace>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace namespace with the name of the hub cluster namespace that you created in step 1.
If you plan to import Kubernetes clusters that were not created by OpenShift Container Platform or Red Hat Advanced Cluster Management, generate a secret that contains your OpenShift Container Platform pull secret information to access the entitled content from the distribution registry. The secret requirements for OpenShift Container Platform clusters are automatically resolved by OpenShift Container Platform and Red Hat Advanced Cluster Management, so you do not have to create the secret if you are not importing other types of Kubernetes clusters to be managed. Important: These secrets are namespace-specific, so make sure that you are in the namespace that you created in step 1.
- Download your OpenShift Container Platform pull secret file from cloud.redhat.com/openshift/install/pull-secret by selecting Download pull secret. Your OpenShift Container Platform pull secret is associated with your Red Hat Customer Portal ID, and is the same across all Kubernetes providers.
Run the following command to create your secret:
oc create secret generic <secret> -n <namespace> --from-file=.dockerconfigjson=<path-to-pull-secret> --type=kubernetes.io/dockerconfigjson
oc create secret generic <secret> -n <namespace> --from-file=.dockerconfigjson=<path-to-pull-secret> --type=kubernetes.io/dockerconfigjson
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace secret with the name of the secret that you want to create. Replace namespace with your project namespace. Replace path-to-pull-secret with the path to your OpenShift Container Platform pull secret that you downloaded.
Create an operator group. Each namespace can have only one operator group.
Create a
.yaml
file that defines the operator group. Your file should look similar to the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace default with the name of your operator group. Replace namespace with the name of your project namespace.
Apply the file that you created to define the operator group:
oc apply -f local/<operator-group>.yaml
oc apply -f local/<operator-group>.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace operator-group with the name of the operator group
.yaml
file that you created.
Apply the subscription.
Create a
.yaml
file that defines the subscription. Your file should look similar to the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the subscription:
oc apply -f local/<subscription>.yaml
oc apply -f local/<subscription>.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace subscription with the name of the subscription file that you created.
Create the MultiClusterHub custom resource by creating a
.yaml
file that defines the custom resource. Your file should look similar to the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace namespace with your project namespace. Replace secret with the name of the secret that you created.
If this step fails with the following error, the resources are still being created and applied:
error: unable to recognize "./mch.yaml": no matches for kind "MultiClusterHub" in version "operator.open-cluster-management.io/v1"
error: unable to recognize "./mch.yaml": no matches for kind "MultiClusterHub" in version "operator.open-cluster-management.io/v1"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the command again in a few minutes when the resources are created.
View the list of routes after about 10 minutes to find your route:
oc get routes
oc get routes
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
If you are reinstalling Red Hat Advanced Cluster Management and the pods do not start, see Troubleshooting reinstallation failure for steps to work around this problem.
Create a hub cluster namespace for the operator requirements:
- In the OpenShift Container Platform console navigation, select Administration > Namespaces.
- Select Create Namespace.
- Provide a name for your namespace. This is the namespace that you use throughout the installation process. Note: The value for namespace might be referred to as Project in the OpenShift Container Platform environment.
Select Create.
Important: The Red Hat Advanced Cluster Management operator must be installed in its own namespace. A
ServiceAccount
with aClusterRoleBinding
automatically gives cluster administrator privileges to Red Hat Advanced Cluster Management and to any ID with access to the namespace. For security, make sure that anyone who is given access to this namespace already has cluster-administrator access.
Switch your project namespace to the one that you created in step 1. This ensures that the steps are completed in the correct namespace. Some resources are namespace-specific.
- In the OpenShift Container Platform console navigation, select Administration > Namespaces.
- Select the namespace that you created in step 1 from the list.
If you plan to import Kubernetes clusters that were not created by OpenShift Container Platform or Red Hat Advanced Cluster Management, creater a secret that contains your OpenShift Container Platform pull secret to access the entitled content from the distribution registry. Secret requirements for OpenShift Container Platform clusters are automatically resolved by OpenShift Container Platform and Red Hat Advanced Cluster Management, so you do not have to create the secret if you are not importing other types of Kubernetes clusters to be managed.
- Copy your OpenShift Container Platform pull secret from cloud.redhat.com/openshift/install/pull-secret by selecting Copy pull secret. You will use the content of this pull secret in a step later in this procedure. Your OpenShift Container Platform pull secret is associated with your Red Hat Customer Portal ID, and is the same across all Kubernetes providers.
- In the OpenShift Container Platform console navigation, select Workloads > Secrets.
- Select Create > Image Pull Secret.
- Enter a name for your secret.
- Select Upload Configuration File as the authentication type.
-
In the Configuration file field, paste the pull secret that you copied from
cloud.redhat.com
. - Select Create to create the secret.
Subscribe to the operator. Note: The value for namespace might be referred to as Project in the OpenShift Container Platform environment.
- In the OpenShift Container Platform console navigation, select Operators > OperatorHub.
- Select Red Hat Advanced Cluster Management. Tip: You can filter on the Integration & Delivery category to narrow the choices.
- Select Install.
- Update the values, if necessary.
- Select Subscribe.
Create the MultiClusterHub custom resource.
- In the OpenShift Container Platform console navigation, select Installed Operators > Advanced Cluster Management for Kubernetes.
- Select the MultiClusterHub tab.
- Select Create MultiClusterHub.
Update the values, according to your needs. Tip: You can edit the values in the
YAML
file by selecting YAML View. Some of the values are only available in theYAML
view. The following example shows some sample data in theYAML
view:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the secret that you created to the imagePullSecret field on the console. In the YAML View, confirm that the namespace is your project namespace.
Select Create to initialize the custom resource. It can take up to 10 minutes for the hub to build and start.
After the hub is created, the status for the operator is Running on the Installed Operators page.
Access the console for the hub.
- In the OpenShift Container Platform console navigation, select Networking > Routes.
- View the URL for your hub in the list, and navigate to it to access the console for your hub.
If you are reinstalling Red Hat Advanced Cluster Management and the pods do not start, see Troubleshooting reinstallation failure for steps to work around this problem.