Enabling the MCCP requires we:
- Choose and configure the database in
- Enable the
- Configure the ingress address for NATS that an agent running on a leaf cluster will connect to.
The default MCCP database configuration will use SQLite on a Host Volume. For all the MCCP pods to be able to access this host volume they must be on the same node. We can do this by applying a label to one of the cluster worker nodes:
Now you can enable the MCCP in config.yaml.
The MCCP also supports PostgreSQL or mounting SQLite on Persistent Volume instead of the host volume described here. See Database Configuration for details.
To enable the MCCP feature edit the
setup/config.yaml file, set the
true, commit and push to the cluster repository.
After a few seconds, the MCCP components are deployed in the
When connecting a leaf cluster a set of manifests are applied to with
kubectl apply -f https://wkp-host/gitops/api/agent.yaml?token=abc. We set the NATS url that is included in
agent.yaml (that the agent will use to connect to the management cluster) by editing
Once the MCCP has started up you'll see a NATS
NodePort service running the in
Take the port (in this case 32545) and update the
wkpGitopsRepoBroker params with the external address of the host (this can be an IP or a hostname) and port discovered above.
Commit and push the changes to
./cluster/platform/components.js. You can now open the UI via configured ingress or with
wk ui and connect clusters. See How to connect a cluster below.
Tip: You can verify that the address is externally accessible with the
Adding an ingress exception for
If you have configured ingress with authentication (see Securing the UI you may need to add an additional ingress rule for
/gitops/api/agent.yaml to ensure that this path is publicly accessible. The manifest below shows how to add this rule.
To connect a cluster to the multi-cluster control plane (MCCP), first navigate to the
Clusters section of the WKP UI and click on the
Connect a cluster button. You will then be presented with a form to add the details of the leaf cluster being connected.
- Name: this is the name of the leaf cluster. This is a required field.
- Ingress URL: this is the publicly accessible HTTP(S) endpoint of the leaf cluster. This is an optional field.
Click on the
Save & next button to persist these details. You will then be presented with a
kubectl command that you can run to install an agent on your leaf cluster. The agent is responsible for inspecting the leaf cluster and sending back leaf information to the MCCP server. It will not make any changes to your cluster.
Ensure that your current kubeconfig context is setup to use the leaf cluster. Then copy the command and run it.
After a few seconds, the status of your cluster should change to
Connected (Ready) which indicates that the leaf cluster has been successfully connected.
To update a cluster, click on the rightmost icon of that cluster's row. You will be presented with a form that allows you to update its name and ingress URL. Finally click on the
Save & next button to persist these changes.
To disconnect a cluster open the config dialog with the 🛠 button on the cluster's row.
The Disconnect tab shows instructions on how to remove the wkp-agent from your leaf cluster.
Once the agent has been removed its status will change from "Connected" to Last seen. Click Remove cluster from the MCCP to remove the cluster and the meta-data that's been collected.
To re-connect the cluster again follow the Connect a cluster instructions above.