based on Kubernetes Setup Using Ansible and Vagrant
Install vagrant & vagrant-vbguest plugin
brew install vagrant
vagrant plugin install vagrant-vbguestInstall ansible on a virtual environment
# create a python virtual environment
python3 -m venv ~/.venv-ansible
# activate environment
source ~/.venv-ansible/bin/activate
# install ansible
pip install ansible
# deactivate environment
deactivateStarts and provisions the vagrant environment
# activate environment
source ~/.venv-ansible/bin/activate
vagrant upAccess to the servers
## Accessing master
vagrant ssh k8s-master
vagrant@k8s-master:~$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-master Ready control-plane,master 20h v1.21.5
node-1 Ready <none> 19h v1.21.5
node-2 Ready <none> 19h v1.21.5
## Accessing nodes
vagrant ssh node-1
vagrant ssh node-2additional vagrant commands
resume resume a suspended vagrant machine
suspend suspends the machine
status outputs status of the vagrant machine- Graphical vi-vim Cheat Sheet and Tutorial
- JSON PATH Quiz- FREE COURSE
- Certified Kubernetes Administrator (CKA) with Practice Tests
- kubectl Cheat Sheet
- Training and Certification
- !!! Linux Foundation Kubernetes Certifications Now Include Exam Simulator
- Important Instructions: CKA and CKAD
- The CKA & CKAD environments are currently running Kubernetes v1.21.
- Platform Selection
- for CKA the Platform Option Available is
Ubuntu 18.04
- for CKA the Platform Option Available is
- calico requirements
Both the container runtime and the kubelet have a property called "cgroup driver", which is important for the management of cgroups on Linux machines.
Warning: Matching the container runtime and kubelet cgroup drivers is required or otherwise the kubelet process will fail.
See Configuring a cgroup driver for more details.
here the info to setup a cgroup driver for docker
-
# run master-playbook.yml ansible-playbook --private-key=~/.vagrant.d/insecure_private_key --extra-vars "node_ip=192.168.50.10" -u vagrant -i .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory kubernetes-setup/master-playbook.yml # run unly join-command ansible-playbook --private-key=~/.vagrant.d/insecure_private_key --extra-vars "node_ip=192.168.50.10" -u vagrant -i .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory kubernetes-setup/master-playbook.yml --tags "join-command"
-
troubleshoot kubelet
If you are on a systemd-powered system, you can try to troubleshoot the error with the following commands: - 'systemctl status kubelet' - 'journalctl -xeu kubelet'