Files
home-cluster/bootstrap/templates/k0s-config.yaml.j2
T
Devin Buhl b41ccc8145 fix: add tls sans options for k3s too (#1170)
* fix: add tls sans options for k3s too

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

* chore: update comment

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

---------

Signed-off-by: Devin Buhl <devin@buhl.casa>
2024-01-16 10:52:48 -05:00

132 lines
4.7 KiB
YAML

#% if bootstrap_distribution == 'k0s' %#
---
apiVersion: k0sctl.k0sproject.io/v1beta1
kind: Cluster
metadata:
name: k0s-cluster
spec:
hosts:
#% for item in bootstrap_nodes.master %#
- role: "#{ item.role | default('controller+worker') }#"
ssh:
address: "#{ item.address }#"
user: "#{ item.username }#"
installFlags:
- --disable-components=metrics-server
#% if item.role | default('') == 'controller+worker' %#
- --no-taints
#% endif %#
#% endfor %#
#% if bootstrap_nodes.worker | default([]) | length > 0 %#
#% for item in bootstrap_nodes.worker %#
- role: worker
ssh:
address: "#{ item.address }#"
user: "#{ item.username }#"
#% endfor %#
#% endif %#
k0s:
# renovate: datasource=github-releases depName=k0sproject/k0s
version: "v1.28.5+k0s.0"
dynamicConfig: false
config:
spec:
telemetry:
enabled: false
controllerManager:
extraArgs:
# Required to monitor kube-controller-manager with kube-prometheus-stack
bind-address: "0.0.0.0"
scheduler:
extraArgs:
# Required to monitor kube-scheduler with kube-prometheus-stack
bind-address: "0.0.0.0"
api:
sans:
- "#{ bootstrap_kube_api_addr }#"
#% 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('')) %#
- "#{ item.name }#"
#% endif %#
#% endfor %#
extensions:
helm:
repositories:
- name: cilium
url: https://helm.cilium.io
charts:
- name: cilium
chartname: cilium/cilium
# renovate: datasource=github-releases depName=cilium/cilium
version: "1.14.5"
namespace: kube-system
values: |2
autoDirectNodeRoutes: true
bpf:
masquerade: true
bgp:
enabled: false
cluster:
name: home-cluster
id: 1
containerRuntime:
integration: containerd
socketPath: /var/run/k0s/containerd.sock
endpointRoutes:
enabled: true
hubble:
enabled: false
ipam:
mode: kubernetes
ipv4NativeRoutingCIDR: "#{ bootstrap_cluster_cidr }#"
#% if bootstrap_ipv6_enabled | default(false) %#
ipv6NativeRoutingCIDR: "#{ bootstrap_cluster_cidr_v6 }#"
ipv6:
enabled: true
#% endif %#
#% if bootstrap_nodes.master | length > 1 or bootstrap_kube_api_addr | default('') %#
k8sServiceHost: "#{ bootstrap_kube_api_addr }#"
#% else %#
k8sServiceHost: "#{ bootstrap_nodes.master[0].address }#"
#% endif %#
k8sServicePort: 6443
kubeProxyReplacement: true
kubeProxyReplacementHealthzBindAddr: 0.0.0.0:10256
l2announcements:
#% if bootstrap_ipv6_enabled | default(false) %#
enabled: false
#% else %#
enabled: true
# https://github.com/cilium/cilium/issues/26586
leaseDuration: 120s
leaseRenewDeadline: 60s
leaseRetryPeriod: 1s
#% endif %#
loadBalancer:
algorithm: maglev
mode: "#{ bootstrap_cilium_loadbalancer_mode | default('dsr', true) }#"
localRedirectPolicy: true
operator:
replicas: 1
rollOutPods: true
rollOutCiliumPods: true
routingMode: native
securityContext:
privileged: true
network:
kubeProxy:
disabled: true
#% if bootstrap_nodes.master | length > 1 %#
nodeLocalLoadBalancing:
enabled: true
type: EnvoyProxy
#% endif %#
provider: custom
#% endif %#