From 98092c1dc01700b84ee3fbe3a6de7afaf8bb69f8 Mon Sep 17 00:00:00 2001 From: James Turland Date: Sun, 3 Dec 2023 23:32:13 +0000 Subject: [PATCH] add traefik external service --- .../default-headers.yaml | 16 ++++++++++ .../Traefik-External-Service/ingress.yaml | 30 +++++++++++++++++++ .../Traefik-External-Service/service.yaml | 12 ++++++++ 3 files changed, 58 insertions(+) create mode 100644 Kubernetes/Traefik-External-Service/default-headers.yaml create mode 100644 Kubernetes/Traefik-External-Service/ingress.yaml create mode 100644 Kubernetes/Traefik-External-Service/service.yaml diff --git a/Kubernetes/Traefik-External-Service/default-headers.yaml b/Kubernetes/Traefik-External-Service/default-headers.yaml new file mode 100644 index 0000000..32a85bd --- /dev/null +++ b/Kubernetes/Traefik-External-Service/default-headers.yaml @@ -0,0 +1,16 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: Middleware +metadata: + name: default-headers + namespace: default +spec: + headers: + browserXssFilter: true + contentTypeNosniff: true + forceSTSHeader: true + stsIncludeSubdomains: true + stsPreload: true + stsSeconds: 15552000 + customFrameOptionsValue: SAMEORIGIN + customRequestHeaders: + X-Forwarded-Proto: https \ No newline at end of file diff --git a/Kubernetes/Traefik-External-Service/ingress.yaml b/Kubernetes/Traefik-External-Service/ingress.yaml new file mode 100644 index 0000000..2594e29 --- /dev/null +++ b/Kubernetes/Traefik-External-Service/ingress.yaml @@ -0,0 +1,30 @@ +--- +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: proxmox + namespace: default + annotations: + kubernetes.io/ingress.class: traefik-external +spec: + entryPoints: + - websecure + routes: + - match: Host(`www.proxmox.jimsgarage.co.uk`) + kind: Rule + services: + - name: proxmox + port: 8006 + scheme: https + passHostHeader: true + - match: Host(`proxmox.jimsgarage.co.uk`) + kind: Rule + services: + - name: proxmox + port: 8006 + scheme: https + passHostHeader: true + middlewares: + - name: default-headers + tls: + secretName: jimsgarage-tls diff --git a/Kubernetes/Traefik-External-Service/service.yaml b/Kubernetes/Traefik-External-Service/service.yaml new file mode 100644 index 0000000..2de0c96 --- /dev/null +++ b/Kubernetes/Traefik-External-Service/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: proxmox + namespace: default +spec: + externalName: 192.168.200.75 + type: ExternalName + ports: + - name: websecure + port: 8006 + targetPort: 8006 \ No newline at end of file