This Ansible project will install a kubernetes master and some minions, based on the getting started Guide. The installation has been tested on the Ubuntu 16.04 LTS - Xenial (HVM) and CentOS 7 (x86_64) - with Updates HVM image in the AWS Cloud. The packages are tagged with fix versions, which are working with this Ansible playbooks. The defined versions can be found in the kubebase defaults.
- kubebase -> Install docker and kubernetes
- kubemaster -> Install a kubernetes master
- kubeminion -> Install a minion
- python_ubuntu.yml -> Install python on ubuntu via raw module
- python_centos.yml -> Install python on centos via raw module
- master.yml -> Install the kubernetes master
- minion.yml -> Install all minions
- setup.yml -> Install the whole kubernetes infrastructure
- Ansible 2.x
- Ubuntu 16.04 or CentOS 7.x
- the kubernetes master is also a node. See kubemaster_and_minion Variable
- you can define a list with plugins. See kubemaster_plugins Variable
# switch in the inventories directory
cd inventories
# copy the sample file
cp sample cluster1
- define the master and minion ip addresses
- define your own kubemaster_token (Hint: Ansible Vault)
- set the private_key_file path (optional)
- set the remote user (optional)
- set the python decision (optional)
[cluster:vars]
# kubernetes part
kubemaster_token = abcdef.abcdefabcdefabcd
# ansible part
ansible_ssh_private_key_file = sshkey.pem
ansible_user = ubuntu
# python part
install_python_centos = false
install_python_ubuntu = true
# example with cluster1 inventory file
ansible-playbook -i inventories/cluster1 playbooks/setup.yml
- works only on Ubuntu 16.04
- all tasks run as
root
,become = True
is set in ansible.cfg - some Ansible tasks are marked with
changed_when: false
. Sorry for that ;-)
## License MIT
## Author
- Pascal Stauffer