Ansible Role - Kubernetes
Go to file
2018-05-10 10:25:49 -05:00
defaults Space in the defaults file. [ci skip] 2018-05-10 09:38:13 -05:00
handlers Initial commit. 2018-05-09 09:19:11 -05:00
meta Fix install on CentOS 7. 2018-05-09 16:09:32 -05:00
tasks Add more variables and docs. 2018-05-10 09:37:53 -05:00
tests Really fix idempotence for Flannel tasks, and get CentOS mostly working. 2018-05-09 17:04:46 -05:00
.gitignore Initial commit. 2018-05-09 09:19:11 -05:00
.travis.yml Issue #3: Allow failures on CentOS 7 Travis CI build for now. 2018-05-10 10:25:49 -05:00
LICENSE Initial commit. 2018-05-09 09:19:11 -05:00
README.md Add more variables and docs. 2018-05-10 09:37:53 -05:00

Ansible Role: Kubernetes

Build Status

An Ansible Role that installs Kubernetes 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

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.

kubernetes_kubelet_extra_args: ""

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".

kubernetes_allow_pods_on_master: True

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.

kubernetes_enable_web_ui: False

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.

kubernetes_apt_release_channel: main
kubernetes_apt_repository: "deb http://apt.kubernetes.io/ kubernetes-xenial {{ kubernetes_apt_release_channel }}"
kubernetes_apt_ignore_key_error: False

Apt repository options for Kubernetes installation.

kubernetes_yum_arch: x86_64

Yum repository options for Kubernetes installation.

Dependencies

None.

Example Playbook

For a single node (master) Kubernetes cluster:

- hosts: all

  vars:
    kubernetes_allow_pods_on_master: True

  roles:
    - geerlingguy.docker
    - geerlingguy.kubernetes

License

MIT / BSD

Author Information

This role was created in 2018 by Jeff Geerling, author of Ansible for DevOps.