Skip to content

kubernetes-app/registration-operator

 
 

Registration Operator

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.

Concepts

Cluster Manager

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.

Klusterlet

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.

Guides

Deploy all-in-one deployment on kind

  1. Create a kind cluster
    kind create cluster --name cluster1
    kind get kubeconfig --name cluster1 > ./.kubeconfig
    
  2. Deploy all components on the kind cluster
    export MANAGED_CLUSTER=cluster1
    make deploy
    
  3. To clean the environment, run make clean-deploy

Deploy on OCP

  1. Deploy hub component
    export OLM_NAMESPACE=openshift-operator-lifecycle-manager
    make deploy-hub
    
  2. Deploy agent component
    export KLUSTERLET_KUBECONFIG_CONTEXT={kube config context of managed cluster}
    export OLM_NAMESPACE=openshift-operator-lifecycle-manager
    make deploy-spoke
    
  3. To clean the environment, run make clean-hub and make clean-spoke

What is next

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

Community, discussion, contribution, and support

Check the CONTRIBUTING Doc for how to contribute to the repo.

Communication channels

Slack channel: #open-cluster-mgmt

License

This code is released under the Apache 2.0 license. See the file LICENSE for more information.

About

Minimum cluster registration and work

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 97.4%
  • Makefile 1.9%
  • Other 0.7%