Skip to content

Latest commit

 

History

History
80 lines (57 loc) · 2.78 KB

cluster-registration.md

File metadata and controls

80 lines (57 loc) · 2.78 KB

Table of Contents generated with DocToc

Joining Clusters

You can use the kubefedctl tool to join clusters as follows.

kubefedctl join cluster1 --cluster-context cluster1 \
    --host-cluster-context cluster1 --v=2
kubefedctl join cluster2 --cluster-context cluster2 \
    --host-cluster-context cluster1 --v=2

Repeat this step to join any additional clusters.

NOTE: cluster-context will default to use the joining cluster name if not specified.

Checking status of joined clusters

Check the status of the joined clusters by using the following command.

kubectl -n kube-federation-system get kubefedclusters

NAME       READY   AGE
cluster1   True    1m
cluster2   True    1m

Joining kind clusters on MacOS

A Kubernetes cluster deployed with kind on Docker for MacOS will have an API endpoint of https://localhost:<random-port> in its kubeconfig context. Such an endpoint will be compatible with local invocations of cli tools like kubectl. The same endpoint will not be reachable from a KubeFed control plane, and the endpoints of kind clusters joined to a KubeFed control plane will need to be updated to https://<kind pod ip>:6443. This can be accomplished by executing the following script after a cluster is registered to the control plane with kubefedctl join.

./scripts/fix-joined-kind-clusters.sh

Unjoining clusters

You can unjoin clusters using kubefedctl tool as follows.

kubefedctl unjoin cluster2 --cluster-context cluster2 --host-cluster-context cluster1 --v=2

Repeat this step to unjoin any additional clusters.

Joining additional clusters in a namespace scoped deployment

Joining additional clusters to a namespaced control plane requires providing additional arguments to kubefedctl join:

  • --kubefed-namespace=<namespace> to ensure the cluster has been joined with the KubeFed control plane running in the specified namespace

You can join mycluster to a control plane deployed in namespace test-namespace as follows.

kubefedctl join mycluster --cluster-context mycluster \
    --host-cluster-context mycluster --v=2 \
    --kubefed-namespace=test-namespace