- Notifications
You must be signed in to change notification settings - Fork3
Ansible for deploying Kubernetes with KubeAdm
License
npflan/k8s-ansible
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Quick and dirty ansible for deploying kubernetes with kubeadm.
Based on this guidehttps://www.arubacloud.com/tutorial/how-to-create-kubernetes-cluster-with-kubeadm-and-ansible-ubuntu-20-04.aspx
- Basic ansible to deploy a cluster with a single master (prepared for HA)
- HA Control Plane
- Removal of hardcoded variables such as Service/Pod CIDR Ranges
For CNI we usekube-router.
Rather than using Docker for the container runtime, we usecontainerd.
We are using kube-router to expose ClusterIP services to the network, running a highly available control plane, this is W.I.P.
Create an ansible inventory in hosts. Each host should be running Ubuntu 20.04.
Generate a SSH key
ssh-keygen -t rsa -m PEM -f npf-ansible -C "npf-ansible"
Add SSH key to agentssh-add npf-ansible
Copy SSH key to each hostssh-copy-id -i npf-ansible npf@172.20.22.11
Execute ansible playbook initialansible-playbook -i hosts initial.yml --ask-become-pass
Execute ansible playbook depsansible-playbook -i hosts deps.yml --ask-become-pass
Execute ansible playbook depsansible-playbook -i hosts kubeadm-init.yml --ask-become-pass
Execute ansible playbook depsansible-playbook -i hosts kubeadm-join.yml --ask-become-pass