Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


1. Ansible Playbook for deploying k8s

In this repo, i will show you how to automated installing k8s on multi node using kubeadm. Before using this ansible playbook, make sure that:

  • You have configured an IP Address

  • You have configured SSH permission for root

  • You have configured SSH less password for root

  • Configure Hostname, Hosts on each node (master and worker)

  • Instal ansible on your PC/Laptop

  • make sure you have input your hosts to ansible hosts in /etc/ansible/hosts

1.1. example /etc/hosts	localhost		k8s-master		k8s-node1		k8s-node2

1.2. example command for set hostname

hostnamectl set-hostname

1.3. example for /etc/ansible/hosts

master ansible_host=

node1 ansible_host=
node2 ansible_host=


2. How to Run this Playbook

  • Create an user with sudo access and less password when sudo with first playbook 1-initialize-user.yml.

ansible-playbook 1-initialize-user.yml
  • Install dependencies for k8s, such as docker, kubelet, kubeadm, etc

ansible-playbook 2-install-dependencies.yml
  • Provision for master nodes and join on worker nodes

ansible-playbook 3-provisioning-k8s.yml

3. After Run Playbook

dhenandi@k8s-master:~$ kubectl get nodes
NAME                     STATUS   ROLES    AGE     VERSION
k8s-master               Ready    master   8m51s   v1.15.3   Ready    <none>   8m7s    v1.15.3
k8s-node2                Ready    <none>   8m7s    v1.15.3
You can’t perform that action at this time.