--- description: > A comprehensive guide to deploying kcp on a kind cluster using Helm, with multi-tenant workspace setup. --- # Quickstart with kind This guide walks you through deploying kcp on a [kind](https://kind.sigs.k8s.io/) (Kubernetes in Docker) cluster using Helm, setting up multiple workspaces, and configuring access for different teams using client certificates. This guide covers the Helm-based deployment. A kcp-operator-based walkthrough will be added in a follow-up. ## Prerequisites Before starting, ensure you have the following tools installed: - [Docker](https://docs.docker.com/get-docker/) - [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation) - [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) - [Helm](https://helm.sh/docs/intro/install/) (v3.x) - [kubectl kcp plugin](./kubectl-plugin.md) ## Step 1: Create a kind Cluster Create a kind cluster with port mapping for kcp access: ```bash cat < ca.crt ``` ### Create Admin Kubeconfig ```bash kubectl --kubeconfig=admin.kubeconfig config set-cluster base \ --server https://${KCP_EXTERNAL_HOSTNAME}:${KCP_PORT}/clusters/root \ --certificate-authority=ca.crt ``` ### Generate Admin Client Certificate Create a certificate for the admin user: ```bash kubectl apply -n kcp -f - < admin-client.crt kubectl get secret cluster-admin-client-cert -n kcp \ -o=jsonpath='{.data.tls\.key}' | base64 -d > admin-client.key ``` Add credentials to kubeconfig: ```bash kubectl --kubeconfig=admin.kubeconfig config set-credentials kcp-admin \ --client-certificate=admin-client.crt \ --client-key=admin-client.key kubectl --kubeconfig=admin.kubeconfig config set-context base \ --cluster=base \ --user=kcp-admin kubectl --kubeconfig=admin.kubeconfig config use-context base ``` Verify admin access: ```bash export KUBECONFIG=admin.kubeconfig kubectl ws tree ``` ## Step 6: Create Team Workspaces Create workspaces for the two teams: ```bash kubectl create workspace team-alpha --enter kubectl ws .. kubectl create workspace team-beta --enter kubectl ws :root ``` > **Note:** Steps 6 through 10 can be automated using the verification script (it reads your kind kubeconfig from `~/.kube/config` by default): > ```bash > ./docs/scripts/verify-docs-quickstart-kind.sh > ``` > > To capture a verification log for troubleshooting or sharing with reviewers: > ```bash > KCP_VERIFY_LOG=verify-kind-install.log ./docs/scripts/verify-docs-quickstart-kind.sh > ``` Verify the workspaces: ```bash kubectl ws tree ``` You should see: ``` root ├── team-alpha └── team-beta ``` ## Step 7: Generate Team Certificates Create client certificates for each team with their respective groups. These certificates are managed by cert-manager running in the underlying kind cluster. If you exported `KUBECONFIG=admin.kubeconfig`, use your kind kubeconfig for the cert-manager steps: ```bash export KIND_KUBECONFIG=${KIND_KUBECONFIG:-$HOME/.kube/config} ``` ### Team Alpha ```bash KUBECONFIG=${KIND_KUBECONFIG} kubectl apply -n kcp -f - < team-${team}.crt KUBECONFIG=${KIND_KUBECONFIG} kubectl get secret team-${team}-cert -n kcp \ -o=jsonpath='{.data.tls\.key}' | base64 -d > team-${team}.key done ``` ### Create Team Kubeconfigs ```bash for team in alpha beta; do kubectl --kubeconfig=team-${team}.kubeconfig config set-cluster kcp \ --server https://${KCP_EXTERNAL_HOSTNAME}:${KCP_PORT}/clusters/root:team-${team} \ --certificate-authority=ca.crt kubectl --kubeconfig=team-${team}.kubeconfig config set-credentials team-${team} \ --client-certificate=team-${team}.crt \ --client-key=team-${team}.key kubectl --kubeconfig=team-${team}.kubeconfig config set-context team-${team} \ --cluster=kcp \ --user=team-${team} kubectl --kubeconfig=team-${team}.kubeconfig config use-context team-${team} done ``` ## Step 10: Verify Team Access Test that each team can access their workspace and is isolated from others: ```bash for team in alpha beta; do echo "--- team-${team} ---" KUBECONFIG=team-${team}.kubeconfig kubectl get namespaces done ``` Create a namespace in each team workspace to confirm write access: ```bash for team in alpha beta; do KUBECONFIG=team-${team}.kubeconfig kubectl get namespace demo-${team} >/dev/null 2>&1 || \ KUBECONFIG=team-${team}.kubeconfig kubectl create namespace demo-${team} KUBECONFIG=team-${team}.kubeconfig kubectl get namespace demo-${team} done ``` Verify workspace isolation — each team should be denied access to other workspaces: ```bash # Team Alpha should NOT be able to access Team Beta's workspace KUBECONFIG=team-alpha.kubeconfig kubectl get namespaces \ --server https://${KCP_EXTERNAL_HOSTNAME}:${KCP_PORT}/clusters/root:team-beta && \ echo "ERROR: Team Alpha can access Team Beta (isolation broken)" || \ echo "OK: Team Alpha cannot access Team Beta (isolation works)" ``` ## Summary You now have a fully functional kcp deployment on kind with: - **kcp** deployed via Helm with TLS certificates managed by cert-manager - **2 team workspaces**: team-alpha, team-beta - **2 client certificates**: One for each team with group membership - **RBAC configuration**: Each team has cluster-admin access to their workspace Each team can independently: - Create and manage resources in their workspace - Deploy applications - Configure their own RBAC policies within their workspace ## Cleanup To remove everything: ```bash # Delete the kind cluster kind delete cluster --name kcp # Remove generated files rm -f ca.crt admin-client.crt admin-client.key admin.kubeconfig rm -f team-*.crt team-*.key team-*.kubeconfig # Remove hosts entry (optional) # macOS: sudo sed -i '' '/kcp.local.test/d' /etc/hosts # Linux: # sudo sed -i '/kcp.local.test/d' /etc/hosts ``` ## Next Steps - [Authorization](../concepts/authorization/index.md) - Learn more about kcp's authorization model - [Workspaces](../concepts/workspaces/index.md) - Deep dive into workspace concepts - [APIs](../concepts/apis/index.md) - Learn how to export and bind APIs across workspaces - [Production Setup](./production/index.md) - Guidelines for production deployments