Tested Environments
Install Ansible
{
sudo apt update
sudo apt install software-properties-common -y
sudo apt-add-repository ppa:ansible/ansible -y
sudo apt update
sudo apt install ansible -y
}
Clone the repo
{
cd ~
git clone https://github.com/adithya321/kubeadm-ansible.git
cd ~/kubeadm-ansible
}
Add hosts
vim hosts.ini
[all:vars]
ansible_connection=ssh
ansible_port=22
ansible_ssh_user=admatic
ansible_ssh_pass=big-d4t4-007
[master]
35.208.244.167 ansible_python_interpreter='python3'
[node]
35.208.84.88 ansible_python_interpreter='python3'
35.209.32.89 ansible_python_interpreter='python3'
[kube-cluster:children]
master
node
Deploy the playbook
ansible-playbook site.yaml
Verify cluster
kubectl get nodes
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
instance-group-1-4q8w Ready master 84s v1.14.0 10.128.0.13 <none> Ubuntu 16.04.6 LTS 4.15.0-1041-gcp docker://17.3.3
instance-group-1-mwnl Ready <none> 21s v1.14.0 10.128.0.10 <none> Ubuntu 16.04.6 LTS 4.15.0-1041-gcp docker://17.3.3
instance-group-1-rwdj Ready <none> 20s v1.14.0 10.128.0.88 <none> Ubuntu 16.04.6 LTS 4.15.0-1041-gcp docker://17.3.3