diff --git a/packages/system/seaweedfs/charts/seaweedfs/templates/s3/s3-lance-ingress.yaml b/packages/system/seaweedfs/charts/seaweedfs/templates/s3/s3-lance-ingress.yaml index 32033a8f1..fce6b13c8 100644 --- a/packages/system/seaweedfs/charts/seaweedfs/templates/s3/s3-lance-ingress.yaml +++ b/packages/system/seaweedfs/charts/seaweedfs/templates/s3/s3-lance-ingress.yaml @@ -5,11 +5,11 @@ paths: backend: {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }} service: - name: {{ include "seaweedfs.componentName" (list . "s3") }} + name: {{ template "seaweedfs.name" . }}-s3 port: number: {{ .Values.s3.lancePort }} {{- else }} - serviceName: {{ include "seaweedfs.componentName" (list . "s3") }} + serviceName: {{ template "seaweedfs.name" . }}-s3 servicePort: {{ .Values.s3.lancePort }} {{- end }} {{- end -}} diff --git a/packages/system/seaweedfs/charts/seaweedfs/templates/shared/_helpers.tpl b/packages/system/seaweedfs/charts/seaweedfs/templates/shared/_helpers.tpl index 6fc10efe6..2f933b8df 100644 --- a/packages/system/seaweedfs/charts/seaweedfs/templates/shared/_helpers.tpl +++ b/packages/system/seaweedfs/charts/seaweedfs/templates/shared/_helpers.tpl @@ -153,7 +153,7 @@ true {{- if .Values.worker.namespaceUrl -}} {{- .Values.worker.namespaceUrl -}} {{- else if and .Values.s3.enabled .Values.s3.lancePort -}} -{{- printf "http://%s.%s:%d" (include "seaweedfs.componentName" (list . "s3")) .Release.Namespace (int .Values.s3.lancePort) -}} +{{- printf "http://%s-s3.%s:%d" (include "seaweedfs.name" .) .Release.Namespace (int .Values.s3.lancePort) -}} {{- end -}} {{- end -}} diff --git a/packages/system/seaweedfs/patches/s3-service-name-consumers.patch b/packages/system/seaweedfs/patches/s3-service-name-consumers.patch index 73b09dc15..92df94401 100644 --- a/packages/system/seaweedfs/patches/s3-service-name-consumers.patch +++ b/packages/system/seaweedfs/patches/s3-service-name-consumers.patch @@ -45,3 +45,34 @@ index bc4eee164..c92063f8c 100644 {{- $s3Port := .Values.allInOne.s3.port | default .Values.s3.port }} {{- /* Build hosts list - support both legacy .host (string) and new .hosts (array) for backwards compatibility */}} {{- $hosts := list }} +diff --git a/packages/system/seaweedfs/charts/seaweedfs/templates/s3/s3-lance-ingress.yaml b/packages/system/seaweedfs/charts/seaweedfs/templates/s3/s3-lance-ingress.yaml +index 32033a8f1..fce6b13c8 100644 +--- a/packages/system/seaweedfs/charts/seaweedfs/templates/s3/s3-lance-ingress.yaml ++++ b/packages/system/seaweedfs/charts/seaweedfs/templates/s3/s3-lance-ingress.yaml +@@ -5,11 +5,11 @@ paths: + backend: + {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }} + service: +- name: {{ include "seaweedfs.componentName" (list . "s3") }} ++ name: {{ template "seaweedfs.name" . }}-s3 + port: + number: {{ .Values.s3.lancePort }} + {{- else }} +- serviceName: {{ include "seaweedfs.componentName" (list . "s3") }} ++ serviceName: {{ template "seaweedfs.name" . }}-s3 + servicePort: {{ .Values.s3.lancePort }} + {{- end }} + {{- end -}} +diff --git a/packages/system/seaweedfs/charts/seaweedfs/templates/shared/_helpers.tpl b/packages/system/seaweedfs/charts/seaweedfs/templates/shared/_helpers.tpl +index 6fc10efe6..2f933b8df 100644 +--- a/packages/system/seaweedfs/charts/seaweedfs/templates/shared/_helpers.tpl ++++ b/packages/system/seaweedfs/charts/seaweedfs/templates/shared/_helpers.tpl +@@ -153,7 +153,7 @@ true + {{- if .Values.worker.namespaceUrl -}} + {{- .Values.worker.namespaceUrl -}} + {{- else if and .Values.s3.enabled .Values.s3.lancePort -}} +-{{- printf "http://%s.%s:%d" (include "seaweedfs.componentName" (list . "s3")) .Release.Namespace (int .Values.s3.lancePort) -}} ++{{- printf "http://%s-s3.%s:%d" (include "seaweedfs.name" .) .Release.Namespace (int .Values.s3.lancePort) -}} + {{- end -}} + {{- end -}} + diff --git a/packages/system/seaweedfs/tests/s3_service_name_consumers_test.yaml b/packages/system/seaweedfs/tests/s3_service_name_consumers_test.yaml index b536b7c57..62672f8ec 100644 --- a/packages/system/seaweedfs/tests/s3_service_name_consumers_test.yaml +++ b/packages/system/seaweedfs/tests/s3_service_name_consumers_test.yaml @@ -7,7 +7,8 @@ suite: seaweedfs s3 consumers resolve the renamed s3 service # but several consumers still resolved it via componentName -> `-s3`: # - the S3 ingress backend, # - the iceberg ingress backend, -# - the COSI provisioner ENDPOINT (in-cluster, s3.ingress.enabled=false path). +# - the COSI provisioner ENDPOINT (in-cluster, s3.ingress.enabled=false path), +# - the Lance catalog ingress backend and the Lance namespace URL the worker gets. # name and fullname only coincide when the release name equals the chart name; # the shipped release is `seaweedfs-system`, so those consumers pointed at # `seaweedfs-system-s3` while the real service is `seaweedfs-s3`. With no @@ -25,6 +26,8 @@ templates: - charts/seaweedfs/templates/s3/s3-ingress.yaml - charts/seaweedfs/templates/s3/s3-iceberg-ingress.yaml - charts/seaweedfs/templates/cosi/cosi-deployment.yaml + - charts/seaweedfs/templates/s3/s3-lance-ingress.yaml + - charts/seaweedfs/templates/worker/worker-deployment.yaml release: name: seaweedfs-system @@ -107,3 +110,33 @@ tests: content: name: ENDPOINT value: https://seaweedfs-s3.cozy-seaweedfs.svc:8333 + + # values.yaml ships s3.lancePort: 0, which keeps both Lance consumers from + # rendering at all; the cases below turn the catalog on to reach them. + - it: lance ingress backend points at the s3 service too + template: charts/seaweedfs/templates/s3/s3-lance-ingress.yaml + set: + seaweedfs.fullnameOverride: seaweedfs-system + seaweedfs.s3.enabled: true + seaweedfs.s3.lancePort: 9101 + seaweedfs.s3.lanceIngress.enabled: true + seaweedfs.s3.lanceIngress.host: lance.example.com + asserts: + - equal: + path: spec.rules[0].http.paths[0].backend.service.name + value: seaweedfs-s3 + + - it: worker Lance namespace URL resolves the s3 service + template: charts/seaweedfs/templates/worker/worker-deployment.yaml + set: + seaweedfs.fullnameOverride: seaweedfs-system + seaweedfs.s3.enabled: true + seaweedfs.s3.lancePort: 9101 + seaweedfs.worker.enabled: true + seaweedfs.worker.adminServer: seaweedfs-admin:23646 + asserts: + - contains: + path: spec.template.spec.containers[1].env + content: + name: LANCE_NAMESPACE_URL + value: http://seaweedfs-s3.cozy-seaweedfs:9101