Common Ingress for Statics
This commit is contained in:
1 parent
b2162cf638
commit
44053c020d
1 file changed
+8
-4
@@ -71,19 +71,23 @@ spec:
|
|||||||
- name: http
|
- name: http
|
||||||
port: 80
|
port: 80
|
||||||
targetPort: 80
|
targetPort: 80
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
name: "{{$prefix}}-static-files-{{$staticFile.path}}"
|
name: "sec-domain-static-files"
|
||||||
annotations:
|
annotations:
|
||||||
homelab-ingress/managing-app-namespace: "apps-ingresses"
|
homelab-ingress/managing-app-namespace: "apps-ingresses"
|
||||||
traefik.ingress.kubernetes.io/router.middlewares: {{ $staticFile.middleware | default "apps-ingresses-https-redirect"}}@kubernetescrd
|
|
||||||
spec:
|
spec:
|
||||||
rules:
|
rules:
|
||||||
- host: "{{ $.Values.global.secondaryDomain }}"
|
- host: "{{ $.Values.global.secondaryDomain }}"
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
|
{{ range $staticFile := .Values.staticFiles.secondaryDomain }}
|
||||||
|
{{ $appLabel := replace "." "-" $staticFile.path }}
|
||||||
|
{{ $prefix := printf "sec-domain-%s" $appLabel }}
|
||||||
- backend:
|
- backend:
|
||||||
service:
|
service:
|
||||||
name: "{{$prefix}}-static-files"
|
name: "{{$prefix}}-static-files"
|
||||||
@@ -91,10 +95,10 @@ spec:
|
|||||||
number: 80
|
number: 80
|
||||||
path: "/{{$staticFile.path}}"
|
path: "/{{$staticFile.path}}"
|
||||||
pathType: Prefix
|
pathType: Prefix
|
||||||
|
{{ end }}
|
||||||
{{ if $.Values.global.tls.enabled }}
|
{{ if $.Values.global.tls.enabled }}
|
||||||
tls:
|
tls:
|
||||||
- secretName: "tls-{{ $.Values.global.secondaryDomain }}"
|
- secretName: "tls-{{ $.Values.global.secondaryDomain }}"
|
||||||
hosts:
|
hosts:
|
||||||
- "{{ $.Values.global.secondaryDomain }}"
|
- "{{ $.Values.global.secondaryDomain }}"
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
|
||||||
Reference in new issue
Block a user