Skip to content


Project Status - Active

Gitlab build status - stable Gitlab build status - development

Debian 11 Debian 12 Ubuntu 20.04 Ubuntu 22.04


This Ansible Collection is for installing a K3s Kubernetes cluster, both single and multi-node cluster deployments are supported. In addition to installing and configuring the firewall for the node. for further information on the firewall config please see the firewall docs


To install this collection use ansible-galaxy collection install nofusscomputing.kubernetes


  • Install k3s cluster. Both Single and multi-node clusters

  • Configure the cluster

  • Upgrade a cluster

For a more detailed list of featured checkout the roles documentation.

Using this collection

This collection has been designed to be a complete and self-contained management tool for a K3s kubernetes cluster.

Cluster Installation

By default the install playbook will install to localhost.

ansible-playbook nofusscomputing.kubernetes.install


By default when the install task is run, The firewall is also configured. The default sets the FORWARD and INPUT tables to have a policy of DROP. Failing to add any required additional rules before installing/configuring kubernetes will cause you to not have remote access to the machine.

You are encouraged to run ansible-playbook nofusscomputing.firewall.install with your rules configured within your inventory first. see the firewall docs for more information.

The install playbook has a dynamic hosts key. This has been done to specifically support running the playbook from AWX and being able to populate the field from the survey feature. Order of precedence for the host variable is as follows:

  • nfc_pb_host set to any valid value that a playbook hosts key can accept

  • nfc_pb_kubernetes_cluster_name with the name of the cluster. This variable is appended to string kubernetes_cluster_ to serve as a group name for the cluster to be installed. i.e. for a cluster called prime, the group name would be set to kubernetes_cluster_prime

  • --limit specified at runtime

  • localhost

For the available variables please view the nfc_kubernetes role docs

Cluster Upgrade

In place cluster upgrades is the method used to conduct the cluster upgrades. The logic for the upgrades first confirms that K3s is installed and that the local binary and running k3s version are the desired versions. If they are not, they will be updated to the desired version. On completion of this the node has its k3s service restarted which completes the upgrade process.


If an upgrade occurs, no other task within the play will run. This is by design. if you have further tasks to be run in addition to the upgrade, run the play again.


not following the Kubernetes version skew policy when upgrading your cluster may break your cluster.


This page forms part of our Project Kubernetes Ansible Collection.

Page Metadata
Version: ToDo: place files short git commit here
Date Created: 2024-03-13
Date Edited: 2024-03-29


Would You like to contribute to our Kubernetes Ansible Collection project? You can assist in the following ways:


ToDo: Add the page list of contributors