1.3 KiB
1.3 KiB
Kubernetes cluster setup using Ansible for Debian
Description
The project configures a Kubernetes cluster on Debian machines with kubeadm.
It uses systemd-networkd for interface configuraition, CRI-O for containerization, Calico as a CNI plugin, and stacked etcd for control-plane database.
Configuration
- General node config: roles/node/defaults/main.yml
- Cluster config:
Usage
1. Configure ssh on all nodes
- ssh in and enable root login by editing /etc/ssh/sshd_conf
ssh-copy-key root@NODE
ssh-agent $SHELL
ssh-add
2. Add nodes to inventory
Edit the inventory file.
3. Prepare nodes
ansible-playbook -i inventory -u root node.yml
4. Initalize cluster
Uses the [first_master]
group from the inventory to select the first master.
ansible-playbook -i inventory -u root init-cluster.yml
5. Join other masters
Uses the [other_masters]
group from the inventory.
Do it ONE-by-ONE.
ansible-playbook -i inventory -u root join-control-plane.yml
6. Join workers
Uses the [workers]
group from the inventory.
Do it ONE-by-ONE.
ansible-playbook -i inventory -u root join-workers.yml