Skip to content

Ansible role to install and configure the Kubernetes CLI

License

Notifications You must be signed in to change notification settings

rolehippie/kubectl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kubectl

Source Code General Workflow Readme Workflow Galaxy Workflow License: Apache-2.0 Ansible Role

Ansible role to install and configure the Kubernetes CLI.

Sponsor

Building and improving this Ansible role have been sponsored by my current and previous employers like Cloudpunks GmbH and Proact Deutschland GmbH.

Table of content


Requirements

  • Minimum Ansible version: 2.10

Default Variables

kubectl_checksum

Checksum for the kubectl release

Default value

kubectl_checksum: sha256:bb04d9450d9c9fa120956c5cc7c8dfaa700297038ff9c941741e730b02bbd1f3

kubectl_ctx_checksum

Checksum for the kubectl ctx plugin release

Default value

kubectl_ctx_checksum: sha256:e887e4e2b3dd4c94d0ecdb84270fb4fac2e65c4d5b0ee461e688fb8089fd4900

kubectl_ctx_download

Download URL for the kubectl ctx plugin release

Default value

kubectl_ctx_download: https://github.com/ahmetb/kubectx/releases/download/v{{ kubectl_ctx_version
  }}/kubectx

kubectl_ctx_install

Install the kubectl ctx plugin

Default value

kubectl_ctx_install: true

kubectl_ctx_version

Version of the kubectl ctx plugin release to install

Default value

kubectl_ctx_version: 0.9.5

kubectl_download

Download URL for the kubectl release

Default value

kubectl_download: https://dl.k8s.io/release/v{{ kubectl_version }}/bin/darwin/amd64/kubectl

kubectl_extra_configs

List of extra configs

Default value

kubectl_extra_configs: []

Example usage

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

kubectl_fixed_version

Pin version if installed from repository

Default value

kubectl_fixed_version: false

kubectl_from_repository

Default value

kubectl_from_repository: false

kubectl_general_configs

List of general configs

Default value

kubectl_general_configs: []

Example usage

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

kubectl_keyring

Path to legacy keyring which got to be removed

Default value

kubectl_keyring: /usr/share/keyrings/kubernetes-v{{ kubectl_minor_version }}-archive-keyring.gpg

kubectl_legacy_keyring

Default value

kubectl_legacy_keyring: /usr/share/keyrings/kubernetes-archive-keyring.gpg

kubectl_legacy_repo

Legacy repository that got to be removed

Default value

kubectl_legacy_repo: deb [signed-by={{ kubectl_legacy_keyring }}] http://apt.kubernetes.io/
  kubernetes-xenial main

kubectl_minor_version

Minor version used for repo selection

Default value

kubectl_minor_version: "{{ (kubectl_version | string).split('.')[0] }}.{{ (kubectl_version
  | string).split('.')[1] }}"

kubectl_ns_checksum

Checksum for the kubectl ns plugin release

Default value

kubectl_ns_checksum: sha256:509c97c0882e688ae8fad8aa13524cc7c003e4883db447a905bdb47d64c13bdc

kubectl_ns_download

Download URL for the kubectl ns plugin release

Default value

kubectl_ns_download: https://github.com/ahmetb/kubectx/releases/download/v{{ kubectl_ns_version
  }}/kubens

kubectl_ns_install

Install the kubectl ns plugin

Default value

kubectl_ns_install: true

kubectl_ns_version

Version of the kubectl ns plugin release to install

Default value

kubectl_ns_version: 0.9.5

kubectl_version

Version of the kubectl release to install

Default value

kubectl_version: 1.29.2

Discovered Tags

kubectl

Dependencies

  • None

License

Apache-2.0

Author

Thomas Boerger