no message
This commit is contained in:
@ -0,0 +1,92 @@
|
||||
{{/*
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
`SPDX-License-Identifier: Apache-2.0`
|
||||
|
||||
This file is considered to be modified by the TrueCharts Project.
|
||||
*/}}
|
||||
|
||||
|
||||
{{- /*
|
||||
The main container included in the controller.
|
||||
*/ -}}
|
||||
{{- define "common.controller.mainContainer" -}}
|
||||
- name: {{ include "common.names.fullname" . }}
|
||||
image: "{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }}"
|
||||
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 }}
|
||||
|
||||
{{- with (include "common.controller.volumeMounts" . | trim) }}
|
||||
volumeMounts:
|
||||
{{- . | nindent 2 }}
|
||||
{{- end }}
|
||||
|
||||
|
||||
{{- include "common.controller.probes" . | nindent 2 }}
|
||||
resources:
|
||||
{{- with .Values.resources }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if and .Values.gpuConfiguration }}
|
||||
limits:
|
||||
{{- toYaml .Values.gpuConfiguration | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
@ -0,0 +1,69 @@
|
||||
{{- /*
|
||||
The pod definition included in the controller.
|
||||
*/ -}}
|
||||
{{- define "common.controller.pod" -}}
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 2 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "common.names.serviceAccountName" . }}
|
||||
{{- with .Values.podSecurityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- with .Values.priorityClassName }}
|
||||
priorityClassName: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.schedulerName }}
|
||||
schedulerName: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.hostNetwork }}
|
||||
hostNetwork: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.hostname }}
|
||||
hostname: {{ . }}
|
||||
{{- end }}
|
||||
{{- if .Values.dnsPolicy }}
|
||||
{{- with .Values.dnsPolicy }}
|
||||
dnsPolicy: {{ . }}
|
||||
{{- end }}
|
||||
{{- else if .Values.hostNetwork }}
|
||||
dnsPolicy: "ClusterFirstWithHostNet"
|
||||
{{- else }}
|
||||
dnsPolicy: ClusterFirst
|
||||
{{- end }}
|
||||
{{- with .Values.dnsConfig }}
|
||||
dnsConfig:
|
||||
{{- toYaml . | nindent 2 }}
|
||||
{{- end }}
|
||||
enableServiceLinks: {{ .Values.enableServiceLinks }}
|
||||
{{- with .Values.initContainers }}
|
||||
initContainers:
|
||||
{{- toYaml . | nindent 2 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
{{- include "common.controller.mainContainer" . | nindent 0 }}
|
||||
{{- with .Values.additionalContainers }}
|
||||
{{- toYaml . | nindent 0 }}
|
||||
{{- end }}
|
||||
{{- with (include "common.controller.volumes" . | trim) }}
|
||||
volumes:
|
||||
{{- . | nindent 0 }}
|
||||
{{- end }}
|
||||
{{- with .Values.hostAliases }}
|
||||
hostAliases:
|
||||
{{- toYaml . | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
@ -0,0 +1,76 @@
|
||||
{{/*
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
`SPDX-License-Identifier: Apache-2.0`
|
||||
|
||||
This file is considered to be modified by the TrueCharts Project.
|
||||
*/}}
|
||||
|
||||
|
||||
{{/*
|
||||
Ports included by the controller.
|
||||
*/}}
|
||||
{{- define "common.controller.ports" -}}
|
||||
{{- $ports := list -}}
|
||||
{{/* append the ports for each appAdditionalService - TrueCharts */}}
|
||||
{{- if $.Values.services -}}
|
||||
{{- range $name, $_ := $.Values.services }}
|
||||
{{- if or ( .enabled ) ( eq $name "main" ) -}}
|
||||
{{- if eq $name "main" -}}
|
||||
{{- $_ := set .port "name" (default "http" .port.name) -}}
|
||||
{{- else if kindIs "string" $name -}}
|
||||
{{- $_ := set .port "name" (default .port.name | default $name) -}}
|
||||
{{- else -}}
|
||||
{{- $_ := set .port "name" (required "Missing port.name" .port.name) -}}
|
||||
{{- end -}}
|
||||
{{- $ports = mustAppend $ports .port -}}
|
||||
{{- range $_ := .additionalPorts -}}
|
||||
{{/* append the additonalPorts for each additional service */}}
|
||||
{{- $ports = mustAppend $ports . -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- if $.Values.additionalServices -}}
|
||||
{{- range $_ := $.Values.additionalServices }}
|
||||
{{- if .enabled -}}
|
||||
{{- $_ := set .port "name" (required "Missing port.name" .port.name) -}}
|
||||
{{- $ports = mustAppend $ports .port -}}
|
||||
{{- range $_ := .additionalPorts -}}
|
||||
{{/* append the additonalPorts for each additional service */}}
|
||||
{{- $ports = mustAppend $ports . -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/* export/render the list of ports */}}
|
||||
{{- if $ports -}}
|
||||
ports:
|
||||
{{- range $_ := $ports }}
|
||||
{{- $protocol := "" -}}
|
||||
{{- if or ( eq .protocol "HTTP" ) ( eq .protocol "HTTPS" ) }}
|
||||
{{- $protocol = "TCP" -}}
|
||||
{{- else }}
|
||||
{{- $protocol = .protocol | default "TCP" -}}
|
||||
{{- end }}
|
||||
- name: {{ required "The port's 'name' is not defined" .name }}
|
||||
{{- if and .targetPort (kindIs "string" .targetPort) }}
|
||||
{{- fail (printf "Our charts do not support named ports for targetPort. (port name %s, targetPort %s)" .name .targetPort) }}
|
||||
{{- end }}
|
||||
containerPort: {{ .targetPort | default .port }}
|
||||
protocol: {{ $protocol | default "TCP" }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
@ -0,0 +1,41 @@
|
||||
{{/*
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
`SPDX-License-Identifier: Apache-2.0`
|
||||
|
||||
This file is considered to be modified by the TrueCharts Project.
|
||||
*/}}
|
||||
|
||||
|
||||
{{/*
|
||||
Probes selection logic.
|
||||
*/}}
|
||||
{{- define "common.controller.probes" -}}
|
||||
{{- $svcPort := .Values.services.main.port.name -}}
|
||||
{{- range $probeName, $probe := .Values.probes }}
|
||||
{{- if $probe.enabled -}}
|
||||
{{- "" | nindent 0 }}
|
||||
{{- $probeName }}Probe:
|
||||
{{- if $probe.custom -}}
|
||||
{{- $probe.spec | toYaml | nindent 2 }}
|
||||
{{- else }}
|
||||
{{- "tcpSocket:" | nindent 2 }}
|
||||
{{- printf "port: %v" $svcPort | nindent 4 }}
|
||||
{{- printf "initialDelaySeconds: %v" $probe.spec.initialDelaySeconds | nindent 2 }}
|
||||
{{- printf "failureThreshold: %v" $probe.spec.failureThreshold | nindent 2 }}
|
||||
{{- printf "timeoutSeconds: %v" $probe.spec.timeoutSeconds | nindent 2 }}
|
||||
{{- printf "periodSeconds: %v" $probe.spec.periodSeconds | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
@ -0,0 +1,62 @@
|
||||
|
||||
{{/*
|
||||
Volumes included by the controller.
|
||||
*/}}
|
||||
{{- define "common.controller.volumeMounts" -}}
|
||||
{{- range $index, $PVC := .Values.persistence }}
|
||||
{{- if and ( $PVC.enabled ) ( $PVC.mountPath ) }}
|
||||
- mountPath: {{ $PVC.mountPath }}
|
||||
name: {{ $index }}
|
||||
{{- if $PVC.subPath }}
|
||||
subPath: {{ $PVC.subPath }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
|
||||
{{ range $name, $dmm := .Values.deviceMounts }}
|
||||
{{- if $dmm.enabled -}}
|
||||
{{ if $dmm.name }}
|
||||
{{ $name = $dmm.name }}
|
||||
{{ end }}
|
||||
- name: devicemount-{{ $name }}
|
||||
mountPath: {{ $dmm.devicePath }}
|
||||
{{ if $dmm.subPath }}
|
||||
subPath: {{ $dmm.subPath }}
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
|
||||
{{ range $name, $csm := .Values.customStorage }}
|
||||
{{- if $csm.enabled -}}
|
||||
{{ if $csm.name }}
|
||||
{{ $name = $csm.name }}
|
||||
{{ end }}
|
||||
- name: customstorage-{{ $name }}
|
||||
mountPath: {{ $csm.mountPath }}
|
||||
{{ if $csm.subPath }}
|
||||
subPath: {{ $csm.subPath }}
|
||||
{{ end }}
|
||||
{{ if $csm.readOnly }}
|
||||
readOnly: {{ $csm.readOnly }}
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{- if .Values.additionalVolumeMounts }}
|
||||
{{- toYaml .Values.additionalVolumeMounts | nindent 0 }}
|
||||
{{- 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 }}
|
||||
|
||||
{{- end -}}
|
@ -0,0 +1,84 @@
|
||||
{{/*
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
`SPDX-License-Identifier: Apache-2.0`
|
||||
|
||||
This file is considered to be modified by the TrueCharts Project.
|
||||
*/}}
|
||||
|
||||
|
||||
{{/*
|
||||
Volumes included by the controller.
|
||||
*/}}
|
||||
{{- define "common.controller.volumes" -}}
|
||||
{{- range $index, $persistence := .Values.persistence }}
|
||||
{{- if $persistence.enabled }}
|
||||
- name: {{ $index }}
|
||||
{{- if $persistence.existingClaim }}
|
||||
{{- /* Always prefer an existingClaim if that is set */}}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ $persistence.existingClaim }}
|
||||
{{- else -}}
|
||||
{{- if $persistence.emptyDir -}}
|
||||
{{- /* Always prefer an emptyDir next if that is set */}}
|
||||
emptyDir: {}
|
||||
{{- else -}}
|
||||
{{- /* Otherwise refer to the PVC name */}}
|
||||
persistentVolumeClaim:
|
||||
{{- if $persistence.nameOverride }}
|
||||
claimName: {{ $persistence.nameOverride }}
|
||||
{{- else if $persistence.nameSuffix }}
|
||||
claimName: {{ printf "%s-%s" (include "common.names.fullname" $) $persistence.nameSuffix }}
|
||||
{{- else }}
|
||||
claimName: {{ printf "%s-%s" (include "common.names.fullname" $) $index }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- range $name, $dm := .Values.deviceMounts -}}
|
||||
{{ if $dm.enabled }}
|
||||
{{ if $dm.name }}
|
||||
{{ $name = $dm.name }}
|
||||
{{ end }}
|
||||
- name: devicemount-{{ $name }}
|
||||
{{ if $dm.emptyDir }}
|
||||
emptyDir: {}
|
||||
{{- else -}}
|
||||
hostPath:
|
||||
path: {{ required "hostPath not set" $dm.devicePath }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- range $name, $cs := .Values.customStorage -}}
|
||||
{{ if $cs.enabled }}
|
||||
{{ if $cs.name }}
|
||||
{{ $name = $cs.name }}
|
||||
{{ end }}
|
||||
- name: customstorage-{{ $name }}
|
||||
{{ if $cs.emptyDir }}
|
||||
emptyDir: {}
|
||||
{{- else -}}
|
||||
hostPath:
|
||||
path: {{ required "hostPath not set" $cs.hostPath }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
{{- if .Values.additionalVolumes }}
|
||||
{{- toYaml .Values.additionalVolumes | nindent 0 }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
Reference in New Issue
Block a user