Kubernetes
This Ansible role is designed to deploy a K3s Kubernetes cluster. Without adding cluster configuration this role will install K3s as a single node cluster. To deploy a multi-node cluster add your configuration, K3s will be installed on all nodes. On completion you will have fully configured cluster in a state ready to use. This role can be used with our our playbooks or comes included, along with the playbook within our Ansible Execution Environment.
Role Details
Item | Value | Description |
---|---|---|
Dependent Roles | None | |
Optional Roles | nfc_firewall | Used to setup the firewall for kubernetes. |
Idempotent | Yes | |
Stats Available | Not Yet | |
Tags | Nil | |
Requirements | Gather Facts | |
become |
Features
-
CNI Setup, calico including
calicoctl
pluginkubectl calico ....
instead ofcalicoctl ....
-
Configurable:
-
Container Registries
-
ectd deployment
-
etcd snapshot cron schedule
-
etcd snapshot retention
-
-
Cluster Domain
-
Configure System reserved CPU, Storage and Memory.
-
Node Labels
-
Node Taints
-
Service Load Balancer Namespace
-
-
Encryption between nodes (Wireguard)
-
Multi-node Deployment
-
OpenID Connect SSO Authentication
-
ToDo-#5 Restore backup on fresh install of a cluster
-
Installs OLM for operator subscriptions
-
Install MetalLB
-
Install KubeVirt including
virtctl
pluginkubectl virt ....
instead ofvirtctl ....
-
Install the Helm Binary
-
Upgrade cluster
Role Workflow
For a more probable than not success this role first installs/configures prime master, other master(s) and worker nodes using the following simplified workflow:
-
Download both install script and k3s binary to ansible controller
-
copy install script and k3s binary to host
-
Create required config files needed for installation
-
(kubernetes prime master only) Add install required config files
-
Install kubernetes
-
(kubernetes prime master only) Wait for kubernetes to be ready. Playbook is paused until
true
-
Configure Kubernetes
-
Install Kubevirt
If the playbook is setup as per our recommendation step 2 onwards is first done on master nodes then worker nodes.
Tip
If you prefer to manually restart the kubernetes service the following variables can be set to prevent a restart of the kubernetes service
See default variables below for explanation of each variable if it's not evident enough.Default Variables
On viewing these variables you will notice there are single dictionary keys prefixed nfc_role_kubernetes_
and a dictionary of dictionaries kubernetes_config
. variables prefixed with nfc_role_kubernetes_
are for single node installs with the kubernetes_config
dictionary containing all of the information for an entire cluster. The kubernetes_config
dictionary variables take precedence. Even if you are installing a cluster on multiple nodes, you are still advised to review the variables prefixed with nfc_role_kubernetes_
as they may still be needed. i.e. setting a node type use keys nfc_role_kubernetes_prime
, nfc_role_kubernetes_master
and nfc_role_kubernetes_worker
.
defaults/main.yaml | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
|
About:
This page forms part of our Project Kubernetes Ansible Collection.
Page Metadata
Version: ToDo: place files short git commit hereDate Created: 2023-10-24
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