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
This commit is contained in:
Chris Lu
2026-09-03 09:17:27 -07:00
committed by GitHub
parent c3511e7c86
commit 59916d8978
10 changed files with 41 additions and 0 deletions
+6
View File
@@ -90,6 +90,12 @@ jobs:
echo "S3 credentials reference the existing secret for $workload" echo "S3 credentials reference the existing secret for $workload"
done 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 ===" echo "=== Testing with all-in-one mode ==="
helm template test $CHART_DIR --set allInOne.enabled=true > /tmp/allinone.yaml helm template test $CHART_DIR --set allInOne.enabled=true > /tmp/allinone.yaml
grep -q "seaweedfs-all-in-one" /tmp/allinone.yaml grep -q "seaweedfs-all-in-one" /tmp/allinone.yaml
@@ -23,6 +23,9 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: admin app.kubernetes.io/component: admin
{{- with .Values.admin.ingress.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec: spec:
{{- if and (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) .Values.admin.ingress.className }} {{- if and (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) .Values.admin.ingress.className }}
ingressClassName: {{ .Values.admin.ingress.className | quote }} ingressClassName: {{ .Values.admin.ingress.className | quote }}
@@ -24,6 +24,9 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: filer app.kubernetes.io/component: filer
{{- with .Values.filer.ingresses.grpc.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec: spec:
{{- if $securityEnabled }} {{- if $securityEnabled }}
tls: tls:
@@ -29,6 +29,9 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: filer app.kubernetes.io/component: filer
{{- with .Values.filer.ingresses.http.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec: spec:
{{- if and (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) .Values.filer.ingresses.http.className }} {{- if and (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) .Values.filer.ingresses.http.className }}
ingressClassName: {{ .Values.filer.ingresses.http.className | quote }} ingressClassName: {{ .Values.filer.ingresses.http.className | quote }}
@@ -87,6 +90,9 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: filer app.kubernetes.io/component: filer
{{- with .Values.filer.ingresses.grpc.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec: spec:
{{- if and (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) .Values.filer.ingresses.grpc.className }} {{- if and (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) .Values.filer.ingresses.grpc.className }}
ingressClassName: {{ .Values.filer.ingresses.grpc.className | quote }} ingressClassName: {{ .Values.filer.ingresses.grpc.className | quote }}
@@ -21,6 +21,9 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: master app.kubernetes.io/component: master
{{- with .Values.master.ingress.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec: spec:
ingressClassName: {{ .Values.master.ingress.className | quote }} ingressClassName: {{ .Values.master.ingress.className | quote }}
tls: tls:
@@ -41,6 +41,9 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: s3-iceberg app.kubernetes.io/component: s3-iceberg
{{- with .Values.s3.icebergIngress.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec: spec:
{{- if .Values.s3.icebergIngress.className }} {{- if .Values.s3.icebergIngress.className }}
ingressClassName: {{ .Values.s3.icebergIngress.className | quote }} ingressClassName: {{ .Values.s3.icebergIngress.className | quote }}
@@ -32,6 +32,9 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: s3 app.kubernetes.io/component: s3
{{- with .Values.s3.ingress.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec: spec:
ingressClassName: {{ .Values.s3.ingress.className | quote }} ingressClassName: {{ .Values.s3.ingress.className | quote }}
tls: tls:
@@ -41,6 +41,9 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: s3-lance app.kubernetes.io/component: s3-lance
{{- with .Values.s3.lanceIngress.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec: spec:
{{- if .Values.s3.lanceIngress.className }} {{- if .Values.s3.lanceIngress.className }}
ingressClassName: {{ .Values.s3.lanceIngress.className | quote }} ingressClassName: {{ .Values.s3.lanceIngress.className | quote }}
@@ -27,6 +27,9 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: volume app.kubernetes.io/component: volume
{{- with .Values.volume.ingress.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec: spec:
{{- if and (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) .Values.volume.ingress.className }} {{- if and (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) .Values.volume.ingress.className }}
ingressClassName: {{ .Values.volume.ingress.className | quote }} ingressClassName: {{ .Values.volume.ingress.className | quote }}
+8
View File
@@ -276,6 +276,7 @@ master:
host: "master.seaweedfs.local" host: "master.seaweedfs.local"
path: "/sw-master/?(.*)" path: "/sw-master/?(.*)"
pathType: ImplementationSpecific pathType: ImplementationSpecific
labels: {}
annotations: {} annotations: {}
# nginx.ingress.kubernetes.io/auth-type: "basic" # nginx.ingress.kubernetes.io/auth-type: "basic"
# nginx.ingress.kubernetes.io/auth-secret: "default/ingress-basic-auth-secret" # nginx.ingress.kubernetes.io/auth-secret: "default/ingress-basic-auth-secret"
@@ -600,6 +601,7 @@ volume:
host: "volume.seaweedfs.local" host: "volume.seaweedfs.local"
path: "/" path: "/"
pathType: Prefix pathType: Prefix
labels: {}
annotations: annotations:
nginx.ingress.kubernetes.io/app-root: /ui/index.html nginx.ingress.kubernetes.io/app-root: /ui/index.html
# nginx.ingress.kubernetes.io/use-regex: "true" # nginx.ingress.kubernetes.io/use-regex: "true"
@@ -858,6 +860,7 @@ filer:
host: "seaweedfs.cluster.local" host: "seaweedfs.cluster.local"
path: "/sw-filer/?(.*)" path: "/sw-filer/?(.*)"
pathType: ImplementationSpecific pathType: ImplementationSpecific
labels: {}
annotations: {} annotations: {}
# nginx.ingress.kubernetes.io/backend-protocol: GRPC # nginx.ingress.kubernetes.io/backend-protocol: GRPC
# nginx.ingress.kubernetes.io/auth-type: "basic" # nginx.ingress.kubernetes.io/auth-type: "basic"
@@ -884,6 +887,7 @@ filer:
# whole host, not the HTTP UI's regex path. # whole host, not the HTTP UI's regex path.
path: "/" path: "/"
pathType: Prefix pathType: Prefix
labels: {}
annotations: annotations:
# Ingress terminates TLS and re-originates gRPC (HTTP/2) to the filer. # Ingress terminates TLS and re-originates gRPC (HTTP/2) to the filer.
nginx.ingress.kubernetes.io/backend-protocol: "GRPC" nginx.ingress.kubernetes.io/backend-protocol: "GRPC"
@@ -1180,6 +1184,7 @@ s3:
host: "seaweedfs.cluster.local" host: "seaweedfs.cluster.local"
path: "/" path: "/"
pathType: Prefix pathType: Prefix
labels: {}
# additional ingress annotations for the s3 endpoint # additional ingress annotations for the s3 endpoint
annotations: {} annotations: {}
tls: [] tls: []
@@ -1205,6 +1210,7 @@ s3:
host: "seaweedfs-iceberg.cluster.local" host: "seaweedfs-iceberg.cluster.local"
path: "/" path: "/"
pathType: Prefix pathType: Prefix
labels: {}
annotations: {} annotations: {}
tls: [] tls: []
@@ -1214,6 +1220,7 @@ s3:
host: "seaweedfs-lance.cluster.local" host: "seaweedfs-lance.cluster.local"
path: "/" path: "/"
pathType: Prefix pathType: Prefix
labels: {}
annotations: {} annotations: {}
tls: [] tls: []
@@ -1445,6 +1452,7 @@ admin:
host: "admin.seaweedfs.local" host: "admin.seaweedfs.local"
path: "/" path: "/"
pathType: Prefix pathType: Prefix
labels: {}
annotations: {} annotations: {}
tls: [] tls: []