Provides Ansible playbook to setup a K8s Cluster (1 Manager and N workers)
Installation guide for various OS
Ansible documentation is located here
We will setup a 3 node cluster with 1 Manager and 2 Worker nodes.
Ensure the Manager node has atleast 2 vCPU and 4 GiB RAM
AWS AMI: Ubuntu Server 18.04 LTS (HVM), SSD Volume Type
Manager Nodes: t2.large
Worker Nodes: t2.micro
Ansible playbook is located in aws
folder
Add the AWS instances IPs and ssh key path to aws-hosts
file
Run the following commands:
# check the ansible playbook syntax
ansible-playbook --syntax-check kubernetes-cluster-1M-2W.yaml -i aws-hosts
# run the playbook
ansible-playbook kubernetes-cluster-1M-2W.yaml -i aws-hosts
The join command for worker nodes to join the master node is in the cluster-join.txt
file created by kubeadm init
command and is located in the home directory of your Master node
- Use ansible variables to pass the join command from Manager to Worker Nodes. This will eliminate the need for user to manually run the join command after
kubeadm init
- Enhance/add playbooks for other public cloud providers - GCP, Azure and OCI