move values around

This commit is contained in:
Stavros kois
2023-01-28 18:42:11 +02:00
parent 3c8ee3861f
commit 105d648ad4
37 changed files with 238 additions and 261 deletions
@@ -13,8 +13,7 @@ tests:
- it: should fail with empty PUID
documentIndex: *deploymentDoc
set:
security:
PUID:
PUID:
asserts:
- failedTemplate:
errorMessage: <PUID> key cannot be empty. Set a value or remove the key for the default (568) to take effect.
@@ -22,8 +21,7 @@ tests:
- it: should fail with PUID not-int
documentIndex: *deploymentDoc
set:
security:
PUID: "1000"
PUID: "1000"
asserts:
- failedTemplate:
errorMessage: <PUID> key has value of ("1000"). But must be an int.
@@ -31,8 +29,7 @@ tests:
- it: should fail with empty UMASK
documentIndex: *deploymentDoc
set:
security:
UMASK:
UMASK:
asserts:
- failedTemplate:
errorMessage: <UMASK> key cannot be empty. Set a value or remove the key for the default (002) to take effect.
@@ -40,8 +37,7 @@ tests:
- it: should fail with UMASK not-string
documentIndex: *deploymentDoc
set:
security:
UMASK: 2
UMASK: 2
asserts:
- failedTemplate:
errorMessage: <UMASK> key must be a string, so the format is kept intact.
@@ -58,8 +54,7 @@ tests:
documentIndex: *deploymentDoc
set:
TZ: ETC
security:
UMASK: "003"
UMASK: "003"
asserts:
- equal:
path: spec.template.spec.containers[0].env
@@ -226,8 +221,7 @@ tests:
securityContext:
runAsUser: 0
runAsNonRoot: false
security:
PUID: 0
PUID: 0
asserts:
- equal:
path: spec.template.spec.containers[0].env
@@ -261,8 +255,7 @@ tests:
securityContext:
runAsGroup: 0
runAsNonRoot: false
security:
PUID: 0
PUID: 0
asserts:
- equal:
path: spec.template.spec.containers[0].env
@@ -298,8 +291,7 @@ tests:
securityContext:
runAsGroup: 0
runAsNonRoot: false
security:
PUID: 0
PUID: 0
asserts:
- equal:
path: spec.template.spec.containers[0].env
@@ -48,9 +48,9 @@ tests:
runtimeClassName: perpod
scaleGPU:
something: blabla
globalDefaults:
runtimeClassName: global
global:
defaults:
runtimeClassName: global
ixChartContext:
addNvidiaRuntimeClass: true
nvidiaRuntimeClassName: something
@@ -72,9 +72,8 @@ tests:
- it: should pass with global runtime set
documentIndex: *deploymentDoc
set:
global:
defaults:
runtimeClassName: something
globalDefaults:
runtimeClassName: something
asserts:
- equal:
path: spec.template.spec.runtimeClassName
@@ -37,9 +37,8 @@ tests:
- it: should fail with ValidateHostPath globally set on and invalid hostPath (/mnt/pool)
set:
global:
defaults:
validateHostPath: true
globalDefaults:
validateHostPath: true
persistence:
some_volume:
type: hostPath
@@ -52,9 +51,8 @@ tests:
- it: should fail with ValidateHostPath globally set on and invalid hostPath (/cluster/ctdb_shared_vol)
set:
global:
defaults:
validateHostPath: true
globalDefaults:
validateHostPath: true
persistence:
some_volume:
type: hostPath
@@ -67,9 +65,8 @@ tests:
- it: should fail with ValidateHostPath globally set on and invalid hostPath (/not_allowed_path)
set:
global:
defaults:
validateHostPath: true
globalDefaults:
validateHostPath: true
persistence:
some_volume:
type: hostPath
@@ -121,9 +118,8 @@ tests:
- it: should fail with ValidateHostPath globally disabled but enabled on the item and invalid hostPath (/not_allowed_path)
set:
global:
defaults:
validateHostPath: false
globalDefaults:
validateHostPath: false
persistence:
some_volume:
type: hostPath
@@ -153,9 +149,8 @@ tests:
- it: should pass with ValidateHostPath globally enabled but disabled on the item and not allowed path for hostPath (/not_allowed_path)
documentIndex: *deploymentDoc
set:
global:
defaults:
validateHostPath: true
globalDefaults:
validateHostPath: true
persistence:
some_volume:
type: hostPath
@@ -174,9 +169,8 @@ tests:
- it: should pass with added hostPath and validation globally enabled (/mnt/pool/dataset)
documentIndex: *deploymentDoc
set:
global:
defaults:
validateHostPath: true
globalDefaults:
validateHostPath: true
persistence:
volume1:
enabled: true
@@ -194,9 +188,8 @@ tests:
- it: should pass with added hostPath and validation globally enabled (/cluster/something)
documentIndex: *deploymentDoc
set:
global:
defaults:
validateHostPath: true
globalDefaults:
validateHostPath: true
persistence:
volume1:
enabled: true
@@ -214,9 +207,8 @@ tests:
- it: should pass with added hostPath and validation globally enabled (/sys)
documentIndex: *deploymentDoc
set:
global:
defaults:
validateHostPath: true
globalDefaults:
validateHostPath: true
persistence:
volume1:
enabled: true
@@ -234,9 +226,8 @@ tests:
- it: should pass with added hostPath and validation globally enabled (/dev)
documentIndex: *deploymentDoc
set:
global:
defaults:
validateHostPath: true
globalDefaults:
validateHostPath: true
persistence:
volume1:
enabled: true
@@ -385,9 +385,8 @@ tests:
securityContext:
runAsUser: 0
runAsNonRoot: false
security:
UMASK: "003"
PUID: 1000
UMASK: "003"
PUID: 1000
asserts:
- isSubset:
path: spec.template.spec.containers[0]
@@ -385,9 +385,8 @@ tests:
securityContext:
runAsUser: 0
runAsNonRoot: false
security:
UMASK: "003"
PUID: 1000
UMASK: "003"
PUID: 1000
asserts:
- isSubset:
path: spec.template.spec.containers[0]
@@ -387,9 +387,8 @@ tests:
securityContext:
runAsUser: 0
runAsNonRoot: false
security:
UMASK: "003"
PUID: 1000
UMASK: "003"
PUID: 1000
asserts:
- isSubset:
path: spec.template.spec.containers[0]
@@ -399,9 +399,8 @@ tests:
securityContext:
runAsUser: 0
runAsNonRoot: false
security:
UMASK: "003"
PUID: 1000
UMASK: "003"
PUID: 1000
asserts:
- isSubset:
path: spec.template.spec.containers[0]
@@ -385,9 +385,8 @@ tests:
securityContext:
runAsUser: 0
runAsNonRoot: false
security:
UMASK: "003"
PUID: 1000
UMASK: "003"
PUID: 1000
asserts:
- isSubset:
path: spec.template.spec.containers[0]
@@ -401,9 +401,8 @@ tests:
securityContext:
runAsUser: 0
runAsNonRoot: false
security:
UMASK: "003"
PUID: 1000
UMASK: "003"
PUID: 1000
asserts:
- isSubset:
path: spec.template.spec.containers[0]
@@ -361,9 +361,8 @@ tests:
securityContext:
runAsUser: 0
runAsNonRoot: false
security:
UMASK: "003"
PUID: 1000
UMASK: "003"
PUID: 1000
asserts:
- isSubset:
path: spec.jobTemplate.spec.template.spec.containers[0]
@@ -328,9 +328,8 @@ tests:
securityContext:
runAsUser: 0
runAsNonRoot: false
security:
UMASK: "003"
PUID: 1000
UMASK: "003"
PUID: 1000
asserts:
- isSubset:
path: spec.template.spec.containers[0]
+14 -18
View File
@@ -14,6 +14,8 @@ tests:
- it: should fail with SCALE-ZFS storageClass but not scaleZFSStorageClass in global
set:
globalDefaults:
scaleZFSStorageClass: ""
persistence:
vol1:
enabled: true
@@ -263,9 +265,8 @@ tests:
- it: should pass with storageClass set to SCALE-ZFS
documentIndex: *pvcDoc
set:
global:
defaults:
scaleZFSStorageClass: something
globalDefaults:
scaleZFSStorageClass: something
persistence:
vol1:
enabled: true
@@ -286,9 +287,8 @@ tests:
documentIndex: *pvcDoc
set:
key: something
global:
defaults:
scaleZFSStorageClass: "{{ .Values.key }}"
globalDefaults:
scaleZFSStorageClass: "{{ .Values.key }}"
persistence:
vol1:
enabled: true
@@ -368,9 +368,8 @@ tests:
- it: should pass with storageClass defined globally
documentIndex: *pvcDoc
set:
global:
defaults:
storageClass: something
globalDefaults:
storageClass: something
persistence:
vol1:
enabled: true
@@ -635,9 +634,8 @@ tests:
- it: should pass with annotations and global retain true
documentIndex: *pvcDoc
set:
global:
defaults:
PVCRetain: true
globalDefaults:
PVCRetain: true
persistence:
vol1:
enabled: true
@@ -656,9 +654,8 @@ tests:
- it: should pass with annotations and global retain true and pvc object to false
documentIndex: *pvcDoc
set:
global:
defaults:
PVCRetain: true
globalDefaults:
PVCRetain: true
persistence:
vol1:
enabled: true
@@ -677,9 +674,8 @@ tests:
- it: should pass with annotations and global retain false and pvc object to true
documentIndex: *pvcDoc
set:
global:
defaults:
PVCRetain: false
globalDefaults:
PVCRetain: false
persistence:
vol1:
enabled: true
@@ -2,7 +2,7 @@
{{- $job := .job -}}
{{- $root := .root -}}
{{- $default := $root.Values.global.defaults.job.cron -}}
{{- $default := $root.Values.globalDefaults.job.cron -}}
{{- $jobName := include "ix.v1.common.names.jobAndCronJob" (dict "root" $root "jobValues" $job) -}}
{{- include "ix.v1.common.validate.cronJob" (dict "root" $root "job" $job) -}}
@@ -3,9 +3,9 @@
{{- define "ix.v1.common.class.pvc" -}}
{{- $pvcValues := .pvc -}}
{{- $root := .root -}}
{{- $defaultSize := $root.Values.global.defaults.PVCSize -}}
{{- $defaultAccessMode := $root.Values.global.defaults.accessMode -}}
{{- $defaultRetain := $root.Values.global.defaults.PVCRetain -}}
{{- $defaultSize := $root.Values.globalDefaults.PVCSize -}}
{{- $defaultAccessMode := $root.Values.globalDefaults.accessMode -}}
{{- $defaultRetain := $root.Values.globalDefaults.PVCRetain -}}
{{- $pvcName := include "ix.v1.common.names.pvc" (dict "root" $root "pvcValues" $pvcValues) -}}
@@ -3,8 +3,8 @@
{{- define "ix.v1.common.class.service" -}}
{{- $svcValues := .svc -}}
{{- $root := .root -}}
{{- $defaultServiceType := $root.Values.global.defaults.serviceType -}}
{{- $defaultPortProtocol := $root.Values.global.defaults.portProtocol -}}
{{- $defaultServiceType := $root.Values.globalDefaults.serviceType -}}
{{- $defaultPortProtocol := $root.Values.globalDefaults.portProtocol -}}
{{- $svcName := include "ix.v1.common.names.service" (dict "root" $root "svcValues" $svcValues) -}}
{{- $svcType := $svcValues.type | default $defaultServiceType -}}
@@ -19,7 +19,7 @@ That's why the custom dict is expected.
{{- $root := .root -}}
{{- $fixedEnv := list -}}
{{- $inject := $root.Values.global.defaults.injectFixedEnvs -}}
{{- $inject := $root.Values.globalDefaults.injectFixedEnvs -}}
{{- if (mustHas (toString $injectFixedEnvs) (list "true" "false")) -}}
{{- $inject = $injectFixedEnvs -}}
{{- end -}}
@@ -7,7 +7,7 @@ can be dynamically configured via an env var.
{{- define "ix.v1.common.container.ports" -}}
{{- $root := .root -}}
{{- $services := .services -}}
{{- $defaultPortProtocol := $root.Values.global.defaults.portProtocol -}}
{{- $defaultPortProtocol := $root.Values.globalDefaults.portProtocol -}}
{{- $ports := list -}}
{{- range $svcName, $svc := $services -}}
@@ -1,15 +1,15 @@
{{/* Probes selection logic included by the container. */}}
{{- define "ix.v1.common.container.probes" -}}
{{- $root := .root -}}
{{- $defaults := $root.Values.global.defaults -}}
{{- $defaults := $root.Values.globalDefaults -}}
{{- $probes := .probes -}}
{{- $isMainContainer := .isMainContainer -}}
{{- $services := .services -}} {{/* Only passed from main container, not init/install/upgrade/additional */}}
{{- $containerName := .containerName -}}
{{- $defaultProbeType := $root.Values.global.defaults.probeType -}}
{{- $defaultProbePath := $root.Values.global.defaults.probePath -}}
{{- $defaultPortProtocol := $root.Values.global.defaults.portProtocol -}}
{{- $defaultProbeType := $root.Values.globalDefaults.probeType -}}
{{- $defaultProbePath := $root.Values.globalDefaults.probePath -}}
{{- $defaultPortProtocol := $root.Values.globalDefaults.portProtocol -}}
{{- $primaryPort := "" -}}
{{- if and $isMainContainer $services -}} {{/* If no services exist don't try to guess a port, but do only in main container */}}
@@ -10,7 +10,7 @@
{{- end -}}
{{/* Get defaults from global */}}
{{- $defautlResources := $root.Values.global.defaults.resources -}}
{{- $defautlResources := $root.Values.globalDefaults.resources -}}
{{- $newResources := (mustDeepCopy $defautlResources) -}}
{{- if and $resources.inherit (not $isMainContainer) -}} {{/* if inherit is set, overwrite defaults with values from mainContainer */}}
@@ -14,7 +14,7 @@ The reason is not splitted, is that on one of the places needs a combo of all va
{{- $isMainContainer := .isMainContainer -}}
{{/* Initialiaze Values */}}
{{- $defaultSecCont := $root.Values.global.defaults.securityContext -}}
{{- $defaultSecCont := $root.Values.globalDefaults.securityContext -}}
{{- $returnValue := (mustDeepCopy $defaultSecCont) -}}
{{- if and (hasKey $secCont "inherit") $isMainContainer -}}
@@ -112,7 +112,7 @@ The reason is not splitted, is that on one of the places needs a combo of all va
{{- $podSecCont := .podSecCont -}}
{{/* Initialiaze Values */}}
{{- $defaultPodSecCont := $root.Values.global.defaults.podSecurityContext -}}
{{- $defaultPodSecCont := $root.Values.globalDefaults.podSecurityContext -}}
{{- $returnValue := (mustDeepCopy $defaultPodSecCont) -}}
{{/* Overwrite from values that user/dev passed */}}
@@ -214,7 +214,7 @@ The reason is not splitted, is that on one of the places needs a combo of all va
{{- $secEnvs := .secEnvs -}}
{{/* Initialiaze Values */}}
{{- $defaultSecEnvs := $root.Values.global.defaults.security -}}
{{- $defaultSecEnvs := (dict "PUID" $root.Values.PUID "UMASK" $root.Values.UMASK ) -}}
{{- $returnValue := (mustDeepCopy $defaultSecEnvs) -}}
{{/* Overwrite from values that user/dev passed */}}
@@ -17,7 +17,7 @@
{{- $scaleGPU := .scaleGPU -}}
{{- $nvidiaCaps := .nvidiaCaps -}}
{{- $nvidiaCaps = $nvidiaCaps | default $root.Values.global.defaults.nvidiaCaps -}}
{{- $nvidiaCaps = $nvidiaCaps | default $root.Values.globalDefaults.nvidiaCaps -}}
{{- if not (deepEqual $nvidiaCaps (mustUniq $nvidiaCaps)) -}}
{{- fail (printf "<nvidiaCaps> (%s) are must have unique values only" $nvidiaCaps) -}}
@@ -13,7 +13,7 @@
{{- $saName = . -}}
{{- end -}}
{{- else -}}
{{/* If we ever have value in global.defaults */}}
{{/* If we ever have value in globalDefaults */}}
{{- end -}}
{{- $schedulerName := "" -}}
@@ -24,7 +24,7 @@
{{- $schedulerName = . -}}
{{- end -}}
{{- else -}}
{{/* If we ever have value in global.defaults */}}
{{/* If we ever have value in globalDefaults */}}
{{- end -}}
{{- $priorityClassName := "" -}}
@@ -35,7 +35,7 @@
{{- $priorityClassName = . -}}
{{- end -}}
{{- else -}}
{{/* If we ever have value in global.defaults */}}
{{/* If we ever have value in globalDefaults */}}
{{- end -}}
{{- $hostname := "" -}}
@@ -46,7 +46,7 @@
{{- $hostname = . -}}
{{- end -}}
{{- else -}}
{{/* If we ever have value in global.defaults */}}
{{/* If we ever have value in globalDefaults */}}
{{- end -}}
{{- $dnsPolicy := "" -}}
@@ -61,7 +61,7 @@
{{- end -}}
{{- end -}}
{{- else -}}
{{/* If we ever have value in global.defaults */}}
{{/* If we ever have value in globalDefaults */}}
{{- end -}}
{{- $dnsConfig := dict -}}
@@ -76,7 +76,7 @@
{{- end -}}
{{- end -}}
{{- else -}}
{{/* If we ever have value in global.defaults */}}
{{/* If we ever have value in globalDefaults */}}
{{- end -}}
{{- $hostAliases := dict -}}
@@ -91,7 +91,7 @@
{{- end -}}
{{- end -}}
{{- else -}}
{{/* If we ever have value in global.defaults */}}
{{/* If we ever have value in globalDefaults */}}
{{- end -}}
{{- $nodeSelector := "" -}}
@@ -106,7 +106,7 @@
{{- end -}}
{{- end -}}
{{- else -}}
{{/* If we ever have value in global.defaults */}}
{{/* If we ever have value in globalDefaults */}}
{{- end -}}
{{- $tolerations := dict -}}
@@ -121,7 +121,7 @@
{{- end -}}
{{- end -}}
{{- else -}}
{{/* If we ever have value in global.defaults */}}
{{/* If we ever have value in globalDefaults */}}
{{- end -}}
{{- $imagePullSecrets := dict -}}
@@ -136,7 +136,7 @@
{{- end -}}
{{- end -}}
{{- else -}}
{{/* If we ever have value in global.defaults */}}
{{/* If we ever have value in globalDefaults */}}
{{- end -}}
{{- $runtimeClassName := "" -}}
@@ -166,7 +166,7 @@
{{- end -}}
{{- end -}}
{{- else -}}
{{/* If we ever have value in global.defaults */}}
{{/* If we ever have value in globalDefaults */}}
{{- end -}}
{{- $secCont := dict -}}
@@ -3,7 +3,7 @@
{{- $root := .root -}}
{{- $job := .job -}}
{{- $default := $root.Values.global.defaults.job -}}
{{- $default := $root.Values.globalDefaults.job -}}
{{- $controllerType := $root.Values.controller.type -}}
{{- include "ix.v1.common.validate.job" (dict "root" $root "job" $job) -}}
@@ -2,7 +2,7 @@
{{- $root := .root -}}
{{- $job := .job -}}
{{- $default := $root.Values.global.defaults.job.cron -}}
{{- $default := $root.Values.globalDefaults.job.cron -}}
{{- $cron := $job.cron -}}
{{- $name := $job.nameOverride -}}
@@ -2,7 +2,7 @@
{{- $root := .root -}}
{{- $job := .job -}}
{{- $default := $root.Values.global.defaults.job -}}
{{- $default := $root.Values.globalDefaults.job -}}
{{- $name := $job.nameOverride -}}
{{- if hasKey $job "backoffLimit" -}}
@@ -4,7 +4,7 @@
{{- $hostNetwork := .hostNetwork -}}
{{- $root := .root -}}
{{- $policy := $root.Values.global.defaults.dnsPolicy -}}
{{- $policy := $root.Values.globalDefaults.dnsPolicy -}}
{{- if $dnsPolicy -}}
{{- if not (mustHas $dnsPolicy (list "Default" "ClusterFirst" "ClusterFirstWithHostNet" "None")) -}}
{{- fail (printf "Not valid dnsPolicy (%s). Valid options are ClusterFirst, Default, ClusterFirstWithHostNet, None" $dnsPolicy) -}}
@@ -60,7 +60,7 @@
"scaleGPU" $container.scaleGPU
"nvidiaCaps" $container.nvidiaCaps
"secCont" $container.securityContext
"secEnvs" $container.security
"secEnvs" (dict "PUID" $container.PUID "UMASK" $container.UMASK)
"injectFixedEnvs" $container.injectFixedEnvs
"root" $root) | trim) }}
env:
@@ -47,7 +47,7 @@ So it can work on multiple places, like additional containers and not only the m
"scaleGPU" $values.scaleGPU
"nvidiaCaps" $values.nvidiaCaps
"secCont" $values.securityContext
"secEnvs" $values.security
"secEnvs" (dict "PUID" $values.PUID "UMASK" $values.UMASK)
"injectFixedEnvs" $values.injectFixedEnvs
"root" $root) | trim) }}
env:
@@ -2,10 +2,10 @@
{{- $root := .root -}}
{{- $restartPolicy := .restartPolicy -}}
{{- $isJob := .isJob | default false -}}
{{- $policy := $root.Values.global.defaults.restartPolicy -}}
{{- $policy := $root.Values.globalDefaults.restartPolicy -}}
{{- if $isJob -}}
{{- $policy = $root.Values.global.defaults.jobRestartPolicy -}}
{{- $policy = $root.Values.globalDefaults.jobRestartPolicy -}}
{{- end -}}
{{- with $restartPolicy -}}
@@ -4,7 +4,7 @@
{{- $isJob := .isJob -}}
{{/* Override previous if a runtime is passed from global defaults */}}
{{- $runtimeName := "" -}}
{{- with $root.Values.global.defaults.runtimeClassName -}}
{{- with $root.Values.globalDefaults.runtimeClassName -}}
{{- $runtimeName = . -}}
{{- end -}}
@@ -2,7 +2,7 @@
{{- define "ix.v1.common.controller.volumes" -}}
{{- $root := .root -}}
{{- $persistence := .persistence -}}
{{- $persistenceDefault := $root.Values.global.defaults.persistenceType -}}
{{- $persistenceDefault := $root.Values.globalDefaults.persistenceType -}}
{{- range $index, $persistence := $persistence -}}
{{- if $persistence.enabled -}}
@@ -1,7 +1,7 @@
{{- define "ix.v1.common.controller.volumes.hostPath.validation" -}}
{{- $vol := .volume -}}
{{- $root := .root -}}
{{- $validate := $root.Values.global.defaults.validateHostPath -}}
{{- $validate := $root.Values.globalDefaults.validateHostPath -}}
{{- if (hasKey $vol "validateHostPath") -}}
{{- $validate = $vol.validateHostPath -}}
@@ -19,8 +19,8 @@ ports:
protocol: {{ $protocol }}
targetPort: {{ $port.targetPort | default $name }}
{{- if and (eq $svcType "NodePort") $port.nodePort -}}
{{- if lt $port.nodePort $root.Values.global.defaults.minimumNodePort -}}
{{- fail (printf "Port number (%s) for (%s) is too low. The minimum port for Node Port is (%s)" ($port.nodePort | toString) $name ($root.Values.global.defaults.minimumNodePort | toString)) -}}
{{- if lt $port.nodePort $root.Values.globalDefaults.minimumNodePort -}}
{{- fail (printf "Port number (%s) for (%s) is too low. The minimum port for Node Port is (%s)" ($port.nodePort | toString) $name ($root.Values.globalDefaults.minimumNodePort | toString)) -}}
{{- end }}
nodePort: {{ $port.nodePort }}
{{- end -}}
@@ -6,9 +6,9 @@
{{/*
If a storage class is defined on a persistence object:
"-" returns "", which means requesting a PV without class
"SCALE-ZFS" returns the value set on Values.global.defaults.scaleZFSStorageClass
"SCALE-ZFS" returns the value set on Values.globalDefaults.scaleZFSStorageClass
else return the defined storageClass
Else if there is a storageClass defined in Values.global.defaults.storageClass, return this
Else if there is a storageClass defined in Values.globalDefaults.storageClass, return this
In any other case, return nothing
*/}}
@@ -17,16 +17,16 @@
{{- if eq "-" $className -}}
{{- print "\"\"" -}}
{{- else if eq "SCALE-ZFS" $className -}} {{/* Later, if we have more storage classes we add another else if (eg SCALE-SMB) */}}
{{- if not $root.Values.global.defaults.scaleZFSStorageClass -}}
{{- fail "A storageClass must be defined in global.defaults.scaleZFSStorageClass" -}}
{{- if not $root.Values.globalDefaults.scaleZFSStorageClass -}}
{{- fail "A storageClass must be defined in globalDefaults.scaleZFSStorageClass" -}}
{{- end -}}
{{- print (tpl $root.Values.global.defaults.scaleZFSStorageClass $root) -}}
{{- print (tpl $root.Values.globalDefaults.scaleZFSStorageClass $root) -}}
{{- else -}}
{{- print $className -}}
{{- end -}}
{{- else if $root.Values.ixChartContext -}}
{{- print (tpl $root.Values.global.ixChartContext.storageClassName $root) -}}
{{- else if $root.Values.global.defaults.storageClass -}}
{{- print $root.Values.global.defaults.storageClass -}}
{{- else if $root.Values.globalDefaults.storageClass -}}
{{- print $root.Values.globalDefaults.storageClass -}}
{{- end -}}
{{- end -}}
@@ -63,10 +63,10 @@ spec:
storageClassName: {{ . }}
{{- end }}
accessModes:
- {{ tpl ($vct.accessMode | default $.Values.global.defaults.accessMode) $ }}
- {{ tpl ($vct.accessMode | default $.Values.globalDefaults.accessMode) $ }}
resources:
requests:
storage: {{ tpl ($vct.size | default $.Values.global.defaults.VCTSize) $ | quote }}
storage: {{ tpl ($vct.size | default $.Values.globalDefaults.VCTSize) $ | quote }}
{{- end -}}
{{- end -}}
{{- end }}
@@ -1,6 +1,6 @@
{{/* Renders the PVC objects */}}
{{- define "ix.v1.common.spawner.pvc" -}}
{{- $defaultType := .Values.global.defaults.persistenceType -}}
{{- $defaultType := .Values.globalDefaults.persistenceType -}}
{{- range $name, $pvc := .Values.persistence -}}
{{- if and $pvc.enabled (eq (default $defaultType $pvc.type) "pvc") (not ($pvc.existingClaim)) -}}
{{- $pvcValues := $pvc -}}
+127 -120
View File
@@ -1,122 +1,134 @@
# This file only includes the default values that are applied.
# All values can be overridden per chart, in their values.yaml
# For Examples and Explanation view the "Values.yaml Explained" markdown file
# For Examples and Explanation view the "docs".
# Global Values
global:
nameOverride: ""
fullnameOverride: ""
annotations: {}
# Labels applied to all objects
labels: {}
defaults:
# If not defined on per pod or in ixChartContext, assume this.
# Empty means NO runtimeClassName
runtimeClassName: ""
# If not defined on the pod, assume this
dnsPolicy: ClusterFirst
# If no restart Policy is defined, assume this
restartPolicy: Always
# If no restart Policy for job is defined, assume this
jobRestartPolicy: Never
# If no port Protocol is defined, assume this
portProtocol: TCP
# Define the minimum NodePort
minimumNodePort: 9000
# If no service Type is defined, assume this
serviceType: ClusterIP
# If no PVC Size is defined, assume this
PVCSize: 1Gi
# If no VCT Size is defined, assume this
VCTSize: 999Gi
# If no PVC type is defined, assume this
persistenceType: pvc
# If no validateHostPath key exists in the persistence item, assume this
validateHostPath: false
# If no PVC accessMode is defined, assume this
accessMode: ReadWriteOnce
# If no PVC retain key is defined, assume this
# Note, that this adds an annotation for helm whether to delete
# the resource on uninstall, manually deleting the namespace it will delete
# the resource no matter what this is set.
PVCRetain: false
# Define a storageClassName that will be used for all PVCs by default
# Leave empty to rely on the node's default storageClass
storageClass:
# When SCALE-ZFS is set for storageClass, return this name
scaleZFSStorageClass: '{{ printf "ix-storage-class-%v" .Release.Name}}'
# Default security context used for all
# init/install/upgrade/additional
# and main containers if not specified
securityContext:
runAsNonRoot: true
runAsUser: 568
runAsGroup: 568
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
privileged: false
capabilities:
add: []
drop:
- ALL
# Default podSecurityContext, used if
# no other is specified
podSecurityContext:
fsGroup: 568
supplementalGroups: []
fsGroupChangePolicy: OnRootMismatch
# Default Security values, if no others
# are specified
security:
PUID: 568
UMASK: "002"
# Whether to inject fixedEnvs on containers
# Can be overruled per container
injectFixedEnvs: true
# Default nvidia Caps will be assigned via
# environment variable (requires injectFixedEnvs)
nvidiaCaps:
- all
# Default Resources values, if no others
# are specified, use those
resources:
limits:
cpu: 4000m
memory: 8Gi
requests:
cpu: 10m
memory: 50Mi
# If no probe Type is defined, assume this
probeType: auto
# If no probe Path is defined, assume this
probePath: /
# Default probe timeouts, if no others
# are specified, use those
probes:
liveness:
spec:
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 5
readiness:
spec:
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 5
startup:
spec:
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 2
failureThreshold: 60
# Default job/cronjob values
job:
cron:
concurrencyPolicy: Forbid
failedJobsHistoryLimit: 1
successfulJobsHistoryLimit: 3
backoffLimit: 6
completionMode: NonIndexed
# Annotations applied to all objects
annotations: {}
# Default values to use if not defined on the chart
globalDefaults:
# Whether to add annotations for specific use cases
addAnnotations:
metallb: false
traefik: false
# Default RuntimeClassName to use for pods
# If not defined on per pod or in ixChartContext, assume this.
# Empty means NO runtimeClassName
runtimeClassName: ""
# Default Restart Policy to use for pods
restartPolicy: Always
# Default Job Restart Policy
jobRestartPolicy: Never
# Default portProtocol for service
portProtocol: TCP
# Define the minimum NodePort
minimumNodePort: 9000
# If not defined on the pod, assume this
dnsPolicy: ClusterFirst
# If no service Type is defined, assume this
serviceType: ClusterIP
# If no PVC Size is defined, assume this
PVCSize: 1Gi
# If no VCT Size is defined, assume this
VCTSize: 999Gi
# If no PVC type is defined, assume this
persistenceType: pvc
# If no validateHostPath key exists in the persistence item, assume this
validateHostPath: false
# If no PVC accessMode is defined, assume this
accessMode: ReadWriteOnce
# Define a storageClassName that will be used for all PVCs by default
# Leave empty to rely on the node's default storageClass
storageClass:
# When SCALE-ZFS is set for storageClass, return this name
scaleZFSStorageClass: '{{ printf "ix-storage-class-%v" .Release.Name}}'
# If no PVC retain key is defined, assume this
# Note, that this adds an annotation for helm whether to delete
# the resource on uninstall, manually deleting the namespace it will delete
# the resource no matter what this is set.
PVCRetain: false
# Default security context used for all
# init/install/upgrade/additional
# and main containers if not specified
securityContext:
runAsNonRoot: true
runAsUser: 568
runAsGroup: 568
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
privileged: false
capabilities:
add: []
drop:
- ALL
# Default podSecurityContext, used if
# no other is specified
podSecurityContext:
fsGroup: 568
supplementalGroups: []
fsGroupChangePolicy: OnRootMismatch
# Whether to inject fixedEnvs on containers
# Can be overruled per container
injectFixedEnvs: true
# Default nvidia Caps will be assigned via
# environment variable (requires injectFixedEnvs)
nvidiaCaps:
- all
# Default Resources values, if no others
# are specified, use those
resources:
limits:
cpu: 4000m
memory: 8Gi
requests:
cpu: 10m
memory: 50Mi
# If no probe Type is defined, assume this
probeType: auto
# If no probe Path is defined, assume this
probePath: /
# Default probe timeouts, if no others
# are specified, use those
probes:
liveness:
spec:
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 5
readiness:
spec:
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 5
startup:
spec:
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 2
failureThreshold: 60
# Default job/cronjob values
job:
cron:
concurrencyPolicy: Forbid
failedJobsHistoryLimit: 1
successfulJobsHistoryLimit: 3
backoffLimit: 6
completionMode: NonIndexed
# Defines the timezone for the container
TZ: UTC
# Default PUID
PUID: 568
# Default UMASK
UMASK: "002"
# Defines image info
image:
@@ -145,12 +157,7 @@ env: {}
envList: []
# Defines the environment variables from a secret or configmap
envFrom: []
# Defines the timezone for the container
TZ: UTC
# Default Security values for main container
security:
PUID: 568
UMASK: "002"
# Nvidia Caps will be assigned via environment variable
# If empty, global defaults will be used
nvidiaCaps: []