The Registration Operator has 2 operators, Cluster Manager and Klusterlet. Cluster Manager installs the foundational components of OCM for the Hub cluster. And we can use the Klusterlet to install the agent components on the manged clusters when we import the manged clusters to the Hub.
The 2 operators are available on OperatorHub Cluster Manager and Klusterlet.
The operator ClusterManager configures the controllers on the hub that govern registration, placement and work distribution for attached Klusterlets.
The controllers are all deployed in open-cluster-management-hub namespace on the Hub cluster.
The operator Klusterlet represents the agent controllers registration and work on the managed cluster. The Klusterlet requires a secret named of bootstrap-hub-kubeconfig in the same namespace to allow API requests to the hub for the registration protocol.
The controllers are all deployed in open-cluster-management-agent namespace by default. The namespace can be specified in Klusterlet CR.
- Create a kind cluster
kind create cluster --name cluster1 kind get kubeconfig --name cluster1 > ./.kubeconfig
- Deploy all components on the kind cluster
export MANAGED_CLUSTER=cluster1 make deploy
- To clean the environment, run
make clean-deploy
- Deploy hub component
export OLM_NAMESPACE=openshift-operator-lifecycle-manager make deploy-hub
- Deploy agent component
export KLUSTERLET_KUBECONFIG_CONTEXT={kube config context of managed cluster} export OLM_NAMESPACE=openshift-operator-lifecycle-manager make deploy-spoke
- To clean the environment, run
make clean-hub
andmake clean-spoke
After a successful deployment, a certificatesigningrequest
and a managedcluster
will
be created on the hub.
kubectl get csr
kubectl get managedcluster
Next approve the csr and set managedCluster to be accepted by hub with the following command
kubectl certificate approve {csr name}
kubectl patch managedcluster {cluster name} -p='{"spec":{"hubAcceptsClient":true}}' --type=merge
Check the CONTRIBUTING Doc for how to contribute to the repo.
Slack channel: #open-cluster-mgmt
This code is released under the Apache 2.0 license. See the file LICENSE for more information.