Skip to content
Open
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
6 changes: 6 additions & 0 deletions charts/flyte-core/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
name: flyte-core
description: Helm chart for Flyte core that each component deployed as separate services
type: application
version: "0.1.0"
appVersion: "1.0.0"
164 changes: 164 additions & 0 deletions charts/flyte-core/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "flyte-core.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
*/}}
{{- define "flyte-core.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Chart label value.
*/}}
{{- define "flyte-core.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels applied to every resource.
*/}}
{{- define "flyte-core.labels" -}}
helm.sh/chart: {{ include "flyte-core.chart" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: flyte
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
{{- with .Values.commonLabels }}
{{ toYaml . }}
{{- end }}
{{- end }}

{{/*
Component labels — call with (dict "ctx" $ "component" "runs").
*/}}
{{- define "flyte-core.componentLabels" -}}
{{ include "flyte-core.labels" .ctx }}
app.kubernetes.io/name: {{ include "flyte-core.name" .ctx }}
app.kubernetes.io/component: {{ .component }}
{{- end }}

{{/*
Selector labels for a component — call with (dict "ctx" $ "component" "runs").
*/}}
{{- define "flyte-core.selectorLabels" -}}
app.kubernetes.io/name: {{ include "flyte-core.name" .ctx }}
app.kubernetes.io/instance: {{ .ctx.Release.Name }}
app.kubernetes.io/component: {{ .component }}
{{- end }}

{{/*
ServiceAccount name.
*/}}
{{- define "flyte-core.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "flyte-core.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Component fullname — call with (dict "ctx" $ "component" "runs").
*/}}
{{- define "flyte-core.componentFullname" -}}
{{- printf "%s-%s" (include "flyte-core.fullname" .ctx) .component | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Per-component ConfigMap name — call with (dict "ctx" $ "component" "runs").
*/}}
{{- define "flyte-core.componentConfigMapName" -}}
{{- printf "%s-%s-config" (include "flyte-core.fullname" .ctx) .component | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Database Secret name.
*/}}
{{- define "flyte-core.dbSecretName" -}}
{{- printf "%s-db-password" (include "flyte-core.fullname" .) }}
{{- end }}

{{/*
Webhook service name.
*/}}
{{- define "flyte-core.webhook.serviceName" -}}
{{- printf "%s-webhook" (include "flyte-core.fullname" .) }}
{{- end }}

{{/*
ClusterRole name.
*/}}
{{- define "flyte-core.clusterRoleName" -}}
{{- printf "%s-cluster-role" (include "flyte-core.fullname" .) }}
{{- end }}

{{/*
Storage stow config block — reused across component configmaps.
*/}}
{{- define "flyte-core.storageConfig" -}}
storage:
type: stow
stow:
{{- if eq .Values.storage.provider "s3" }}
{{- with .Values.storage.providerConfig.s3 }}
kind: s3
config:
region: {{ .region }}
disable_ssl: {{ .disableSSL }}
v2_signing: {{ .v2Signing }}
{{- if .endpoint }}
endpoint: {{ .endpoint }}
{{- end }}
auth_type: {{ .authType }}
{{- end }}
{{- else if eq .Values.storage.provider "gcs" }}
kind: google
config:
json: ""
project_id: {{ .Values.storage.providerConfig.gcs.project }}
scopes: https://www.googleapis.com/auth/cloud-platform
{{- else if eq .Values.storage.provider "azure" }}
{{- with .Values.storage.providerConfig.azure }}
kind: azure
config:
account: {{ .account }}
{{- if .key }}
key: {{ .key }}
{{- end }}
{{- end }}
{{- end }}
container: {{ .Values.storage.metadataContainer }}
{{- end }}

{{/*
Database config block — reused by runs and cache_service.
*/}}
{{- define "flyte-core.databaseConfig" -}}
database:
postgres:
username: {{ .Values.database.username }}
host: {{ tpl .Values.database.host . }}
port: {{ .Values.database.port }}
dbname: {{ .Values.database.dbname }}
options: {{ .Values.database.options | quote }}
{{- if .Values.database.password }}
passwordPath: /etc/flyte/db-password/password
{{- else if .Values.database.passwordPath }}
passwordPath: {{ .Values.database.passwordPath }}
{{- end }}
{{- end }}
27 changes: 27 additions & 0 deletions charts/flyte-core/templates/actions/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if .Values.actions.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "flyte-core.componentConfigMapName" (dict "ctx" $ "component" "actions") }}
namespace: {{ .Release.Namespace }}
labels: {{- include "flyte-core.componentLabels" (dict "ctx" $ "component" "actions") | nindent 4 }}
data:
000-core.yaml: |
logger:
show-source: true
level: {{ .Values.logging.level }}
010-actions.yaml: |
actions:
server:
host: "0.0.0.0"
port: {{ .Values.actions.port }}
kubernetes:
namespace: {{ .Release.Namespace }}
watchBufferSize: {{ .Values.actions.config.watchBufferSize }}
watchWorkers: {{ .Values.actions.config.watchWorkers }}
runServiceUrl: "http://{{ include "flyte-core.componentFullname" (dict "ctx" $ "component" "runs") }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.runs.port }}"
{{- with .Values.inlineConfig }}
100-inline.yaml: |
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
78 changes: 78 additions & 0 deletions charts/flyte-core/templates/actions/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{{- if .Values.actions.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "flyte-core.componentFullname" (dict "ctx" $ "component" "actions") }}
namespace: {{ .Release.Namespace }}
labels: {{- include "flyte-core.componentLabels" (dict "ctx" $ "component" "actions") | nindent 4 }}
spec:
replicas: {{ .Values.actions.replicaCount }}
selector:
matchLabels: {{- include "flyte-core.selectorLabels" (dict "ctx" $ "component" "actions") | nindent 6 }}
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/actions/configmap.yaml") . | sha256sum }}
{{- with .Values.actions.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels: {{- include "flyte-core.selectorLabels" (dict "ctx" $ "component" "actions") | nindent 8 }}
{{- with .Values.actions.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "flyte-core.serviceAccountName" . }}
{{- with .Values.actions.nodeSelector }}
nodeSelector: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.actions.tolerations }}
tolerations: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.actions.affinity }}
affinity: {{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: actions
image: "{{ .Values.image.repository }}/actions:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/usr/local/bin/flyte-actions"]
args: ["--config", "/etc/flyte/config.d/*.yaml"]
ports:
- name: http
containerPort: {{ .Values.actions.port }}
protocol: TCP
livenessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 30
readinessProbe:
httpGet:
path: /readyz
port: http
initialDelaySeconds: 30
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- with .Values.actions.extraEnvVars }}
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: config
mountPath: /etc/flyte/config.d
{{- with .Values.actions.resources }}
resources: {{- toYaml . | nindent 12 }}
{{- end }}
volumes:
- name: config
projected:
sources:
- configMap:
name: {{ include "flyte-core.componentConfigMapName" (dict "ctx" $ "component" "actions") }}
{{- end }}
16 changes: 16 additions & 0 deletions charts/flyte-core/templates/actions/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.actions.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "flyte-core.componentFullname" (dict "ctx" $ "component" "actions") }}
namespace: {{ .Release.Namespace }}
labels: {{- include "flyte-core.componentLabels" (dict "ctx" $ "component" "actions") | nindent 4 }}
spec:
type: ClusterIP
ports:
- name: http
port: {{ .Values.actions.port }}
targetPort: http
protocol: TCP
selector: {{- include "flyte-core.selectorLabels" (dict "ctx" $ "component" "actions") | nindent 4 }}
{{- end }}
26 changes: 26 additions & 0 deletions charts/flyte-core/templates/cache_service/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- if .Values.cacheService.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "flyte-core.componentConfigMapName" (dict "ctx" $ "component" "cache-service") }}
namespace: {{ .Release.Namespace }}
labels: {{- include "flyte-core.componentLabels" (dict "ctx" $ "component" "cache-service") | nindent 4 }}
data:
000-core.yaml: |
logger:
show-source: true
level: {{ .Values.logging.level }}
001-storage.yaml: |
{{- include "flyte-core.storageConfig" . | nindent 4 }}
002-database.yaml: |
{{- include "flyte-core.databaseConfig" . | nindent 4 }}
010-cache-service.yaml: |
cache_service:
server:
host: "0.0.0.0"
port: {{ .Values.cacheService.port }}
{{- with .Values.inlineConfig }}
100-inline.yaml: |
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
Loading
Loading