Initialize all master components:
sudo kubeadm init --apiserver-advertise-address=192.168.188.10 --pod-network-cidr=10.244.0.0/16
To access API via kubectl:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
Change node IP (Vagrant issue) (on each node set its enp0s8 ip address) Add this line:
Environment="KUBELET_EXTRA_ARGS=--node-ip=<nodeIP>"
to:
/etc/systemd/system/kubelet.service.d/10-kubeadm.conf
and restart kubelet daemon:
sudo systemctl daemon-reload
sudo systemctl restart kubelet
Apply flannel network:
kubectl apply -f kube-flannel.yml
Join to the master:
sudo kubeadm join --token <TOKEN> <MASTER_IP>:6443 --discovery-token-ca-cert-hash <CERT>
Change node IP (Vagrant issue) (on each node set its enp0s8 ip address) Add this line:
Environment="KUBELET_EXTRA_ARGS=--node-ip=<nodeIP>"
to:
/etc/systemd/system/kubelet.service.d/10-kubeadm.conf
and restart kubelet daemon:
sudo systemctl daemon-reload
sudo systemctl restart kubelet
And that's it :) We've just created our cluster.
kubectl apply -f web-deployment.yml
kubectl apply -f web-service.yml
kubectl apply -f db-deployment.yml
kubectl apply -f db-service.yml
kubectl apply -f kubernetes-dashboard.yml
kubectl apply -f dashboard-role.yml
Enable HTTP proxy to access Dashboard from the host machine
kubectl proxy --address=0.0.0.0 --accept-hosts='^*$'
Access dashboard from your host machine
http://192.168.188.10:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
sudo kubeadm token create --print-join-command
sudo tcpdump -pni enp0s8 tcp port 6443
sudo netstat -tp
sudo nsenter --net=/var/run/docker/netns/<NETNS> <COMMAND>
ip -d link show