From 37f2f1e137e5ae4a8fcb31c7608e8f2d4aedd740 Mon Sep 17 00:00:00 2001 From: Finn Date: Wed, 17 Jul 2024 21:46:22 -0700 Subject: [PATCH] fix traefik configs --- roles/k8s-node/handlers/main.yaml | 4 ++++ roles/k8s-node/tasks/main.yaml | 11 +++++++++++ roles/k8s-node/templates/traefik-config.yaml | 19 +++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 roles/k8s-node/handlers/main.yaml create mode 100644 roles/k8s-node/tasks/main.yaml create mode 100644 roles/k8s-node/templates/traefik-config.yaml diff --git a/roles/k8s-node/handlers/main.yaml b/roles/k8s-node/handlers/main.yaml new file mode 100644 index 0000000..50328f3 --- /dev/null +++ b/roles/k8s-node/handlers/main.yaml @@ -0,0 +1,4 @@ +- name: restart k3s + service: + name: k3s + state: restarted diff --git a/roles/k8s-node/tasks/main.yaml b/roles/k8s-node/tasks/main.yaml new file mode 100644 index 0000000..8811539 --- /dev/null +++ b/roles/k8s-node/tasks/main.yaml @@ -0,0 +1,11 @@ +- name: Install packages required for longhorn + apt: + name: [open-iscsi, nfs-common, cryptsetup] + +- name: template traefik-config.yaml + template: + src: traefik-config.yaml + dest: /var/lib/rancher/k3s/server/manifests/traefik-config.yaml + notify: + - restart k3s + when: k3s_role == "server" diff --git a/roles/k8s-node/templates/traefik-config.yaml b/roles/k8s-node/templates/traefik-config.yaml new file mode 100644 index 0000000..66677ba --- /dev/null +++ b/roles/k8s-node/templates/traefik-config.yaml @@ -0,0 +1,19 @@ +apiVersion: helm.cattle.io/v1 +kind: HelmChartConfig +metadata: + name: traefik + namespace: kube-system +spec: + valuesContent: |- + ports: + web: + proxyProtocol: + trustedIPs: + - 10.5.1.245/32 + - 10.5.1.1/32 + - 10.42.0.0/16 # traffic getting redirected from other nodes + websecure: + proxyProtocol: + trustedIPs: + - 10.5.1.245/32 + - 10.42.0.0/16 # traffic getting redirected from other nodes