update deploy yaml

This commit is contained in:
2025-07-07 09:25:55 +08:00
parent 4d1eb20080
commit 9ffc73ddc7
7 changed files with 58 additions and 147 deletions

View File

@@ -0,0 +1,31 @@
# kubernetes/fastapi-chart/templates/ingress.yaml
{{- if .Values.ingress.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "mark-word-fastapi.fullname" . }}
labels:
{{- include "mark-word-fastapi.labels" . | nindent 4 }}
annotations:
# 可以添加 Traefik 特定的 annotation例如强制重定向到 HTTPS
# traefik.ingress.kubernetes.io/router.entrypoints: web, websecure
# traefik.ingress.kubernetes.io/router.tls: "true"
# traefik.ingress.kubernetes.io/router.middlewares: default-redirect-https@kubernetescrd
spec:
ingressClassName: {{ .Values.ingress.className }}
rules:
- host: {{ .Values.ingress.host | quote }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ include "mark-word-fastapi.fullname" . }}
port:
number: {{ .Values.service.port }}
{{- if .Values.ingress.tls }}
tls:
{{- toYaml .Values.ingress.tls | nindent 4 }}
{{- end }}
{{- end }}