Skip to content

Evantage-WS/ansible-collection-k8s-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

k8s-tools

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 binary
  • install_kubectx : Install kubectx binary
  • install_krew : Install krew binary
  • install_krew_plugins: Install specified krew plugins
  • install_helm : Install helm
  • install_k9s : Install K9s
  • setup_bashrc : Adds specific configurations to the bashrc

Requirements

  • Ansible 2.9 or higher
  • Targeted OS: openSUSE /SUSE Linux Enterprise (SLES)

Example Playbook

Running Locally

1. Setting Up the Variable File

Define the necessary variables in the vars.yml file:

# vars.yml
home_user: "root"
krew_plugins:
  - "ctx"
  - "neat"
  - "ns"
  # more...

2. Creating the Playbook

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

3. Running the Playbook

Execute the playbook with the following command:

ansible-playbook site.yml

Post-Task Actions

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.

Role Variables

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.

Dependencies

None.


License

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.

Releases

No releases published

Packages

No packages published