Skip to content

Commit eaa576f

Browse files
mhotanclaude
andcommitted
Replace flyte-core subchart with direct templates (FAB-277)
Add dedicated templates for flyteadmin and flyteconsole that render identically to the flyte-core subchart output. The subchart is now suppressed by default via `flyte.useDirectTemplates: true`. New templates: - templates/flyteadmin/ — configmap, deployment, hpa, rbac, secret, service, secret-auth (7 files) - templates/flyteconsole/ — configmap, deployment, service (3 files) Absorbed subchart helpers into _flyte-core.tpl: - storage.base, storage (S3/GCS/sandbox/custom) - databaseSecret.volume, databaseSecret.volumeMount - flyteadmin.podLabels, flyteconsole.* helpers - flyte.chart (now uses controlplane chart identity) Values changes: - flyte.useDirectTemplates: true (default on, opt-out with false) - flyte.flyteadmin.enabled: false (subchart suppressed) - flyte.flyteconsole.enabled: false (subchart suppressed) - flyte.secrets.adminOauthClientCredentials.enabled: false **Breaking change — requires `helm upgrade --force`:** Labels on flyteadmin/flyteconsole resources change: - `helm.sh/chart` changes from `flyte-core-v1.16.1` to `controlplane-<version>` - `app.kubernetes.io/managed-by: Helm` is now included (was commented out) Selector labels (`app.kubernetes.io/name`, `app.kubernetes.io/instance`) are unchanged, so pod scheduling is not affected. **Legacy subchart behavior:** Set `flyte.useDirectTemplates: false` and re-enable `flyte.flyteadmin.enabled: true`, `flyte.flyteconsole.enabled: true`, `flyte.secrets.adminOauthClientCredentials.enabled: true`. ref FAB-277 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d6c3ccb commit eaa576f

17 files changed

Lines changed: 4202 additions & 3392 deletions
Lines changed: 170 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,32 @@
1+
{{/*
2+
Flyte component helpers.
3+
4+
These were originally defined in the flyte-core subchart _helpers.tpl and overridden
5+
here. As part of FAB-277 (remove flyte-core subchart), they are now the canonical
6+
definitions. Direct templates in templates/flyteadmin/ and templates/flyteconsole/
7+
use these helpers.
8+
9+
NOTE: Labels intentionally differ from the old subchart output:
10+
- helm.sh/chart uses the controlplane chart version (was flyte-core-v1.16.1)
11+
- app.kubernetes.io/managed-by is included (was commented out)
12+
This requires `helm upgrade --force` when upgrading from subchart-based releases.
13+
*/}}
14+
115
{{- define "flyte.namespace" -}}
216
{{- default .Release.Namespace .Values.forceNamespace | trunc 63 | trimSuffix "-" -}}
317
{{- end -}}
418

19+
{{/* Chart label — uses controlplane chart identity (breaking change from subchart) */}}
20+
{{- define "flyte.chart" -}}
21+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
22+
{{- end -}}
23+
24+
{{- define "flyte.selectorLabels" -}}
25+
app.kubernetes.io/instance: {{ .Release.Name }}
26+
{{- end }}
27+
28+
{{/* ---- flyteadmin ---- */}}
29+
530
{{- define "flyteadmin.name" -}}
631
flyteadmin
732
{{- end -}}
@@ -11,16 +36,154 @@ app.kubernetes.io/name: {{ template "flyteadmin.name" . }}
1136
app.kubernetes.io/instance: {{ .Release.Name }}
1237
{{- end -}}
1338

