mirror of
https://github.com/truecharts/library-charts.git
synced 2026-07-06 04:26:22 -03:00
initial work for volumeMounts for extra contaienrs
This commit is contained in:
@@ -7,6 +7,7 @@ can be dynamically configured via an env var.
|
||||
{{- define "ix.v1.common.container.ports" -}}
|
||||
{{- $defaultPortProtocol := .Values.global.defaults.portProtocol -}}
|
||||
{{- $ports := list -}}
|
||||
|
||||
{{- range $svcName, $svc := .Values.service -}}
|
||||
{{- if $svc.enabled -}}
|
||||
{{- if not $svc.ports -}}
|
||||
@@ -50,6 +51,7 @@ can be dynamically configured via an env var.
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* This is called by init/install/upgrade/additional containers only */}}
|
||||
{{- define "ix.v1.common.container.extraContainerPorts" -}}
|
||||
{{- $containerName := .containerName -}}
|
||||
{{- $ports := .ports -}}
|
||||
|
||||
@@ -1,18 +1,26 @@
|
||||
{{/* Volume Mounts included by the container. */}}
|
||||
{{- define "ix.v1.common.container.volumeMounts" -}}
|
||||
{{- range $name, $item := .Values.persistence -}}
|
||||
{{- if $item.enabled -}}
|
||||
{{- if not $item.noMount -}}
|
||||
{{- include "ix.v1.common.container.volumeMount" (dict "root" $ "item" $item "name" $name) | nindent 0 -}}
|
||||
{{- $isMainContainer := .isMainContainer -}}
|
||||
{{- $root := .root -}}
|
||||
{{- $extraContainerVolMounts := .extraContainerVolMouts -}}
|
||||
|
||||
{{- if $isMainContainer -}}
|
||||
{{- range $name, $item := $root.Values.persistence -}}
|
||||
{{- if $item.enabled -}}
|
||||
{{- if not $item.noMount -}}
|
||||
{{- include "ix.v1.common.container.volumeMount" (dict "root" $root "item" $item "name" $name) | nindent 0 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* TODO: write tests when statefulset is ready */}}
|
||||
{{- if eq .Values.controller.type "statefulset" -}}
|
||||
{{- range $index, $vct := .Values.volumeClaimTemplates -}}
|
||||
{{- include "ix.v1.common.container.volumeMount" (dict "root" $ "item" $vct "name" (toString $index)) | nindent 0 -}}
|
||||
{{/* TODO: write tests when statefulset is ready */}}
|
||||
{{- if eq $root.Values.controller.type "statefulset" -}}
|
||||
{{- range $index, $vct := $root.Values.volumeClaimTemplates -}}
|
||||
{{- include "ix.v1.common.container.volumeMount" (dict "root" $root "item" $vct "name" (toString $index)) | nindent 0 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- else if not $isMainContainer -}}
|
||||
{{/* range themounts of extra contaienrs */}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
@@ -90,6 +90,12 @@
|
||||
ports:
|
||||
{{- . | nindent 4 }}
|
||||
{{- end -}}
|
||||
{{- with (include "ix.v1.common.container.volumeMounts" (dict "root" $root
|
||||
"extraContaienrVolMounts" $container.volumeMounts
|
||||
"isMainContainer" false) | trim) }}
|
||||
volumeMounts:
|
||||
{{- . | nindent 4 }}
|
||||
{{- end -}}
|
||||
{{- with (include "ix.v1.common.container.resources" (dict "resources" $container.resources
|
||||
"gpu" $container.scaleGPU
|
||||
"isMainContainer" false
|
||||
|
||||
@@ -54,7 +54,8 @@ So it can work on multiple places, like additional containers and not only the m
|
||||
ports:
|
||||
{{- . | nindent 4 }}
|
||||
{{- end -}}
|
||||
{{- with (include "ix.v1.common.container.volumeMounts" . | trim) }}
|
||||
{{- with (include "ix.v1.common.container.volumeMounts" (dict "root" .
|
||||
"isMainContainer" true) | trim) }}
|
||||
volumeMounts:
|
||||
{{- . | nindent 4 }}
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user