wabumike.k3s

Setting Up k3s

Build Status

This Ansible role will download, install, and start k3s, a lightweight version of Kubernetes.

Unique Features of This Role

There are other k3s Ansible roles available, but here’s what makes this one different:

  • When k3s binaries are downloaded, older versions stay in a subfolder within k3s_install_path. Only the links in /usr/local/bin/ are updated. This allows you to revert to a previous version anytime by changing the symlinks for 'k3s', 'kubectl', and 'crictl' in /usr/local/bin.

  • This role uses the same names as k3s: server, agent, etc.

  • It has been fully tested using Molecule.

Requirements

Variables

You may want to change the following variables (like in group_vars or host_vars):

  • k3s_install_path: "/opt/k3s"
  • k3s_server_options:
  • k3s_agent_options:
  • k3s_version:

Server Group

Make sure to include the host that will act as the server in this group: [k3s_server].

Example

Hosts file:

[k3s]
192.168.2.90
192.168.2.91
192.168.2.92

[k3s_server]
192.168.2.90

Playbook:

- hosts: k3s
  become: true
  roles:
    - role: k3s

Testing

  • Run molecule test --all
    • There are scenarios for Debian (default), Ubuntu, and CentOS.

Debugging Tests

  1. Use molecule test --destroy=never to start the default scenario.
  2. Log into the machine using molecule login -h <molecule-k3s-agent|molecule-k3s-master>.
  3. After finishing, remove the machines with molecule destroy.
Informazioni sul progetto

Download, install and start k3s, a lightweight Kubernetes distribution

Installa
ansible-galaxy install wabumike.k3s
Licenza
gpl-3.0
Download
86
Proprietario
https://fosstodon.org/@WabuMike https://gitlab.com/wabuMike