14-
{{/*
15-
Selector labels
16-
*/}}
17-
{{- define "flyte.selectorLabels" -}}
39+
{{- define "flyteadmin.labels" -}}
40+
{{ include "flyteadmin.selectorLabels" . }}
41+
helm.sh/chart: {{ include "flyte.chart" . }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end -}}
44+
45+
{{- define "flyteadmin.podLabels" -}}
46+
{{ include "flyteadmin.labels" . }}
47+
{{- with .Values.flyte.flyteadmin.podLabels }}
48+
{{ toYaml . }}
49+
{{- end }}
50+
{{- end -}}
51+
52+
{{/* ---- flyteconsole ---- */}}
53+
54+
{{- define "flyteconsole.name" -}}
55+
flyteconsole
56+
{{- end -}}
57+
58+
{{- define "flyteconsole.selectorLabels" -}}
59+
app.kubernetes.io/name: {{ template "flyteconsole.name" . }}
1860
app.kubernetes.io/instance: {{ .Release.Name }}
61+
{{- end -}}
62+
63+
{{- define "flyteconsole.labels" -}}
64+
{{ include "flyteconsole.selectorLabels" . }}
65+
helm.sh/chart: {{ include "flyte.chart" . }}
66+
app.kubernetes.io/managed-by: {{ .Release.Service }}
67+
{{- end -}}
68+
69+
{{- define "flyteconsole.podLabels" -}}
70+
{{ include "flyteconsole.labels" . }}
71+
{{- with .Values.flyte.flyteconsole.podLabels }}
72+
{{ toYaml . }}
1973
{{- end }}
74+
{{- end -}}
2075

76+
{{/* ---- cacheservice (already has dedicated templates, helpers referenced there) ---- */}}
2177

