Writing
Nastavenie vlastného Kubernetes clusteru cez VirtualBox
Návod krok za krokom na nastavenie vlastného Kubernetes clusteru pomocou Vagrantu a VirtualBoxu.
Table of Contents
Nastavenie
Pomocou Vagrantu spustite viacero virtuálnych strojov: vagrant up
Keď je riadiaci uzol (master) pripravený, vykonáme nasledujúce kroky:
vagrant ssh kmaster
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
Kontrola stavu virtuálnych strojov:
vagrant status
Zobrazenie informácií o clusteri:
kubectl cluster-info
Výstup:
Kubernetes control plane is running at https://172.16.16.100:6443
CoreDNS is running at https://172.16.16.100:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
Pripojenie worker uzla do clusteru:
kubeadm join 172.16.16.100:6443 --token 9dmt3c.9t4400l1mzy9r5u1 --discovery-token-ca-cert-hash sha256:7573516548545806e00ca32eb04d2e23d7211bf5a8df2d007c08790ba4176465
Zoznam uzlov v clusteri:
kubectl get nodes
Výstup:
NAME STATUS ROLES AGE VERSION
kmaster Ready control-plane 18m v1.23.4
kworker1 Ready <none> 11m v1.23.4
Zobrazenie všetkých podov:
kubectl get pods -A