Skip to content

Commit 9e80b11

Browse files
authored
Cherry-pick 09396a manually (#545)
* Cherry-pick 09396a manually Signed-off-by: clyang82 <[email protected]> * Correct README.md Signed-off-by: clyang82 <[email protected]> --------- Signed-off-by: clyang82 <[email protected]>
1 parent 398e548 commit 9e80b11

File tree

6 files changed

+358
-271
lines changed

6 files changed

+358
-271
lines changed

doc/README.md

Lines changed: 84 additions & 72 deletions
Large diffs are not rendered by default.

doc/dev-preview.md

Lines changed: 44 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,45 @@
1-
### Create a regional hub cluster (dev preview)
2-
Refer to the original [Create cluster](https://access.redhat.com/documentation/en-us/red_hat_advanced_cluster_management_for_kubernetes/2.6/html/multicluster_engine/multicluster_engine_overview#creating-a-cluster) document to create the managed cluster in the global hub cluster. add labels of `global-hub.open-cluster-management.io/hub-cluster-install: ''` in managedcluster CR and then the new created managed cluster can be switched to be a regional hub cluster automatically. In other words, the latest released RHACM is installed in this managed cluster. You can get the ACM hub information in the cluster overview page.
1+
### Create a regional hub cluster (Developer Preview)
2+
Refer to the original [Create cluster](https://access.redhat.com/documentation/en-us/red_hat_advanced_cluster_management_for_kubernetes/2.8/html/clusters/cluster_mce_overview#creating-a-cluster) document to create the managed cluster in the global hub cluster. Add the label of `global-hub.open-cluster-management.io/hub-cluster-install: ''` to the `managedcluster` custom resource and then the new created managed cluster can automatically be switched to be a regional hub cluster. In other words, the latest version of Red Hat Advanced Cluster Management for Kubernetes is installed in this managed cluster. You can get the Red Hat Advanced Cluster Management hub information in the cluster overview page.
3+
34
![cluster overview](cluster_overview.png)
4-
### Import a regional hub cluster in hosted mode (dev preview)
5-
It does not require any changes before importing it. The ACM agent is running in a hosting cluster.
6-
1. Import the cluster from the ACM console, add these annotations to the managedCluster, use the kubeconfig import mode, and disable all add-ons.
7-
```
8-
import.open-cluster-management.io/klusterlet-deploy-mode: Hosted
9-
import.open-cluster-management.io/hosting-cluster-name: local-cluster
10-
addon.open-cluster-management.io/disable-automatic-installation: "true"
11-
```
12-
![import hosted cluster](import_hosted_cluster.png)
13-
Click `Next` Button to complete the import process.
14-
15-
2. Enable work-manager addon after the imported cluster is available.
16-
```
17-
oc apply -f - <<EOF
18-
apiVersion: addon.open-cluster-management.io/v1alpha1
19-
kind: ManagedClusterAddOn
20-
metadata:
21-
name: work-manager
22-
namespace: hub1
23-
annotations:
24-
addon.open-cluster-management.io/hosting-cluster-name: local-cluster
25-
spec:
26-
installNamespace: open-cluster-management-hub1-addon-workmanager
27-
EOF
28-
```
29-
You have to create a kubeconfig secret for the work-manager add-on via the following command:
30-
```
31-
oc create secret generic work-manager-managed-kubeconfig --from-file=kubeconfig=<your regional hub kubeconfig> -n open-cluster-management-hub1-addon-workmanager
32-
```
5+
6+
### Import a regional hub cluster in hosted mode (Developer Preview)
7+
A regional hub cluster does not require any changes before importing it. The Red Hat Advanced Cluster Management agent is running in a hosting cluster.
8+
9+
1. Import the cluster from the Red Hat Advanced Cluster Management console, add these annotations to the `managedCluster` custom resource. Use the kubeconfig import mode, and disable all add-ons.
10+
11+
```
12+
import.open-cluster-management.io/klusterlet-deploy-mode: Hosted
13+
import.open-cluster-management.io/hosting-cluster-name: local-cluster
14+
addon.open-cluster-management.io/disable-automatic-installation: "true"
15+
```
16+
17+
![import hosted cluster](import_hosted_cluster.png)
18+
19+
2. Click `Next` to complete the import process.
20+
21+
3. Enable the work-manager addon after the imported cluster is available by creating a file named `work-manager-file` that contains content that is similar to the following example:.
22+
23+
```
24+
apiVersion: addon.open-cluster-management.io/v1alpha1
25+
kind: ManagedClusterAddOn
26+
metadata:
27+
name: work-manager
28+
namespace: hub1
29+
annotations:
30+
addon.open-cluster-management.io/hosting-cluster-name: local-cluster
31+
spec:
32+
installNamespace: open-cluster-management-hub1-addon-workmanager
33+
```
34+
35+
4. Apply the file by running the following command:
36+
37+
```
38+
oc apply -f <work-manager-file>
39+
```
40+
41+
5. Create a kubeconfig secret for the work-manager add-on by running the following command:
42+
43+
```
44+
oc create secret generic work-manager-managed-kubeconfig --from-file=kubeconfig=<your regional hub kubeconfig> -n open-cluster-management-hub1-addon-workmanager
45+
```

doc/disconnected_environment/README.md

Lines changed: 78 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,105 @@
1-
# Deploy Global Hub Operator on a Disconnected Environment
1+
# Deploying Global Hub Operator in a disconnected environment
2+
3+
In situations where a network connection is not available, you can deploy the Global Hub Operator in a disconnected environment.
24

35
## Prerequisites
46

5-
- Make sure you have an image registry, and a bastion host that has access to both the Internet and your mirror registry
6-
- Have OLM([Operator Lifecycle Manager](https://docs.openshift.com/container-platform/4.11/operators/understanding/olm/olm-understanding-olm.html)) installed on your cluster
7-
- The Advanced Cluster Management for Kubernetes has been installed on your cluster
8-
- Make sure your user is authorized with cluster-admin permissions
7+
- An image registry and a bastion host that have access to both the Internet and to your mirror registry
8+
- Operator Lifecycle Manager ([OLM](https://docs.openshift.com/container-platform/4.11/operators/understanding/olm/olm-understanding-olm.html)) installed on your cluster
9+
- Red Hat Advanced Cluster Management for Kubernetes version 2.7, or later, installed on your cluster
10+
- A user account with `cluster-admin` permissions
911

1012
## Mirror Registry
1113

12-
Installing global hub in a disconnected environment involves the use of a mirror image registry. Which ensures your clusters only use container images that satisfy your organizational controls on external content. You can following the following two step to provision the mirror registry for global hub.
13-
- [Creating a mirror registry](https://docs.openshift.com/container-platform/4.11/installing/disconnected_install/installing-mirroring-creating-registry.html#installing-mirroring-creating-registry)
14-
- [Mirroring images for a disconnected installation](https://docs.openshift.com/container-platform/4.11/installing/disconnected_install/installing-mirroring-installation-images.html)
14+
You must use a mirror image registry when installing Multicluster Global Hub in a disconnected environment. The image registry ensures that your clusters only use container images that satisfy your organizational controls on external content. You can complete the following two-step procedure to provision the mirror registry for global hub.
15+
- [Creating a mirror registry](https://access.redhat.com/documentation/en-us/openshift_container_platform/4.13/html/installing/disconnected-installation-mirroring#creating-mirror-registry)
16+
- [Mirroring images for a disconnected installation](https://access.redhat.com/documentation/en-us/openshift_container_platform/4.13/html/installing/disconnected-installation-mirroring#installing-mirroring-installation-images)
1517

16-
## Create ImageContentSourcePolicy
18+
## Create an ImageContentSourcePolicy
1719

18-
In order to have your cluster obtain container images for the global hub operator from your mirror registry, rather than from the internet-hosted registries, you can configure an `ImageContentSourcePolicy` on your disconnected cluster to redirect image references to your mirror registry.
20+
You can configure an `ImageContentSourcePolicy` on your disconnected cluster to redirect image references to your mirror registry. This enables you to have your cluster obtain container images for the global hub operator on your mirror registry, rather than from the Internet-hosted registries.
1921

2022
**Note**: The ImageContentSourcePolicy can only support the image mirror with image digest.
2123

22-
```bash
23-
$ cat ./doc/disconnected_environment/imagecontentsourcepolicy.yaml
24-
apiVersion: operator.openshift.io/v1alpha1
25-
kind: ImageContentSourcePolicy
26-
metadata:
27-
name: global-hub-operator-icsp
28-
spec:
29-
repositoryDigestMirrors:
30-
- mirrors:
31-
- ${REGISTRY}//multicluster-globalhub
32-
source: registry.redhat.io/multicluster-globalhub
24+
1. Create a file called `imagecontentsourcepolicy.yaml`:
3325

34-
$ envsubst < ./doc/disconnected-operator/imagecontentsourcepolicy.yaml | kubectl apply -f -
35-
```
26+
```
27+
$ cat ./doc/disconnected_environment/imagecontentsourcepolicy.yaml
28+
```
29+
30+
2. Add content that resembles the following content to the new file:
31+
32+
```
33+
apiVersion: operator.openshift.io/v1alpha1
34+
kind: ImageContentSourcePolicy
35+
metadata:
36+
name: global-hub-operator-icsp
37+
spec:
38+
repositoryDigestMirrors:
39+
- mirrors:
40+
- ${REGISTRY}//multicluster-globalhub
41+
source: registry.redhat.io/multicluster-globalhub
42+
```
43+
44+
3. Apply `imagecontentsourcepolicy.yaml` by running the following command:
45+
46+
```
47+
envsubst < ./doc/disconnected-operator/imagecontentsourcepolicy.yaml | kubectl apply -f -
48+
```
3649
3750
## Configure the image pull secret
3851
39-
If the Operator or Operand images that are referenced by a subscribed Operator require access to a private registry, you can either [provide access to all namespaces in the cluster, or individual target tenant namespaces](https://access.redhat.com/documentation/en-us/openshift_container_platform/4.11/html-single/operators/index#olm-creating-catalog-from-index_olm-managing-custom-catalogs).
52+
If the Operator or Operand images that are referenced by a subscribed Operator require access to a private registry, you can either [provide access to all namespaces in the cluster, or to individual target tenant namespaces](https://access.redhat.com/documentation/en-us/openshift_container_platform/4.13/html-single/operators/index#olm-creating-catalog-from-index_olm-managing-custom-catalogs).
4053
41-
### Option 1. Configure the globalhub imagepullsecret in an Openshift Cluster
54+
### Option 1. Configure the global hub image pull secret in an OpenShift cluster
4255
43-
**Note**: if you apply this on a pre-existing cluster, it will cause a rolling restart of all nodes.
56+
**Note**: Applying the image pull secret on a pre-existing cluster causes a rolling restart of all of the nodes.
4457
45-
```bash
46-
$ export USER=<the-registry-user>
47-
$ export PASSWORD=<the-registry-password>
48-
$ oc get secret/pull-secret -n openshift-config --template='{{index .data ".dockerconfigjson" | base64decode}}' > pull_secret.yaml
49-
$ oc registry login --registry=${REGISTRY} --auth-basic="$USER:$PASSWORD" --to=pull_secret.yaml
50-
$ oc set data secret/pull-secret -n openshift-config --from-file=.dockerconfigjson=pull_secret.yaml
51-
$ rm pull_secret.yaml
52-
```
58+
1. Export the user name from the pull secret:
59+
```
60+
export USER=<the-registry-user>
61+
```
62+
63+
2. Export the password from the pull secret:
64+
```
65+
export PASSWORD=<the-registry-password>
66+
```
67+
68+
3. Copy the pull secret:
69+
```
70+
oc get secret/pull-secret -n openshift-config --template='{{index .data ".dockerconfigjson" | base64decode}}' > pull_secret.yaml
71+
```
72+
73+
4. Log in using the pull secret:
74+
```
75+
oc registry login --registry=${REGISTRY} --auth-basic="$USER:$PASSWORD" --to=pull_secret.yaml
76+
```
77+
78+
5. Specify the global hub image pull secret:
79+
```
80+
oc set data secret/pull-secret -n openshift-config --from-file=.dockerconfigjson=pull_secret.yaml
81+
```
82+
83+
6. Remove the old pull secret:
84+
```
85+
rm pull_secret.yaml
86+
```
5387
5488
### Option 2. Configure image pull secret to an individual namespace
5589
56-
```bash
57-
# create the secret in the tenant namespace
58-
$ oc create secret generic <secret_name> \
59-
-n <tenant_namespace> \
90+
1. Create the secret in the tenant namespace by running the following command:
91+
```
92+
oc create secret generic <secret_name> -n <tenant_namespace> \
6093
--from-file=.dockerconfigjson=<path/to/registry/credentials> \
6194
--type=kubernetes.io/dockerconfigjson
95+
```
6296
63-
# link the secret to the service account for your operator/operand
64-
$ oc secrets link <operator_sa> -n <tenant_namespace> <secret_name> --for=pull
65-
```
97+
2. Link the secret to the service account for your operator/operand:
98+
```
99+
oc secrets link <operator_sa> -n <tenant_namespace> <secret_name> --for=pull
100+
```
66101
67-
## Add GlobalHub operator catalog
102+
## Add the GlobalHub operator catalog
68103
69104
### Build the GlobalHub catalog from upstream [Optional]
70105
@@ -150,7 +185,7 @@ multicluster-global-hub-operator Community Operators 28m
150185
name: multicluster-global-hub-operator
151186
namespace: open-cluster-management
152187
spec:
153-
channel: release-0.7
188+
channel: alpha
154189
installPlanApproval: Automatic
155190
name: multicluster-global-hub-operator
156191
source: global-hub-operator-catalog

0 commit comments

Comments
 (0)