Create Demo Cluster

This page explains how to set up a local Kubernetes cluster with k3d.

Install and Run k3d

  1. Configure the container registry

    Configure the container registry access as explained in this section.

  2. Install k3d

    Create the registry_bin folder and ecr-credential-provider file for the ECR Credential Provider service:

    mkdir -p registry_bin
    touch registry_bin/ecr-credential-provider
    chmod 755 registry_bin/ecr-credential-provider

    Now we can run a local Kubernetes cluster (update the path to config.yaml file, and the Kubernetes image tag version):

    k3d cluster create --image rancher/k3s:v1.26.11-k3s2 --k3s-arg "--disable=traefik,metrics-server@server:0" \
    -v $(pwd)/registry_bin:/var/lib/rancher/credentialprovider/bin@server:0 \
    -v $(pwd)/config.yaml:/var/lib/rancher/credentialprovider/config.yaml@server:0

    Now we need to install the ECR Credential Provider binary into the Kubernetes nodes. We will use a Kubernetes Job to do that:

    apiVersion: batch/v1
    kind: Job
    metadata:
    name: cloud-provider-repository-binary-builder
    spec:
    backoffLimit: 0
    template:
    spec:
    restartPolicy: Never
    containers:
    - name: ecr-credential-builder
    image: alpine:3.18
    command:
    - /bin/sh
    - -c
    - |
    apk add -U ca-certificates tar zstd tzdata go git
    git clone https://github.com/kubernetes/cloud-provider-aws.git
    cd cloud-provider-aws/cmd/ecr-credential-provider
    CGO_ENABLED=0 go build -mod=readonly .
    chmod 755 ecr-credential-provider
    mkdir -p /mnt/host/var/lib/rancher/credentialprovider/bin/
    cp ecr-credential-provider /mnt/host/var/lib/rancher/credentialprovider/bin/
    volumeMounts:
    - mountPath: /mnt/host
    name: host
    volumes:
    - hostPath:
    path: /
    type: ""
    name: host

    You can now move on the Qovery Helm deployment.

  3. Check your cluster

    Run the following command to check that your cluster is ready with your ECR credentials:

    TODO

Next Steps

Congratulations! You have successfully created a Kubernetes cluster with k3d. You are now ready to install Qovery BYOK on your cluster. Next step: Install Qovery BYOK