Kubernetes playground
Work in progress - It's a playground environment with k8s master/slave nodes. You can simply create vms with vagrant and provision them by the ansible-playbook in the repository.
create-cluster
script under the scripts
folder in order to create the virtual machines and a Kubernetes cluster on them.$ ./scripts/create-cluster
The script would create 3 virtual machines with the following IP addresses:
download-k8s-config
script under scripts
folder.$ ./scripts/download-k8s-config
$ kubectl get nodes
You should see a result like the following:
NAME STATUS ROLES AGE VERSION
k8smaster Ready master 28m v1.19.0
k8sslave1 Ready <none> 27m v1.19.0
k8sslave2 Ready <none> 27m v1.19.0
NOTE: Keep it mind that nodes may become available (Ready) in several minutes.
If master works and slave nodes looks NotReady
Check if all machine date/time configurations are identical
$ ./scripts/display-servers-date
Server: Master
Thu Sep 10 20:14:36 +03 2020
Server: Slave-1
Thu Sep 10 20:14:36 +03 2020
Server: Slave-2
Thu Sep 10 17:14:37 UTC 2020
$ vagrant reload
kubectl get nodes
command $ kubectl get nodes
if you still don't see the following result in a few minutes, continue by the next steps below.
NAME STATUS ROLES AGE VERSION
k8smaster Ready master 13m v1.19.0
k8sslave1 Ready <none> 12m v1.19.0
k8sslave2 Ready <none> 12m v1.19.0
reinitialize-cluster
script under scripts folder. IMPORTANT: This step will reset whole cluster. You may lose your data
$ ./scripts/reinitialize-cluster
$ ./scripts/download-k8s-config
Some docs for kubernetes installation
https://www.tecmint.com/install-a-kubernetes-cluster-on-centos-8/
https://phoenixnap.com/kb/how-to-install-kubernetes-on-centos
Solution for tc command missing
issue
https://stackoverflow.com/questions/59653331/kubernetes-centos-8-tc-command-missing-impact
Solution for misconfiguration: kubelet cgroup driver: "systemd" is different from docker cgroup driver: "cgroupfs"
issue
https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm/
Solution to print join token after initialized master node https://stackoverflow.com/questions/40009831/cant-find-kubeadm-token-after-initializing-master
Solution for unable to update cni config: No networks found in /etc/cni/net.d
issue
https://stackoverflow.com/questions/43713509/kubernetes-v1-6-2-unable-to-update-cni-config-no-networks-found-in-etc-cni-net