Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions charts/controlplane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,15 @@ flyte:
maxOpenConnections: 20
connMaxLifeTime: 120s
configmap:
# --- Namespace Mapping (flyteadmin) ---
# Controls how flyteadmin maps project-domain pairs to Kubernetes namespaces.
# MUST match the dataplane's namespace_mapping value.
# Default (if unset): "{{ project }}-{{ domain }}"
#
# namespace_config:
# namespace_mapping:
# template: "{{ project }}-{{ domain }}"

adminServer:
admin:
endpoint: 'dns:///{{ .Values.global.UNION_HOST }}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ data:
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}

{{- with .Values.config.namespace_mapping }}
{{- $nsMapping := .Values.config.namespace_mapping | default .Values.namespace_mapping }}
{{- with $nsMapping }}
namespace_mapping.yaml: |
namespace_mapping:
{{- tpl (toYaml .) $ | nindent 6 }}
Expand Down
6 changes: 6 additions & 0 deletions charts/dataplane/templates/nodeexecutor/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ data:
{{- with .Values.executor.raw_config }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- if not (dig "namespace_mapping" false .Values.executor.raw_config) }}
{{- with .Values.namespace_mapping }}
namespace_mapping:
{{- tpl (toYaml .) $ | nindent 6 }}
{{- end }}
{{- end }}
union:
{{- with .Values.config.union.connection }}
connection:
Expand Down
4 changes: 4 additions & 0 deletions charts/dataplane/templates/operator/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ data:
org:
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- if and (not .Values.config.operator.org) .Values.namespace_mapping }}
org:
namespaceTemplate: {{ tpl (.Values.namespace_mapping.template | quote) $ }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry stupid question but wouldn't we still want this in the org block above when and (Values.config.operator.org) .Values.namespace_mapping

{{- end }}
{{- if .Values.imageBuilder.enabled }}
imageBuilder:
enabled: {{ .Values.imageBuilder.enabled }}
Expand Down
6 changes: 6 additions & 0 deletions charts/dataplane/templates/propeller/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ data:
{{- with .Values.config.namespace_config }}
namespace_config.yaml: | {{ tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- if and (not .Values.config.namespace_config) .Values.namespace_mapping }}
namespace_config.yaml: |
namespace_config:
namespace_mapping:
{{- tpl (toYaml .Values.namespace_mapping) $ | nindent 8 }}
{{- end }}
{{- with .Values.config.resource_manager }}
resource_manager.yaml: | {{ tpl (toYaml .) $ | nindent 4 }}
{{- end }}
Expand Down
6 changes: 5 additions & 1 deletion charts/dataplane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,11 @@ databricks:
enabled: false
plugin_config: { }

# -- Custom namespace mapping for mapping Union runs to Kubernetes namespaces.
# -- Namespace mapping template for mapping Union runs to Kubernetes namespaces.
# This is the canonical source of truth. All dataplane services (propeller,
# clusterresourcesync, operator, executor) will inherit this value unless
# explicitly overridden in their service-specific config sections
# (config.namespace_config, config.operator.org, executor.raw_config).
namespace_mapping: {}
# template: "{{`{{ project }}`}}-{{`{{ domain }}`}}"

Expand Down
23 changes: 17 additions & 6 deletions tests/generated/dataplane.aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,9 @@ data:
logger:
level: 4
show-source: true
namespace_mapping.yaml: |
namespace_mapping:
template: '{{ project }}-{{ domain }}'
---
# Source: dataplane/templates/clusterresourcesync/configmap.yaml
apiVersion: v1
Expand Down Expand Up @@ -1493,6 +1496,8 @@ data:
cpu: 4096
gpu: 256
memory: 2Ti
namespace_mapping:
template: '{{ project }}-{{ domain }}'
union:
connection:
host: dns:///test-controlplane-host
Expand Down Expand Up @@ -1632,6 +1637,8 @@ data:
endpoint: 'http://flytepropeller:10254'
proxy:
endpoint: 'http://union-operator-proxy:10254'
org:
namespaceTemplate: "{{ project }}-{{ domain }}"
imageBuilder:
enabled: true
executionNamespaceLabels:
Expand Down Expand Up @@ -1795,6 +1802,10 @@ data:
logger:
level: 4
show-source: true
namespace_config.yaml: |
namespace_config:
namespace_mapping:
template: '{{ project }}-{{ domain }}'
resource_manager.yaml: |
propeller:
resourcemanager:
Expand Down Expand Up @@ -4412,7 +4423,7 @@ spec:
template:
metadata:
annotations:
configChecksum: "4c10925a32e76bd929981340593aa27527dc5f5827716a704f673db74981dc5"
configChecksum: "96e08b4b50439ee97d49319af9b9c392cffe7461c4ffe74aeaa4860d09c0aa8"

labels:

Expand Down Expand Up @@ -4628,7 +4639,7 @@ spec:
template:
metadata:
annotations:
configChecksum: "71f13cdc28f478300a3a90f5237a97936a1d96315c52911dff8b0756be1304f"
configChecksum: "abb00a305bfda2dcf825ac2267a95fe083054bb9ce97bb8bc3f2be362fd863e"
labels:

app: executor
Expand Down Expand Up @@ -4729,7 +4740,7 @@ spec:
template:
metadata:
annotations:
configChecksum: "aa0b3e931973af95466cb9c822de00987868ffab27ce820f7949f1b507fca88"
configChecksum: "071c066b54a8d9b15360f8d98529029af0e3c7748deb7436d95df1ef3ac4578"

labels:

Expand Down Expand Up @@ -4866,7 +4877,7 @@ spec:
template:
metadata:
annotations:
configChecksum: "aa0b3e931973af95466cb9c822de00987868ffab27ce820f7949f1b507fca88"
configChecksum: "071c066b54a8d9b15360f8d98529029af0e3c7748deb7436d95df1ef3ac4578"

labels:

Expand Down Expand Up @@ -4983,7 +4994,7 @@ spec:
platform.union.ai/service-group: release-name
app.kubernetes.io/managed-by: Helm
annotations:
configChecksum: "ed08f5a0ef5d77051b1af982bca6e255e12245db7f508442075567beabe1106"
configChecksum: "ce28c1ece19c982aaa77267a6d9f6b1818e9477097b789666fbe0d216d37060"

spec:
securityContext:
Expand Down Expand Up @@ -5138,7 +5149,7 @@ spec:
template:
metadata:
annotations:
configChecksum: "ed08f5a0ef5d77051b1af982bca6e255e12245db7f508442075567beabe1106"
configChecksum: "ce28c1ece19c982aaa77267a6d9f6b1818e9477097b789666fbe0d216d37060"

labels:

Expand Down
23 changes: 17 additions & 6 deletions tests/generated/dataplane.fully-selfhosted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ data:
logger:
level: 4
show-source: true
namespace_mapping.yaml: |
namespace_mapping:
template: '{{ project }}-{{ domain }}'
---
# Source: dataplane/templates/clusterresourcesync/configmap.yaml
apiVersion: v1
Expand Down Expand Up @@ -506,6 +509,8 @@ data:
cpu: 4096
gpu: 256
memory: 2Ti
namespace_mapping:
template: '{{ project }}-{{ domain }}'
union:
connection:
host: dns:///
Expand Down Expand Up @@ -653,6 +658,8 @@ data:
endpoint: 'http://flytepropeller:10254'
proxy:
endpoint: 'http://union-operator-proxy:10254'
org:
namespaceTemplate: "{{ project }}-{{ domain }}"
imageBuilder:
enabled: true
executionNamespaceLabels:
Expand Down Expand Up @@ -828,6 +835,10 @@ data:
logger:
level: 4
show-source: true
namespace_config.yaml: |
namespace_config:
namespace_mapping:
template: '{{ project }}-{{ domain }}'
resource_manager.yaml: |
propeller:
resourcemanager:
Expand Down Expand Up @@ -2631,7 +2642,7 @@ spec:
template:
metadata:
annotations:
configChecksum: "82cfe6bdee45aed1dd8245a73999608b8268148a8c7975ab0a20bb88bb4be19"
configChecksum: "e2d33d90f995ae85ac39eef81f2f5a880bbd04474e04814acee17db56f44eb9"

labels:

Expand Down Expand Up @@ -2842,7 +2853,7 @@ spec:
template:
metadata:
annotations:
configChecksum: "d714568b3dd8af97f1b334de6d7014002d6e6ea02e4a341fc49cdb593199381"
configChecksum: "4857510c582cb1e2132b8e75575f26493e3b7d51c0e1638e7ee3dff738dda98"
labels:

app: executor
Expand Down Expand Up @@ -2933,7 +2944,7 @@ spec:
template:
metadata:
annotations:
configChecksum: "a1ad51467d053b9a340c1c604c1882e120eba8b3cce0f8eb5d0284c7e8ed54a"
configChecksum: "2c4a7051e59f1a44007742d413b7a3abe8b2fe4ac12c859a0bd4f3a27a84d96"

labels:

Expand Down Expand Up @@ -3039,7 +3050,7 @@ spec:
template:
metadata:
annotations:
configChecksum: "a1ad51467d053b9a340c1c604c1882e120eba8b3cce0f8eb5d0284c7e8ed54a"
configChecksum: "2c4a7051e59f1a44007742d413b7a3abe8b2fe4ac12c859a0bd4f3a27a84d96"

labels:

Expand Down Expand Up @@ -3151,7 +3162,7 @@ spec:
platform.union.ai/service-group: release-name
app.kubernetes.io/managed-by: Helm
annotations:
configChecksum: "915dd1c16576bf7f84b7293876a05f5b66993798003e1ce6a9fc2da8a861b26"
configChecksum: "dfe184061ce334f96f260b7a43383a53b8dd2604ce86eb1cc0adf0b42497119"

spec:
securityContext:
Expand Down Expand Up @@ -3306,7 +3317,7 @@ spec:
template:
metadata:
annotations:
configChecksum: "915dd1c16576bf7f84b7293876a05f5b66993798003e1ce6a9fc2da8a861b26"
configChecksum: "dfe184061ce334f96f260b7a43383a53b8dd2604ce86eb1cc0adf0b42497119"

labels:

Expand Down
5 changes: 5 additions & 0 deletions tests/values/dataplane.aws.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Intended to match and test charts/dataplane/values.aws.yaml

# Test namespace_mapping cascading to all services
namespace_mapping:
template: '{{`{{ project }}`}}-{{`{{ domain }}`}}'

global:
UNION_CONTROL_PLANE_HOST: "test-controlplane-host"
CLUSTER_NAME: "test-cluster-name"
Expand Down
4 changes: 4 additions & 0 deletions tests/values/dataplane.fully-selfhosted.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Test namespace_mapping cascading to all services
namespace_mapping:
template: '{{`{{ project }}`}}-{{`{{ domain }}`}}'

serving:
auth:
enabled: false
Expand Down