Files
truecharts/library/common/templates/lib/controller/_container.tpl
Kjeld Schouten-Lebbing 1d51be0e3d 777 on new scripts (+2 squashed commit)
Squashed commit:

[9ae7dd0f] add helm-docs to workflow

[2206f5ba] fix small typo in workflows (+1 squashed commits)

Squashed commits:

[29c2ceb4] Documentation-Cleanup (#181)

* work on readme generation

* document windows setup

* add simple pre-commit install script

* more docs for git setup

* Update pre-commit

* pre-commit automatic fixes

* Increase all patch versions

* Auto Readme and Config doc

* Auto app-readme.md generation

* increase common and common-test versions accordingly (due to cleanup)

* move contribution guidelines to /development in wiki

* fix some end-of-line issues (again)

* fix line 14 of workflows
2021-02-23 18:21:54 +01:00

94 lines
2.8 KiB
Smarty

{{- /*
The main container included in the controller.
*/ -}}
{{- define "common.controller.mainContainer" -}}
- name: {{ include "common.names.fullname" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.command }}
command: {{ . }}
{{- end }}
{{- with .Values.args }}
args: {{ . }}
{{- end }}
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 4 }}
{{- end }}
env:
- name: PUID
value: {{ .Values.PUID | quote }}
- name: PGID
value: {{ .Values.PGID | quote }}
- name: UMASK
value: {{ .Values.UMASK | quote }}
{{- if .Values.timezone }}
- name: TZ
value: {{ .Values.timezone | quote }}
{{- end }}
{{- if or .Values.env .Values.envTpl .Values.envValueFrom .Values.envVariable .Values.environmentVariables }}
{{- range $envVariable := .Values.environmentVariables }}
{{- if and $envVariable.name $envVariable.value }}
- name: {{ $envVariable.name }}
value: {{ $envVariable.value | quote }}
{{- else }}
{{- fail "Please specify name/value for environment variable" }}
{{- end }}
{{- end}}
{{- range $key, $value := .Values.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
{{- range $key, $value := .Values.envTpl }}
- name: {{ $key }}
value: {{ tpl $value $ | quote }}
{{- end }}
{{- range $key, $value := .Values.envValueFrom }}
- name: {{ $key }}
valueFrom:
{{- $value | toYaml | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.envFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- include "common.controller.ports" . | trim | nindent 2 }}
volumeMounts:
{{- range $index, $PVC := .Values.persistence }}
{{- if $PVC.enabled }}
- mountPath: {{ $PVC.mountPath }}
name: {{ $index }}
{{- if $PVC.subPath }}
subPath: {{ $PVC.subPath }}
{{- end }}
{{- end }}
{{- end }}
{{- include "common.custom.configuredAppVolumeMounts" . | indent 2 }}
{{- if .Values.additionalVolumeMounts }}
{{- toYaml .Values.additionalVolumeMounts | nindent 2 }}
{{- end }}
{{- if eq .Values.controllerType "statefulset" }}
{{- range $index, $vct := .Values.volumeClaimTemplates }}
- mountPath: {{ $vct.mountPath }}
name: {{ $vct.name }}
{{- if $vct.subPath }}
subPath: {{ $vct.subPath }}
{{- end }}
{{- end }}
{{- end }}
{{- include "common.controller.probes" . | nindent 2 }}
{{- with .Values.resources }}
resources:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if and .Values.gpuConfiguration .Values.resources }}
limits:
{{- toYaml .Values.gpuConfiguration | nindent 14 }}
{{- else if .Values.gpuConfiguration }}
resources:
limits:
{{- toYaml .Values.gpuConfiguration | nindent 14 }}
{{- end }}
{{- end -}}