feat: add advanced features to config (#1208)

* feat: add advanced features to config

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

* fix: only enable longhorn if distro is k3s or k0s

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

* fix: update ansible lint

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

---------

Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
Devin Buhl authored and GitHub committed 2024-01-20 12:27:20 -05:00
1 parent 0fda1f6a56
commit 1ec59d1559
87 files changed
+158 -145

No files matched your search

+2 -1
View File
@@ -1,5 +1,6 @@
#% if bootstrap_distribution == 'k3s' or bootstrap_distribution == 'k0s' %#
#% if bootstrap_distribution in ['k3s', 'k0s'] %#
skip_list:
- jinja[spacing]
- yaml[commas]
- yaml[line-length]
- var-naming
@@ -11,7 +11,7 @@ k3s_registration_address: "{{ kube_api_addr }}"
# /var/lib/rancher/k3s/server/manifests
k3s_server_manifests_templates:
- custom-cilium-helmchart.yaml.j2
#% if bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr | default('') %#
#% if bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr|default('') %#
# /var/lib/rancher/k3s/server/manifests
k3s_server_manifests_urls:
- url: https://raw.githubusercontent.com/kube-vip/website/main/content/manifests/rbac.yaml
@@ -1,20 +1,20 @@
#% if bootstrap_distribution == 'k3s' or bootstrap_distribution == 'k0s' %#
#% if bootstrap_distribution in ['k3s', 'k0s'] %#
---
timezone: "#{ bootstrap_timezone }#"
github_username: "#{ bootstrap_github_username }#"
coredns_addr: "#{ bootstrap_service_cidr.split(',')[0] | nthhost(10) }#"
#% if bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr | default('') %#
#% if bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr|default('') %#
kube_api_addr: "#{ bootstrap_kube_api_addr }#"
#% else %#
kube_api_addr: "#{ bootstrap_nodes.master[0].address }#"
#% endif %#
#% if bootstrap_kube_api_hostname | default('') %#
#% if bootstrap_kube_api_hostname|default('') %#
kube_api_hostname: "#{ bootstrap_kube_api_hostname }#"
#% endif %#
cluster_cidr: "#{ bootstrap_cluster_cidr.split(',')[0] }#"
service_cidr: "#{ bootstrap_service_cidr.split(',')[0] }#"
node_cidr: "#{ bootstrap_node_cidr }#"
#% if bootstrap_ipv6_enabled | default(false) %#
#% if bootstrap_ipv6_enabled|default(false) %#
cluster_cidr_v6: "#{ bootstrap_cluster_cidr.split(',')[1] }#"
service_cidr_v6: "#{ bootstrap_service_cidr.split(',')[1] }#"
#% endif %#
@@ -4,14 +4,14 @@
# https://github.com/PyratLabs/ansible-role-k3s
k3s_control_node: true
k3s_server:
#% if bootstrap_ipv6_enabled | default(false) %#
#% if bootstrap_ipv6_enabled|default(false) %#
node-ip: "{{ ansible_host }},{{ ansible_default_ipv6.address }}"
#% else %#
node-ip: "{{ ansible_host }}"
#% endif %#
tls-san:
- "{{ kube_api_addr }}"
#% if bootstrap_kube_api_hostname | default('') %#
#% if bootstrap_kube_api_hostname|default('') %#
- "{{ kube_api_hostname }}"
#% endif %#
docker: false
@@ -23,7 +23,7 @@ k3s_server:
write-kubeconfig-mode: "644"
pause-image: registry.k8s.io/pause:3.9
secrets-encryption: true
#% if bootstrap_ipv6_enabled | default(false) %#
#% if bootstrap_ipv6_enabled|default(false) %#
cluster-cidr: "{{ cluster_cidr }},{{ cluster_cidr_v6 }}"
service-cidr: "{{ service_cidr }},{{ service_cidr_v6 }}"
#% else %#
@@ -4,7 +4,7 @@
# https://github.com/PyratLabs/ansible-role-k3s
k3s_control_node: false
k3s_agent:
#% if bootstrap_ipv6_enabled | default(false) %#
#% if bootstrap_ipv6_enabled|default(false) %#
node-ip: "{{ ansible_host }},{{ ansible_default_ipv6.address }}"
#% else %#
node-ip: "{{ ansible_host }}"
@@ -1,4 +1,4 @@
#% if bootstrap_distribution == 'k3s' or bootstrap_distribution == 'k0s' %#
#% if bootstrap_distribution in ['k3s', 'k0s'] %#
---
kubernetes:
children:
@@ -9,7 +9,7 @@ kubernetes:
ansible_user: "#{ item.username }#"
ansible_host: "#{ item.address }#"
#% endfor %#
#% if bootstrap_nodes.worker | default([]) | length > 0 %#
#% if bootstrap_nodes.worker|default([]) | length > 0 %#
worker:
hosts:
#% for item in bootstrap_nodes.worker %#
@@ -41,7 +41,7 @@
kubeconfig: /etc/rancher/k3s/k3s.yaml
kind: "{{ item.kind }}"
name: "{{ item.name }}"
namespace: "{{ item.namespace | default('') }}"
namespace: "{{ item.namespace|default('') }}"
wait: true
wait_sleep: 10
wait_timeout: 360
@@ -16,7 +16,7 @@
block:
- name: Locale | Set timezone
community.general.timezone:
name: "{{ timezone | default('Etc/UTC') }}"
name: "{{ timezone|default('Etc/UTC') }}"
- name: Packages
block:
@@ -62,6 +62,7 @@
ff02::2 ip6-allrouters
dest: /etc/hosts
mode: preserve
#% if bootstrap_advanced_flags|default({}) and bootstrap_advanced_flags.update_resolv_conf|default(true) %#
# https://github.com/onedr0p/flux-cluster-template/discussions/635
- name: Network Configuration | Remove immutable flag from /etc/resolv.conf
ansible.builtin.file:
@@ -79,7 +80,8 @@
dest: /etc/resolv.conf
content: |
search .
nameserver #{ bootstrap_dns_server | default('1.1.1.1', true) }#
nameserver #{ bootstrap_dns_server|default('1.1.1.1', true) }#
#% endif %#
- name: System Configuration
notify: Reboot
@@ -1,4 +1,4 @@
#% if bootstrap_distribution == 'k3s' or bootstrap_distribution == 'k0s' %#
#% if bootstrap_distribution in ['k3s', 'k0s'] %#
---
- name: Reboot
hosts: kubernetes
@@ -1,4 +1,4 @@
#% if bootstrap_distribution == 'k3s' or bootstrap_distribution == 'k0s' %#
#% if bootstrap_distribution in ['k3s', 'k0s'] %#
---
# https://github.com/kevincoakley/ansible-role-k8s-rolling-update
- name: Cluster rollout update
@@ -1,4 +1,4 @@
#% if bootstrap_distribution == 'k3s' and (bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr | default('')) %#
#% if bootstrap_distribution == 'k3s' and (bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr|default('')) %#
---
apiVersion: v1
kind: Pod
@@ -1,4 +1,4 @@
#% if discord_template_notifier.enabled | default(false) %#
#% if discord_template_notifier|default({}) and discord_template_notifier.enabled|default(false) %#
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
@@ -1,4 +1,4 @@
#% if discord_template_notifier.enabled | default(false) %#
#% if discord_template_notifier|default({}) and discord_template_notifier.enabled|default(false) %#
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
@@ -1,4 +1,4 @@
#% if discord_template_notifier.enabled | default(false) %#
#% if discord_template_notifier|default({}) and discord_template_notifier.enabled|default(false) %#
---
apiVersion: v1
kind: Secret
@@ -1,4 +1,4 @@
#% if discord_template_notifier.enabled | default(false) %#
#% if discord_template_notifier|default({}) and discord_template_notifier.enabled|default(false) %#
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
@@ -1,4 +1,4 @@
#% if homepage.enabled | default(false) %#
#% if homepage|default({}) and homepage.enabled|default(false) %#
---
apiVersion: v1
kind: ConfigMap
@@ -1,4 +1,4 @@
#% if homepage.enabled | default(false) %#
#% if homepage|default({}) and homepage.enabled|default(false) %#
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
@@ -1,4 +1,4 @@
#% if homepage.enabled | default(false) %#
#% if homepage|default({}) and homepage.enabled|default(false) %#
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
@@ -1,4 +1,4 @@
#% if homepage.enabled | default(false) %#
#% if homepage|default({}) and homepage.enabled|default(false) %#
---
apiVersion: v1
kind: Secret
@@ -1,4 +1,4 @@
#% if homepage.enabled | default(false) %#
#% if homepage|default({}) and homepage.enabled|default(false) %#
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
@@ -3,9 +3,9 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./namespace.yaml
#% if homepage.enabled | default(false) %#
#% if homepage|default({}) and homepage.enabled|default(false) %#
- ./homepage/ks.yaml
#% endif %#
#% if discord_template_notifier.enabled | default(false) %#
#% if discord_template_notifier|default({}) and discord_template_notifier.enabled|default(false) %#
- ./discord-template-notifier/ks.yaml
#% endif %#
@@ -4,6 +4,6 @@ kind: Kustomization
resources:
- ./namespace.yaml
- ./addons/ks.yaml
#% if weave_gitops.enabled | default(false) %#
#% if weave_gitops|default({}) and weave_gitops.enabled|default(false) %#
- ./weave-gitops/ks.yaml
#% endif %#
@@ -1,4 +1,4 @@
#% if weave_gitops.enabled | default(false) %#
#% if weave_gitops|default({}) and weave_gitops.enabled|default(false) %#
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
@@ -31,7 +31,7 @@ spec:
ingress:
enabled: true
className: internal
#% if homepage.enabled | default(false) %#
#% if homepage|default({}) and homepage.enabled|default(false) %#
annotations:
gethomepage.dev/enabled: "true"
gethomepage.dev/group: Home
@@ -1,4 +1,4 @@
#% if weave_gitops.enabled | default(false) %#
#% if weave_gitops|default({}) and weave_gitops.enabled|default(false) %#
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
@@ -1,4 +1,4 @@
#% if weave_gitops.enabled | default(false) %#
#% if weave_gitops|default({}) and weave_gitops.enabled|default(false) %#
---
apiVersion: v1
kind: Secret
@@ -1,4 +1,4 @@
#% if weave_gitops.enabled | default(false) %#
#% if weave_gitops|default({}) and weave_gitops.enabled|default(false) %#
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
@@ -2,7 +2,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
#% if not bootstrap_ipv6_enabled | default(false) %#
#% if not bootstrap_ipv6_enabled|default(false) %#
- ./cilium-l2.yaml
#% endif %#
- ./helmrelease.yaml
@@ -8,6 +8,6 @@ resources:
- ./kubelet-csr-approver/ks.yaml
#% endif %#
- ./metrics-server/ks.yaml
#% if (bootstrap_distribution == "k0s" or bootstrap_distribution == "talos") and spegel.enabled | default(false) %#
#% if bootstrap_distribution in ['k0s', 'talos'] and spegel|default({}) and spegel.enabled|default(false) %#
- ./spegel/ks.yaml
#% endif %#
@@ -1,4 +1,4 @@
#% if (bootstrap_distribution == "k0s" or bootstrap_distribution == "talos") and spegel.enabled | default(false) %#
#% if bootstrap_distribution in ['k0s', 'talos'] and spegel|default({}) and spegel.enabled|default(false) %#
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
@@ -1,4 +1,4 @@
#% if (bootstrap_distribution == "k0s" or bootstrap_distribution == "talos") and spegel.enabled | default(false) %#
#% if bootstrap_distribution in ['k0s', 'talos'] and spegel|default({}) and spegel.enabled|default(false) %#
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
@@ -1,4 +1,4 @@
#% if (bootstrap_distribution == "k0s" or bootstrap_distribution == "talos") and spegel.enabled | default(false) %#
#% if bootstrap_distribution in ['k0s', 'talos'] and spegel|default({}) and spegel.enabled|default(false) %#
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
@@ -1,4 +1,4 @@
#% if longhorn.enabled | default(false) %#
#% if bootstrap_distribution in ['k0s', 'k3s'] and longhorn|default({}) and longhorn.enabled|default(false) %#
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
@@ -1,4 +1,4 @@
#% if longhorn.enabled | default(false) %#
#% if bootstrap_distribution in ['k0s', 'k3s'] and longhorn|default({}) and longhorn.enabled|default(false) %#
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
@@ -1,4 +1,4 @@
#% if longhorn.enabled | default(false) %#
#% if bootstrap_distribution in ['k0s', 'k3s'] and longhorn|default({}) and longhorn.enabled|default(false) %#
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
@@ -1,4 +1,4 @@
#% if longhorn.enabled | default(false) %#
#% if bootstrap_distribution in ['k0s', 'k3s'] and longhorn|default({}) and longhorn.enabled|default(false) %#
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
@@ -1,4 +1,4 @@
#% if longhorn.enabled | default(false) %#
#% if bootstrap_distribution in ['k0s', 'k3s'] and longhorn|default({}) and longhorn.enabled|default(false) %#
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
@@ -1,4 +1,4 @@
#% if longhorn.enabled | default(false) %#
#% if bootstrap_distribution in ['k0s', 'k3s'] and longhorn|default({}) and longhorn.enabled|default(false) %#
---
apiVersion: v1
kind: Namespace
@@ -70,7 +70,7 @@ spec:
className: external
annotations:
external-dns.alpha.kubernetes.io/target: "external.${SECRET_DOMAIN}"
#% if homepage.enabled | default(false) %#
#% if homepage|default({}) and homepage.enabled|default(false) %#
gethomepage.dev/enabled: "true"
gethomepage.dev/group: Network
gethomepage.dev/name: Echo Server
@@ -3,6 +3,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./staging.yaml
#% if bootstrap_acme_production_enabled | default(false) %#
#% if bootstrap_acme_production_enabled|default(false) %#
- ./production.yaml
#% endif %#
@@ -70,7 +70,7 @@ spec:
namespaceSelector:
any: true
extraArgs:
#% if bootstrap_acme_production_enabled | default(false) %#
#% if bootstrap_acme_production_enabled|default(false) %#
default-ssl-certificate: "network/${SECRET_DOMAIN/./-}-production-tls"
#% else %#
default-ssl-certificate: "network/${SECRET_DOMAIN/./-}-staging-tls"
@@ -68,7 +68,7 @@ spec:
namespaceSelector:
any: true
extraArgs:
#% if bootstrap_acme_production_enabled | default(false) %#
#% if bootstrap_acme_production_enabled|default(false) %#
default-ssl-certificate: "network/${SECRET_DOMAIN/./-}-production-tls"
#% else %#
default-ssl-certificate: "network/${SECRET_DOMAIN/./-}-staging-tls"
@@ -1,4 +1,4 @@
#% if grafana.enabled | default(false) %#
#% if grafana|default({}) and grafana.enabled|default(false) %#
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
@@ -159,7 +159,7 @@ spec:
ingress:
enabled: true
ingressClassName: internal
#% if homepage.enabled | default(false) %#
#% if homepage|default({}) and homepage.enabled|default(false) %#
annotations:
gethomepage.dev/enabled: "true"
gethomepage.dev/icon: grafana.png
@@ -1,4 +1,4 @@
#% if grafana.enabled | default(false) %#
#% if grafana|default({}) and grafana.enabled|default(false) %#
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
@@ -1,4 +1,4 @@
#% if grafana.enabled | default(false) %#
#% if grafana|default({}) and grafana.enabled|default(false) %#
---
apiVersion: v1
kind: Secret
@@ -1,4 +1,4 @@
#% if grafana.enabled | default(false) %#
#% if grafana|default({}) and grafana.enabled|default(false) %#
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
@@ -1,4 +1,4 @@
#% if kube_prometheus_stack.enabled | default(false) %#
#% if kube_prometheus_stack|default({}) and kube_prometheus_stack.enabled|default(false) %#
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
@@ -121,7 +121,7 @@ spec:
ingress:
enabled: true
ingressClassName: internal
#% if homepage.enabled | default(false) %#
#% if homepage|default({}) and homepage.enabled|default(false) %#
annotations:
gethomepage.dev/enabled: "true"
gethomepage.dev/icon: prometheus.png
@@ -1,4 +1,4 @@
#% if kube_prometheus_stack.enabled | default(false) %#
#% if kube_prometheus_stack|default({}) and kube_prometheus_stack.enabled|default(false) %#
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
@@ -1,4 +1,4 @@
#% if kube_prometheus_stack.enabled | default(false) %#
#% if kube_prometheus_stack|default({}) and kube_prometheus_stack.enabled|default(false) %#
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
@@ -1,4 +1,4 @@
#% if kubernetes_dashboard.enabled | default(false) %#
#% if kubernetes_dashboard|default({}) and kubernetes_dashboard.enabled|default(false) %#
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
@@ -31,7 +31,7 @@ spec:
ingress:
enabled: true
className: internal
#% if homepage.enabled | default(false) %#
#% if homepage|default({}) and homepage.enabled|default(false) %#
annotations:
gethomepage.dev/enabled: "true"
gethomepage.dev/icon: kubernetes-dashboard.png
@@ -1,4 +1,4 @@
#% if kubernetes_dashboard.enabled | default(false) %#
#% if kubernetes_dashboard|default({}) and kubernetes_dashboard.enabled|default(false) %#
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
@@ -1,4 +1,4 @@
#% if kubernetes_dashboard.enabled | default(false) %#
#% if kubernetes_dashboard|default({}) and kubernetes_dashboard.enabled|default(false) %#
# For dashboard sign in token:
# kubectl -n observability get secret kubernetes-dashboard -o jsonpath='{.data.token}' | base64 -d
---
@@ -1,4 +1,4 @@
#% if kubernetes_dashboard.enabled | default(false) %#
#% if kubernetes_dashboard|default({}) and kubernetes_dashboard.enabled|default(false) %#
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
@@ -3,12 +3,12 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./namespace.yaml
#% if grafana.enabled | default(false) %#
#% if grafana|default({}) and grafana.enabled|default(false) %#
- ./grafana/ks.yaml
#% endif %#
#% if kube_prometheus_stack.enabled | default(false) %#
#% if kube_prometheus_stack|default({}) and kube_prometheus_stack.enabled|default(false) %#
- ./kube-prometheus-stack/ks.yaml
#% endif %#
#% if kubernetes_dashboard.enabled | default(false) %#
#% if kubernetes_dashboard|default({}) and kubernetes_dashboard.enabled|default(false) %#
- ./kubernetes-dashboard/ks.yaml
#% endif %#
@@ -1,4 +1,4 @@
#% if csi_driver_nfs.enabled | default(false) %#
#% if csi_driver_nfs|default({}) and csi_driver_nfs.enabled|default(false) %#
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
@@ -1,4 +1,4 @@
#% if csi_driver_nfs.enabled | default(false) %#
#% if csi_driver_nfs|default({}) and csi_driver_nfs.enabled|default(false) %#
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
@@ -1,4 +1,4 @@
#% if csi_driver_nfs.enabled | default(false) %#
#% if csi_driver_nfs|default({}) and csi_driver_nfs.enabled|default(false) %#
#% for item in csi_driver_nfs.storage_class %#
---
apiVersion: storage.k8s.io/v1
@@ -1,4 +1,4 @@
#% if csi_driver_nfs.enabled | default(false) %#
#% if csi_driver_nfs|default({}) and csi_driver_nfs.enabled|default(false) %#
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
@@ -4,9 +4,9 @@ kind: Kustomization
resources:
- ./namespace.yaml
- ./openebs/ks.yaml
#% if volsync.enabled | default(false) %#
#% if volsync|default({}) and volsync.enabled|default(false) %#
- ./volsync/ks.yaml
#% endif %#
#% if csi_driver_nfs.enabled | default(false) %#
#% if csi_driver_nfs|default({}) and csi_driver_nfs.enabled|default(false) %#
- ./csi-driver-nfs/ks.yaml
#% endif %#
@@ -1,4 +1,4 @@
#% if volsync.enabled | default(false) %#
#% if volsync|default({}) and volsync.enabled|default(false) %#
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
@@ -1,4 +1,4 @@
#% if volsync.enabled | default(false) %#
#% if volsync|default({}) and volsync.enabled|default(false) %#
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
@@ -1,4 +1,4 @@
#% if volsync.enabled | default(false) %#
#% if volsync|default({}) and volsync.enabled|default(false) %#
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
@@ -1,4 +1,4 @@
#% if volsync.enabled | default(false) %#
#% if volsync|default({}) and volsync.enabled|default(false) %#
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
@@ -10,7 +10,7 @@ spec:
commonMetadata:
labels:
app.kubernetes.io/name: *app
#% if longhorn.enabled | default(false) %#
#% if longhorn|default({}) and longhorn.enabled|default(false) %#
dependsOn:
- name: longhorn
#% endif %#
@@ -1,4 +1,4 @@
#% if volsync.enabled | default(false) %#
#% if volsync|default({}) and volsync.enabled|default(false) %#
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
@@ -27,7 +27,7 @@ spec:
keepHistory: false
values:
controller:
#% if longhorn.enabled | default(false) %#
#% if bootstrap_distribution in ['k0s', 'k3s'] and longhorn|default({}) and longhorn.enabled|default(false) %#
volumeSnapshotClasses:
- name: longhorn-snapclass
annotations:
@@ -1,4 +1,4 @@
#% if volsync.enabled | default(false) %#
#% if volsync|default({}) and volsync.enabled|default(false) %#
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
@@ -5,6 +5,6 @@ resources:
- ./namespace.yaml
- ./descheduler/ks.yaml
- ./reloader/ks.yaml
#% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %#
#% if bootstrap_distribution == "k3s" and system_upgrade_controller|default({}) and system_upgrade_controller.enabled|default(false) %#
- ./system-upgrade-controller/ks.yaml
#% endif %#
@@ -1,4 +1,4 @@
#% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %#
#% if bootstrap_distribution == "k3s" and system_upgrade_controller|default({}) and system_upgrade_controller.enabled|default(false) %#
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
@@ -1,4 +1,4 @@
#% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %#
#% if bootstrap_distribution == "k3s" and system_upgrade_controller|default({}) and system_upgrade_controller.enabled|default(false) %#
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
@@ -1,4 +1,4 @@
#% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %#
#% if bootstrap_distribution == "k3s" and system_upgrade_controller|default({}) and system_upgrade_controller.enabled|default(false) %#
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
@@ -1,4 +1,4 @@
#% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %#
#% if bootstrap_distribution == "k3s" and system_upgrade_controller|default({}) and system_upgrade_controller.enabled|default(false) %#
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
@@ -1,4 +1,4 @@
#% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %#
#% if bootstrap_distribution == "k3s" and system_upgrade_controller|default({}) and system_upgrade_controller.enabled|default(false) %#
---
apiVersion: upgrade.cattle.io/v1
kind: Plan
@@ -1,4 +1,4 @@
#% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %#
#% if bootstrap_distribution == "k3s" and system_upgrade_controller|default({}) and system_upgrade_controller.enabled|default(false) %#
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
@@ -1,4 +1,4 @@
#% if bootstrap_distribution == "k3s" and system_upgrade_controller.enabled | default(false) %#
#% if bootstrap_distribution == "k3s" and system_upgrade_controller|default({}) and system_upgrade_controller.enabled|default(false) %#
---
apiVersion: upgrade.cattle.io/v1
kind: Plan
@@ -7,8 +7,8 @@ metadata:
spec:
interval: 30m
ref:
branch: "#{ bootstrap_github_repository_branch | default('main', true) }#"
#% if bootstrap_private_github_repo | default(false) %#
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 }#"
@@ -7,7 +7,7 @@ metadata:
data:
TIMEZONE: "#{ bootstrap_timezone }#"
COREDNS_ADDR: "#{ bootstrap_service_cidr.split(',')[0] | nthhost(10) }#"
#% if bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr | default('') %#
#% if bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr|default('') %#
KUBE_API_ADDR: "#{ bootstrap_kube_api_addr }#"
#% else %#
KUBE_API_ADDR: "#{ bootstrap_nodes.master[0].address }#"
@@ -15,7 +15,7 @@ data:
CLUSTER_CIDR: "#{ bootstrap_cluster_cidr.split(',')[0] }#"
SERVICE_CIDR: "#{ bootstrap_service_cidr.split(',')[0] }#"
NODE_CIDR: "#{ bootstrap_node_cidr }#"
#% if bootstrap_ipv6_enabled | default(false) %#
#% if bootstrap_ipv6_enabled|default(false) %#
CLUSTER_CIDR_V6: "#{ bootstrap_cluster_cidr.split(',')[1] }#"
SERVICE_CIDR_V6: "#{ bootstrap_service_cidr.split(',')[1] }#"
#% endif %#
@@ -37,7 +37,7 @@ spec:
before:
- sudo bash /home/#{ item.username }#/k0s/hooks/apply-system.sh
- sudo mv /home/#{ item.username }#/k0s/containerd/unprivileged-ports.toml /etc/k0s/containerd.d/unprivileged-ports.toml
#% if spegel.enabled | default(false) %#
#% if spegel|default({}) and spegel.enabled|default(false) %#
- sudo mv /home/#{ item.username }#/k0s/containerd/spegel.toml /etc/k0s/containerd.d/spegel.toml
#% endif %#
reset:
@@ -49,7 +49,7 @@ spec:
hooks: *hooks
#% endif %#
#% endfor %#
#% if bootstrap_nodes.worker | default([]) | length > 0 %#
#% if bootstrap_nodes.worker|default([]) | length > 0 %#
#% for item in bootstrap_nodes.worker %#
- role: worker
ssh:
@@ -82,14 +82,14 @@ spec:
api:
sans:
- "#{ bootstrap_kube_api_addr }#"
#% if bootstrap_kube_api_hostname | default('') %#
#% if bootstrap_kube_api_hostname|default('') %#
- "#{ bootstrap_kube_api_hostname }#"
#% endif %#
#% for item in bootstrap_nodes.master %#
#% if item.address != bootstrap_kube_api_addr %#
- "#{ item.address }#"
#% endif %#
#% if (not bootstrap_kube_api_hostname | default('')) or (item.name != bootstrap_kube_api_hostname | default('')) %#
#% if (not bootstrap_kube_api_hostname|default('')) or (item.name != bootstrap_kube_api_hostname|default('')) %#
- "#{ item.name }#"
#% endif %#
#% endfor %#
@@ -1,4 +1,4 @@
#% if bootstrap_distribution == 'k0s' and spegel.enabled | default(false) %#
#% if bootstrap_distribution == 'k0s' and spegel|default({}) and spegel.enabled|default(false) %#
[plugins."io.containerd.grpc.v1.cri".registry]
config_path = "/var/lib/k0s/containerd/certs.d"
[plugins."io.containerd.grpc.v1.cri".containerd]
@@ -16,14 +16,16 @@ apt-get install -y --no-install-recommends \
nvme-cli open-iscsi parted psmisc python3 python3-apt python3-kubernetes python3-yaml \
smartmontools socat software-properties-common unzip util-linux
#% if bootstrap_advanced_flags|default({}) and bootstrap_advanced_flags.update_resolv_conf|default(true) %#
# Update DNS
chattr -i /etc/resolv.conf
rm -f /etc/resolv.conf
cat <<EOF > /etc/resolv.conf
search .
nameserver #{ bootstrap_dns_server | default('1.1.1.1', true) }#
nameserver #{ bootstrap_dns_server|default('1.1.1.1', true) }#
EOF
chattr +i /etc/resolv.conf
#% endif %#
# Kernel Modules
for module in br_netfilter ceph ip_vs ip_vs_rr nbd overlay rbd; do
@@ -8,7 +8,7 @@ kubernetesVersion: 1.29.1
clusterName: &cluster home-kubernetes
#% if bootstrap_kube_api_hostname | default('') %#
#% if bootstrap_kube_api_hostname|default('') %#
endpoint: https://#{ bootstrap_kube_api_hostname }#:6443
#% else %#
endpoint: https://#{ bootstrap_kube_api_addr }#:6443
@@ -22,7 +22,7 @@ clusterSvcNets:
additionalApiServerCertSans: &sans
- "#{ bootstrap_kube_api_addr }#"
- 127.0.0.1 #KubePrism
#% if bootstrap_kube_api_hostname | default('') %#
#% if bootstrap_kube_api_hostname|default('') %#
- "#{ bootstrap_kube_api_hostname }#"
#% endif %#
@@ -48,7 +48,7 @@ nodes:
vip:
ip: "#{ bootstrap_kube_api_addr }#"
#% endfor %#
#% if bootstrap_nodes.worker | default([]) | length > 0 %#
#% if bootstrap_nodes.worker|default([]) | length > 0 %#
#% for item in bootstrap_nodes.worker %#
- hostname: "#{ item.name }#"
ipAddress: "#{ item.address }#"
@@ -77,7 +77,7 @@ controlPlane:
[plugins."io.containerd.grpc.v1.cri"]
enable_unprivileged_ports = true
enable_unprivileged_icmp = true
#% if spegel.enabled | default(false) %#
#% if spegel|default({}) and spegel.enabled|default(false) %#
[plugins."io.containerd.grpc.v1.cri".containerd]
discard_unpacked_layers = false
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
@@ -123,7 +123,7 @@ controlPlane:
machine:
network:
nameservers:
- "#{ bootstrap_dns_server | default('1.1.1.1', true) }#"
- "#{ bootstrap_dns_server|default('1.1.1.1', true) }#"
# Configure NTP
- &ntpPatch |-
@@ -44,7 +44,7 @@ hubble:
ingress:
enabled: true
className: internal
#% if homepage.enabled | default(false) %#
#% if homepage|default({}) and homepage.enabled|default(false) %#
annotations:
gethomepage.dev/enabled: "true"
gethomepage.dev/group: Network
@@ -59,7 +59,7 @@ hubble:
ipam:
mode: kubernetes
ipv4NativeRoutingCIDR: "${CLUSTER_CIDR}"
#% if bootstrap_ipv6_enabled | default(false) %#
#% if bootstrap_ipv6_enabled|default(false) %#
ipv6NativeRoutingCIDR: "${CLUSTER_CIDR_V6}"
ipv6:
enabled: true
@@ -77,7 +77,7 @@ k8sServicePort: 7445
kubeProxyReplacement: true
kubeProxyReplacementHealthzBindAddr: 0.0.0.0:10256
l2announcements:
#% if bootstrap_ipv6_enabled | default(false) %#
#% if bootstrap_ipv6_enabled|default(false) %#
enabled: false
#% else %#
enabled: true
@@ -88,7 +88,7 @@ l2announcements:
#% endif %#
loadBalancer:
algorithm: maglev
mode: "#{ bootstrap_cilium_loadbalancer_mode | default('dsr', true) }#"
mode: "#{ bootstrap_cilium_loadbalancer_mode|default('dsr', true) }#"
localRedirectPolicy: true
operator:
replicas: 1
@@ -20,7 +20,7 @@ hubble:
ipam:
mode: kubernetes
ipv4NativeRoutingCIDR: "#{ bootstrap_cluster_cidr }#"
#% if bootstrap_ipv6_enabled | default(false) %#
#% if bootstrap_ipv6_enabled|default(false) %#
ipv6NativeRoutingCIDR: "#{ bootstrap_cluster_cidr_v6 }#"
ipv6:
enabled: true
@@ -38,7 +38,7 @@ k8sServicePort: 7445
kubeProxyReplacement: true
kubeProxyReplacementHealthzBindAddr: 0.0.0.0:10256
l2announcements:
#% if bootstrap_ipv6_enabled | default(false) %#
#% if bootstrap_ipv6_enabled|default(false) %#
enabled: false
#% else %#
enabled: true
@@ -49,7 +49,7 @@ l2announcements:
#% endif %#
loadBalancer:
algorithm: maglev
mode: "#{ bootstrap_cilium_loadbalancer_mode | default('dsr', true) }#"
mode: "#{ bootstrap_cilium_loadbalancer_mode|default('dsr', true) }#"
localRedirectPolicy: true
operator:
replicas: 1
@@ -1,2 +1,2 @@
providerRegex: ^(#{ (bootstrap_nodes.master + bootstrap_nodes.worker | default([])) | map(attribute='name') | join('|') }#)$
providerRegex: ^(#{ (bootstrap_nodes.master + bootstrap_nodes.worker|default([])) | map(attribute='name') | join('|') }#)$
bypassDnsResolution: true