Red Hat Advanced Cluster Management for Kubernetes is installed using a main operator that deploys all of the required sub-operators such as etcd, multicloud subscription, Apache Hive, and so on.
There are two methods that you can use to install, both require the same prerequisites and preparations.
-
Method 1 is an easier method, which leverages a
start.shinstaller script to automate the installation to get running quickly. -
Method 2 is more customizable if you want to use commands to complete each required step, but is not as easy as Method 1.
See the following prerequisites before installing Red Hat Advanced Cluster Management for Kubernetes:
-
Red Hat OpenShift Container Platform version 4.3 or 4.4 must be deployed in your environment, and you must be logged into it with the CLI. See the OpenShift version 4.3 documentation or the OpenShift version 4.4 documentation.
-
A pre-configured StorageClass in Red Hat OpenShift Container Platform that can be used to create storage for Red Hat Advanced Cluster Management for Kubernetes.
-
Your Red Hat OpenShift Container Platform CLI must be version 4.3, or later, and configured to run
occommands. See Getting started with the CLI for information about installing and configuring the Red Hat OpenShift CLI. -
You also need the Kubernetes CLI,
kubectlversion 1.6, or later. See Overview of kubectl for information aboutkubectl. -
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.
-
You must have
jqinstalled. If you do not havejqinstalled, and you are using macOS, enterbreq install jqin a terminal window. -
If you are using macOS, you must install
gsed. If you do not already havegsedinstalled, you can install it by enteringbrew install gnu-sedin a terminal window. -
Optional: If you are using macOS and want to view the progress of your pods starting, you must install
watch. If you do not already havewatchinstalled, you can install it by enteringbrew install watchin a teminal window. You must havewatchif you use the--watchoption with your installation command.
Complete the following preparations before you complete either of the installation procedures. Note: Only run the steps in this section once.
- Download the required files by cloning the
open-cluster-management/deployGit repository with the following command:
git clone https://github.com/open-cluster-management/deploy.git
Cloning the repository provides the required files for installing Red Hat Advanced Cluster Management for Kubernetes. The repository contains three directories:
-
prereqs: Contains.yamldefinitions that define the required objects, such as namespaces and pull-secrets. -
multiclusterhub-operator: Contains.yamldefinitions for setting up aCatalogSourcefor the operator. -
multiclusterhub: Containsyamldefinitions for creating an instance ofMultiClusterHub.
Each directory contains a kustomization.yaml file with settings that you can update to create your environment. If you update the files, you can apply the changes by entering the kubectl apply -k command.
-
Change to the
deploydirectory that you just cloned. -
Generate a pull-secret.
- Ensure you have access to the Red Hat Quay.io organization by signing in to open-cluster-management.
If you do not have access to the
open-cluster-managementorganization in Quay.io, you can request access on the internal#forum-acmSlack channel.-
Visit the following link, but replace
<your_username>with your Quay.io username: https://quay.io/user/<your_username>?tab=settings. -
Select Generate Encrypted Password.
-
Enter your Quay.io password.
-
Select Kubernetes Secret from the navigation menu.
-
Select Download <your_username>-secret.yml with your Quay username in place of
<your_username>. -
Save your secret file in the
prereqsdirectory of the cloned Git repository with the name ofpull-secret.yaml. Notice: If the pull secret file has a .yml extension when you download it, update it to .yaml when you rename it. -
Edit the contents of the
pull-secret.yamlfile and replace the name of theSecret metadata: nameentry withmulticlusterhub-operator-pull-secret, as shown in the following example:
apiVersion: v1 kind: Secret metadata: name: multiclusterhub-operator-pull-secret ... -
Select either Method 1 or Method 2 to continue installing Red Hat Advanced Cluster Management for Kubernetes.
{: #script}
You can install Red Hat Advanced Cluster Management for Kubernetes by making some updates to a script file and deploying the cluster. This is the easiest way to get started, but the other method is provided if you prefer to use oc commands to install.
- Run the
start.shscript that is in the clonedopen-cluster-management/deployrepository. The following options are available to use when you run the script, but you cannot use multiple options with a single command:
-
-t: Modifies the.yaml, but exits before applying the resources. You can verify or update the settings in the.yamlfile before you apply them. -
--silent: Skips all prompting and uses the settings from the previous configuration. -
--watch: Monitors the main Red Hat Advanced Cluster Management for Kubernetes pod deployments for up to 10 minutes to ensure that they start correctly.
The command format should be similar to the following example:
./start.sh --watch
- Provide the SNAPSHOT tag. You can either press
Enterto use the tag that was used on the previous installation, or provide a new tag. You can find a list of available tags in the Quay.io multiclusterhub-operator-index. Tip: You can change the default SNAPSHOT value in thestart.shscript by editing the value forsnapshot.verto the new version. Updating the default SNAPSHOT value in the script is useful when using the--silentoption.
The following text shows the format of the snapshot:
SNAPSHOT-2020-03-31-02-16-43
Remember: If you enter a snapshot value, the value that you enter overwrites the existing default value and is stored as the default value for future installation attempts. The last snapshot value that was entered is the default value.
-
Enter the
watch oc -n open-cluster-management get podscommand to view the progress of the deployment of theOCM. Depending on the option that you used when you ran the script,OCMis either deployed or deploying. -
When the deployment is complete, visit the
Open Cluster ManagementURL that is provided in thestart.shscript file.
Note: You can run this script multiple times, and it attempts to continue where it left off. If you have a failure and have installed multiple times, run the uninstall.sh script to clean up the directories before you run the installation again.
- Follow the link that is included at the end of the installation output to your installed cluster.
- Create the required objects by applying the
.yamldefinitions that are contained in thedeploy/prereqsdirectory:
kubectl apply --openapi-patch=true -k prereqs/
- Update the
kustomization.yamlfile that is in themulticlusterhub-operatordirectory so thenewTagsetting contains the tag for your snapshot. You can find a snapshot tag by viewing the list of tags available in the Quay.io index. You must use a tag that has the word SNAPSHOT in it, as shown in the following example:
namespace: open-cluster-management
images: # updates operator.yaml with the dev image
- name: multiclusterhub-operator-index
newName: quay.io/open-cluster-management/multiclusterhub-operator-index
newTag: "SNAPSHOT-2020-03-31-02-16-43"
- Create the multiclusterhub-operator objects by applying the
.yamldefinitions in thedeploy/multiclusterhub-operatordirectory. Enter the following command:
kubectl apply -k multiclusterhub-operator/
- Run the following command to determine whether the subscription is healthy:
oc get subscription multiclusterhub-operator-bundle --namespace open-cluster-management -o yaml
A healthy subscription returns a true status value for the healthy entry, as shown in the following example:
...
status:
catalogHealth:
- catalogSourceRef:
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
name: open-cluster-management
namespace: open-cluster-management
resourceVersion: "1123089"
uid: f6da232b-e7c1-4fc6-958a-6fb1777e728c
healthy: true
...
Continue with the next step when your subscription is healthy.
- Edit the
example-multiclusterhub-cr.yamlfile in themulitclusterhubdirectory. Set theimageTagSuffixto the snapshot value that you used in thekustomization.yamlfile in themulticlusterhub-operatordirectory in step 2. Remove theVERSION 1.0.0-,from thenewTagvalue taken from thekustomization.yamlfile.
The output should look similar to the following example:
apiVersion: operators.open-cluster-management.io/v1alpha1
kind: MultiClusterHub
metadata:
name: example-multiclusterhub
namespace: open-cluster-management
spec:
version: latest
imageRepository: "quay.io/open-cluster-management"
imageTagSuffix: "SNAPSHOT-2020-03-31-02-16-43"
imagePullPolicy: Always
imagePullSecret: multiclusterhub-operator-pull-secret
foundation:
apiserver:
configuration:
http2-max-streams-per-connection: "1000"
replicas: 1
apiserverSecret: "mcm-apiserver-self-signed-secrets"
klusterletSecret: "mcm-klusterlet-self-signed-secrets"
controller:
configuration:
enable-rbac: "true"
enable-service-registry: "true"
replicas: 1
mongo:
endpoints: mongo-0.mongo.open-cluster-management
replicaSet: rs0
hive:
additionalCertificateAuthorities:
- name: letsencrypt-ca
managedDomains:
- s1.openshiftapps.com
globalPullSecret:
name: private-secret
failedProvisionConfig:
skipGatherLogs: true
- Create the
example-multiclusterhubobjects by applying the.yamldefinitions that are contained in thedeploy/multiclusterhubdirectory:
kubectl apply -k multiclusterhub/
- Verify that your installation is successful and access your URL by running the following command, where
namespace-from-installis the namespace where you installed the product:
oc get routes -n <namespace-from-install>
See the following example command:
oc get routes -n <open-cluster-management>
- Find the
multicloud-consolename and theHost/Portcolumns to get your URL. See the following example:
https://multicloud-console.apps.<HOST/PORT>