Files
porthole/helm/tline/templates/ingress-tailscale.yaml.tpl
OpenCode Test e1a64aa092 Initial commit
2025-12-24 10:50:10 -08:00

121 lines
4.7 KiB
Smarty

{{- if and .Values.global.tailscale.enabled .Values.web.enabled .Values.web.ingress.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "tline.componentName" (dict "Values" .Values "Chart" .Chart "Release" .Release "component" "web") }}
labels:
{{ include "tline.labels" . | indent 4 }}
app.kubernetes.io/component: web
annotations:
{{- if .Values.global.tailscale.proxyGroup.enabled }}
tailscale.com/proxy-group: {{ .Values.global.tailscale.proxyGroup.name | quote }}
{{- end }}
{{- if .Values.web.ingress.funnel }}
tailscale.com/funnel: "true"
{{- end }}
{{- if .Values.web.ingress.tags }}
tailscale.com/tags: {{ join "," .Values.web.ingress.tags | quote }}
{{- end }}
{{- with .Values.web.ingress.extraAnnotations }}
{{ toYaml . | indent 4 }}
{{- end }}
spec:
ingressClassName: {{ .Values.global.tailscale.ingressClassName }}
tls:
- hosts:
- {{ .Values.web.ingress.hostnameLabel | quote }}
rules:
- host: {{ .Values.web.ingress.hostnameLabel | quote }}
http:
paths:
- path: {{ .Values.web.ingress.path }}
pathType: {{ .Values.web.ingress.pathType }}
backend:
service:
name: {{ include "tline.componentName" (dict "Values" .Values "Chart" .Chart "Release" .Release "component" "web") }}
port:
number: {{ .Values.web.service.port }}
{{ end }}
{{- $disableMinioS3Ingress := and .Values.minio.tailscaleServiceS3.enabled (.Values.minio.ingressS3DisabledWhenTailscaleService | default true) -}}
{{- if and .Values.global.tailscale.enabled .Values.minio.enabled .Values.minio.ingressS3.enabled (not $disableMinioS3Ingress) -}}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "tline.componentName" (dict "Values" .Values "Chart" .Chart "Release" .Release "component" "minio") }}
labels:
{{ include "tline.labels" . | indent 4 }}
app.kubernetes.io/component: minio
annotations:
{{- if .Values.global.tailscale.proxyGroup.enabled }}
tailscale.com/proxy-group: {{ .Values.global.tailscale.proxyGroup.name | quote }}
{{- end }}
{{- if .Values.minio.ingressS3.funnel }}
tailscale.com/funnel: "true"
{{- end }}
{{- if .Values.minio.ingressS3.tags }}
tailscale.com/tags: {{ join "," .Values.minio.ingressS3.tags | quote }}
{{- end }}
{{- with .Values.minio.ingressS3.extraAnnotations }}
{{ toYaml . | indent 4 }}
{{- end }}
spec:
ingressClassName: {{ .Values.global.tailscale.ingressClassName }}
tls:
- hosts:
- {{ .Values.minio.ingressS3.hostnameLabel | quote }}
rules:
- host: {{ .Values.minio.ingressS3.hostnameLabel | quote }}
http:
paths:
- path: {{ .Values.minio.ingressS3.path }}
pathType: {{ .Values.minio.ingressS3.pathType }}
backend:
service:
name: {{ include "tline.componentName" (dict "Values" .Values "Chart" .Chart "Release" .Release "component" "minio") }}
port:
number: {{ .Values.minio.service.s3Port }}
{{ end }}
{{- $disableMinioConsoleIngress := and .Values.minio.tailscaleServiceConsole.enabled (.Values.minio.ingressConsoleDisabledWhenTailscaleService | default true) -}}
{{- if and .Values.global.tailscale.enabled .Values.minio.enabled .Values.minio.ingressConsole.enabled (not $disableMinioConsoleIngress) -}}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "tline.componentName" (dict "Values" .Values "Chart" .Chart "Release" .Release "component" "minio-console") }}
labels:
{{ include "tline.labels" . | indent 4 }}
app.kubernetes.io/component: minio
annotations:
{{- if .Values.global.tailscale.proxyGroup.enabled }}
tailscale.com/proxy-group: {{ .Values.global.tailscale.proxyGroup.name | quote }}
{{- end }}
{{- if .Values.minio.ingressConsole.funnel }}
tailscale.com/funnel: "true"
{{- end }}
{{- if .Values.minio.ingressConsole.tags }}
tailscale.com/tags: {{ join "," .Values.minio.ingressConsole.tags | quote }}
{{- end }}
{{- with .Values.minio.ingressConsole.extraAnnotations }}
{{ toYaml . | indent 4 }}
{{- end }}
spec:
ingressClassName: {{ .Values.global.tailscale.ingressClassName }}
tls:
- hosts:
- {{ .Values.minio.ingressConsole.hostnameLabel | quote }}
rules:
- host: {{ .Values.minio.ingressConsole.hostnameLabel | quote }}
http:
paths:
- path: {{ .Values.minio.ingressConsole.path }}
pathType: {{ .Values.minio.ingressConsole.pathType }}
backend:
service:
name: {{ include "tline.componentName" (dict "Values" .Values "Chart" .Chart "Release" .Release "component" "minio") }}
port:
number: {{ .Values.minio.service.consolePort }}
{{- end }}