From e537d10bdb43dfb6b44adecd6da88b99c1040bc7 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Sun, 14 Jan 2024 01:14:24 +0100 Subject: [PATCH] feat(traefik): Move to independant namespace and rework general settings --- traefik/dashboard-hook-ingressroute.yaml | 20 +++++++++++++++++ traefik/dashboard-ingress.yaml | 22 +++++++++++++++++++ traefik/dashboard-service.yaml | 13 +++++++++++ traefik/dashboard.yaml | 16 ++++++++++++++ traefik/namespace.yaml | 4 ++++ .../traefik-external/service-dashboard.yaml | 14 ++++++++++++ traefik/traefik-internal/patch.yaml | 0 traefik/traefik-internal/service-prod.yaml | 0 8 files changed, 89 insertions(+) create mode 100644 traefik/dashboard-hook-ingressroute.yaml create mode 100644 traefik/dashboard-ingress.yaml create mode 100644 traefik/dashboard-service.yaml create mode 100644 traefik/dashboard.yaml create mode 100644 traefik/namespace.yaml create mode 100644 traefik/traefik-external/service-dashboard.yaml create mode 100644 traefik/traefik-internal/patch.yaml create mode 100644 traefik/traefik-internal/service-prod.yaml diff --git a/traefik/dashboard-hook-ingressroute.yaml b/traefik/dashboard-hook-ingressroute.yaml new file mode 100644 index 0000000..24f0e01 --- /dev/null +++ b/traefik/dashboard-hook-ingressroute.yaml @@ -0,0 +1,20 @@ +--- +# Source: traefik/templates/dashboard-hook-ingressroute.yaml +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: traefik-dashboard + annotations: + helm.sh/hook: "post-install,post-upgrade" + labels: + app.kubernetes.io/name: traefik + app.kubernetes.io/instance: traefik +spec: + entryPoints: + - traefik + routes: + - match: PathPrefix(`/dashboard`) || PathPrefix(`/api`) + kind: Rule + services: + - name: api@internal + kind: TraefikService diff --git a/traefik/dashboard-ingress.yaml b/traefik/dashboard-ingress.yaml new file mode 100644 index 0000000..752674b --- /dev/null +++ b/traefik/dashboard-ingress.yaml @@ -0,0 +1,22 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: traefik-dashboard-ingress + annotations: + kubernetes.io/ingress.class: "traefik-inter" +spec: + tls: + - secretName: traefik-dashboard-beta-tls + hosts: + - traefik.beta.entos + rules: + - host: traefik.beta.entos + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: traefik-dashboard-svc + port: + number: 80 diff --git a/traefik/dashboard-service.yaml b/traefik/dashboard-service.yaml new file mode 100644 index 0000000..3c97bd3 --- /dev/null +++ b/traefik/dashboard-service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: traefik-dashboard-svc +spec: + ports: + - name: http + port: 80 + protocol: TCP + targetPort: 8080 + selector: + app.kubernetes.io/name: traefik-inter + app.kubernetes.io/instance: treafik-inter diff --git a/traefik/dashboard.yaml b/traefik/dashboard.yaml new file mode 100644 index 0000000..41fa741 --- /dev/null +++ b/traefik/dashboard.yaml @@ -0,0 +1,16 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: traefik-dashboard + namespace: traefik + annotations: + kubernetes.io/ingress.class: "traefik-inter" +spec: + entryPoints: + - websecure + routes: + - kind: Rule + match: Host(`traefik.beta.entos`) + services: + - name: api@internal + kind: TraefikService diff --git a/traefik/namespace.yaml b/traefik/namespace.yaml new file mode 100644 index 0000000..c088a91 --- /dev/null +++ b/traefik/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: traefik diff --git a/traefik/traefik-external/service-dashboard.yaml b/traefik/traefik-external/service-dashboard.yaml new file mode 100644 index 0000000..d8884a3 --- /dev/null +++ b/traefik/traefik-external/service-dashboard.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: traefik-dashboard-svc + namespace: default +spec: + ports: + - name: admin + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app.kubernetes.io/name: traefik + app.kubernetes.io/instance: traefik diff --git a/traefik/traefik-internal/patch.yaml b/traefik/traefik-internal/patch.yaml new file mode 100644 index 0000000..e69de29 diff --git a/traefik/traefik-internal/service-prod.yaml b/traefik/traefik-internal/service-prod.yaml new file mode 100644 index 0000000..e69de29