Skip to content

add k0s support #1123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ae2718a
ignore idea
brunnels Jan 8, 2024
20764e9
Initial work on support for k0s
brunnels Jan 8, 2024
61d4078
* Changed config param to bootstrap_distribution
brunnels Jan 8, 2024
9cf455d
* Switched to single storage path for openebs
brunnels Jan 9, 2024
1d984ba
* added the storageclass name to be declarative
brunnels Jan 9, 2024
3600011
* added newline
brunnels Jan 9, 2024
86ff24c
* fixed spacing in K0sTasks
brunnels Jan 9, 2024
3bb45e1
* updated configure task to use venv
brunnels Jan 10, 2024
7ce2910
* tweaked configure task cmd
brunnels Jan 10, 2024
f40699b
* tweaked k0s task cmd
brunnels Jan 11, 2024
384d074
* fixed whitespace
brunnels Jan 11, 2024
2f31c7a
add k0sctl to brew tasks
onedr0p Jan 11, 2024
9915a21
Update bootstrap/vars/config.sample.yaml
onedr0p Jan 11, 2024
394a261
Update bootstrap/vars/config.sample.yaml
onedr0p Jan 11, 2024
3f98769
Update k0s-config.yaml.j2
onedr0p Jan 11, 2024
ed9aad9
Update config.sample.yaml
onedr0p Jan 11, 2024
efd3f80
controllerManager and scheduler bind to `0.0.0.0` for metrics
onedr0p Jan 11, 2024
1598f73
Update custom-cilium-helmchart.yaml.j2.j2
onedr0p Jan 11, 2024
e9c0eec
Update helmvalues.yaml.j2
onedr0p Jan 11, 2024
cacc851
Update bootstrap/tasks/addons/main.yaml
onedr0p Jan 11, 2024
3252c39
first pass at readme updates
onedr0p Jan 11, 2024
d6ded50
update placement of k0sconfig options
onedr0p Jan 11, 2024
ce13bd5
disable telemetry on k0sctl too
onedr0p Jan 11, 2024
5a7808d
disable k0s telemetry in env too
onedr0p Jan 11, 2024
43eca2c
update: jinja spacing in k0sconfig
onedr0p Jan 11, 2024
f2bc783
fix: ensure bootstrap_local_storage_path is delete on nuke
onedr0p Jan 11, 2024
178f2fa
fix: update renovate regex for k3s/k0s
onedr0p Jan 11, 2024
91455ce
fix: update nuke playbook and only include k3s task when k3s
onedr0p Jan 11, 2024
ef99521
fix: update nuke playbook and only include k3s task when k3s and incl…
onedr0p Jan 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions bootstrap/tasks/validation/vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
success_msg: Required bootstrap var {{ item }} exists and is defined
fail_msg: Required bootstrap var {{ item }} does not exists or is not defined
loop:
- bootstrap_distribution
- bootstrap_acme_email
- bootstrap_age_public_key
- bootstrap_cilium_loadbalancer_mode
Expand All @@ -17,15 +16,17 @@
- bootstrap_cloudflare_tunnel_id
- bootstrap_cloudflare_tunnel_secret
- bootstrap_cluster_cidr
- bootstrap_distribution
- bootstrap_external_ingress_addr
- bootstrap_flux_github_webhook_token
- bootstrap_github_repository_name
- bootstrap_github_repository_branch
- bootstrap_github_repository_name
- bootstrap_github_username
- bootstrap_external_ingress_addr
- bootstrap_internal_ingress_addr
- bootstrap_ipv6_enabled
- bootstrap_k8s_gateway_addr
- bootstrap_kube_vip_addr
- bootstrap_local_storage_path
- bootstrap_node_cidr
- bootstrap_service_cidr
- bootstrap_timezone
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ data:
id: 1
containerRuntime:
integration: containerd
{% if k0s.enabled | default(false) %}
socketPath: /var/run/k0s/containerd.sock
{% else %}
{% if bootstrap_distribution == "k3s" %}
socketPath: /var/run/k3s/containerd/containerd.sock
{% endif %}
{% else %}
socketPath: /var/run/k0s/containerd.sock
{% endif %}
endpointRoutes:
enabled: true
hubble:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ kind: Kustomization
resources:
- ./namespace.yaml
- ./cilium/ks.yaml
{% if bootstrap_distribution == "k3s" %}
{% if bootstrap_distribution == "k3s" %}
- ./coredns/ks.yaml
{% endif %}
{% endif %}
- ./metrics-server/ks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,5 @@ spec:
hostpathClass:
enabled: true
isDefaultClass: false
{% if bootstrap_distribution == 'k3s' %}
basePath: "{{ bootstrap_local_storage_path | default('/var/lib/rancher/k3s/local-hostpath', true) }}"
{% else %}
basePath: "{{ bootstrap_local_storage_path | default('/var/openebs/local', true) }}"
{% endif %}
basePath: "{{ bootstrap_local_storage_path }}"

7 changes: 7 additions & 0 deletions bootstrap/templates/kubernetes/flux/config/cluster.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#jinja2: trim_blocks: True, lstrip_blocks: True
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
Expand All @@ -8,7 +9,13 @@ spec:
interval: 30m
ref:
branch: {{ bootstrap_github_repository_branch | default('main', true) }}
{% if bootstrap_private_github_repo | default(false) %}
secretRef:
name: github-deploy-key
url: "ssh://github.com/{{ bootstrap_github_username }}/{{ bootstrap_github_repository_name }}"
{% else %}
url: "https://github.com/{{ bootstrap_github_username }}/{{ bootstrap_github_repository_name }}.git"
{% endif %}
ignore: |
# exclude all
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: democratic-csi
name: openebs
namespace: flux-system
spec:
interval: 1h
url: https://democratic-csi.github.io/charts/
url: https://openebs.github.io/charts
7 changes: 1 addition & 6 deletions bootstrap/vars/config.sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ bootstrap_github_repository_name:
bootstrap_github_repository_branch: main
# Age Public Key (e.g. age15uzrw396e67z9wdzsxzdk7ka0g2gr3l460e0slaea563zll3hdfqwqxdta)
bootstrap_age_public_key:
# Set true if repo is private
bootstrap_private_github_repo: false
# Choose your timezone (e.g. America/New_York)
bootstrap_timezone: Etc/UTC
# Email you want to be associated with the ACME account (used for TLS certificates via letsencrypt.org)
Expand Down Expand Up @@ -70,10 +68,7 @@ bootstrap_cluster_cidr: 10.42.0.0/16
bootstrap_service_cidr: 10.43.0.0/16

# (Advanced) Path for openebs openebs-hostpath to use for storage on ALL nodes
# for k3s distribution
#bootstrap_local_storage_path: /var/lib/rancher/k3s/local-hostpath
# for k0s distribution
#bootstrap_local_storage_path: /var/openebs/local
bootstrap_local_storage_path: /var/openebs/local

# Node information
bootstrap_nodes:
Expand Down