Skip to content

Ansible playbook for deploying kubernetes cluster using kubeadm

Notifications You must be signed in to change notification settings

darvein/ansible-kubernetes

Repository files navigation

Ansible Kubernetes Playbook

This is an Ansible playbook that deploys a Kubernetes cluster using kubeadm.

Configurations

You will need update the kitchen-hosts and set IP Addresses or FQDN's accordingly. You can define a kubernetes master (k8smaster) or a kubernete node (k8snodes)

Also you will need to install the ruby dependencies from Gemfile by running:

bundle install

How to use

Thanks to Test kitchen framework you will easily get running a Kubernetes cluster.

Token generation

In order to get running Kubernetes master and get nodes joined into the master you will need a token in this playbook you can generate a token by your own by running generate_token.sh shell script:

$ ./generate_token.sh

Running tests

This playbook is using Test Kitchen framework for automation testing, you can run either:

kitchen test

or

kitchen create
kitchen converge
kitchen verify

If you take a look into .kitchen.yml you will find that Kitchen will run 2 centos7.2 servers: a kubernete master and a kubernete node1 demo.

Running using ansible-playbook command line

You can also run this playbook directly on the servers by using ansible command line commands.

There is a ansible.cfg file already pointing to kitchen-hosts as Inventory, all you need to run is:

ansible-playbook master.yml
ansible-playbook node.yml

TODO

  • Run Docker under docker group for security purposes

About

Ansible playbook for deploying kubernetes cluster using kubeadm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published