2018-05-09 16:19:11 +02:00
# Ansible Role: Kubernetes
[![Build Status ](https://travis-ci.org/geerlingguy/ansible-role-kubernetes.svg?branch=master )](https://travis-ci.org/geerlingguy/ansible-role-kubernetes)
An Ansible Role that installs [Kubernetes ](https://kubernetes.io ) on Linux.
## Requirements
Requires Docker; recommended role for Docker installation: `geerlingguy.docker` .
## Role Variables
Available variables are listed below, along with default values (see `defaults/main.yml` ):
kubernetes_packages:
- name: kubelet
state: present
- name: kubeadm
state: present
- name: kubernetes-cni
state: present
2018-05-10 16:37:53 +02:00
Kubernetes packages to be installed on the server. You can either provide a list of package names, or set `name` and `state` to have more control over whether the package is `present` , `absent` , `latest` , etc.
2018-05-09 18:15:30 +02:00
2018-05-10 00:04:46 +02:00
kubernetes_kubelet_extra_args: ""
2018-05-09 18:15:30 +02:00
2018-05-10 16:37:53 +02:00
Extra args to pass to `kubelet` during startup. E.g. to allow `kubelet` to start up even if there is swap is enabled on your server, set this to: `"--fail-swap-on=false"` .
2018-05-09 18:15:30 +02:00
kubernetes_allow_pods_on_master: True
2018-05-10 16:37:53 +02:00
Whether to remove the taint that denies pods from being deployed to the Kubernetes master. If you have a single-node cluster, this should definitely be `True` . Otherwise, set to `False` if you want a dedicated Kubernetes master which doesn't run any other pods.
2018-05-09 18:15:30 +02:00
2018-05-09 21:51:36 +02:00
kubernetes_enable_web_ui: False
2018-05-09 18:15:30 +02:00
2018-05-10 16:37:53 +02:00
Whether to enable the Kubernetes web dashboard UI (only accessible on the master itself, or proxied).
kubernetes_pod_network_cidr: '10.0.1.0/16'
kubernetes_version: 'stable-1.10'
kubernetes_ignore_preflight_errors: 'all'
Options passed to `kubeadm init` when initializing the Kubernetes master.
2018-05-09 16:19:11 +02:00
kubernetes_apt_release_channel: main
2018-05-09 22:15:34 +02:00
kubernetes_apt_repository: "deb http://apt.kubernetes.io/ kubernetes-xenial {{ kubernetes_apt_release_channel }}"
2018-05-09 16:19:11 +02:00
kubernetes_apt_ignore_key_error: False
2018-05-10 16:37:53 +02:00
Apt repository options for Kubernetes installation.
2018-05-09 23:09:32 +02:00
kubernetes_yum_arch: x86_64
2018-05-10 16:37:53 +02:00
Yum repository options for Kubernetes installation.
2018-05-09 16:19:11 +02:00
## Dependencies
None.
## Example Playbook
2018-05-10 16:37:53 +02:00
For a single node (master) Kubernetes cluster:
2018-05-09 16:19:11 +02:00
```yaml
- hosts: all
2018-05-10 16:37:53 +02:00
vars:
kubernetes_allow_pods_on_master: True
2018-05-09 16:19:11 +02:00
roles:
- geerlingguy.docker
- geerlingguy.kubernetes
```
## License
MIT / BSD
## Author Information
This role was created in 2018 by [Jeff Geerling ](https://www.jeffgeerling.com/ ), author of [Ansible for DevOps ](https://www.ansiblefordevops.com/ ).