22-
{{- define "flyteadmin.labels" -}}
23-
{{ include "flyteadmin.selectorLabels" . }}
78+
{{- define "cacheservice.name" -}}
79+
cacheservice
80+
{{- end -}}
81+
82+
{{- define "cacheservice.selectorLabels" -}}
83+
app.kubernetes.io/name: {{ template "cacheservice.name" . }}
84+
app.kubernetes.io/instance: {{ .Release.Name }}
85+
{{- end -}}
86+
87+
{{- define "cacheservice.labels" -}}
88+
{{ include "cacheservice.selectorLabels" . }}
2489
helm.sh/chart: {{ include "flyte.chart" . }}
25-
#app.kubernetes.io/managed-by: {{ .Release.Service }}
90+
app.kubernetes.io/managed-by: {{ .Release.Service }}
2691
{{- end -}}
92+
93+
{{- define "cacheservice.podLabels" -}}
94+
{{ include "cacheservice.labels" . }}
95+
{{- with .Values.flyte.cacheservice.podLabels }}
96+
{{ toYaml . }}
97+
{{- end }}
98+
{{- end -}}
99+
100+
{{/* ---- Database secret volume helpers ---- */}}
101+
102+
{{- define "databaseSecret.volume" -}}
103+
{{- with .Values.flyte.common.databaseSecret.name -}}
104+
- name: {{ . }}
105+
secret:
106+
secretName: {{ . }}
107+
{{- end }}
108+
{{- end }}
109+
110+
{{- define "databaseSecret.volumeMount" -}}
111+
{{- with .Values.flyte.common.databaseSecret.name -}}
112+
- mountPath: /etc/db
113+
name: {{ . }}
114+
{{- end }}
115+
{{- end }}
116+
117+
{{/* cacheservice uses the same pattern but was historically separate */}}
118+
{{- define "cacheservice-databaseSecret.volume" -}}
119+
{{- with .Values.flyte.common.databaseSecret.name -}}
120+
- name: {{ . }}
121+
secret:
122+
secretName: {{ . }}
123+
{{- end }}
124+
{{- end }}
125+
126+
{{- define "cacheservice-databaseSecret.volumeMount" -}}
127+
{{- with .Values.flyte.common.databaseSecret.name -}}
128+
- mountPath: /etc/db
129+
name: {{ . }}
130+
{{- end }}
131+
{{- end }}
132+
133+
{{/* ---- Storage helpers (from flyte-core _helpers.tpl) ---- */}}
134+
135+
{{- define "storage.base" -}}
136+
storage:
137+
{{- if eq .Values.flyte.storage.type "s3" }}
138+
type: s3
139+
container: {{ .Values.flyte.storage.bucketName | quote }}
140+
connection:
141+
auth-type: {{ .Values.flyte.storage.s3.authType }}
142+
region: {{ .Values.flyte.storage.s3.region }}
143+
{{- if .Values.flyte.storage.s3.endpoint }}
144+
endpoint: {{ .Values.flyte.storage.s3.endpoint }}
145+
{{- end }}
146+
{{- if eq .Values.flyte.storage.s3.authType "accesskey" }}
147+
access-key: {{ .Values.flyte.storage.s3.accessKey }}
148+
secret-key: {{ .Values.flyte.storage.s3.secretKey }}
149+
{{- end }}
150+
{{- else if eq .Values.flyte.storage.type "gcs" }}
151+
type: stow
152+
stow:
153+
kind: google
154+
config:
155+
json: ""
156+
project_id: {{ .Values.flyte.storage.gcs.projectId }}
157+
scopes: https://www.googleapis.com/auth/cloud-platform
158+
container: {{ .Values.flyte.storage.bucketName | quote }}
159+
{{- else if eq .Values.flyte.storage.type "sandbox" }}
160+
type: minio
161+
container: {{ .Values.flyte.storage.bucketName | quote }}
162+
stow:
163+
kind: s3
164+
config:
165+
access_key_id: minio
166+
auth_type: accesskey
167+
secret_key: miniostorage
168+
disable_ssl: true
169+
endpoint: http://minio.{{ .Release.Namespace }}.svc.cluster.local:9000
170+
region: us-east-1
171+
signedUrl:
172+
stowConfigOverride:
173+
endpoint: http://minio.{{ .Release.Namespace }}.svc.cluster.local:9000
174+
{{- else if eq .Values.flyte.storage.type "custom" }}
175+
{{- with .Values.flyte.storage.custom -}}
176+
{{ tpl (toYaml .) $ | nindent 2 }}
177+
{{- end }}
178+
{{- end }}
179+
{{- end }}
180+
181+
{{- define "storage" -}}
182+
{{ include "storage.base" .}}
183+
enable-multicontainer: {{ .Values.flyte.storage.enableMultiContainer }}
184+
limits:
185+
maxDownloadMBs: {{ .Values.flyte.storage.limits.maxDownloadMBs }}
186+
cache:
187+
max_size_mbs: {{ .Values.flyte.storage.cache.maxSizeMBs }}
188+
target_gc_percent: {{ .Values.flyte.storage.cache.targetGCPercent }}
189+
{{- end }}
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
{{- if .Values.flyte.useDirectTemplates }}
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: flyte-admin-clusters-config
6+
namespace: {{ template "flyte.namespace" . }}
7+
labels: {{ include "flyteadmin.labels" . | nindent 4 }}
8+
data:
9+
{{- with .Values.flyte.configmap.clusters }}
10+
clusters.yaml: |
11+
clusters:
12+
{{- tpl (toYaml .) $ | nindent 6 }}
13+
{{- end }}
14+
---
15+
apiVersion: v1
16+
kind: ConfigMap
17+
metadata:
18+
name: flyte-admin-base-config
19+
namespace: {{ template "flyte.namespace" . }}
20+
labels: {{ include "flyteadmin.labels" . | nindent 4 }}
21+
data:
22+
{{- with .Values.flyte.db.admin }}
23+
db.yaml: | {{ tpl (toYaml .) $ | nindent 4 }}
24+
{{- end }}
25+
{{- with .Values.flyte.configmap.domain }}
26+
domain.yaml: | {{ tpl (toYaml .) $ | nindent 4 }}
27+
{{- end }}
28+
{{- with .Values.flyte.configmap.logger }}
29+
logger.yaml: | {{ tpl (toYaml .) $ | nindent 4 }}
30+
{{- end }}
31+
{{- with .Values.flyte.configmap.otel }}
32+
otel.yaml: | {{ tpl (toYaml .) $ | nindent 4 }}
33+
{{- end }}
34+
{{- with .Values.flyte.configmap.adminServer }}
35+
server.yaml: | {{ tpl (toYaml .) $ | nindent 4 }}
36+
{{- end }}
37+
{{- with .Values.flyte.configmap.remoteData }}
38+
remoteData.yaml: | {{ tpl (toYaml .) $ | nindent 4 }}
39+
{{- end }}
40+
{{- with .Values.flyte.configmap.namespace_config }}
41+
namespace_config.yaml: | {{ toYaml . | nindent 4 }}
42+
{{- end }}
43+
{{- with .Values.flyte.configmap.clusterpool_config }}
44+
clusterpool_config.yaml: | {{ toYaml . | nindent 4 }}
45+
{{- end }}
46+
{{- if not .Values.flyte.storage.secretName }}
47+
storage.yaml: | {{ tpl (include "storage" .) $ | nindent 4 }}
48+
{{- end }}
49+
{{- with .Values.flyte.configmap.task_resource_defaults }}
50+
task_resource_defaults.yaml: | {{ tpl (toYaml .) $ | nindent 4 }}
51+
{{- end }}
52+
{{- if .Values.flyte.workflow_notifications.enabled }}
53+
notifications.yaml: |
54+
notifications:
55+
type: {{ .Values.flyte.workflow_notifications.config.notifications.type }}
56+
{{- if not .Values.flyte.workflow_notifications.config.notifications.aws }}
57+
{{- with .Values.flyte.workflow_notifications.config.notifications.region }}
58+
region: {{ tpl . $ }}
59+
{{- end }}
60+
{{- end }}
61+
{{- if eq .Values.flyte.workflow_notifications.config.notifications.type "aws" }}
62+
{{- with .Values.flyte.workflow_notifications.config.notifications.aws }}
63+
aws: {{ tpl (toYaml .) $ | nindent 8 }}
64+
{{- end }}
65+
{{- end }}
66+
{{- if eq .Values.flyte.workflow_notifications.config.notifications.type "gcp" }}
67+
{{- with .Values.flyte.workflow_notifications.config.notifications.gcp }}
68+
gcp: {{ tpl (toYaml .) $ | nindent 8 }}
69+
{{- end }}
70+
{{- end }}
71+
{{- with .Values.flyte.workflow_notifications.config.notifications.publisher }}
72+
publisher: {{- tpl (toYaml .) $ | nindent 8 }}
73+
{{- end }}
74+
{{- with .Values.flyte.workflow_notifications.config.notifications.processor }}
75+
processor: {{- tpl (toYaml .) $ | nindent 8 }}
76+
{{- end }}
77+
{{- with .Values.flyte.workflow_notifications.config.notifications.emailer }}
78+
emailer: {{- toYaml . | nindent 8 }}
79+
{{- end }}
80+
{{- end }}
81+
{{- if .Values.flyte.external_events.enable }}
82+
{{- with .Values.flyte.external_events }}
83+
external_events.yaml: |
84+
externalEvents: {{ tpl (toYaml .) $ | nindent 6 }}
85+
{{- end }}
86+
{{- end }}
87+
{{- if .Values.flyte.cloud_events.enable }}
88+
{{- with .Values.flyte.cloud_events }}
89+
cloud_events.yaml: |
90+
cloudEvents: {{ tpl (toYaml .) $ | nindent 6 }}
91+
{{- end }}
92+
{{- end }}
93+
{{- if .Values.flyte.cluster_resource_manager.enabled }}
94+
{{- with .Values.flyte.cluster_resource_manager.config }}
95+
cluster_resources.yaml: | {{ tpl (toYaml .) $ | nindent 4 }}
96+
{{- end }}
97+
{{- end }}
98+
{{- if and .Values.flyte.workflow_scheduler.enabled (eq .Values.flyte.workflow_scheduler.type "aws") }}
99+
{{- with .Values.flyte.workflow_scheduler.config }}
100+
scheduler.yaml: | {{ tpl (toYaml .) $ | nindent 4 }}
101+
{{- end }}
102+
{{- end }}
103+
{{- end }}

0 commit comments

Comments
 (0)