From 59916d897804c51b683002545ce952902ea95021 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 3 Sep 2026 09:17:27 -0700 Subject: [PATCH] helm: values-driven labels on every ingress (#11127) * helm: values-driven labels on every ingress Each ingress already takes annotations from values, but its labels were a fixed block, so tools that select ingresses by label (ExternalDNS label filters, for one) had nothing to key on. Every ingress block now has a labels map rendered after the standard app.kubernetes.io labels, including the Traefik IngressRouteTCP that shares the filer gRPC values. Claude-Session: https://claude.ai/code/session_01L6eJGXtYkwe1W9QjGeUgr1 * helm ci: render check for ingress labels Claude-Session: https://claude.ai/code/session_01L6eJGXtYkwe1W9QjGeUgr1 --- .github/workflows/helm_ci.yml | 6 ++++++ k8s/charts/seaweedfs/templates/admin/admin-ingress.yaml | 3 +++ .../templates/filer/filer-grpc-ingressroutetcp.yaml | 3 +++ k8s/charts/seaweedfs/templates/filer/filer-ingress.yaml | 6 ++++++ k8s/charts/seaweedfs/templates/master/master-ingress.yaml | 3 +++ k8s/charts/seaweedfs/templates/s3/s3-iceberg-ingress.yaml | 3 +++ k8s/charts/seaweedfs/templates/s3/s3-ingress.yaml | 3 +++ k8s/charts/seaweedfs/templates/s3/s3-lance-ingress.yaml | 3 +++ k8s/charts/seaweedfs/templates/volume/volume-ingress.yaml | 3 +++ k8s/charts/seaweedfs/values.yaml | 8 ++++++++ 10 files changed, 41 insertions(+) diff --git a/.github/workflows/helm_ci.yml b/.github/workflows/helm_ci.yml index 7d7e2cdaf..fe83fc117 100644 --- a/.github/workflows/helm_ci.yml +++ b/.github/workflows/helm_ci.yml @@ -90,6 +90,12 @@ jobs: echo "S3 credentials reference the existing secret for $workload" done + echo "=== Testing ingress labels ===" + helm template test $CHART_DIR --set s3.enabled=true,s3.ingress.enabled=true \ + --set s3.ingress.labels.external-dns=s3 > /tmp/s3-ingress-labels.yaml + grep -A 12 "^kind: Ingress" /tmp/s3-ingress-labels.yaml | grep -q "^ external-dns: s3" + echo "S3 ingress renders custom labels" + echo "=== Testing with all-in-one mode ===" helm template test $CHART_DIR --set allInOne.enabled=true > /tmp/allinone.yaml grep -q "seaweedfs-all-in-one" /tmp/allinone.yaml diff --git a/k8s/charts/seaweedfs/templates/admin/admin-ingress.yaml b/k8s/charts/seaweedfs/templates/admin/admin-ingress.yaml index d5106d163..1d9bd8b71 100644 --- a/k8s/charts/seaweedfs/templates/admin/admin-ingress.yaml +++ b/k8s/charts/seaweedfs/templates/admin/admin-ingress.yaml @@ -23,6 +23,9 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: admin + {{- with .Values.admin.ingress.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: {{- if and (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) .Values.admin.ingress.className }} ingressClassName: {{ .Values.admin.ingress.className | quote }} diff --git a/k8s/charts/seaweedfs/templates/filer/filer-grpc-ingressroutetcp.yaml b/k8s/charts/seaweedfs/templates/filer/filer-grpc-ingressroutetcp.yaml index c1c2f7d78..8c150971d 100644 --- a/k8s/charts/seaweedfs/templates/filer/filer-grpc-ingressroutetcp.yaml +++ b/k8s/charts/seaweedfs/templates/filer/filer-grpc-ingressroutetcp.yaml @@ -24,6 +24,9 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: filer + {{- with .Values.filer.ingresses.grpc.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: {{- if $securityEnabled }} tls: diff --git a/k8s/charts/seaweedfs/templates/filer/filer-ingress.yaml b/k8s/charts/seaweedfs/templates/filer/filer-ingress.yaml index b747cd2d8..335f250b0 100644 --- a/k8s/charts/seaweedfs/templates/filer/filer-ingress.yaml +++ b/k8s/charts/seaweedfs/templates/filer/filer-ingress.yaml @@ -29,6 +29,9 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: filer + {{- with .Values.filer.ingresses.http.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: {{- if and (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) .Values.filer.ingresses.http.className }} ingressClassName: {{ .Values.filer.ingresses.http.className | quote }} @@ -87,6 +90,9 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: filer + {{- with .Values.filer.ingresses.grpc.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: {{- if and (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) .Values.filer.ingresses.grpc.className }} ingressClassName: {{ .Values.filer.ingresses.grpc.className | quote }} diff --git a/k8s/charts/seaweedfs/templates/master/master-ingress.yaml b/k8s/charts/seaweedfs/templates/master/master-ingress.yaml index 75319709a..9ec8819a2 100644 --- a/k8s/charts/seaweedfs/templates/master/master-ingress.yaml +++ b/k8s/charts/seaweedfs/templates/master/master-ingress.yaml @@ -21,6 +21,9 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: master + {{- with .Values.master.ingress.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: ingressClassName: {{ .Values.master.ingress.className | quote }} tls: diff --git a/k8s/charts/seaweedfs/templates/s3/s3-iceberg-ingress.yaml b/k8s/charts/seaweedfs/templates/s3/s3-iceberg-ingress.yaml index 5a760d7e9..322880c75 100644 --- a/k8s/charts/seaweedfs/templates/s3/s3-iceberg-ingress.yaml +++ b/k8s/charts/seaweedfs/templates/s3/s3-iceberg-ingress.yaml @@ -41,6 +41,9 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: s3-iceberg + {{- with .Values.s3.icebergIngress.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: {{- if .Values.s3.icebergIngress.className }} ingressClassName: {{ .Values.s3.icebergIngress.className | quote }} diff --git a/k8s/charts/seaweedfs/templates/s3/s3-ingress.yaml b/k8s/charts/seaweedfs/templates/s3/s3-ingress.yaml index bc4eee164..cf55ca45b 100644 --- a/k8s/charts/seaweedfs/templates/s3/s3-ingress.yaml +++ b/k8s/charts/seaweedfs/templates/s3/s3-ingress.yaml @@ -32,6 +32,9 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: s3 + {{- with .Values.s3.ingress.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: ingressClassName: {{ .Values.s3.ingress.className | quote }} tls: diff --git a/k8s/charts/seaweedfs/templates/s3/s3-lance-ingress.yaml b/k8s/charts/seaweedfs/templates/s3/s3-lance-ingress.yaml index 32033a8f1..eeca7b02e 100644 --- a/k8s/charts/seaweedfs/templates/s3/s3-lance-ingress.yaml +++ b/k8s/charts/seaweedfs/templates/s3/s3-lance-ingress.yaml @@ -41,6 +41,9 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: s3-lance + {{- with .Values.s3.lanceIngress.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: {{- if .Values.s3.lanceIngress.className }} ingressClassName: {{ .Values.s3.lanceIngress.className | quote }} diff --git a/k8s/charts/seaweedfs/templates/volume/volume-ingress.yaml b/k8s/charts/seaweedfs/templates/volume/volume-ingress.yaml index b36c29867..15d24de5f 100644 --- a/k8s/charts/seaweedfs/templates/volume/volume-ingress.yaml +++ b/k8s/charts/seaweedfs/templates/volume/volume-ingress.yaml @@ -27,6 +27,9 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: volume + {{- with .Values.volume.ingress.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: {{- if and (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) .Values.volume.ingress.className }} ingressClassName: {{ .Values.volume.ingress.className | quote }} diff --git a/k8s/charts/seaweedfs/values.yaml b/k8s/charts/seaweedfs/values.yaml index a9c75b7a4..f1f1a3fe5 100644 --- a/k8s/charts/seaweedfs/values.yaml +++ b/k8s/charts/seaweedfs/values.yaml @@ -276,6 +276,7 @@ master: host: "master.seaweedfs.local" path: "/sw-master/?(.*)" pathType: ImplementationSpecific + labels: {} annotations: {} # nginx.ingress.kubernetes.io/auth-type: "basic" # nginx.ingress.kubernetes.io/auth-secret: "default/ingress-basic-auth-secret" @@ -600,6 +601,7 @@ volume: host: "volume.seaweedfs.local" path: "/" pathType: Prefix + labels: {} annotations: nginx.ingress.kubernetes.io/app-root: /ui/index.html # nginx.ingress.kubernetes.io/use-regex: "true" @@ -858,6 +860,7 @@ filer: host: "seaweedfs.cluster.local" path: "/sw-filer/?(.*)" pathType: ImplementationSpecific + labels: {} annotations: {} # nginx.ingress.kubernetes.io/backend-protocol: GRPC # nginx.ingress.kubernetes.io/auth-type: "basic" @@ -884,6 +887,7 @@ filer: # whole host, not the HTTP UI's regex path. path: "/" pathType: Prefix + labels: {} annotations: # Ingress terminates TLS and re-originates gRPC (HTTP/2) to the filer. nginx.ingress.kubernetes.io/backend-protocol: "GRPC" @@ -1180,6 +1184,7 @@ s3: host: "seaweedfs.cluster.local" path: "/" pathType: Prefix + labels: {} # additional ingress annotations for the s3 endpoint annotations: {} tls: [] @@ -1205,6 +1210,7 @@ s3: host: "seaweedfs-iceberg.cluster.local" path: "/" pathType: Prefix + labels: {} annotations: {} tls: [] @@ -1214,6 +1220,7 @@ s3: host: "seaweedfs-lance.cluster.local" path: "/" pathType: Prefix + labels: {} annotations: {} tls: [] @@ -1445,6 +1452,7 @@ admin: host: "admin.seaweedfs.local" path: "/" pathType: Prefix + labels: {} annotations: {} tls: []