K3d single instance
Use case development
Section titled “Use case ”developmentThe host only needs Docker and Git. Run the MVK commands from the container described in Container-first development environment.
Clone the mvk repo from Codeberg so the scripts, files, and manifests are
available. We will assume this is under $HOME/projects:
mkdir -p "$HOME/projects"cd "$HOME/projects"git clone https://codeberg.org/headshed/mvk.gitcd mvkStart the container and cluster
Section titled “Start the container and cluster”cd apps/containermake binmake upmake shellmake bin fetches the Linux runtime binaries. make up pulls and starts the
container, mounting ~/workdir at /home/user/workdir and the checkout at
/home/user/workdir/mvk. make shell opens a shell in /home/user/workdir.
From inside the container, create the cluster:
cd mvk./apps/cli/infra/k3d/scripts/create_k3d_cluster.shThe cluster is created on the dev-net Docker network shared with the
container, and the script points the persisted kubeconfig at the k3d load
balancer. If a mycluster cluster already exists from an older configuration,
delete it first with k3d cluster delete mycluster.
Check the cluster
Section titled “Check the cluster”From inside the container:
k3d cluster listNAME SERVERS AGENTS LOADBALANCERmycluster 1/1 0/0 truekubectl get nodesNAME STATUS ROLES AGE VERSIONk3d-mycluster-server-0 Ready control-plane,master 93m v1.31.5+k3s1A healthy state and most of the resources may be viewed in several ways, but two good starting points are:
kubectl get events -Akubectl get all -AThe first lists events logged by the cluster. The second lists the main resources; it is not a complete inventory.
Delete the cluster
Section titled “Delete the cluster”When you are done with this section:
k3d cluster delete myclusterYou can create a new cluster at any time with the script above.