Ansible role to install and configure the Kubernetes CLI.
Building and improving this Ansible role have been sponsored by my current and previous employers like Cloudpunks GmbH and Proact Deutschland GmbH.
- Requirements
- Default Variables
- kubectl_checksum
- kubectl_ctx_checksum
- kubectl_ctx_download
- kubectl_ctx_install
- kubectl_ctx_version
- kubectl_download
- kubectl_extra_configs
- kubectl_fixed_version
- kubectl_from_repository
- kubectl_general_configs
- kubectl_keyring
- kubectl_legacy_keyring
- kubectl_legacy_repo
- kubectl_minor_version
- kubectl_ns_checksum
- kubectl_ns_download
- kubectl_ns_install
- kubectl_ns_version
- kubectl_version
- Discovered Tags
- Dependencies
- License
- Author
- Minimum Ansible version:
2.10
Checksum for the kubectl release
kubectl_checksum: sha256:bb04d9450d9c9fa120956c5cc7c8dfaa700297038ff9c941741e730b02bbd1f3
Checksum for the kubectl ctx plugin release
kubectl_ctx_checksum: sha256:e887e4e2b3dd4c94d0ecdb84270fb4fac2e65c4d5b0ee461e688fb8089fd4900
Download URL for the kubectl ctx plugin release
kubectl_ctx_download: https://github.com/ahmetb/kubectx/releases/download/v{{ kubectl_ctx_version
}}/kubectx
Install the kubectl ctx plugin
kubectl_ctx_install: true
Version of the kubectl ctx plugin release to install
kubectl_ctx_version: 0.9.5
Download URL for the kubectl release
kubectl_download: https://dl.k8s.io/release/v{{ kubectl_version }}/bin/darwin/amd64/kubectl
List of extra configs
kubectl_extra_configs: []
kubectl_extra_configs:
- name: global
path: /etc/kubernetes/config
owner: root
group: root
mode: u=rwX,g=rX,o=rX
current: foobar
clusters:
- name: foobar
ca: ...
server: https://10.13.37.1:6443
users:
- name: admin
cert: ...
key: ...
contexts:
- name: foobar
cluster: foobar
user: admin
Pin version if installed from repository
kubectl_fixed_version: false
kubectl_from_repository: false
List of general configs
kubectl_general_configs: []
kubectl_general_configs:
- name: global
path: /etc/kubernetes/config
owner: root
group: root
mode: u=rwX,g=rX,o=rX
current: foobar
clusters:
- name: foobar
ca: ...
server: https://10.13.37.1:6443
users:
- name: admin
cert: ...
key: ...
contexts:
- name: foobar
cluster: foobar
user: admin
Path to legacy keyring which got to be removed
kubectl_keyring: /usr/share/keyrings/kubernetes-v{{ kubectl_minor_version }}-archive-keyring.gpg
kubectl_legacy_keyring: /usr/share/keyrings/kubernetes-archive-keyring.gpg
Legacy repository that got to be removed
kubectl_legacy_repo: deb [signed-by={{ kubectl_legacy_keyring }}] http://apt.kubernetes.io/
kubernetes-xenial main
Minor version used for repo selection
kubectl_minor_version: "{{ (kubectl_version | string).split('.')[0] }}.{{ (kubectl_version
| string).split('.')[1] }}"
Checksum for the kubectl ns plugin release
kubectl_ns_checksum: sha256:509c97c0882e688ae8fad8aa13524cc7c003e4883db447a905bdb47d64c13bdc
Download URL for the kubectl ns plugin release
kubectl_ns_download: https://github.com/ahmetb/kubectx/releases/download/v{{ kubectl_ns_version
}}/kubens
Install the kubectl ns plugin
kubectl_ns_install: true
Version of the kubectl ns plugin release to install
kubectl_ns_version: 0.9.5
Version of the kubectl release to install
kubectl_version: 1.29.2
kubectl
- None
Apache-2.0