Kubernetes
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
Installation
To install this collection use ansible-galaxy collection install nofusscomputing.kubernetes
Features
-
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.
Danger
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 playbookhosts
key can accept -
nfc_pb_kubernetes_cluster_name
with the name of the cluster. This variable is appended to stringkubernetes_cluster_
to serve as a group name for the cluster to be installed. i.e. for a cluster calledprime
, the group name would be set tokubernetes_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.
Info
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.
Danger
not following the Kubernetes version skew policy when upgrading your cluster may break your cluster.
About:
This page forms part of our Project Kubernetes Ansible Collection.
Page Metadata
Version: ToDo: place files short git commit hereDate Created: 2024-03-13
Date Edited: 2024-03-29
Contribution:
Would You like to contribute to our Kubernetes Ansible Collection project? You can assist in the following ways:
- Edit This Page If there is a mistake or a way you can improve it.
- Add a Page to the Manual if you would like to add an item to our manual
- Raise an Issue if there is something about this page you would like to improve, and git is unfamiliar to you.
ToDo: Add the page list of contributors