feat: add partial support, change k0s config filename, always use NLLB for k0s (#1180)

* feat: add partial support, change k0s config filename, always use NLLB for k0s

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

* chore: update wording

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-18 08:38:03 -05:00
1 parent 13a005d23d
commit d46e7f9663
9 files changed
+189 -220

No files matched your search

+2 -2
View File
@@ -6,13 +6,13 @@ env:
DISABLE_UPGRADE_CHECK: "true" DISABLE_UPGRADE_CHECK: "true"
vars: vars:
K0S_CONFIG_FILE: "{{.KUBERNETES_DIR}}/k0s/k0s-config.yaml" K0S_CONFIG_FILE: "{{.KUBERNETES_DIR}}/k0s/k0sctl.yaml"
tasks: tasks:
apply: apply:
desc: Apply k0s cluster config desc: Apply k0s cluster config
dir: "{{.KUBERNETES_DIR}}/k0s" # Needed for uploading files in k0s-config.yaml dir: "{{.KUBERNETES_DIR}}/k0s" # Needed for uploading files in k0sctl.yaml
cmds: cmds:
- k0sctl apply --config {{.K0S_CONFIG_FILE}} - k0sctl apply --config {{.K0S_CONFIG_FILE}}
- task: kubeconfig - task: kubeconfig
+1 -1
View File
@@ -77,7 +77,7 @@ tasks:
.template: .template:
internal: true internal: true
cmds: cmds:
- ./.venv/bin/makejinja --keep-trailing-newline --force - ./.venv/bin/makejinja
- task: sops:encrypt - task: sops:encrypt
preconditions: preconditions:
- { msg: "Missing Makejinja config file", sh: "test -f {{.MAKEJINJA_CONFIG_FILE}}" } - { msg: "Missing Makejinja config file", sh: "test -f {{.MAKEJINJA_CONFIG_FILE}}" }
@@ -14,52 +14,7 @@ spec:
targetNamespace: kube-system targetNamespace: kube-system
bootstrap: true bootstrap: true
valuesContent: |- valuesContent: |-
autoDirectNodeRoutes: true #% filter indent(width=4, first=True) %#
bpf: #% include 'partials/cilium-values-init.yaml.partial' %#
masquerade: true #% endfilter %#
bgp:
enabled: false
cluster:
name: home-cluster
id: 1
containerRuntime:
integration: containerd
socketPath: /var/run/k3s/containerd/containerd.sock
endpointRoutes:
enabled: true
hubble:
enabled: false
ipam:
mode: kubernetes
ipv4NativeRoutingCIDR: "{{ cluster_cidr }}"
#% if bootstrap_ipv6_enabled | default(false) %#
ipv6NativeRoutingCIDR: "{{ cluster_cidr_v6 }}"
ipv6:
enabled: true
#% endif %#
k8sServiceHost: 127.0.0.1
k8sServicePort: 6444
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
#% endif %# #% endif %#
@@ -24,116 +24,6 @@ spec:
uninstall: uninstall:
keepHistory: false keepHistory: false
values: values:
autoDirectNodeRoutes: true #% filter indent(width=4, first=True) %#
bpf: #% include 'partials/cilium-values-full.yaml.partial' %#
masquerade: true #% endfilter %#
bgp:
enabled: false
cluster:
name: home-cluster
id: 1
containerRuntime:
integration: containerd
#% if bootstrap_distribution == "k3s" %#
socketPath: /var/run/k3s/containerd/containerd.sock
#% elif bootstrap_distribution == "k0s" %#
socketPath: /var/run/k0s/containerd.sock
#% endif %#
endpointRoutes:
enabled: true
hubble:
enabled: true
metrics:
enabled:
- dns:query
- drop
- tcp
- flow
- port-distribution
- icmp
- http
serviceMonitor:
enabled: true
dashboards:
enabled: true
annotations:
grafana_folder: Cilium
relay:
enabled: true
rollOutPods: true
prometheus:
serviceMonitor:
enabled: true
ui:
enabled: true
rollOutPods: true
ingress:
enabled: true
className: internal
#% if homepage.enabled | default(false) %#
annotations:
gethomepage.dev/enabled: "true"
gethomepage.dev/group: Network
gethomepage.dev/name: Cilium
gethomepage.dev/icon: cilium.png
#% endif %#
hosts:
- "hubble.${SECRET_DOMAIN}"
tls:
- hosts:
- "hubble.${SECRET_DOMAIN}"
ipam:
mode: kubernetes
ipv4NativeRoutingCIDR: "${CLUSTER_CIDR}"
#% if bootstrap_ipv6_enabled | default(false) %#
ipv6NativeRoutingCIDR: "${CLUSTER_CIDR_V6}"
ipv6:
enabled: true
#% endif %#
#% if bootstrap_distribution == "k3s" %#
k8sServiceHost: 127.0.0.1
k8sServicePort: 6444
#% else %#
k8sServiceHost: "${KUBE_API_ADDR}"
k8sServicePort: 6443
#% endif %#
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
prometheus:
enabled: true
serviceMonitor:
enabled: true
dashboards:
enabled: true
annotations:
grafana_folder: Cilium
prometheus:
enabled: true
serviceMonitor:
enabled: true
trustCRDsExist: true
dashboards:
enabled: true
annotations:
grafana_folder: Cilium
rollOutCiliumPods: true
routingMode: native
securityContext:
privileged: true
@@ -86,14 +86,12 @@ spec:
#% endif %# #% endif %#
#% endfor %# #% endfor %#
network: network:
provider: custom
kubeProxy: kubeProxy:
disabled: true disabled: true
#% if bootstrap_nodes.master | length > 1 %#
nodeLocalLoadBalancing: nodeLocalLoadBalancing:
enabled: true enabled: true
type: EnvoyProxy type: EnvoyProxy
#% endif %#
provider: custom
extensions: extensions:
helm: helm:
repositories: repositories:
@@ -106,56 +104,7 @@ spec:
version: "1.14.5" version: "1.14.5"
namespace: kube-system namespace: kube-system
values: |2 values: |2
autoDirectNodeRoutes: true #% filter indent(width=18, first=True) %#
bpf: #% include 'partials/cilium-values-init.yaml.partial' %#
masquerade: true #% endfilter %#
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
#% endif %# #% endif %#
@@ -0,0 +1,113 @@
autoDirectNodeRoutes: true
bpf:
masquerade: true
bgp:
enabled: false
cluster:
name: home-cluster
id: 1
containerRuntime:
integration: containerd
#% if bootstrap_distribution == "k3s" %#
socketPath: /var/run/k3s/containerd/containerd.sock
#% elif bootstrap_distribution == "k0s" %#
socketPath: /var/run/k0s/containerd.sock
#% endif %#
endpointRoutes:
enabled: true
hubble:
enabled: true
metrics:
enabled:
- dns:query
- drop
- tcp
- flow
- port-distribution
- icmp
- http
serviceMonitor:
enabled: true
dashboards:
enabled: true
annotations:
grafana_folder: Cilium
relay:
enabled: true
rollOutPods: true
prometheus:
serviceMonitor:
enabled: true
ui:
enabled: true
rollOutPods: true
ingress:
enabled: true
className: internal
#% if homepage.enabled | default(false) %#
annotations:
gethomepage.dev/enabled: "true"
gethomepage.dev/group: Network
gethomepage.dev/name: Cilium
gethomepage.dev/icon: cilium.png
#% endif %#
hosts:
- "hubble.${SECRET_DOMAIN}"
tls:
- hosts:
- "hubble.${SECRET_DOMAIN}"
ipam:
mode: kubernetes
ipv4NativeRoutingCIDR: "${CLUSTER_CIDR}"
#% if bootstrap_ipv6_enabled | default(false) %#
ipv6NativeRoutingCIDR: "${CLUSTER_CIDR_V6}"
ipv6:
enabled: true
#% endif %#
#% if bootstrap_distribution == "k3s" %#
k8sServiceHost: 127.0.0.1
k8sServicePort: 6444
#% elif bootstrap_distribution == "k0s" %#
k8sServiceHost: localhost
k8sServicePort: 7443
#% endif %#
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
prometheus:
enabled: true
serviceMonitor:
enabled: true
dashboards:
enabled: true
annotations:
grafana_folder: Cilium
prometheus:
enabled: true
serviceMonitor:
enabled: true
trustCRDsExist: true
dashboards:
enabled: true
annotations:
grafana_folder: Cilium
rollOutCiliumPods: true
routingMode: native
securityContext:
privileged: true
@@ -0,0 +1,57 @@
autoDirectNodeRoutes: true
bpf:
masquerade: true
bgp:
enabled: false
cluster:
name: home-cluster
id: 1
containerRuntime:
integration: containerd
#% if bootstrap_distribution == "k3s" %#
socketPath: /var/run/k3s/containerd/containerd.sock
#% elif bootstrap_distribution == "k0s" %#
socketPath: /var/run/k0s/containerd.sock
#% endif %#
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_distribution == "k3s" %#
k8sServiceHost: 127.0.0.1
k8sServicePort: 6444
#% elif bootstrap_distribution == "k0s" %#
k8sServiceHost: localhost
k8sServicePort: 7443
#% endif %#
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
+1 -1
View File
@@ -46,7 +46,7 @@ bootstrap_node_cidr:
# and keepalived in k0s and use the master node IP instead # and keepalived in k0s and use the master node IP instead
bootstrap_kube_api_addr: bootstrap_kube_api_addr:
# (Optional) The hostname of the Kube API, set this if you intend to call the Kube API by # (Optional) The hostname of the Kube API, set this if you intend to call the Kube API by
# hostname rather than IP. Hostname is added to the Kube API cert sans # hostname rather than IP. If the hostname is set it is added to the Kube API cert sans
bootstrap_kube_api_hostname: bootstrap_kube_api_hostname:
# The Load balancer IP for k8s_gateway, choose an available IP in your nodes network that is not being used # The Load balancer IP for k8s_gateway, choose an available IP in your nodes network that is not being used
bootstrap_k8s_gateway_addr: bootstrap_k8s_gateway_addr:
+5
View File
@@ -1,10 +1,12 @@
[makejinja] [makejinja]
inputs = ["./bootstrap/templates"] inputs = ["./bootstrap/templates"]
output = "./" output = "./"
exclude_patterns = ["*.partial"]
data = ["./bootstrap/vars/addons.yaml", "./bootstrap/vars/config.yaml"] data = ["./bootstrap/vars/addons.yaml", "./bootstrap/vars/config.yaml"]
import_paths = ["./bootstrap/scripts"] import_paths = ["./bootstrap/scripts"]
loaders = ["loader:Loader"] loaders = ["loader:Loader"]
jinja_suffix = ".j2" jinja_suffix = ".j2"
force = true
# Block and comment delimiters are changed to avoid conflicts with Renovate # Block and comment delimiters are changed to avoid conflicts with Renovate
# Variable delimiters are changed to avoid conflicts with Renovate and Go templates # Variable delimiters are changed to avoid conflicts with Renovate and Go templates
@@ -16,3 +18,6 @@ comment_start = "#|"
comment_end = "|#" comment_end = "|#"
variable_start = "#{" variable_start = "#{"
variable_end = "}#" variable_end = "}#"
[makejinja.whitespace]
keep_trailing_newline = true