diff --git a/kubernetes/fastapi-chart/templates/ingress.yaml b/kubernetes/fastapi-chart/templates/ingress.yaml index 67bc071..3876344 100644 --- a/kubernetes/fastapi-chart/templates/ingress.yaml +++ b/kubernetes/fastapi-chart/templates/ingress.yaml @@ -1,19 +1,25 @@ +# kubernetes/fastapi-chart/templates/ingress.yaml apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: mark-word-fastapi-ingress - namespace: default + name: {{ include "mark-word-fastapi.fullname" . }} + labels: + {{- include "mark-word-fastapi.labels" . | nindent 4 }} annotations: - traefik.ingress.kubernetes.io/router.entrypoints: web + # 可以添加 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: traefik + ingressClassName: {{ .Values.ingress.className }} rules: - - http: + - host: {{ .Values.ingress.host | quote }} + http: paths: - path: / pathType: Prefix backend: service: - name: mark-word-fastapi + name: {{ include "mark-word-fastapi.fullname" . }} port: - number: 8000 \ No newline at end of file + number: {{ .Values.service.port }} \ No newline at end of file