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