Skip to content

Commit

Permalink
Adding option for defining extra Init Containers
Browse files Browse the repository at this point in the history
Signed-off-by: Nikhil Jiju <[email protected]>
  • Loading branch information
NiJuFirenzia committed Oct 23, 2024
1 parent 0393728 commit dae31eb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
7 changes: 6 additions & 1 deletion charts/prefect-worker/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ spec:
{{- if .Values.worker.priorityClassName }}
priorityClassName: {{ .Values.worker.priorityClassName }}
{{- end }}
{{- if include "worker.baseJobTemplateName" . }}
{{- if or (include "worker.baseJobTemplateName" .) (.Values.worker.initContainer.extraContainers) }}
initContainers:
{{- if include "worker.baseJobTemplateName" . }}
- name: sync-base-job-template
image: "{{ .Values.worker.image.repository }}:{{ .Values.worker.image.prefectTag }}"
imagePullPolicy: {{ .Values.worker.image.pullPolicy }}
Expand Down Expand Up @@ -125,6 +126,10 @@ spec:
{{- with .Values.worker.initContainer.containerSecurityContext }}
securityContext: {{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.worker.initContainer.extraContainers }}
{{- include "common.tplvalues.render" (dict "value" .Values.worker.initContainer.extraContainers "context" $) | nindent 8 }}
{{- end }}
{{- end }}
containers:
- name: prefect-worker
Expand Down
8 changes: 8 additions & 0 deletions charts/prefect-worker/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@
}
}
}
},
"extraContainers": {
"type": "array",
"title": "Extra Containers",
"description": "additional init containers",
"items": {
"type": "object"
}
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions charts/prefect-worker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ worker:
allowPrivilegeEscalation: false
# -- set init container's security context capabilities
capabilities: {}

# -- additional sidecar containers
extraContainers: []

image:
# -- worker image repository
Expand Down

0 comments on commit dae31eb

Please sign in to comment.