k8s-multinode-cluster

goal:

To create the k8s-multinode cluster with one master node and multiple worker/slave nodes

pre-requisite:

[master]
3.6.37.121 ansible_user=ec2-user ansible_ssh_private_key_file=/root/ansible.pem ansible_connection=ssh
[slaves]
13.127.231.29 ansible_user=ec2-user ansible_ssh_private_key_file=/root/ansible.pem ansible_connection=ssh
13.233.198.137 ansible_user=ec2-user ansible_ssh_private_key_file=/root/ansible.pem ansible_connection=ssh

Solution:

- hosts: localhost
roles:
- role: kube_nodes

Don’t forget to add your access key and secret key of IAM user in this file

---
# vars file for kube_nodes
access_key: "A*******************************"
secret_key: "9oFlQ5*************************cpS4johW"
- hosts: localhost
roles:
- role: kube_nodes
- hosts: master
roles:
- role: k8s-master1

- hosts: slaves
vars_prompt:
- name: join
prompt: "Please enter the command to join worker node with master"
private: no
roles:
- role: k8s-slave

Thank you