Skip to content

Commit

Permalink
feat(k0s): unsupport it (#1291)
Browse files Browse the repository at this point in the history
Signed-off-by: Devin Buhl <devin@buhl.casa>
  • Loading branch information
onedr0p committed Feb 2, 2024
1 parent 3e0fb23 commit eab6347
Show file tree
Hide file tree
Showing 48 changed files with 22 additions and 505 deletions.
2 changes: 0 additions & 2 deletions .devcontainer/ci/features/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ for app in \
"FiloSottile/age!!?as=age&type=script" \
"fluxcd/flux2!!?as=flux&type=script" \
"go-task/task!!?as=task&type=script" \
"k0sproject/k0sctl!!?as=k0sctl&type=script" \
"kubecolor/kubecolor!!?as=kubecolor&type=script" \
"kubernetes-sigs/krew!!?as=krew&type=script" \
"kubernetes-sigs/kustomize!!?as=kustomize&type=script" \
Expand All @@ -46,7 +45,6 @@ for tool in cilium flux helm k9s kubectl kustomize talhelper talosctl; do
$tool completion fish > /home/vscode/.config/fish/completions/$tool.fish
done
gh completion --shell fish > /home/vscode/.config/fish/completions/gh.fish
k0sctl completion --shell fish > /home/vscode/.config/fish/completions/k0sctl.fish
stern --completion fish > /home/vscode/.config/fish/completions/stern.fish
yq shell-completion fish > /home/vscode/.config/fish/completions/yq.fish

Expand Down
3 changes: 0 additions & 3 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ export ANSIBLE_VARS_ENABLED="host_group_vars"
export ANSIBLE_LOCALHOST_WARNING="False"
export ANSIBLE_INVENTORY_UNPARSED_WARNING="False"
export K8S_AUTH_KUBECONFIG="$(expand_path ./kubeconfig)"
# k0s
export DISABLE_TELEMETRY="true"
export DISABLE_UPGRADE_CHECK="true"
# Talos
export TALOSCONFIG="$(expand_path ./kubernetes/talos/clusterconfig/talosconfig)"
# Bin
Expand Down
1 change: 0 additions & 1 deletion .github/labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
- { name: "area/kubernetes", color: "0e8a16" }
- { name: "area/taskfile", color: "0e8a16" }
# Distro
- { name: "distro/k0s", color: "ffc300" }
- { name: "distro/k3s", color: "ffc300" }
- { name: "distro/talos", color: "ffc300" }
# Renovate
Expand Down
4 changes: 2 additions & 2 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@
},
// custom versioning
{
"description": ["Use custom versioning for k0s/k3s"],
"description": ["Use custom versioning for k3s"],
"matchDatasources": ["github-releases"],
"versioning": "regex:^v(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)(?<compatibility>\\+k.s)\\.?(?<build>\\d+)$",
"matchPackagePatterns": ["k0s", "k3s"]
"matchPackagePatterns": ["k3s"]
},
// commit message topics
{
Expand Down
55 changes: 0 additions & 55 deletions .github/tests/config-k0s.yaml

This file was deleted.

3 changes: 1 addition & 2 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
fail-fast: false
matrix:
config-files:
- k0s
- k3s-ipv4
- k3s-ipv6
- talos
Expand Down Expand Up @@ -94,7 +93,7 @@ jobs:
task talos:genconfig
- name: Run Ansible tasks
if: ${{ startsWith(matrix.config-files, 'k0s') || startsWith(matrix.config-files, 'k3s') }}
if: ${{ startsWith(matrix.config-files, 'k3s') }}
shell: bash
run: |
task ansible:deps force=false
Expand Down
46 changes: 0 additions & 46 deletions .taskfiles/K0s/Taskfile.yaml

This file was deleted.

1 change: 0 additions & 1 deletion .taskfiles/Repository/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ tasks:
prompt: Reset templated configuration files... continue?
cmds:
- task: :ansible:.reset
- task: :k0s:.reset
- task: :kubernetes:.reset
- task: :sops:.reset
- task: :talos:.reset
Expand Down
1 change: 0 additions & 1 deletion .taskfiles/Workstation/Archfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ go-task
go-yq
helm
jq
k0sctl-bin
kubeconform
kubectl-bin
kustomize
Expand Down
2 changes: 0 additions & 2 deletions .taskfiles/Workstation/Brewfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
tap "fluxcd/tap"
tap "go-task/tap"
tap "k0sproject/tap"
tap "siderolabs/talos"
brew "age"
brew "cloudflared"
Expand All @@ -9,7 +8,6 @@ brew "fluxcd/tap/flux"
brew "go-task/tap/go-task"
brew "helm"
brew "jq"
brew "k0sproject/tap/k0sctl"
brew "kubeconform"
brew "kubernetes-cli"
brew "kustomize"
Expand Down
1 change: 0 additions & 1 deletion .taskfiles/Workstation/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ tasks:
- fluxcd/flux2?as=flux&type=script
- getsops/sops?as=sops&type=script
- jqlang/jq?as=jq&type=script
- k0sproject/k0sctl?as=k0sctl&type=script
- kubernetes-sigs/kustomize?as=kustomize&type=script
- siderolabs/talos?as=talosctl&type=script
- yannh/kubeconform?as=kubeconform&type=script
Expand Down
22 changes: 9 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ At a high level this project makes use of [makejinja](https://github.com/mirkole

The features included will depend on the type of configuration you want to use. There are currently **3 different types** of **configurations** available with this template.

1. **"Bare cluster"** - a Kubernetes distribution of your choosing: [k0s](https://github.com/k0sproject/k0s), [k3s](https://github.com/k3s-io/k3s) or [Talos](https://github.com/siderolabs/talos)
1. **"Bare cluster"** - a Kubernetes distribution of your choosing: [k3s](https://github.com/k3s-io/k3s) or [Talos](https://github.com/siderolabs/talos)

- **Required:** Debian 12 or Talos Linux installed on bare metal (or VMs) and some knowledge of [Containers](https://opencontainers.org/) and [YAML](https://yaml.org/).
- **Components:** [Cilium](https://github.com/cilium/cilium) and [kube-vip](https://github.com/kube-vip/kube-vip) _(k0s/k3s)_
- **Components:** [Cilium](https://github.com/cilium/cilium) and [kube-vip](https://github.com/kube-vip/kube-vip) _(k3s)_

2. **"Flux cluster"** - An addition to "**Bare cluster**" that deploys an opinionated implementation of [Flux](https://github.com/fluxcd/flux2) using [GitHub](https://github.com/) as the Git provider and [sops](https://github.com/getsops/sops) to manage secrets.

Expand All @@ -30,12 +30,12 @@ The features included will depend on the type of configuration you want to use.

## 💻 Machine Preparation

Hopefully some of this peeked your interests! If you are marching forward, now is a good time to choose whether you will deploy a Kubernetes cluster with [k0s](https://github.com/k0sproject/k0s), [k3s](https://github.com/k3s-io/k3s) or [Talos](https://github.com/siderolabs/talos).
Hopefully some of this peeked your interests! If you are marching forward, now is a good time to choose whether you will deploy a Kubernetes cluster with [k3s](https://github.com/k3s-io/k3s) or [Talos](https://github.com/siderolabs/talos).

### System requirements

> [!NOTE]
> 1. The included behaviour of Talos, k3s or k0s is that all nodes are able to run workloads, **including** the controller nodes. **Worker nodes** are therefore **optional**.
> 1. The included behaviour of Talos or k3s is that all nodes are able to run workloads, **including** the controller nodes. **Worker nodes** are therefore **optional**.
> 2. Do you have 3 or more nodes? It is highly recommended to make 3 of them controller nodes for a highly available control plane.
> 3. Running the cluster on Proxmox VE? My thoughts and recommendations about that are documented [here](https://onedr0p.github.io/home-ops/notes/proxmox-considerations.html).
Expand All @@ -55,7 +55,7 @@ Hopefully some of this peeked your interests! If you are marching forward, now

4. Continue on to 🚀 [**Getting Started**](#-getting-started)

### k3s or k0s (AMD64)
### k3s (AMD64)

1. Download the latest stable release of Debian from [here](https://cdimage.debian.org/debian-cd/current/amd64/iso-dvd), then follow [this guide](https://www.linuxtechi.com/how-to-install-debian-12-step-by-step) to get it installed. Deviations from the guide:

Expand Down Expand Up @@ -99,7 +99,7 @@ Hopefully some of this peeked your interests! If you are marching forward, now
chmod 600 ~/.ssh/authorized_keys
```

### k3s or k0s (RasPi4)
### k3s (RasPi4)

<details>
<summary><i>Click <b>here</b> to read about using a RasPi4</i></summary>
Expand All @@ -126,7 +126,7 @@ Hopefully some of this peeked your interests! If you are marching forward, now

5. [Post install] SSH into the device with the `root` user and then create a normal user account with `adduser ${username}`

6. [Post install] Follow steps 3 and 4 from [k3s or k0s (AMD64)](##k3s-or-k0s-amd64).
6. [Post install] Follow steps 3 and 4 from [k3s (AMD64)](##k3s-amd64).

7. [Post install] Install `python3` which is needed by Ansible.

Expand Down Expand Up @@ -245,7 +245,7 @@ You have two different options for setting up your local workstation.
### ⚡ Stage 4: Prepare your nodes for Kubernetes

> [!NOTE]
> For **Talos** or **k0s** skip ahead to ⛵ [**Stage 5**](#-stage-5-install-kubernetes)
> For **Talos** skip ahead to ⛵ [**Stage 5**](#-stage-5-install-kubernetes)
#### k3s

Expand Down Expand Up @@ -309,15 +309,13 @@ You have two different options for setting up your local workstation.
task talos:apply-extras
```

#### k3s or k0s
#### k3s

1. Install Kubernetes depending on the distribution you chose

```sh
# Install k3s
task ansible:run playbook=cluster-installation
# or, install k0s
task k0s:apply
```

#### Cluster validation
Expand Down Expand Up @@ -452,8 +450,6 @@ There might be a situation where you want to destroy your Kubernetes cluster. Th
```sh
# Nuke k3s
task ansible:run playbook=cluster-nuke
# or, Nuke k0s
task k0s:reset
```

## 🤖 Renovate
Expand Down
1 change: 0 additions & 1 deletion Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ includes:
aliases: ["k8s"]
taskfile: .taskfiles/Kubernetes/Taskfile.yaml
flux: .taskfiles/Flux/Taskfile.yaml
k0s: .taskfiles/K0s/Taskfile.yaml
repository:
aliases: ["repo"]
taskfile: .taskfiles/Repository/Taskfile.yaml
Expand Down
6 changes: 1 addition & 5 deletions bootstrap/scripts/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
import netaddr
import sys

DISTRIBUTIONS = ["k0s", "k3s", "talos"]
DISTRIBUTIONS = ["k3s", "talos"]
GLOBAL_CLI_TOOLS = ["age", "cloudflared", "flux", "sops", "jq", "kubeconform", "kustomize"]
TALOS_CLI_TOOLS = ["talosctl", "talhelper"]
K0S_CLI_TOOLS = ["k0sctl"]

def required(*keys: str):
def wrapper_outter(func: Callable):
Expand Down Expand Up @@ -48,9 +47,6 @@ def validate_cli_tools(distribution: dict, **_) -> None:
for tool in TALOS_CLI_TOOLS if distribution in ["talos"] else []:
if not which(tool):
raise ValueError(f"Missing required CLI tool {tool}")
for tool in K0S_CLI_TOOLS if distribution in ["k0s"] else []:
if not which(tool):
raise ValueError(f"Missing required CLI tool {tool}")


@required("distribution")
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/templates/.sops.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ creation_rules:
key_groups:
- age:
- "{{ flux.sops_age_public_key }}"
{% if distribution.type in ["k0s", "k3s"] %}
{% if distribution.type in ["k3s"] %}
- path_regex: ansible/.*\.sops\.ya?ml
key_groups:
- age:
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/templates/ansible/.mjfilter.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
main = lambda data: data.get("distribution", {}).get("type", "k3s") in ["k0s", "k3s"]
main = lambda data: data.get("distribution", {}).get("type", "k3s") in ["k3s"]
1 change: 0 additions & 1 deletion bootstrap/templates/ansible/inventory/.mjfilter.py

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{% if distribution.type in ["k3s"] %}
---
- name: Cluster Installation
hosts: kubernetes
Expand Down Expand Up @@ -59,4 +58,3 @@
- name: Cruft
when: k3s_primary_control_node
ansible.builtin.include_tasks: tasks/cruft.yaml
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,15 @@
ansible.builtin.pause:
seconds: 5
tasks:
{% if distribution.type in ["k3s"] %}
- name: Ensure Kubernetes is running
ansible.builtin.include_role:
name: xanmanning.k3s
public: true
vars:
k3s_state: started
{% endif %}

- name: Upgrade kube-vip
ansible.builtin.template:
src: templates/kube-vip-ds.yaml.j2
{% if distribution.type in ["k3s"] %}
dest: "{% raw %}{{ k3s_server_manifests_dir }}{% endraw %}/kube-vip-ds.yaml"
{% elif distribution.type in ["k0s"] %}
dest: "/var/lib/k0s/manifests/kube-vip/kube-vip-ds.yaml"
{% endif %}
mode: preserve
2 changes: 0 additions & 2 deletions bootstrap/templates/ansible/playbooks/cluster-nuke.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{% if distribution.type in ["k3s"] %}
---
- name: Cluster Nuke
hosts: kubernetes
Expand Down Expand Up @@ -100,4 +99,3 @@
ansible.builtin.reboot:
msg: Rebooting hosts
reboot_timeout: 3600
{% endif %}
2 changes: 0 additions & 2 deletions bootstrap/templates/ansible/playbooks/cluster-prepare.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{% if distribution.type in ["k3s"] %}
---
- name: Prepare System
hosts: kubernetes
Expand Down Expand Up @@ -112,4 +111,3 @@
ansible.builtin.reboot:
msg: Rebooting hosts
reboot_timeout: 3600
{% endif %}
Loading

0 comments on commit eab6347

Please sign in to comment.