Skip to content

Commit

Permalink
Added flyte scheduler in helm (#1374)
Browse files Browse the repository at this point in the history
  • Loading branch information
yindia authored Sep 25, 2021
1 parent c158263 commit e3f9211
Show file tree
Hide file tree
Showing 19 changed files with 729 additions and 214 deletions.
33 changes: 29 additions & 4 deletions charts/flyte-core/README.md

Large diffs are not rendered by default.

142 changes: 71 additions & 71 deletions charts/flyte-core/templates/admin/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,54 +22,54 @@ spec:
- name: check-db-ready
image: postgres:10.16-alpine
command:
- sh
- -c
- until pg_isready -h {{ tpl .Values.db.admin.database.host $ }} -p {{ .Values.db.admin.database.port }}; do echo waiting for database; sleep 2; done;
- sh
- -c
- until pg_isready -h {{ tpl .Values.db.admin.database.host $ }} -p {{ .Values.db.admin.database.port }}; do echo waiting for database; sleep 2; done;
{{- end }}
- command:
- flyteadmin
- --config
- {{ .Values.flyteadmin.configPath }}
- migrate
- run
- flyteadmin
- --config
- {{ .Values.flyteadmin.configPath }}
- migrate
- run
image: "{{ .Values.flyteadmin.image.repository }}:{{ .Values.flyteadmin.image.tag }}"
imagePullPolicy: "{{ .Values.flyteadmin.image.pullPolicy }}"
name: run-migrations
volumeMounts: {{- include "databaseSecret.volumeMount" . | nindent 10 }}
- mountPath: /etc/flyte/config
name: config-volume
- mountPath: /etc/flyte/config
name: config-volume
{{- if .Values.flyteadmin.initialProjects }}
- command:
- flyteadmin
- --config
- {{ .Values.flyteadmin.configPath }}
- migrate
- seed-projects
- flyteadmin
- --config
- {{ .Values.flyteadmin.configPath }}
- migrate
- seed-projects
{{- range .Values.flyteadmin.initialProjects }}
- {{ . }}
{{- end }}
image: "{{ .Values.flyteadmin.image.repository }}:{{ .Values.flyteadmin.image.tag }}"
imagePullPolicy: "{{ .Values.flyteadmin.image.pullPolicy }}"
name: seed-projects
volumeMounts: {{- include "databaseSecret.volumeMount" . | nindent 10 }}
- mountPath: /etc/flyte/config
name: config-volume
- mountPath: /etc/flyte/config
name: config-volume
{{- end }}
{{- if .Values.cluster_resource_manager.enabled }}
- command:
- flyteadmin
- --config
- {{ .Values.flyteadmin.configPath }}
- clusterresource
- sync
- flyteadmin
- --config
- {{ .Values.flyteadmin.configPath }}
- clusterresource
- sync
image: "{{ .Values.flyteadmin.image.repository }}:{{ .Values.flyteadmin.image.tag }}"
imagePullPolicy: "{{ .Values.flyteadmin.image.pullPolicy }}"
name: sync-cluster-resources
volumeMounts: {{- include "databaseSecret.volumeMount" . | nindent 10 }}
- mountPath: /etc/flyte/clusterresource/templates
name: resource-templates
- mountPath: /etc/flyte/config
name: config-volume
- mountPath: /etc/flyte/clusterresource/templates
name: resource-templates
- mountPath: /etc/flyte/config
name: config-volume
{{- end }}
- name: generate-secrets
image: "{{ .Values.flyteadmin.image.repository }}:{{ .Values.flyteadmin.image.tag }}"
Expand All @@ -88,51 +88,51 @@ spec:
fieldRef:
fieldPath: metadata.namespace
containers:
- command:
- flyteadmin
- --config
- {{ .Values.flyteadmin.configPath }}
{{- with .Values.flyteadmin.extraArgs }}
{{- toYaml . | nindent 8 }}
{{- end }}
- serve
image: "{{ .Values.flyteadmin.image.repository }}:{{ .Values.flyteadmin.image.tag }}"
imagePullPolicy: "{{ .Values.flyteadmin.image.pullPolicy }}"
name: flyteadmin
ports:
- containerPort: 8088
- containerPort: 8089
resources: {{ toYaml .Values.flyteadmin.resources | nindent 10 }}
volumeMounts: {{- include "databaseSecret.volumeMount" . | nindent 8 }}
- mountPath: /srv/flyte
name: shared-data
- mountPath: /etc/flyte/config
name: config-volume
- name: auth
mountPath: /etc/secrets/
{{- with .Values.flyteadmin.additionalVolumeMounts -}}
{{ toYaml . | nindent 8 }}
{{- end }}
- command:
- sh
- -c
- ln -s /usr/share/nginx/html /usr/share/nginx/html/openapi && sh /usr/local/bin/docker-run.sh
env:
- name: PAGE_TITLE
value: Flyte Admin OpenAPI
- name: SPEC_URL
value: /api/v1/openapi
- name: PORT
value: "8087"
image: docker.io/redocly/redoc
imagePullPolicy: IfNotPresent
name: redoc
ports:
- containerPort: 8087
resources:
limits:
cpu: "0.1"
memory: 200Mi
- command:
- flyteadmin
- --config
- {{ .Values.flyteadmin.configPath }}
{{- with .Values.flyteadmin.extraArgs }}
{{- toYaml . | nindent 8 }}
{{- end }}
- serve
image: "{{ .Values.flyteadmin.image.repository }}:{{ .Values.flyteadmin.image.tag }}"
imagePullPolicy: "{{ .Values.flyteadmin.image.pullPolicy }}"
name: flyteadmin
ports:
- containerPort: 8088
- containerPort: 8089
resources: {{ toYaml .Values.flyteadmin.resources | nindent 10 }}
volumeMounts: {{- include "databaseSecret.volumeMount" . | nindent 8 }}
- mountPath: /srv/flyte
name: shared-data
- mountPath: /etc/flyte/config
name: config-volume
- name: auth
mountPath: /etc/secrets/
{{- with .Values.flyteadmin.additionalVolumeMounts -}}
{{ toYaml . | nindent 8 }}
{{- end }}
- command:
- sh
- -c
- ln -s /usr/share/nginx/html /usr/share/nginx/html/openapi && sh /usr/local/bin/docker-run.sh
env:
- name: PAGE_TITLE
value: Flyte Admin OpenAPI
- name: SPEC_URL
value: /api/v1/openapi
- name: PORT
value: "8087"
image: docker.io/redocly/redoc
imagePullPolicy: IfNotPresent
name: redoc
ports:
- containerPort: 8087
resources:
limits:
cpu: "0.1"
memory: 200Mi
serviceAccountName: {{ template "flyteadmin.name" . }}
volumes: {{- include "databaseSecret.volume" . | nindent 8 }}
- emptyDir: {}
Expand Down
88 changes: 44 additions & 44 deletions charts/flyte-core/templates/datacatalog/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,52 +18,52 @@ spec:
labels: {{ include "datacatalog.labels" . | nindent 8 }}
spec:
initContainers:
{{- if .Values.postgres.enabled }}
- name: check-db-ready
image: postgres:10.16-alpine
command:
- sh
- -c
- until pg_isready -h {{ tpl .Values.db.datacatalog.database.host $ }} -p {{ .Values.db.datacatalog.database.port }}; do echo waiting for database; sleep 2; done;
{{- end }}
- command:
- datacatalog
- --config
- {{ .Values.datacatalog.configPath }}
- migrate
- run
image: "{{ .Values.datacatalog.image.repository }}:{{ .Values.datacatalog.image.tag }}"
imagePullPolicy: "{{ .Values.datacatalog.image.pullPolicy }}"
name: run-migrations
volumeMounts: {{- include "databaseSecret.volumeMount" . | nindent 12 }}
- mountPath: /etc/datacatalog/config
name: config-volume
{{- if .Values.postgres.enabled }}
- name: check-db-ready
image: postgres:10.16-alpine
command:
- sh
- -c
- until pg_isready -h {{ tpl .Values.db.datacatalog.database.host $ }} -p {{ .Values.db.datacatalog.database.port }}; do echo waiting for database; sleep 2; done;
{{- end }}
- command:
- datacatalog
- --config
- {{ .Values.datacatalog.configPath }}
- migrate
- run
image: "{{ .Values.datacatalog.image.repository }}:{{ .Values.datacatalog.image.tag }}"
imagePullPolicy: "{{ .Values.datacatalog.image.pullPolicy }}"
name: run-migrations
volumeMounts: {{- include "databaseSecret.volumeMount" . | nindent 8 }}
- mountPath: /etc/datacatalog/config
name: config-volume
containers:
- command:
- datacatalog
- --config
- {{ .Values.datacatalog.configPath }}
{{- with .Values.datacatalog.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
- serve
image: "{{ .Values.datacatalog.image.repository }}:{{ .Values.datacatalog.image.tag }}"
imagePullPolicy: "{{ .Values.datacatalog.image.pullPolicy }}"
name: datacatalog
ports:
- containerPort: 8088
- containerPort: 8089
resources: {{ toYaml .Values.datacatalog.resources | nindent 12 }}
volumeMounts: {{- include "databaseSecret.volumeMount" . | nindent 12 }}
- mountPath: /etc/datacatalog/config
name: config-volume
serviceAccountName: {{ template "datacatalog.name" . }}
volumes: {{- include "databaseSecret.volume" . | nindent 8 }}
- emptyDir: {}
name: shared-data
- configMap:
name: datacatalog-config
- command:
- datacatalog
- --config
- {{ .Values.datacatalog.configPath }}
{{- with .Values.datacatalog.extraArgs }}
{{- toYaml . | nindent 8 }}
{{- end }}
- serve
image: "{{ .Values.datacatalog.image.repository }}:{{ .Values.datacatalog.image.tag }}"
imagePullPolicy: "{{ .Values.datacatalog.image.pullPolicy }}"
name: datacatalog
ports:
- containerPort: 8088
- containerPort: 8089
resources: {{ toYaml .Values.datacatalog.resources | nindent 10 }}
volumeMounts: {{- include "databaseSecret.volumeMount" . | nindent 8 }}
- mountPath: /etc/datacatalog/config
name: config-volume
serviceAccountName: {{ template "datacatalog.name" . }}
volumes: {{- include "databaseSecret.volume" . | nindent 6 }}
- emptyDir: {}
name: shared-data
- configMap:
name: datacatalog-config
name: config-volume
{{- with .Values.datacatalog.nodeSelector }}
nodeSelector: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
20 changes: 20 additions & 0 deletions charts/flyte-core/templates/flytescheduler/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if .Values.workflow_scheduler.enabled}}
{{- if eq .Values.workflow_scheduler.type "native" }}
apiVersion: v1
kind: ConfigMap
metadata:
name: flyte-scheduler-config
namespace: {{ template "flyte.namespace" . }}
labels: {{ include "flytescheduler.labels" . | nindent 4 }}
data:
{{- with .Values.configmap.admin }}
admin.yaml: | {{ toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.db.admin }}
db.yaml: | {{ tpl (toYaml .) $ | nindent 4 }}
{{- end }}
{{- with .Values.configmap.logger }}
logger.yaml: | {{ toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
64 changes: 64 additions & 0 deletions charts/flyte-core/templates/flytescheduler/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{{- if .Values.workflow_scheduler.enabled}}
{{- if eq .Values.workflow_scheduler.type "native" }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "flytescheduler.name" . }}
namespace: {{ template "flyte.namespace" . }}
labels: {{ include "flytescheduler.labels" . | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels: {{ include "flytescheduler.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
configChecksum: {{ include (print .Template.BasePath "/admin/configmap.yaml") . | sha256sum | trunc 63 | quote }}
{{- with .Values.flytescheduler.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels: {{ include "flytescheduler.labels" . | nindent 8 }}
spec:
initContainers:
- command:
- flytescheduler
- precheck
- --config
- {{ .Values.flytescheduler.configPath }}
image: "{{ .Values.flytescheduler.image.repository }}:{{ .Values.flytescheduler.image.tag }}"
imagePullPolicy: "{{ .Values.flytescheduler.image.pullPolicy }}"
name: flytescheduler-check
volumeMounts: {{- include "databaseSecret.volumeMount" . | nindent 10 }}
- mountPath: /etc/flyte/config
name: config-volume
containers:
- command:
- flytescheduler
- run
- --config
- {{ .Values.flytescheduler.configPath }}
image: "{{ .Values.flytescheduler.image.repository }}:{{ .Values.flytescheduler.image.tag }}"
imagePullPolicy: "{{ .Values.flytescheduler.image.pullPolicy }}"
name: flytescheduler
resources: {{ toYaml .Values.flytescheduler.resources | nindent 10 }}
volumeMounts: {{- include "databaseSecret.volumeMount" . | nindent 10 }}
- mountPath: /etc/flyte/config
name: config-volume
serviceAccountName: {{ template "flyteadmin.name" . }}
volumes: {{- include "databaseSecret.volume" . | nindent 8 }}
- emptyDir: {}
name: shared-data
- configMap:
name: flyte-scheduler-config
name: config-volume
{{- with .Values.flytescheduler.nodeSelector }}
nodeSelector: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.flytescheduler.affinity }}
affinity: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.flytescheduler.tolerations }}
tolerations: {{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
Loading

0 comments on commit e3f9211

Please sign in to comment.