KaaS – Cluster API installation
Prerequisites
1. Tools
To install cluster API on a Kubernetes cluster it is required to have these tools installed on the machine used to administer :
- kubectl
- clusterctl
- git
- kctx (optional)
If one of these tool is missing, please follow this guide here
2. Cluster connection
Test that you are correctly connected to the cluster you want to install Cluster API on.
If you are not connected to the good cluster, switch your kubectl to the good kubeconfig file.
For that you can use kctx or any other preferred way. How to install kctx
3. VCD Account
A VCD Account will be required for Cluster API, this account will be used for all operations made by cluster API (cluster creation, storage provisionning, load balancer operations).
You can use default roles or create a specific one with these rights :
- User > Manage user’s own API token
- vApp > Preserve ExtraConfig Elements during OVA Import and Export (follow the KB to enable this right on VCD)
- Catalog > View Shared Catalogs from Other Organizations
- Gateway > View Gateway
- Gateway Services > NAT Configure, LoadBalancer Configure
- Rights from the default
vApp Author
role - Right ‘Full Control: VMWARE:CAPVCDCLUSTER’
- Organization VDC > Create a Shared Disk
Installation
Prepare the Cluster API Provider for vCloud Director
Cluster API a besoin d’un provider afin de pouvoir communiquer avec l’API de vCloud Director afin d’orchestrer le déploiement et de gérer le cycle de vie des clusters.
Ce provider est fourni par VMware et est disponible sur un reposository GIT que l’on va utiliser pour l’installation de Cluster API.
Le principe est le suivant :
- Clonez le repository GIT
- Récupérez les fichiers de template et de configuration
- Déclarez le provider dans la configuration de cluster api
Prepare templates and configuration files.
Declare the provider in the Cluster API configuration
- Edit the
~/.cluster-api/clusterctl.yaml
file. - Modify the
url
parameter for the vCloud Director (vcd) provider.
Here’s a general example of what the relevant section of your clusterctl.yaml
file might look like :
Make sure to replace "/path/to/infrastructure-components.yaml"
with the actual file path to your infrastructure-components.yaml
file. This configuration tells Cluster API where to find the provider and its configuration.
Cluster API Installation
- Launch clusterctl init command
You should received this message :
Your management cluster has been initialized successfully!
Apply the CRS (ClusterResourceSet)
The ClusterResourceSet is an object from the Cluster API, and it allows for the automatic creation of resources on the child clusters that will be deployed. In our case, we are using it to deploy automatically:
- CNI Antrea
- CSI for vCloud Director (for Persistent Storage)
- CPI for vCloud Director (for LB)
If you copied the files to a different directory in the previous steps, you can modify the first line to provide the correct location.
All PODS and configurations will be automatically applied to the cluster.
Please wait for all these PODS to be in the “Running” status.
If an error occurs, please refer to the page. KaaS Standard – Troubleshooting
Next steps
Next you have to deploy your cluster, it can be a management cluster or a workload cluster depending of your need :
- Deploy a management cluster : KaaS Standard – Management Cluster
- Deploy a workload cluster : KaaS Advanced – Deploy workload cluster