### Install Kamaji with PostgreSQL datastore and create a TenantControlPlane Source: https://kamaji.clastix.io/guides/alternative-datastore Install Kamaji with a PostgreSQL datastore: deploy the PostgreSQL resources, apply the sample Datastore manifest, verify it is not ready until the operator is installed, install the operator with the required Helm values, then create and clean up a TenantControlPlane that uses the datastore. The Datastore stays not ready until the Kamaji chart is installed because no operator is running to reconcile it. The TenantControlPlane manifest sets dataStore to postgresql-gold, which must match the Datastore resource name. ```bash make -C ./deploy/kine/postgresql/ postgresql NAME=gold ``` ```bash kubectl apply -f ./config/samples/kamaji_v1alpha1_datastore_postgresql_gold.yaml ``` ```bash kubectl get datastores NAME DRIVER READY AGE postgresql-gold PostgreSQL 18s ``` ```bash helm install kamaji ./charts/kamaji -n kamaji-system --create-namespace \ --set kamaji-etcd.deploy=false \ --set datastore.driver=PostgreSQL \ --set datastore.endpoints[0]=postgres-gold-rw.postgres-system.svc:5432 \ --set datastore.basicAuth.usernameSecret.name=postgres-gold-superuser \ --set datastore.basicAuth.usernameSecret.namespace=postgres-system \ --set datastore.basicAuth.usernameSecret.keyPath=username \ --set datastore.basicAuth.passwordSecret.name=postgres-gold-superuser \ --set datastore.basicAuth.passwordSecret.namespace=postgres-system \ --set datastore.basicAuth.passwordSecret.keyPath=password \ --set datastore.tlsConfig.certificateAuthority.certificate.name=postgres-gold-ca \ --set datastore.tlsConfig.certificateAuthority.certificate.namespace=postgres-system \ --set datastore.tlsConfig.certificateAuthority.certificate.keyPath=ca.crt \ --set datastore.tlsConfig.certificateAuthority.privateKey.name=postgres-gold-ca \ --set datastore.tlsConfig.certificateAuthority.privateKey.namespace=postgres-system \ --set datastore.tlsConfig.certificateAuthority.privateKey.keyPath=ca.key \ --set datastore.tlsConfig.clientCertificate.certificate.name=postgres-gold-root-cert \ --set datastore.tlsConfig.clientCertificate.certificate.namespace=postgres-system \ --set datastore.tlsConfig.clientCertificate.certificate.keyPath=tls.crt \ --set datastore.tlsConfig.clientCertificate.privateKey.name=postgres-gold-root-cert \ --set datastore.tlsConfig.clientCertificate.privateKey.namespace=postgres-system \ --set datastore.tlsConfig.clientCertificate.privateKey.keyPath=tls.key ``` ```bash NAME DRIVER READY AGE postgresql-gold PostgreSQL true 4m40s ``` ```bash cat > test-tenant-gold.yaml < ADMIN_PASSWORD: # Secret used to sign the browser session JWT_SECRET: # URL where the console is accessible: https:///ui NEXTAUTH_URL: EOF ``` ```bash helm repo add clastix https://clastix.github.io/charts helm repo update helm -n kamaji-system install console clastix/kamaji-console helm status console -n kamaji-system ``` -------------------------------- ### Check Tenant Cluster node status after joining Source: https://kamaji.clastix.io/getting-started/kamaji-azure Displays the list of nodes in the Tenant Cluster and shows them starting as NotReady until a CNI plugin is installed. ```bash kubectl --kubeconfig=${TENANT_NAMESPACE}-${TENANT_NAME}.kubeconfig get nodes NAME STATUS ROLES AGE VERSION tenant-00-000000 NotReady 112s v1.25.0 tenant-00-000002 NotReady 92s v1.25.0 tenant-00-000003 NotReady 71s v1.25.0 ``` -------------------------------- ### Install secondary Datastore with Helm Source: https://kamaji.clastix.io/guides/datastore-overrides Installs the secondary Datastore, reusing the cert-manager CA created by the etcd-primary release via the nameOverride setting. ```shell helm install etcd-secondary clastix/kamaji-etcd -n kamaji-etcd --create-namespace \ --set selfSignedCertificates.enabled=false \ --set certManager.enabled=true \ --set certManager.ca.create=false \ --set certManager.ca.nameOverride=etcd-primary-kamaji-etcd-ca \ --set certManager.issuerRef.kind=ClusterIssuer \ --set certManager.issuerRef.name=self-signed ``` -------------------------------- ### Install Kamaji with Helm Source: https://kamaji.clastix.io/reference/benchmark Installs Kamaji from the clastix/kamaji chart into the kamaji-system namespace, with node selectors and tolerations for the infra node group and resource constraints disabled. The benchmark runs Kamaji without resource limits to use all available resources. ```bash helm upgrade --install kamaji clastix/kamaji --namespace kamaji-system --create-namespace \ --set nodeSelector."eks\.amazonaws\.com/nodegroup"=infra \ --set "tolerations[0].key=pool" \ --set "tolerations[0].operator=Equal" \ --set "tolerations[0].value=infra" \ --set "tolerations[0].effect=NoExecute" \ --set "tolerations[1].key=pool" \ --set "tolerations[1].operator=Equal" \ --set "tolerations[1].value=infra" \ --set "tolerations[1].effect=NoSchedule" \ --set "resources=null" ``` -------------------------------- ### Install Tenant Cluster with Helm Source: https://kamaji.clastix.io/cluster-api/vsphere-infra-provider Adds the clastix Helm repository, updates it, and installs the cluster-api-kamaji-vsphere chart as a release named 'sample' with the cluster name set to 'sample', in the 'default' namespace, using values from 'my-values.yaml'. ```bash helm repo add clastix https://clastix.github.io/cluster-api-kamaji-vsphere helm repo update helm install sample clastix/cluster-api-kamaji-vsphere \ --set cluster.name=sample \ --namespace default \ --values my-values.yaml ``` -------------------------------- ### Install in-cluster IPAM provider with clusterctl Source: https://kamaji.clastix.io/cluster-api/proxmox-infra-provider Initialize the management cluster with the in-cluster IPAM provider to assign IP addresses to nodes. ```bash clusterctl init --ipam in-cluster ``` -------------------------------- ### Create Kind cluster Source: https://kamaji.clastix.io/getting-started/kamaji-kind Creates a Kind cluster named 'kamaji'. This is the first step in the setup. ```bash kind create cluster --name kamaji ``` -------------------------------- ### Install Calico CNI plugin Source: https://kamaji.clastix.io/getting-started/kamaji-generic Install Calico as the CNI plugin for the Tenant Cluster. First download the Calico manifest, optionally customize it, then apply it to the Tenant Cluster using the kubeconfig. ```bash curl https://raw.githubusercontent.com/projectcalico/calico/v3.24.1/manifests/calico.yaml -O ``` ```bash kubectl --kubeconfig=${TENANT_NAMESPACE}-${TENANT_NAME}.kubeconfig apply -f calico.yaml ``` -------------------------------- ### Install Kamaji controller (latest edge) Source: https://kamaji.clastix.io/getting-started/kamaji-generic Installs the latest edge release of the Kamaji controller using the official Helm chart. As of July 2024, version-pinned stable releases are only available on a subscription basis. ```bash helm install kamaji clastix/kamaji \ --version 0.0.0+latest \ --namespace kamaji-system \ --create-namespace \ --set image.tag=latest ``` -------------------------------- ### Install ProvisioningRequest CRD Source: https://kamaji.clastix.io/cluster-api/cluster-autoscaler Install the ProvisioningRequest custom resource definition using kubectl. The command retrieves the kubeconfig for the capi-quickstart-kubevirt cluster and applies the CRD from the autoscaler repository. ```bash kubectl kamaji kubeconfig get capi-quickstart-kubevirt > /tmp/capi-quickstart-kubevirt KUBECONFIG=/tmp/capi-quickstart-kubevirt kubectl apply -f https://raw.githubusercontent.com/kubernetes/autoscaler/refs/tags/cluster-autoscaler-1.34.1/cluster-autoscaler/apis/config/crd/autoscaling.x-k8s.io_provisioningrequests.yaml ``` -------------------------------- ### Install kamaji-etcd Helm chart for a new datastore Source: https://kamaji.clastix.io/guides/datastore-migration Installs the kamaji-etcd chart to create a managed multi-tenant etcd datastore named 'dedicated' in the 'dedicated' namespace. Requires the clastix Helm repository to be added and updated first. The --set datastore.enabled=true flag enables the datastore creation. ```bash helm repo add clastix https://clastix.github.io/charts helm repo update helm install dedicated clastix/kamaji-etcd -n dedicated --create-namespace --set datastore.enabled=true ``` -------------------------------- ### clusterctl init with Kamaji control plane Source: https://kamaji.clastix.io/cluster-api/control-plane-provider Initializes the Management Cluster with Cluster API components and the Kamaji Control Plane Provider. Run this command after installing clusterctl, kubectl, and Kamaji in the Management Cluster. ```bash clusterctl init --control-plane kamaji ``` -------------------------------- ### Add Jetstack Helm repo and update Source: https://kamaji.clastix.io/getting-started/kamaji-kind Adds the Jetstack Helm repository and updates the Helm repository list. Required before installing cert-manager. ```bash helm repo add jetstack https://charts.jetstack.io helm repo update ``` -------------------------------- ### Verify worker node readiness after Calico installation Source: https://kamaji.clastix.io/getting-started/kamaji-azure Shows that after Calico is applied, all nodes transition to Ready status, confirming they successfully joined the Tenant Cluster. ```bash kubectl --kubeconfig=${TENANT_NAMESPACE}-${TENANT_NAME}.kubeconfig get nodes NAME STATUS ROLES AGE VERSION tenant-00-000000 Ready 3m38s v1.25.0 tenant-00-000002 Ready 3m18s v1.25.0 tenant-00-000003 Ready 2m57s v1.25.0 ``` -------------------------------- ### Verify ClusterClass Installation Source: https://kamaji.clastix.io/cluster-api/cluster-class Check that Cluster API and Kamaji components are deployed by listing deployments and filtering for capi or kamaji. ```bash kubectl get deployments -A | grep -E "capi|kamaji" ``` -------------------------------- ### Generate and apply cluster manifest with CCM Source: https://kamaji.clastix.io/cluster-api/vsphere-infra-provider Generate a cluster manifest with the CCM installed on the Management Cluster using the template capi-kamaji-vsphere-template-ccm.yaml, then apply the generated manifest to create the tenant cluster. ```bash clusterctl generate cluster $CLUSTER_NAME \ --from capi-kamaji-vsphere-template-ccm.yaml \ > capi-kamaji-vsphere-cluster.yaml ``` ```bash kubectl apply -f capi-kamaji-vsphere-cluster.yaml ``` -------------------------------- ### Download the Calico manifest Source: https://kamaji.clastix.io/getting-started/kamaji-azure Downloads the official Calico manifest v3.24.1 from the projectcalico GitHub repository for later installation on the Tenant Cluster. ```bash curl https://raw.githubusercontent.com/projectcalico/calico/v3.24.1/manifests/calico.yaml -O ``` -------------------------------- ### Verify Kamaji CRDs Source: https://kamaji.clastix.io/getting-started/kamaji-kind Checks that Kamaji CRDs are installed by filtering the output of 'kubectl get crds' for 'kamaji'. ```bash kubectl get crds | grep -i kamaji ``` -------------------------------- ### Create EKS cluster configuration and deploy Source: https://kamaji.clastix.io/getting-started/kamaji-aws Source environment variables, create an eks-cluster.yaml configuration file, and create the EKS cluster using eksctl. ```bash source kamaji-aws.env cat > eks-cluster.yaml < test-tenant-gold.yaml < ${TENANT_NAMESPACE}-${TENANT_NAME}-tcp.yaml <