add k0s support (#1123)

* ignore idea

* Initial work on support for k0s

* *  Changed config param to bootstrap_distribution
*  Replaced democratic-csi with openebs
*  Added notes about system-upgrade-controller being ignored with k0s
*  Removed password for nodes

* *  Switched to single storage path for openebs
*  Removed democratic-csi helm repo
*  Added missing openebs helm repo
*  Fixed template formatting
*  Made bootstrap_private_github_repo hidden/undocumented
*  Updated flux cluster config to accommodate bootstrap_private_github_repo

* *  added the storageclass name to be declarative

* *  added newline
*  set chart wait false

* *  fixed spacing in K0sTasks
*  fixed openebs path
*  properly added openebs helm repo

* *  updated configure task to use venv
*  renamed bootstrap_kube_vip_addr to bootstrap_kubeapi_addr
*  renamed bootstrap_kube_vip_addr derived variables accordingly

* *  tweaked configure task cmd
*  started work on k0s-config.yaml template

* *  tweaked k0s task cmd
*  moved coredns under addons rather than optional
*  fixed typo in coredns task
*  normalized formatting in k0s-config
*  disabled telemetry in k0s-config
*  added renovate to k0s-config
*  removed tunnel and added routing mode in k0s-config cilium chart values
*  updated docs in config example
*  fixed issue with k0s-config controller role so it didn't default to worker+controller if more than one master

* *  fixed whitespace

* add k0sctl to brew tasks

* Update bootstrap/vars/config.sample.yaml

* Update bootstrap/vars/config.sample.yaml

* Update k0s-config.yaml.j2

* Update config.sample.yaml

* controllerManager and scheduler bind to `0.0.0.0` for metrics

* Update custom-cilium-helmchart.yaml.j2.j2

* Update helmvalues.yaml.j2

* Update bootstrap/tasks/addons/main.yaml

* first pass at readme updates

* update placement of k0sconfig options

* disable telemetry on k0sctl too

* disable k0s telemetry in env too

* update: jinja spacing in k0sconfig

Signed-off-by: Devin Buhl <devin@buhl.casa>

* fix: ensure bootstrap_local_storage_path is delete on nuke

Signed-off-by: Devin Buhl <devin@buhl.casa>

* fix: update renovate regex for k3s/k0s

Signed-off-by: Devin Buhl <devin@buhl.casa>

* fix: update nuke playbook and only include k3s task when k3s

Signed-off-by: Devin Buhl <devin@buhl.casa>

* fix: update nuke playbook and only include k3s task when k3s and include jinja comments

Signed-off-by: Devin Buhl <devin@buhl.casa>

---------

Signed-off-by: Devin Buhl <devin@buhl.casa>
Co-authored-by: Devin Buhl <onedr0p@users.noreply.github.com>
Co-authored-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
authored and GitHub committed 2024-01-11 15:03:36 -05:00
1 parent 1b73543d34
commit d093d0a4e1
43 files changed
+357 -155

No files matched your search

+9 -6
View File
@@ -1,6 +1,6 @@
# Deploy a Kubernetes cluster backed by Flux
Welcome to my highly opinionated template for deploying a single Kubernetes ([k3s](https://k3s.io)) cluster with [Ansible](https://www.ansible.com) and using [Flux](https://toolkit.fluxcd.io) to manage its state.
Welcome to my highly opinionated template for deploying a single Kubernetes ([k3s](https://k3s.io) or [k0s](https://github.com/k0sproject/k0s)) cluster with [Ansible](https://www.ansible.com) and using [Flux](https://toolkit.fluxcd.io) to manage its state.
## 👋 Introduction
@@ -258,7 +258,7 @@ Once you have installed Debian on your nodes, there are six stages to getting a
> └─📁 apps # Apps deployed into the cluster grouped by namespace
> ```
### ⚡ Stage 4: Prepare your nodes for k3s
### ⚡ Stage 4: Prepare your nodes for Kubernetes
📍 _Here we will be running an Ansible playbook to prepare your nodes for running a Kubernetes cluster._
@@ -282,7 +282,7 @@ Once you have installed Debian on your nodes, there are six stages to getting a
task ansible:run playbook=cluster-prepare
```
### ⛵ Stage 5: Use Ansible to install k3s
### ⛵ Stage 5: Install Kubernetes
📍 _Here we will be running a Ansible Playbook to install [k3s](https://k3s.io/) with [this](https://galaxy.ansible.com/xanmanning/k3s) Ansible galaxy role. If you run into problems, you can run `task ansible:run playbook=cluster-nuke` to destroy the k3s cluster and start over from this point._
@@ -298,13 +298,16 @@ Once you have installed Debian on your nodes, there are six stages to getting a
task ansible:ping
```
3. Install k3s with Ansible
3. Install Kubernetes
```sh
# k3s
task ansible:run playbook=cluster-installation
# k0s
task k0s:apply
```
4. Verify the nodes are online
5. Verify the nodes are online
📍 _If this command **fails** you likely haven't configured `direnv` as mentioned previously in the guide._
@@ -315,7 +318,7 @@ Once you have installed Debian on your nodes, there are six stages to getting a
# k8s-1 Ready worker 1h v1.27.3+k3s1
```
5. The `kubeconfig` for interacting with your cluster should have been created in the root of your repository.
6. The `kubeconfig` for interacting with your cluster should have been created in the root of your repository.
### 🔹 Stage 6: Install Flux in your cluster