update deploy yaml
This commit is contained in:
31
kubernetes/fastapi-chart/templates/ingress.yaml
Normal file
31
kubernetes/fastapi-chart/templates/ingress.yaml
Normal 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 }}
|
||||
Reference in New Issue
Block a user