This Ansible collection is dedicated to setting up Kubernetes tooling on the SUSE Linux Family. The collection comprises several roles, each focusing on a specific tool or configuration:
install_kubectl
: Install kubectl binaryinstall_kubectx
: Install kubectx binaryinstall_krew
: Install krew binaryinstall_krew_plugins
: Install specified krew pluginsinstall_helm
: Install helminstall_k9s
: Install K9ssetup_bashrc
: Adds specific configurations to the bashrc
- Ansible 2.9 or higher
- Targeted OS: openSUSE /SUSE Linux Enterprise (SLES)
Define the necessary variables in the vars.yml
file:
# vars.yml
home_user: "root"
krew_plugins:
- "ctx"
- "neat"
- "ns"
# more...
- For a comprehensive list of available krew plugins, visit the official krew plugins directory. For the krew version, visit https://github.com/kubernetes-sigs/krew/releases/
Write the playbook in the site.yml
file:
# site.yml
---
- hosts: localhost
become: yes
vars_files:
- ~/vars.yml
collections:
- evantage.k8s-tools
roles:
- setup_bashrc
- install_kubectl
- install_kubectx
- install_krew
- install_krew_plugins
- install_helm
- install_k9s
Execute the playbook with the following command:
ansible-playbook site.yml
After the tasks have been completed, apply the changes on the installed machine by running:
source ~/.bashrc
- This command will apply any changes made in the .bashrc file to the current shell session.
The variables below can be modified in the ~/vars.yml
file as per your requirements:
home_user
: User for which the tooling setup should be applied.krew_version
: Desired version of krew. Default:v0.4.4
krew_plugins
: List of krew plugins to be installed.
None.
Based on https://github.com/somaz94/ansible-k8s-iac-tool and https://github.com/Pandemonium1986/ansible-collection-k8s-toolbox
This project is licensed under the MIT License - see the LICENSE file for details.