all kubernetes controlplane components in a single container
docker run -it --rm \
-e IP={IP Address, that kubelet can access} \
-p 6443:6443 -p 8132:8132 \
ghcr.io/iwanhae/controlplane-in-docker
docker run -d --name kubernetes \
-e IP={IP Address, that kubelet can access} \
-p 6443:6443 -p 8132:8132 \
-v {path_for_etcd}:/var/lib/etcd -v {path_for_certs}:/etc/kubernetes \
ghcr.io/iwanhae/controlplane-in-docker
[at controlplane host]
get bootstrap token by docker exec -it {docker_id} kubeadm token list
or create new one by docker exec -it {docker_id} kubeadm token create
[at worker node]
after installing kubeadm and Container Runtime (docker, containerd, CRI-O... etc)
kubeadm join \
{IP for kube-apiserver}:6443 \
--token {bootstrap token} \
--discovery-token-unsafe-skip-ca-verification # or you can use ca.crt from "path_for_certs"
~/controlplane-in-docker$ kubectl get node -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
worker-1 Ready <none> 2d9h v1.24.1 192.168.0.24 <none> Ubuntu 20.04.4 LTS 5.4.0-113-generic containerd://1.5.9
worker-2 Ready <none> 2d8h v1.24.1 192.168.0.48 <none> Ubuntu 20.04.4 LTS 5.4.0-113-generic containerd://1.5.9
This container requires to port-forward 8132 port. It is used by konnectivity.