diff --git a/library/common/1.0.0/templates/lib/chart/_annotations.tpl b/library/common/1.0.0/templates/lib/chart/_annotations.tpl index 454713cb..586b8975 100644 --- a/library/common/1.0.0/templates/lib/chart/_annotations.tpl +++ b/library/common/1.0.0/templates/lib/chart/_annotations.tpl @@ -1,3 +1,5 @@ +{{/* Workloads = Deployment, ReplicaSet, StatefulSet, DaemonSet, Job, CronJob, etc */}} + {{/* These annotations will be shared on all objects Rendered under ".metadata.annotations" @@ -27,5 +29,3 @@ Rendered under ".metadata.annotations" {{- define "ix.v1.common.annotations.workload" -}} rollme: {{ randAlphaNum 5 | quote }} {{- end -}} - -{{/* Workloads = Deployment, ReplicaSet, StatefulSet, DaemonSet, Job, CronJob, etc */}} diff --git a/library/common/1.0.0/templates/lib/container/_args.tpl b/library/common/1.0.0/templates/lib/container/_args.tpl index 7ca61a7a..fb714f29 100644 --- a/library/common/1.0.0/templates/lib/container/_args.tpl +++ b/library/common/1.0.0/templates/lib/container/_args.tpl @@ -1,3 +1,10 @@ +{{/* +A custom dict is expected with args, extraArgs and root. +It's designed to work for mainContainer AND initContainers. +Calling this from an initContainer, wouldn't work, as it would have a different "root" context, +and "tpl" on "$" would cause erors. +That's why the custom dict is expected. +*/}} {{/* Args included by the container */}} {{- define "ix.v1.common.container.args" -}} {{- $args := .args -}} @@ -18,11 +25,3 @@ {{- end }} {{- end }} {{- end -}} - -{{/* -A custom dict is expected with args, extraArgs and root. -It's designed to work for mainContainer AND initContainers. -Calling this from an initContainer, wouldn't work, as it would have a different "root" context, -and "tpl" on "$" would cause erors. -That's why the custom dict is expected. -*/}} diff --git a/library/common/1.0.0/templates/lib/container/_command.tpl b/library/common/1.0.0/templates/lib/container/_command.tpl index ea93a286..0123e366 100644 --- a/library/common/1.0.0/templates/lib/container/_command.tpl +++ b/library/common/1.0.0/templates/lib/container/_command.tpl @@ -1,3 +1,10 @@ +{{/* +A custom dict is expected with commands and root. +It's designed to work for mainContainer AND initContainers. +Calling this from an initContainer, wouldn't work, as it would have a different "root" context, +and "tpl" on "$" would cause erors. +That's why the custom dict is expected. +*/}} {{/* Command included by the container */}} {{- define "ix.v1.common.container.command" -}} {{- $commands := .commands -}} @@ -10,11 +17,3 @@ {{- end }} {{- end }} {{- end -}} - -{{/* -A custom dict is expected with commands and root. -It's designed to work for mainContainer AND initContainers. -Calling this from an initContainer, wouldn't work, as it would have a different "root" context, -and "tpl" on "$" would cause erors. -That's why the custom dict is expected. -*/}} diff --git a/library/common/1.0.0/templates/lib/container/_env_from.tpl b/library/common/1.0.0/templates/lib/container/_env_from.tpl index b38d5005..87025c2e 100644 --- a/library/common/1.0.0/templates/lib/container/_env_from.tpl +++ b/library/common/1.0.0/templates/lib/container/_env_from.tpl @@ -1,3 +1,11 @@ +{{/* +A custom dict is expected with envList and root. +It's designed to work for mainContainer AND initContainers. +Calling this from an initContainer, wouldn't work, as it would have a different "root" context, +and "tpl" on "$" would cause erors. +That's why the custom dict is expected. +*/}} + {{/* Environment Variables List included by the container */}} {{- define "ix.v1.common.container.envFrom" -}} {{- $envFrom := .envFrom -}} @@ -18,11 +26,3 @@ {{- end -}} {{- end -}} {{- end -}} - -{{/* -A custom dict is expected with envList and root. -It's designed to work for mainContainer AND initContainers. -Calling this from an initContainer, wouldn't work, as it would have a different "root" context, -and "tpl" on "$" would cause erors. -That's why the custom dict is expected. -*/}} diff --git a/library/common/1.0.0/templates/lib/container/_env_vars.tpl b/library/common/1.0.0/templates/lib/container/_env_vars.tpl index 7cf34ad9..1e674277 100644 --- a/library/common/1.0.0/templates/lib/container/_env_vars.tpl +++ b/library/common/1.0.0/templates/lib/container/_env_vars.tpl @@ -1,3 +1,10 @@ +{{/* +A custom dict is expected with envs and root. +It's designed to work for mainContainer AND initContainers. +Calling this from an initContainer, wouldn't work, as it would have a different "root" context, +and "tpl" on "$" would cause erors. +That's why the custom dict is expected. +*/}} {{/* Environment Variables included by the container */}} {{- define "ix.v1.common.container.envVars" -}} {{- $envs := .envs -}} @@ -67,11 +74,3 @@ {{- end -}} {{- end -}} {{/* Finish envList */}} {{- end -}} - -{{/* -A custom dict is expected with envs and root. -It's designed to work for mainContainer AND initContainers. -Calling this from an initContainer, wouldn't work, as it would have a different "root" context, -and "tpl" on "$" would cause erors. -That's why the custom dict is expected. -*/}} diff --git a/library/common/1.0.0/templates/lib/container/_ports.tpl b/library/common/1.0.0/templates/lib/container/_ports.tpl index a1d8c5f5..7fd0c0dc 100644 --- a/library/common/1.0.0/templates/lib/container/_ports.tpl +++ b/library/common/1.0.0/templates/lib/container/_ports.tpl @@ -1,3 +1,8 @@ +{{/* +If no targetPort is given, default to port. +This is for cases where port (that container listens) +can be dynamically configured via an env var. +*/}} {{/* Ports included by the container. */}} {{- define "ix.v1.common.container.ports" -}} {{ $ports := list }} @@ -37,9 +42,3 @@ {{- end }} {{- end -}} {{- end -}} - -{{/* -If no targetPort is given, default to port. -This is for cases where port (that container listens) -can be dynamically configured via an env var. -*/}} diff --git a/library/common/1.0.0/templates/lib/controller/_container.tpl b/library/common/1.0.0/templates/lib/controller/_container.tpl index 5b9213bb..4dfc1380 100644 --- a/library/common/1.0.0/templates/lib/controller/_container.tpl +++ b/library/common/1.0.0/templates/lib/controller/_container.tpl @@ -1,4 +1,12 @@ {{/* The main container included in the controller */}} +{{/* +The "tpl (toYaml somepath) $" is used to expand template content (if any) +Cases like this are when we set these values on another tpl file with template + +On some includes we pass a dict with the "root" and some other values. +This is because this named function relies on those two, to specify it's context. +So it can work on multiple places, like additional containers and not only the main container. +*/}} {{- define "ix.v1.common.controller.mainContainer" -}} - name: {{ include "ix.v1.common.names.fullname" . }} image: {{ include "ix.v1.common.images.selector" . }} @@ -52,13 +60,3 @@ {{- . | nindent 4 }} {{- end -}} {{- end -}} - -{{/* -The "tpl (toYaml somepath) $" is used to expand template content (if any) -Cases like this are when we set these values on another tpl file with template -*/}} -{{/* -On some includes we pass a dict with the "root" and some other values. -This is because this named function relies on those two, to specify it's context. -So it can work on multiple places, like additional containers and not only the main container. -*/}} diff --git a/library/common/1.0.0/templates/lib/controller/_volumes.tpl b/library/common/1.0.0/templates/lib/controller/_volumes.tpl index 16469072..59a1e5c3 100644 --- a/library/common/1.0.0/templates/lib/controller/_volumes.tpl +++ b/library/common/1.0.0/templates/lib/controller/_volumes.tpl @@ -1,3 +1,9 @@ + +{{/* +For emptyDir: +If the `SizeMemoryBackedVolumes` feature gate is enabled, +you can specify a size for memory backed volumes. +*/}} {{/* Volumes included by the controller. */}} {{- define "ix.v1.common.controller.volumes" -}} {{- $persistenceDefault := "pvc" -}} @@ -81,9 +87,3 @@ {{- end }} {{- end }} {{- end }} - -{{/* -For emptyDir: -If the `SizeMemoryBackedVolumes` feature gate is enabled, -you can specify a size for memory backed volumes. -*/}} diff --git a/library/common/1.0.0/templates/lib/util/_primary_port.tpl b/library/common/1.0.0/templates/lib/util/_primary_port.tpl index 95b7883a..b486c0e0 100644 --- a/library/common/1.0.0/templates/lib/util/_primary_port.tpl +++ b/library/common/1.0.0/templates/lib/util/_primary_port.tpl @@ -1,3 +1,4 @@ +{{/* A dict containing .values and .serviceName is passed when this function is called */}} {{/* Return the primary port for a given Service object. */}} {{- define "ix.v1.common.lib.util.service.ports.primary" -}} {{- $enabledPorts := dict -}} @@ -29,4 +30,3 @@ {{- $result -}} {{- end -}} -{{/* A dict containing .values and .serviceName is passed when this function is called */}}