Manage AttachedCluster
In Kurator, clusters that are not created by Kurator are referred to as AttachedClusters
.
These clusters can be managed by adding them to the Kurator Fleet, expanding the fleet’s control to clusters not originally created by Kurator.
This guide will walk you through the process of creating AttachedCluster resources, using two Kind clusters as examples.
Prerequisites
Cluster operator
As the AttachedCluster object is controlled by the cluster-operator, you need to first go to Install cluser operator page to create clusters using hack/local-dev-setup.sh
and install cluster operator.
AttachedCluster secrets
From these clusters created by hack/local-dev-setup.sh
, we’ll select kurator-member1 and kurator-member2 to be attached to the Kurator Fleet.
Next, we’ll create secrets containing the kubeconfig information of these clusters. Make sure to replace the paths like /root/.kube/kurator-member1.config
with the actual kubeconfig file paths on your system.
Please note, here we have named the secrets as kurator-member1
and kurator-member2
respectively, and set the key to save the kubeconfig in the secret as kurator-member1.config
and kurator-member1.config
respectively.
You can modify these two elements according to your needs.
Create attachedCluster resources
Now that we have the prerequisites sorted out, let’s move on to creating the AttachedCluster resources.
We’ll start by editing the configuration for the AttachedCluster.
Notice that the name
and key
here need to be consistent with the secret generated earlier.
We can apply the resources using the configuration provided below.
View resource status
Here is an example.
When we see ready: true
in the status, it means that everything is as expected and the AttachedCluster is ready to be managed by Fleet.
If this is not the case, you can use the following command to check the reason.
Join with fleet
To join the AttachedClusters into a fleet, create the yaml like this:
Cleanup
If you no longer need the AttachedClusters, you can delete them by running the following commands in the terminal: