Kcm
#k0rdent Cluster Manager (KCM)
#Overview
k0rdent Cluster Manager is part of k0rdent which is focused on delivering a open source approach to providing an enterprise grade multi-cluster kubernetes management solution based entirely on standard open source tooling that works across private or public clouds.
#Documentation
Detailed documentation is available in k0rdent Docs
#Installation
#TL;DR
helm install kcm oci://ghcr.io/k0rdent/kcm/charts/kcm -n kcm-system --create-namespace
Then follow the Deploy a cluster deployment guide to create a cluster deployment.
[!NOTE] The KCM installation using Kubernetes manifests does not allow customization of the deployment. To apply a custom KCM configuration, install KCM using the Helm chart.
#Development guide
See Install KCM for development purposes.
#Software Prerequisites
KCM requires the following:
- Existing management cluster (minimum required kubernetes version 1.28.0).
kubectlCLI installed locally.
Optionally, the following CLIs may be helpful:
helm(required only when installing KCM usinghelm).clusterctl(to handle the lifecycle of the cluster deployments).
#Providers configuration
Full details on the provider configuration can be found in the k0rdent Docs, see Documentation
#k0rdent Installation
export KUBECONFIG=<path-to-management-kubeconfig> helm install kcm oci://ghcr.io/k0rdent/kcm/charts/kcm --version <kcm-version> -n kcm-system --create-namespace
#Extended Management configuration
By default, kcm is being deployed with the following configuration:
apiVersion: k0rdent.mirantis.com/v1beta1 kind: Management metadata: name: kcm spec: providers: - name: cluster-api-provider-k0sproject-k0smotron - name: cluster-api-provider-azure - name: cluster-api-provider-vsphere - name: cluster-api-provider-aws - name: cluster-api-provider-openstack - name: cluster-api-provider-docker - name: cluster-api-provider-gcp - name: cluster-api-provider-ipam - name: cluster-api-provider-infoblox - name: projectsveltos release: kcm-<dashed-kcm-version>
There are two options to override the default management configuration of KCM:
-
Update the
Managementobject after the KCM installation usingkubectl:kubectl --kubeconfig <path-to-management-kubeconfig> edit management -
Deploy KCM skipping the default
Managementobject creation and provide your ownManagementconfiguration:-
Create
management.yamlfile and configure core components and providers. See Management API. -
Specify
--create-management=falsecontroller argument and install KCM:
If installing using
helmadd the following parameter to thehelm installcommand:--set="controller.createManagement=false"- Create
kcmManagementobject after KCM installation:
kubectl --kubeconfig <path-to-management-kubeconfig> create -f management.yaml -
#Create a ClusterDeployment
To create a ClusterDeployment:
-
Create
Credentialobject with all credentials required.See Credential system docs for more information regarding this object.
-
Select the
ClusterTemplateyou want to use for the deployment. To list all available templates, run:
export KUBECONFIG=<path-to-management-kubeconfig> kubectl get clustertemplate -n kcm-system
If you want to deploy hosted control plane template, make sure to check additional notes on Hosted control plane in k0rdent Docs, see Documentation.
- Create the file with the
ClusterDeploymentconfiguration:
[!NOTE] Substitute the parameters enclosed in angle brackets with the corresponding values. Enable the
dryRunflag if required. For details, see Dryrun.
apiVersion: k0rdent.mirantis.com/v1beta1 kind: ClusterDeployment metadata: name: <cluster-name> namespace: <cluster-namespace> spec: template: <template-name> credential: <credential-name> dryRun: <true/false> config: <cluster-configuration>
- Create the
ClusterDeploymentobject:
kubectl create -f clusterdeployment.yaml
- Check the status of the newly created
ClusterDeploymentobject:
kubectl -n <clusterdeployment-namespace> get clusterdeployments <clusterdeployment-name> -o=yaml
- Wait for infrastructure to be provisioned and the cluster to be deployed (the
provisioning starts only when
spec.dryRunis disabled):
kubectl -n <clusterdeployment-namespace> get cluster <clusterdeployment-name> -o=yaml
[!NOTE] You may also watch the process with the
clusterctl describecommand (requires theclusterctlCLI to be installed):clusterctl describe cluster <clusterdeployment-name> -n <clusterdeployment-namespace> --show-conditions all
- Retrieve the
kubeconfigof your cluster deployment:
kubectl get secret -n kcm-system <clusterdeployment-name>-kubeconfig -o go-template='{{.data.value|base64decode}}' > kubeconfig
#Dry run
KCM ClusterDeployment supports two modes: with and without (default) dryRun.
If no configuration (spec.config) provided, the ClusterDeployment object will
be populated with defaults (default configuration can be found in the
corresponding Template status) and automatically marked as dryRun.
After you adjust your configuration and ensure that it passes validation
(TemplateReady condition from status.conditions), remove the spec.dryRun
flag to proceed with the deployment.
#Cleanup
- Remove the Management object:
[!NOTE] Make sure you have no KCM
ClusterDeploymentobjects left in the cluster prior to Management deletion
kubectl delete management.k0rdent kcm
- Remove the
kcmHelm release:
helm uninstall kcm -n kcm-system
- Remove the
kcm-systemnamespace:
kubectl delete ns kcm-system