From 862c914468cc062ef7397be7ea12dd2bbdee9bf5 Mon Sep 17 00:00:00 2001 From: Victor Roest Date: Wed, 27 Oct 2021 15:00:59 +0200 Subject: [PATCH] add traefik --- cluster/apps/kustomization.yaml | 4 ++ cluster/apps/networking/kustomization.yaml | 4 ++ .../apps/networking/traefik/helm-release.yaml | 67 +++++++++++++++++++ .../networking/traefik/kustomization.yaml | 4 ++ cluster/base/apps.yaml | 15 +++++ .../charts/helm/kustomization.yaml | 1 + .../charts/helm/traefik-charts.yaml | 10 +++ 7 files changed, 105 insertions(+) create mode 100644 cluster/apps/kustomization.yaml create mode 100644 cluster/apps/networking/kustomization.yaml create mode 100644 cluster/apps/networking/traefik/helm-release.yaml create mode 100644 cluster/apps/networking/traefik/kustomization.yaml create mode 100644 cluster/base/apps.yaml create mode 100644 cluster/base/flux-system/charts/helm/traefik-charts.yaml diff --git a/cluster/apps/kustomization.yaml b/cluster/apps/kustomization.yaml new file mode 100644 index 0000000..1a8401e --- /dev/null +++ b/cluster/apps/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - networking diff --git a/cluster/apps/networking/kustomization.yaml b/cluster/apps/networking/kustomization.yaml new file mode 100644 index 0000000..0ad868a --- /dev/null +++ b/cluster/apps/networking/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - traefik diff --git a/cluster/apps/networking/traefik/helm-release.yaml b/cluster/apps/networking/traefik/helm-release.yaml new file mode 100644 index 0000000..91a489a --- /dev/null +++ b/cluster/apps/networking/traefik/helm-release.yaml @@ -0,0 +1,67 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2beta1 +kind: HelmRelease +metadata: + name: traefik + namespace: networking +spec: + interval: 5m + chart: + spec: + # renovate: registryUrl=https://helm.traefik.io/traefik + chart: traefik + version: 10.6.0 + sourceRef: + kind: HelmRepository + name: traefik-charts + namespace: flux-system + interval: 5m + values: + image: + name: traefik + deployment: + kind: Deployment + replicas: 2 + service: + enabled: true + type: LoadBalancer + spec: + externalIPs: + - 10.42.42.150 + externalTrafficPolicy: Local + logs: + general: + level: WARN + ingressClass: + enabled: true + isDefaultClass: true + fallbackApiVersion: v1 + globalArguments: + - "--providers.kubernetesingress.ingressclass=traefik" + - "--entryPoints.websecure.forwardedHeaders.trustedIPs=10.42.42.0/23" + additionalArguments: + - "--providers.kubernetesingress.ingressendpoint.ip=10.42.42.150" + ports: + traefik: + port: 9000 + expose: true + web: + port: 8000 + exposedPort: 8000 + expose: true + websecure: + port: 8443 + exposedPort: 8443 + expose: true + pilot: + enabled: false + experimental: + plugins: + enabled: false + affinity: {} + resources: + requests: + memory: 100Mi + cpu: 500m + limits: + memory: 500Mi diff --git a/cluster/apps/networking/traefik/kustomization.yaml b/cluster/apps/networking/traefik/kustomization.yaml new file mode 100644 index 0000000..34a8531 --- /dev/null +++ b/cluster/apps/networking/traefik/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - helm-release.yaml diff --git a/cluster/base/apps.yaml b/cluster/base/apps.yaml new file mode 100644 index 0000000..71aa43d --- /dev/null +++ b/cluster/base/apps.yaml @@ -0,0 +1,15 @@ +--- +apiVersion: kustomize.toolkit.fluxcd.io/v1beta2 +kind: Kustomization +metadata: + name: apps + namespace: flux-system +spec: + interval: 10m0s + dependsOn: + - name: core + path: ./cluster/apps + prune: true + sourceRef: + kind: GitRepository + name: flux-system diff --git a/cluster/base/flux-system/charts/helm/kustomization.yaml b/cluster/base/flux-system/charts/helm/kustomization.yaml index 326c3cc..65d6813 100644 --- a/cluster/base/flux-system/charts/helm/kustomization.yaml +++ b/cluster/base/flux-system/charts/helm/kustomization.yaml @@ -2,3 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - metallb-charts.yaml + - traefik-charts.yaml diff --git a/cluster/base/flux-system/charts/helm/traefik-charts.yaml b/cluster/base/flux-system/charts/helm/traefik-charts.yaml new file mode 100644 index 0000000..dda0b32 --- /dev/null +++ b/cluster/base/flux-system/charts/helm/traefik-charts.yaml @@ -0,0 +1,10 @@ +--- +apiVersion: source.toolkit.fluxcd.io/v1beta1 +kind: HelmRepository +metadata: + name: traefik-charts + namespace: flux-system +spec: + interval: 15m + url: https://helm.traefik.io/traefik + timeout: 3m