From 6d67df70efe832ec66246bdc31f644f1464fb71f Mon Sep 17 00:00:00 2001 From: lostecho Date: Mon, 7 Jul 2025 11:45:13 +0800 Subject: [PATCH] update ingress.yaml --- .../fastapi-chart/templates/ingress.yaml | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) 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