sbouii.kubernetes
kubernetes-ansible
Description
This is an ansible role to set up a kubernetes master and monitor its componments on several GNU/Linux systems.
Although there are many ansible roles for installing kubernetes even production-ready ones , this version is mine , created for specific need.Besides automating the installation of kubernetes using Kubeadm and deploying Grafana and Prometheus pods for monitoring the componments of the kubernetes master and the application running on it, it uses the infrastructure testing tool KitchenCi to verify if the master is well setup and configured as expected or not.
Requirements
Software Requirements
Python 2.7 or higher
Ansible 2.2 or higher
Vagrant 1.7 or higher
Virtualbox 5.1 or higher
Supported Systems
- Debian
- Ubuntu
- Centos
More infos in the role's metadata file.
Dependencies
None.
Role variables
kubernetes_debian_repositoy_filename- the filename of the kubernetes debian repositorykubernetes_redhat_repositoy_name- a unique kubernetes redhat repository IDkubernetes_redhat_repositoy_description- a description for the kubernetes redhat repository
Available tags
kubernetes-setup- Specify this tag to perform the kubernetes master setupkubernetes-config- Specify this tag for deploying application and monitoring pods
Usage
In order to set up a kubernetes master across your plateform, start by checking out the role from Ansible galaxy:
ansible-galaxy install sbouii.kubernetes
Finally call the role within you Ansible playbook:
---
- hosts: localhost
sudo: yes
roles:
- sbouii.kubernetes
Development and Testing
Test with Vagrant
For quick tests, you can spin up a Debian VM using Vagrant. You maybe need to adapt the Vagrantfile to suit your environment (IP addresses, etc).
$ vagrant up
Run acceptance tests
For runing Acceptance/Integration tests against your role , we use the tool test-kitchen.All written acceptance tests are in the ./test/integration/ directory.
The .kitchen.yml file describes the testing configuration and the list of suite tests to run. By default, the instances will be converged with Ansible and ran in Vagrant virtual machines.
To list the instances:
$ kitchen list
Instance Driver Provisioner Verifier Transport Last Action
default-debian-8-x64 Vagrant AnsiblePlaybook Busser Ssh <Not Created>
...
To run the default test suite, for instance, on a Ubuntu Trusty platform, run the following command:
$ kitchen test default-ubuntu-1404-x64
Author information
This role was created by Mariem Sbouii.
Set up a kubeadm master on several GNU/Linux servers and monitor its componments.
ansible-galaxy install sbouii.kubernetes