Ansible role for installing Kubernetes
Role to install the Kubernetes container cluster
manager.
Ansible Core >= 2.12
Linux Distribution
Debian Family
Ubuntu
The following variables will change the behavior of this role (default values
are shown below):
# Node type: determines what features are installed.
# - controller:
# - kubectl
# - worker:
# - kubelet
# - kubernetes-cni
# - master:
# - kubelet
# - kubectl
# - kubernetes-cni
# - admin:
# - kubelet
# - kubectl
# - kubeadm
# - kubernetes-cni
kubernetes_node_type: worker
# The ID of the APT key for the Kubernetes repository (optional)
kubernetes_apt_key_id:
- hosts: servers
roles:
- role: gantsign.kubernetes
kubernetes_node_type: worker
We recommended using the
gantsign.antigen role to enable
Zsh support for Kubernetes (this must be configured for each user).
- hosts: servers
roles:
- role: gantsign.kubernetes
kubernetes_node_type: worker
- role: gantsign.antigen
users:
- username: example
antigen_libraries:
- name: oh-my-zsh
antigen_bundles:
# Use the Oh My Zsh plugin for kubectl
- name: kubectl
# Use the GantSign plugin for kubeadm
- name: kubeadm
url: gantsign/zsh-plugins
location: kubeadm
If you prefer to use Antigen directly
add the following to your Antigen configuration:
antigen use oh-my-zsh
antigen bundle kubectl
antigen bundle gantsign/zsh-plugins kubeadm
Important: there’s a bug
with the current version of Antigen that prevents it working with the kubectl
plugin. We recommend using version 2.0.2
of Antigen until the issue is fixed.
To manually configure Zsh tab completion add the following to your .zshrc
:
eval "$(kubectl completion zsh)"
eval "$(kubeadm completion zsh)"
You can find more roles from GantSign on
Ansible Galaxy.
This project uses the following tooling:
A Visual Studio Code
Dev Container is
provided for developing and testing this role.
MIT
John Freeman
GantSign Ltd.
Company No. 06109112 (registered in England)