项目作者: gantsign

项目描述 :
Ansible role for installing Kubernetes
高级语言: Shell
项目地址: git://github.com/gantsign/ansible-role-kubernetes.git
创建时间: 2016-11-05T19:41:26Z
项目社区:https://github.com/gantsign/ansible-role-kubernetes

开源协议:MIT License

下载


Ansible Role: Kubernetes

Tests
Ansible Galaxy
License

Role to install the Kubernetes container cluster
manager.

Requirements

  • Ansible Core >= 2.12

  • Linux Distribution

    • Debian Family

      • Ubuntu

        • Bionic (18.04)
        • Focal (20.04)

Role Variables

The following variables will change the behavior of this role (default values
are shown below):

  1. # Node type: determines what features are installed.
  2. # - controller:
  3. # - kubectl
  4. # - worker:
  5. # - kubelet
  6. # - kubernetes-cni
  7. # - master:
  8. # - kubelet
  9. # - kubectl
  10. # - kubernetes-cni
  11. # - admin:
  12. # - kubelet
  13. # - kubectl
  14. # - kubeadm
  15. # - kubernetes-cni
  16. kubernetes_node_type: worker
  17. # The ID of the APT key for the Kubernetes repository (optional)
  18. kubernetes_apt_key_id:

Example Playbook

  1. - hosts: servers
  2. roles:
  3. - role: gantsign.kubernetes
  4. kubernetes_node_type: worker

Tab Completion & Aliases for Zsh

Using Ansible

We recommended using the
gantsign.antigen role to enable
Zsh support for Kubernetes (this must be configured for each user).

  1. - hosts: servers
  2. roles:
  3. - role: gantsign.kubernetes
  4. kubernetes_node_type: worker
  5. - role: gantsign.antigen
  6. users:
  7. - username: example
  8. antigen_libraries:
  9. - name: oh-my-zsh
  10. antigen_bundles:
  11. # Use the Oh My Zsh plugin for kubectl
  12. - name: kubectl
  13. # Use the GantSign plugin for kubeadm
  14. - name: kubeadm
  15. url: gantsign/zsh-plugins
  16. location: kubeadm

Using Antigen

If you prefer to use Antigen directly
add the following to your Antigen configuration:

  1. antigen use oh-my-zsh
  2. antigen bundle kubectl
  3. 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.

Manual configuration

To manually configure Zsh tab completion add the following to your .zshrc:

  1. eval "$(kubectl completion zsh)"
  2. eval "$(kubeadm completion zsh)"

More Roles From GantSign

You can find more roles from GantSign on
Ansible Galaxy.

Development & Testing

This project uses the following tooling:

  • Molecule for orchestrating test scenarios
  • Testinfra for testing the changes on the
    remote
  • pytest the testing framework
  • Tox manages Python virtual
    environments for linting and testing
  • pip-tools for managing dependencies

A Visual Studio Code
Dev Container is
provided for developing and testing this role.

License

MIT

Author Information

John Freeman

GantSign Ltd.
Company No. 06109112 (registered in England)