Advanced Cluster Management and ClusterImageSets from Red Hat
Red Hat Advanced Cluster Management (RHACM) is an answer that lets you control Kubernetes/OpenShift clusters and infrastructures. It consists of OpenShift Hive, an operator that runs as a carrier primarily based totally on OpenShift. The Hive carrier may be used to provision and carry out the preliminary configuration of OpenShift clusters. Hive allows deployments with unique cloud providers, consisting of AWS, Azure, or Google Cloud Platform, in addition to naked metallic infrastructure.
OpenShift Hive offers a custom useful resource known as ClusterImageSet, which factors to unique to be had OpenShift variations. You can without problems test which to is had OpenShift variations are to be had with the subsequent command:
> oc get clusterimagesets.hive.openshift.io NAME RELEASE img4.10.3-x86-64-appsub quay.io/openshift-release-dev/ocp-release:4.10.3-x86_64 img4.10.4-x86-64-appsub quay.io/openshift-release-dev/ocp-release:4.10.4-x86_64 img4.10.5-x86-64-appsub quay.io/openshift-release-dev/ocp-release:4.10.5-x86_64 img4.6.1-x86-64-appsub quay.io/openshift-release-dev/ocp-release:4.6.1-x86_64 img4.6.12-x86-64-appsub quay.io/openshift-release-dev/ocp-release:4.6.12-x86_64 img4.6.13-x86-64-appsub quay.io/openshift-release-dev/ocp-release:4.6.13-x86_64 img4.6.15-x86-64-appsub quay.io/openshift-release-dev/ocp-release:4.6.15-x86_64 img4.6.16-x86-64-appsub quay.io/openshift-release-dev/ocp-release:4.6.16-x86_64 img4.6.17-x86-64-appsub quay.io/openshift-release-dev/ocp-release:4.6.17-x86_64 img4.6.18-x86-64-appsub quay.io/openshift-release-dev/ocp-release:4.6.18-x86_64 img4.6.19-x86-64-appsub quay.io/openshift-release-dev/ocp-release:4.6.19-x86_64 .....
The oc CLI presents the entire listing of to-be-had pics. However, whilst the use of RHACM console, this listing is mechanically filtered to expose the handiest of the ultra-modern versions. This encourages the advent of clusters with the ultra-modern launch pics however does now no longer save you use of preceding versions. See the subsequent command:
> oc get clusterimagesets.hive.openshift.io img4.10.10-x86-64-appsub -o jsonpath={.metadata.labels.visible} false > oc get clusterimagesets.hive.openshift.io img4.10.15-x86-64-appsub -o jsonpath={.metadata.labels.visible} true
Subscribing ClusterImageSet
The listing of to-be-had snapshots has mechanically synced the usage of an aggregate of subscription and channel resources. See the subsequent facts approximately subscription manifests (simplified for higher reading):
> oc get subscription hive-clusterimagesets-subscription-fast-0 -n open-cluster-management -oyaml apiVersion: apps.open-cluster-management.io/v1 kind: Subscription metadata: annotations: apps.open-cluster-management.io/git-branch: release-2.5 apps.open-cluster-management.io/git-path: clusterImageSets/fast creationTimestamp: "2022-03-29T12:39:46Z" labels: subscription-pause: "false" name: hive-clusterimagesets-subscription-fast-0 namespace: open-cluster-management spec: channel: open-cluster-management/acm-hive-openshift-releases-chn-0 placement: local: true status: lastUpdateTime: "2022-05-24T22:20:38Z" message: Active phase: Subscribed statuses: /: packages: acm-hive-openshift-releases-chn-0-ClusterImageSet-img4.6.1-x86-64-appsub: lastUpdateTime: "2022-04-17T14:43:26Z" phase: Subscribed acm-hive-openshift-releases-chn-0-ClusterImageSet-img4.6.3-x86-64-appsub: lastUpdateTime: "2022-04-17T14:43:25Z" phase: Subscribed acm-hive-openshift-releases-chn-0-ClusterImageSet-img4.6.4-x86-64-appsub: lastUpdateTime: "2022-04-17T14:43:27Z" phase: Subscribed acm-hive-openshift-releases-chn-0-ClusterImageSet-img4.6.6-x86-64-appsub:
See the subsequent essential facts we are able to take a look at for withinside the subscription:
- The subscription makes use of a quick channel and the discharge 2.5 branch, which is the modern model of RHACM withinside the example.
- The subscription is active (now no longer paused).
- The lastUpdateTime indicates the final replacement time for the subscription.
- There is a listing of all of the ClusterImageSet received.
The spec.channel factors to the corresponding channel resource, which maintains the communique with the repository containing all of the ClusterImageSets. In this case, the subscription is the use of the open-cluster-management/acm-hive-openshift-releases-chn-zero RHACM channel.
See the subsequent to get greater data approximately the RHACM channel:
> oc get channel acm-hive-openshift-releases-chn-0 -n open-cluster-management -oyaml apiVersion: apps.open-cluster-management.io/v1 kind: Channel metadata: annotations: apps.open-cluster-management.io/reconcile-rate: low creationTimestamp: "2022-03-29T12:39:46Z" name: acm-hive-openshift-releases-chn-0 namespace: open-cluster-management spec: pathname: https://github.com/stolostron/acm-hive-openshift-releases.git type: Git
The channel factors to a Git repository. This repository is maintained and up to date through Red Hat with the distinct be had OCP variations withinside the manner of ClusterImageSets. See that the subscription makes use of this channel, deciding on the git-repo and git-branch:
apiVersion: apps.open-cluster-management.io/v1 kind: Subscription metadata: annotations: apps.open-cluster-management.io/git-branch: release-2.5 apps.open-cluster-management.io/git-path: clusterImageSets/fast
With this mechanism, RHACM is up to date with all of the to-be-had variations of RHOCP.
Combining the Git URL configured with the aid of using the channel, the git-department, and the git-direction from the subscription, you could browse to the repo, wherein the exclusive ClusterImageSets are downloaded.
Changing the Channel to Sync
RHACM comes with the short channel mounted through default. This may be modified by following subsequent steps. If you’re simply the usage of RHACM, through default, all of the assets must be controlled in the open-cluster-control Namespace. See the subsequent procedure:
- Pause the short channel subscription. Run the subsequent command:
> oc -n open-cluster-management patch appsub hive-clusterimagesets-subscription-fast-0 --type='json' -p='[{"op":"replace","path": "/metadata/labels/subscription-pause","value":"true"}]' subscription.apps.open-cluster-management.io/hive-clusterimagesets-subscription-fast-0 patched
2. Delete all of the present-day to-be-had ClusterImageSets. These items simplest comprise references to download images so that you aren’t without a doubt deleting something critical. The sources we’re deleting belong to the short channel. Ensure you probably did now no longer manually create ClusterImageSets; those may be additionally deleted and you could need to preserve them:
> oc delete clusterimageset --all clusterimageset.hive.openshift.io "img4.10.10-x86-64-appsub" deleted clusterimageset.hive.openshift.io "img4.10.11-x86-64-appsub" deleted clusterimageset.hive.openshift.io "img4.10.12-x86-64-appsub" deleted clusterimageset.hive.openshift.io "img4.10.13-x86-64-appsub" deleted clusterimageset.hive.openshift.io "img4.10.14-x86-64-appsub" deleted clusterimageset.hive.openshift.io "img4.10.15-x86-64-appsub" deleted clusterimageset.hive.openshift.io "img4.10.3-x86-64-appsub" deleted clusterimageset.hive.openshift.io "img4.10.4-x86-64-appsub" deleted clusterimageset.hive.openshift.io "img4.10.5-x86-64-appsub" deleted clusterimageset.hive.openshift.io "img4.10.6-x86-64-appsub" deleted clusterimageset.hive.openshift.io "img4.10.8-x86-64-appsub" deleted
3. Add a brand new subscription for the strong channel.
Best practice: Get the Manifest out of your modern-day subscription. Just easy the same old more information created with the aid of using OpenShift/Kubernetes.
4. Finally, extrude the git-patch, make certain it isn’t paused, and extrude the call for strong-0. See the subsequent instance primarily based totally on the preinstalled rapid subscription:
apiVersion: apps.open-cluster-management.io/v1 kind: Subscription metadata: annotations: apps.open-cluster-management.io/git-branch: release-2.5 apps.open-cluster-management.io/git-path: clusterImageSets/stable labels: app: hive-clusterimagesets subscription-pause: "false" name: hive-clusterimagesets-subscription-stable-0 namespace: open-cluster-management spec: channel: open-cluster-management/acm-hive-openshift-releases-chn-0 placement: local: true
5. Create the item and watch for a while. You can list the brand new set of ClusterImageSets and spot that the brand new ones belong to a solid channel:
> oc get clusterimagesets img4.9.9-x86-64-appsub -o jsonpath={.metadata.labels.channel} stable
After that, you could alternate from one channel to another, simply pausing and unpausing the subscriptions.
ClusterImageSets Refresh Frequency
The refresh frequency is controlled via way of means of channel resources. See the subsequent command:
> oc get channel acm-hive-openshift-releases-chn-0 -n open-cluster-management -o json | grep apps.open-cluster-management.io/reconcile-rate "apps.open-cluster-management.io/reconcile-rate": "low",
Creating ClusterImageSets Clusters for Multiple Architectures
Automatically synced ClusterImageSets offer Red Hat OpenShift snapshots for the simplest architecture. But you could create (manually) your very own ClusterImageSets pointing to distinct architectures.