From ffd44aac0c95d8442ad7106ec102e9fd180c664f Mon Sep 17 00:00:00 2001 From: "M. Rehan" Date: Thu, 28 Jul 2022 03:46:22 +0500 Subject: [PATCH] Remove unused library common charts --- library/common/2101.0.0/.helmignore | 23 ------ library/common/2101.0.0/Chart.yaml | 23 ------ library/common/2101.0.0/README.md | 11 --- .../2101.0.0/templates/_serviceaccount.tpl | 11 --- .../2101.0.0/templates/classes/_service.tpl | 41 ---------- .../templates/classes/_service_ports.tpl | 19 ----- .../templates/lib/chart/_annotations.tpl | 6 -- .../templates/lib/chart/_capabilities.tpl | 27 ------- .../2101.0.0/templates/lib/chart/_labels.tpl | 24 ------ .../2101.0.0/templates/lib/chart/_names.tpl | 66 ---------------- .../templates/lib/containers/_environment.tpl | 41 ---------- .../templates/lib/containers/_image.tpl | 9 --- .../templates/lib/containers/_resource.tpl | 10 --- .../templates/lib/deployments/_utils.tpl | 41 ---------- .../templates/lib/networking/_dns.tpl | 10 --- .../templates/lib/resources/_certs.tpl | 26 ------- .../2101.0.0/templates/lib/schema/_utils.tpl | 19 ----- .../templates/lib/storage/_appStorage.tpl | 72 ------------------ .../templates/lib/storage/_ixvolumes.tpl | 11 --- library/common/2105.0.0/.helmignore | 23 ------ library/common/2105.0.0/Chart.yaml | 23 ------ library/common/2105.0.0/README.md | 11 --- .../2105.0.0/templates/_serviceaccount.tpl | 11 --- .../2105.0.0/templates/classes/_service.tpl | 41 ---------- .../templates/classes/_service_ports.tpl | 19 ----- .../templates/lib/chart/_annotations.tpl | 6 -- .../templates/lib/chart/_capabilities.tpl | 27 ------- .../2105.0.0/templates/lib/chart/_labels.tpl | 24 ------ .../2105.0.0/templates/lib/chart/_names.tpl | 66 ---------------- .../templates/lib/containers/_environment.tpl | 41 ---------- .../templates/lib/containers/_image.tpl | 9 --- .../templates/lib/containers/_resource.tpl | 10 --- .../templates/lib/deployments/_utils.tpl | 41 ---------- .../templates/lib/networking/_dns.tpl | 12 --- .../templates/lib/resources/_certs.tpl | 26 ------- .../2105.0.0/templates/lib/schema/_utils.tpl | 19 ----- .../templates/lib/storage/_appStorage.tpl | 72 ------------------ .../templates/lib/storage/_ixvolumes.tpl | 11 --- library/common/2112.0.0/.helmignore | 23 ------ library/common/2112.0.0/Chart.yaml | 23 ------ library/common/2112.0.0/README.md | 11 --- .../2112.0.0/templates/_serviceaccount.tpl | 11 --- .../2112.0.0/templates/classes/_service.tpl | 41 ---------- .../templates/classes/_service_ports.tpl | 19 ----- .../templates/lib/chart/_annotations.tpl | 6 -- .../templates/lib/chart/_capabilities.tpl | 27 ------- .../2112.0.0/templates/lib/chart/_labels.tpl | 24 ------ .../2112.0.0/templates/lib/chart/_names.tpl | 66 ---------------- .../templates/lib/containers/_environment.tpl | 41 ---------- .../templates/lib/containers/_image.tpl | 9 --- .../templates/lib/containers/_port.tpl | 15 ---- .../templates/lib/containers/_resource.tpl | 10 --- .../templates/lib/deployments/_utils.tpl | 41 ---------- .../templates/lib/networking/_dns.tpl | 12 --- .../templates/lib/resources/_certs.tpl | 26 ------- .../2112.0.0/templates/lib/schema/_utils.tpl | 19 ----- .../templates/lib/storage/_appStorage.tpl | 75 ------------------- .../lib/storage/_hostpathValidation.tpl | 56 -------------- .../templates/lib/storage/_ixvolumes.tpl | 11 --- 59 files changed, 1548 deletions(-) delete mode 100644 library/common/2101.0.0/.helmignore delete mode 100644 library/common/2101.0.0/Chart.yaml delete mode 100644 library/common/2101.0.0/README.md delete mode 100644 library/common/2101.0.0/templates/_serviceaccount.tpl delete mode 100644 library/common/2101.0.0/templates/classes/_service.tpl delete mode 100644 library/common/2101.0.0/templates/classes/_service_ports.tpl delete mode 100644 library/common/2101.0.0/templates/lib/chart/_annotations.tpl delete mode 100644 library/common/2101.0.0/templates/lib/chart/_capabilities.tpl delete mode 100644 library/common/2101.0.0/templates/lib/chart/_labels.tpl delete mode 100644 library/common/2101.0.0/templates/lib/chart/_names.tpl delete mode 100644 library/common/2101.0.0/templates/lib/containers/_environment.tpl delete mode 100644 library/common/2101.0.0/templates/lib/containers/_image.tpl delete mode 100644 library/common/2101.0.0/templates/lib/containers/_resource.tpl delete mode 100644 library/common/2101.0.0/templates/lib/deployments/_utils.tpl delete mode 100644 library/common/2101.0.0/templates/lib/networking/_dns.tpl delete mode 100644 library/common/2101.0.0/templates/lib/resources/_certs.tpl delete mode 100644 library/common/2101.0.0/templates/lib/schema/_utils.tpl delete mode 100644 library/common/2101.0.0/templates/lib/storage/_appStorage.tpl delete mode 100644 library/common/2101.0.0/templates/lib/storage/_ixvolumes.tpl delete mode 100644 library/common/2105.0.0/.helmignore delete mode 100644 library/common/2105.0.0/Chart.yaml delete mode 100644 library/common/2105.0.0/README.md delete mode 100644 library/common/2105.0.0/templates/_serviceaccount.tpl delete mode 100644 library/common/2105.0.0/templates/classes/_service.tpl delete mode 100644 library/common/2105.0.0/templates/classes/_service_ports.tpl delete mode 100644 library/common/2105.0.0/templates/lib/chart/_annotations.tpl delete mode 100644 library/common/2105.0.0/templates/lib/chart/_capabilities.tpl delete mode 100644 library/common/2105.0.0/templates/lib/chart/_labels.tpl delete mode 100644 library/common/2105.0.0/templates/lib/chart/_names.tpl delete mode 100644 library/common/2105.0.0/templates/lib/containers/_environment.tpl delete mode 100644 library/common/2105.0.0/templates/lib/containers/_image.tpl delete mode 100644 library/common/2105.0.0/templates/lib/containers/_resource.tpl delete mode 100644 library/common/2105.0.0/templates/lib/deployments/_utils.tpl delete mode 100644 library/common/2105.0.0/templates/lib/networking/_dns.tpl delete mode 100644 library/common/2105.0.0/templates/lib/resources/_certs.tpl delete mode 100644 library/common/2105.0.0/templates/lib/schema/_utils.tpl delete mode 100644 library/common/2105.0.0/templates/lib/storage/_appStorage.tpl delete mode 100644 library/common/2105.0.0/templates/lib/storage/_ixvolumes.tpl delete mode 100644 library/common/2112.0.0/.helmignore delete mode 100644 library/common/2112.0.0/Chart.yaml delete mode 100644 library/common/2112.0.0/README.md delete mode 100644 library/common/2112.0.0/templates/_serviceaccount.tpl delete mode 100644 library/common/2112.0.0/templates/classes/_service.tpl delete mode 100644 library/common/2112.0.0/templates/classes/_service_ports.tpl delete mode 100644 library/common/2112.0.0/templates/lib/chart/_annotations.tpl delete mode 100644 library/common/2112.0.0/templates/lib/chart/_capabilities.tpl delete mode 100644 library/common/2112.0.0/templates/lib/chart/_labels.tpl delete mode 100644 library/common/2112.0.0/templates/lib/chart/_names.tpl delete mode 100644 library/common/2112.0.0/templates/lib/containers/_environment.tpl delete mode 100644 library/common/2112.0.0/templates/lib/containers/_image.tpl delete mode 100644 library/common/2112.0.0/templates/lib/containers/_port.tpl delete mode 100644 library/common/2112.0.0/templates/lib/containers/_resource.tpl delete mode 100644 library/common/2112.0.0/templates/lib/deployments/_utils.tpl delete mode 100644 library/common/2112.0.0/templates/lib/networking/_dns.tpl delete mode 100644 library/common/2112.0.0/templates/lib/resources/_certs.tpl delete mode 100644 library/common/2112.0.0/templates/lib/schema/_utils.tpl delete mode 100644 library/common/2112.0.0/templates/lib/storage/_appStorage.tpl delete mode 100644 library/common/2112.0.0/templates/lib/storage/_hostpathValidation.tpl delete mode 100644 library/common/2112.0.0/templates/lib/storage/_ixvolumes.tpl diff --git a/library/common/2101.0.0/.helmignore b/library/common/2101.0.0/.helmignore deleted file mode 100644 index 0e8a0eb36f..0000000000 --- a/library/common/2101.0.0/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/library/common/2101.0.0/Chart.yaml b/library/common/2101.0.0/Chart.yaml deleted file mode 100644 index 9a222c4857..0000000000 --- a/library/common/2101.0.0/Chart.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v2 -name: common -description: A library chart for iX Official Catalog - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: library - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2101.0.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -appVersion: v1 diff --git a/library/common/2101.0.0/README.md b/library/common/2101.0.0/README.md deleted file mode 100644 index f8784843a2..0000000000 --- a/library/common/2101.0.0/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Library Chart for iX Official Catalog iX Chart - -**WARNING: THIS CHART IS NOT MEANT TO BE INSTALLED DIRECTLY** - -This is a [Helm Library Chart](https://helm.sh/docs/topics/library_charts/#helm). It's purpose is for grouping common logic between the k8s@home charts. - -Since a lot of charts follow the same pattern this library was built to reduce maintenance cost between the charts that use it and try achieve a goal of being DRY. - -## Introduction - -This chart provides common template helpers which can be used to develop new charts using [Helm](https://helm.sh) package manager. diff --git a/library/common/2101.0.0/templates/_serviceaccount.tpl b/library/common/2101.0.0/templates/_serviceaccount.tpl deleted file mode 100644 index b96d4009a9..0000000000 --- a/library/common/2101.0.0/templates/_serviceaccount.tpl +++ /dev/null @@ -1,11 +0,0 @@ -{{/* -Common service account -*/}} -{{- define "common.serviceaccount" -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "common.names.serviceAccountName" . | quote }} - namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.selectorLabels" . | nindent 4 -}} -{{- end -}} diff --git a/library/common/2101.0.0/templates/classes/_service.tpl b/library/common/2101.0.0/templates/classes/_service.tpl deleted file mode 100644 index c63ab9b933..0000000000 --- a/library/common/2101.0.0/templates/classes/_service.tpl +++ /dev/null @@ -1,41 +0,0 @@ -{{/* -This template serves as a blueprint for all Service objects that are created -within the common library. -*/}} -{{- define "common.classes.service" -}} -{{- $values := .commonService -}} -{{- $serviceName := include "common.names.fullname" . -}} -{{- if hasKey $values "nameSuffix" -}} - {{- $serviceName = (printf "%v-%v" $serviceName $values.nameSuffix) -}} -{{ end -}} -{{- $svcType := $values.type | default "" -}} -apiVersion: v1 -kind: Service -metadata: - name: {{ $serviceName }} - labels: - {{- include "common.labels" . | nindent 4 }} - {{- if $values.labels }} - {{ toYaml $values.labels | nindent 4 }} - {{- end }} - {{- if $values.annotations }} - {{- with $values.annotations }} - annotations: - {{ toYaml . | nindent 4 }} - {{- end }} - {{- end }} -spec: - {{- if (or (eq $svcType "ClusterIP") (empty $svcType)) }} - type: ClusterIP - {{- if $values.clusterIP }} - clusterIP: {{ $values.clusterIP }} - {{end}} - {{- else if eq $svcType "NodePort" }} - type: {{ $svcType }} - {{- else }} - {{- fail "Only ClusterIP and NodePort services are supported in common chart" }} - {{- end }} - {{- include "common.classes.service.ports" (dict "svcType" $svcType "values" $values ) | trim | nindent 2 }} - selector: - {{- include "common.labels.selectorLabels" . | nindent 4 }} -{{- end }} diff --git a/library/common/2101.0.0/templates/classes/_service_ports.tpl b/library/common/2101.0.0/templates/classes/_service_ports.tpl deleted file mode 100644 index a61900b42a..0000000000 --- a/library/common/2101.0.0/templates/classes/_service_ports.tpl +++ /dev/null @@ -1,19 +0,0 @@ -{{/* -Render all the ports and additionalPorts for a Service object. -*/}} -{{- define "common.classes.service.ports" -}} - {{- $values := .values -}} - {{- $ports := $values.ports -}} - {{- if $ports -}} - ports: - {{- range $_ := $ports }} - - port: {{ .port }} - targetPort: {{ .targetPort | default "http" }} - protocol: {{ .protocol | default "TCP" }} - name: {{ .name | default "http" }} - {{- if (and (eq $.svcType "NodePort") (not (empty .nodePort))) }} - nodePort: {{ .nodePort }} - {{ end }} - {{- end -}} - {{- end -}} -{{- end }} diff --git a/library/common/2101.0.0/templates/lib/chart/_annotations.tpl b/library/common/2101.0.0/templates/lib/chart/_annotations.tpl deleted file mode 100644 index ad80be1e90..0000000000 --- a/library/common/2101.0.0/templates/lib/chart/_annotations.tpl +++ /dev/null @@ -1,6 +0,0 @@ -{{/* -Common workload annotations -*/}} -{{- define "common.annotations" -}} -rollme: {{ randAlphaNum 5 | quote }} -{{- end -}} diff --git a/library/common/2101.0.0/templates/lib/chart/_capabilities.tpl b/library/common/2101.0.0/templates/lib/chart/_capabilities.tpl deleted file mode 100644 index 7a3c13c8b2..0000000000 --- a/library/common/2101.0.0/templates/lib/chart/_capabilities.tpl +++ /dev/null @@ -1,27 +0,0 @@ -{{/* -Return the appropriate apiVersion for DaemonSet objects. -*/}} -{{- define "common.capabilities.daemonset.apiVersion" -}} -{{- print "apps/v1" -}} -{{- end -}} - -{{/* -Return the appropriate apiVersion for Deployment objects. -*/}} -{{- define "common.capabilities.deployment.apiVersion" -}} -{{- print "apps/v1" -}} -{{- end -}} - -{{/* -Return the appropriate apiVersion for StatefulSet objects. -*/}} -{{- define "common.capabilities.statefulset.apiVersion" -}} -{{- print "apps/v1" -}} -{{- end -}} - -{{/* -Return the appropriate apiVersion for StatefulSet objects. -*/}} -{{- define "common.capabilities.cronjob.apiVersion" -}} -{{- print "batch/v1beta1" -}} -{{- end -}} diff --git a/library/common/2101.0.0/templates/lib/chart/_labels.tpl b/library/common/2101.0.0/templates/lib/chart/_labels.tpl deleted file mode 100644 index f64aead636..0000000000 --- a/library/common/2101.0.0/templates/lib/chart/_labels.tpl +++ /dev/null @@ -1,24 +0,0 @@ -{{/* -Common labels shared across objects. -*/}} -{{- define "common.labels" -}} -helm.sh/chart: {{ include "common.names.chart" . }} -{{ include "common.labels.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels shared across objects. -*/}} -{{- define "common.labels.selectorLabels" -}} -app.kubernetes.io/name: {{ include "common.names.name" . }} -app.kubernetes.io/instance: {{ include "common.names.releaseName" . }} -{{ if hasKey .Values "extraSelectorLabels" }} -{{ range $selector := .Values.extraSelectorLabels }} -{{ printf "%s: %s" $selector.key $selector.value }} -{{ end }} -{{ end }} -{{- end }} diff --git a/library/common/2101.0.0/templates/lib/chart/_names.tpl b/library/common/2101.0.0/templates/lib/chart/_names.tpl deleted file mode 100644 index e98c6b4e6f..0000000000 --- a/library/common/2101.0.0/templates/lib/chart/_names.tpl +++ /dev/null @@ -1,66 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "common.names.name" -}} -{{- $values := (.common | default dict) -}} -{{- $name := (default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-") }} -{{- if hasKey $values "nameSuffix" -}} - {{- $name = (printf "%v-%v" $name $values.nameSuffix) -}} -{{ end -}} -{{- print $name -}} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "common.names.fullname" -}} -{{- $values := (.common | default dict) -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- $name = (.Release.Name | trunc 63 | trimSuffix "-") }} -{{- else }} -{{- $name = (printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-") }} -{{- end }} -{{- if hasKey $values "nameSuffix" -}} - {{- $name = (printf "%v-%v" $name $values.nameSuffix) -}} -{{ end -}} -{{- print $name -}} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "common.names.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Determine service account name for deployment or statefulset. -*/}} -{{- define "common.names.serviceAccountName" -}} -{{- if .Values.serviceAccountNameOverride }} -{{- .Values.serviceAccountNameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-service-account" (include "common.names.releaseName" .) | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} - - -{{/* -Determine release name -This will add a suffix to the release name if nameSuffix is set -*/}} -{{- define "common.names.releaseName" -}} -{{- $values := (.common | default dict) -}} -{{- if hasKey $values "nameSuffix" -}} - {{- printf "%v-%v" .Release.Name $values.nameSuffix -}} -{{- else -}} - {{- print .Release.Name -}} -{{ end -}} -{{- end -}} diff --git a/library/common/2101.0.0/templates/lib/containers/_environment.tpl b/library/common/2101.0.0/templates/lib/containers/_environment.tpl deleted file mode 100644 index 9d3862599b..0000000000 --- a/library/common/2101.0.0/templates/lib/containers/_environment.tpl +++ /dev/null @@ -1,41 +0,0 @@ -{{/* -Render environment variable -*/}} -{{- define "common.containers.environmentVariable" -}} -{{- $envVariable := . -}} -{{- include "common.schema.validateKeys" (dict "values" $envVariable "checkKeys" (list "name")) -}} -{{- if $envVariable.valueFromSecret -}} -{{- include "common.schema.validateKeys" (dict "values" $envVariable "checkKeys" (list "secretName" "secretKey")) -}} -- name: {{ $envVariable.name }} - valueFrom: - secretKeyRef: - name: {{ $envVariable.secretName }} - key: {{ $envVariable.secretKey }} -{{- else -}} -{{- include "common.schema.validateKeys" (dict "values" $envVariable "checkKeys" (list "value")) -}} -- name: {{ $envVariable.name }} - value: {{ $envVariable.value }} -{{- end -}} -{{- end -}} - -{{/* -Render environment variables -*/}} -{{- define "common.containers.environmentVariables" -}} -{{- $values := . -}} -{{- include "common.schema.validateKeys" (dict "values" $values "checkKeys" (list "environmentVariables")) -}} -{{- range $envVariable := $values.environmentVariables -}} -{{- include "common.containers.environmentVariable" $envVariable | nindent 0 -}} -{{- end -}} -{{- end -}} - -{{/* -Render environment variables if present -*/}} -{{- define "common.containers.allEnvironmentVariables" -}} -{{- $values := . -}} -{{- include "common.schema.validateKeys" (dict "values" $values "checkKeys" (list "environmentVariables")) -}} -{{- if $values.environmentVariables -}} -env: {{- include "common.containers.environmentVariables" $values | nindent 2 -}} -{{- end -}} -{{- end -}} diff --git a/library/common/2101.0.0/templates/lib/containers/_image.tpl b/library/common/2101.0.0/templates/lib/containers/_image.tpl deleted file mode 100644 index 4a5a368008..0000000000 --- a/library/common/2101.0.0/templates/lib/containers/_image.tpl +++ /dev/null @@ -1,9 +0,0 @@ -{{/* -Retrieve image configuration for container -*/}} -{{- define "common.containers.imageConfig" -}} -{{- $values := . -}} -{{- include "common.schema.validateKeys" (dict "values" $values "checkKeys" (list "repository" "tag" "pullPolicy")) -}} -image: "{{ $values.repository }}:{{ $values.tag }}" -imagePullPolicy: {{ $values.pullPolicy }} -{{- end -}} diff --git a/library/common/2101.0.0/templates/lib/containers/_resource.tpl b/library/common/2101.0.0/templates/lib/containers/_resource.tpl deleted file mode 100644 index fd4f6eef02..0000000000 --- a/library/common/2101.0.0/templates/lib/containers/_resource.tpl +++ /dev/null @@ -1,10 +0,0 @@ -{{/* -Retrieve GPU Configuration -*/}} -{{- define "common.containers.gpuConfiguration" -}} -{{- $values := . -}} -{{ if $values.gpuConfiguration }} -resources: - limits: {{- toYaml $values.gpuConfiguration | nindent 4 }} -{{ end }} -{{- end -}} diff --git a/library/common/2101.0.0/templates/lib/deployments/_utils.tpl b/library/common/2101.0.0/templates/lib/deployments/_utils.tpl deleted file mode 100644 index b8b2f76ad5..0000000000 --- a/library/common/2101.0.0/templates/lib/deployments/_utils.tpl +++ /dev/null @@ -1,41 +0,0 @@ -{{/* -Retrieve deployment metadata -*/}} -{{- define "common.deployment.metadata" -}} -metadata: - name: {{ template "common.names.fullname" . }} - labels: {{ include "common.labels.selectorLabels" . | nindent 4 }} -{{- end -}} - - -{{/* -Retrieve replicas/strategy/selector -*/}} -{{- define "common.deployment.common_spec" -}} -replicas: {{ (default 1 .Values.replicas) }} -strategy: - type: {{ (default "Recreate" .Values.updateStrategy ) }} -selector: - matchLabels: {{ include "common.labels.selectorLabels" . | nindent 4 }} -{{- end -}} - - -{{/* -Retrieve deployment pod's metadata -*/}} -{{- define "common.deployment.pod.metadata" -}} -metadata: - name: {{ template "common.names.fullname" . }} - labels: {{ include "common.labels.selectorLabels" . | nindent 4 }} - annotations: {{ include "common.annotations" . | nindent 4 }} -{{- end -}} - - -{{/* -Retrieve common deployment configuration -*/}} -{{- define "common.deployment.common_config" -}} -apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }} -kind: Deployment -{{ include "common.deployment.metadata" . | nindent 0 }} -{{- end -}} diff --git a/library/common/2101.0.0/templates/lib/networking/_dns.tpl b/library/common/2101.0.0/templates/lib/networking/_dns.tpl deleted file mode 100644 index c95d374616..0000000000 --- a/library/common/2101.0.0/templates/lib/networking/_dns.tpl +++ /dev/null @@ -1,10 +0,0 @@ -{{/* -DNS Configuration -*/}} -{{- define "common.networking.dnsConfiguration" }} -dnsPolicy: {{ .Values.dnsPolicy }} -{{- if .Values.dnsConfig }} -dnsConfig: - {{- toYaml .Values.dnsConfig | nindent 2 }} -{{- end }} -{{- end }} diff --git a/library/common/2101.0.0/templates/lib/resources/_certs.tpl b/library/common/2101.0.0/templates/lib/resources/_certs.tpl deleted file mode 100644 index 9e091595e9..0000000000 --- a/library/common/2101.0.0/templates/lib/resources/_certs.tpl +++ /dev/null @@ -1,26 +0,0 @@ -{{/* -Retrieve true/false if certificate is available in ixCertificates -*/}} -{{- define "common.resources.cert_present" -}} -{{- $values := . -}} -{{- include "common.schema.validateKeys" (dict "values" . "checkKeys" (list "commonCertOptions")) -}} -{{- hasKey $values.Values.ixCertificates ($values.commonCertOptions.certKeyName | toString) -}} -{{- end -}} - - -{{/* -Retrieve certificate from variable name -*/}} -{{- define "common.resources.cert" -}} -{{- $values := . -}} -{{- include "common.schema.validateKeys" (dict "values" . "checkKeys" (list "commonCertOptions")) -}} -{{- $certKey := ($values.commonCertOptions.certKeyName | toString) -}} -{{- if hasKey $values.Values.ixCertificates $certKey -}} -{{- $cert := get $values.Values.ixCertificates $certKey -}} -{{- if $values.commonCertOptions.publicKey -}} -{{ $cert.certificate }} -{{- else -}} -{{ $cert.privatekey }} -{{- end -}} -{{- end -}} -{{- end -}} diff --git a/library/common/2101.0.0/templates/lib/schema/_utils.tpl b/library/common/2101.0.0/templates/lib/schema/_utils.tpl deleted file mode 100644 index 8577a0b615..0000000000 --- a/library/common/2101.0.0/templates/lib/schema/_utils.tpl +++ /dev/null @@ -1,19 +0,0 @@ -{{/* -Checks if a list of keys are present in a dictionary -*/}} -{{- define "common.schema.validateKeys" -}} -{{- $values := . -}} -{{- if and (hasKey $values "values") (hasKey $values "checkKeys") -}} -{{- $missingKeys := list -}} -{{- range $values.checkKeys -}} -{{- if eq (hasKey $values.values . ) false -}} -{{- $missingKeys = mustAppend $missingKeys . -}} -{{- end -}} -{{- end -}} -{{- if $missingKeys -}} -{{- fail (printf "Missing %s from dictionary" ($missingKeys | join ", ")) -}} -{{- end -}} -{{- else -}} -{{- fail "A dictionary and list of keys to check must be provided" -}} -{{- end -}} -{{- end -}} diff --git a/library/common/2101.0.0/templates/lib/storage/_appStorage.tpl b/library/common/2101.0.0/templates/lib/storage/_appStorage.tpl deleted file mode 100644 index 0651870eb1..0000000000 --- a/library/common/2101.0.0/templates/lib/storage/_appStorage.tpl +++ /dev/null @@ -1,72 +0,0 @@ -{{/* -Define appVolumeMounts for container -*/}} -{{- define "common.storage.configureAppVolumeMountsInContainer" -}} -{{- include "common.schema.validateKeys" (dict "values" . "checkKeys" (list "appVolumeMounts")) -}} -{{- $appVolumeMounts := .appVolumeMounts -}} -{{- if $appVolumeMounts -}} -{{ range $name, $avm := $appVolumeMounts }} -{{- if (default true $avm.enabled) -}} -{{ if $avm.containerNameOverride }} -{{ $name = $avm.containerNameOverride }} -{{ end }} -- name: {{ $name }} - mountPath: {{ $avm.mountPath }} - {{ if $avm.subPath }} - subPath: {{ $avm.subPath }} - {{ end }} -{{- end -}} -{{ end }} -{{- end -}} -{{- end -}} - - -{{/* -Define hostPath for appVolumes -*/}} -{{- define "common.storage.configureAppVolumes" -}} -{{- include "common.schema.validateKeys" (dict "values" . "checkKeys" (list "appVolumeMounts")) -}} -{{- $values := . -}} -{{- if $values.appVolumeMounts -}} -{{- range $name, $av := $values.appVolumeMounts -}} -{{ if (default true $av.enabled) }} -- name: {{ $name }} - {{ if or $av.emptyDir $.emptyDirVolumes }} - emptyDir: {} - {{- else -}} - hostPath: - {{ if $av.hostPathEnabled }} - path: {{ required "hostPath not set" $av.hostPath }} - {{ else }} - {{- include "common.schema.validateKeys" (dict "values" $values "checkKeys" (list "ixVolumes")) -}} - {{- include "common.schema.validateKeys" (dict "values" $av "checkKeys" (list "datasetName")) -}} - {{- $volDict := dict "datasetName" $av.datasetName "ixVolumes" $values.ixVolumes -}} - path: {{ include "common.storage.retrieveHostPathFromiXVolume" $volDict }} - {{ end }} - {{ end }} -{{ end }} -{{- end -}} -{{- end -}} -{{- end -}} - - -{{/* -Get all volumes configuration -*/}} -{{- define "common.storage.allAppVolumes" -}} -{{- $appVolumeMounts := .appVolumeMounts -}} -{{- if $appVolumeMounts -}} -volumes: {{- include "common.storage.configureAppVolumes" . | nindent 2 -}} -{{- end -}} -{{- end -}} - - -{{/* -Get all container volume moutns configuration -*/}} -{{- define "common.storage.allContainerVolumeMounts" -}} -{{- $appVolumeMounts := .appVolumeMounts -}} -{{- if $appVolumeMounts -}} -volumeMounts: {{- include "common.storage.configureAppVolumeMountsInContainer" . | nindent 2 -}} -{{- end -}} -{{- end -}} diff --git a/library/common/2101.0.0/templates/lib/storage/_ixvolumes.tpl b/library/common/2101.0.0/templates/lib/storage/_ixvolumes.tpl deleted file mode 100644 index f45b9d8d96..0000000000 --- a/library/common/2101.0.0/templates/lib/storage/_ixvolumes.tpl +++ /dev/null @@ -1,11 +0,0 @@ -{{/* -Retrieve host path from ix volumes based on dataset name -*/}} -{{- define "common.storage.retrieveHostPathFromiXVolume" -}} -{{- range $index, $hostPathConfiguration := $.ixVolumes }} -{{- $dsName := base $hostPathConfiguration.hostPath -}} -{{- if eq $.datasetName $dsName -}} -{{- $hostPathConfiguration.hostPath -}} -{{- end -}} -{{- end }} -{{- end -}} diff --git a/library/common/2105.0.0/.helmignore b/library/common/2105.0.0/.helmignore deleted file mode 100644 index 0e8a0eb36f..0000000000 --- a/library/common/2105.0.0/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/library/common/2105.0.0/Chart.yaml b/library/common/2105.0.0/Chart.yaml deleted file mode 100644 index 300110574f..0000000000 --- a/library/common/2105.0.0/Chart.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v2 -name: common -description: A library chart for iX Official Catalog - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: library - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2105.0.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -appVersion: v1 diff --git a/library/common/2105.0.0/README.md b/library/common/2105.0.0/README.md deleted file mode 100644 index f8784843a2..0000000000 --- a/library/common/2105.0.0/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Library Chart for iX Official Catalog iX Chart - -**WARNING: THIS CHART IS NOT MEANT TO BE INSTALLED DIRECTLY** - -This is a [Helm Library Chart](https://helm.sh/docs/topics/library_charts/#helm). It's purpose is for grouping common logic between the k8s@home charts. - -Since a lot of charts follow the same pattern this library was built to reduce maintenance cost between the charts that use it and try achieve a goal of being DRY. - -## Introduction - -This chart provides common template helpers which can be used to develop new charts using [Helm](https://helm.sh) package manager. diff --git a/library/common/2105.0.0/templates/_serviceaccount.tpl b/library/common/2105.0.0/templates/_serviceaccount.tpl deleted file mode 100644 index b96d4009a9..0000000000 --- a/library/common/2105.0.0/templates/_serviceaccount.tpl +++ /dev/null @@ -1,11 +0,0 @@ -{{/* -Common service account -*/}} -{{- define "common.serviceaccount" -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "common.names.serviceAccountName" . | quote }} - namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.selectorLabels" . | nindent 4 -}} -{{- end -}} diff --git a/library/common/2105.0.0/templates/classes/_service.tpl b/library/common/2105.0.0/templates/classes/_service.tpl deleted file mode 100644 index c63ab9b933..0000000000 --- a/library/common/2105.0.0/templates/classes/_service.tpl +++ /dev/null @@ -1,41 +0,0 @@ -{{/* -This template serves as a blueprint for all Service objects that are created -within the common library. -*/}} -{{- define "common.classes.service" -}} -{{- $values := .commonService -}} -{{- $serviceName := include "common.names.fullname" . -}} -{{- if hasKey $values "nameSuffix" -}} - {{- $serviceName = (printf "%v-%v" $serviceName $values.nameSuffix) -}} -{{ end -}} -{{- $svcType := $values.type | default "" -}} -apiVersion: v1 -kind: Service -metadata: - name: {{ $serviceName }} - labels: - {{- include "common.labels" . | nindent 4 }} - {{- if $values.labels }} - {{ toYaml $values.labels | nindent 4 }} - {{- end }} - {{- if $values.annotations }} - {{- with $values.annotations }} - annotations: - {{ toYaml . | nindent 4 }} - {{- end }} - {{- end }} -spec: - {{- if (or (eq $svcType "ClusterIP") (empty $svcType)) }} - type: ClusterIP - {{- if $values.clusterIP }} - clusterIP: {{ $values.clusterIP }} - {{end}} - {{- else if eq $svcType "NodePort" }} - type: {{ $svcType }} - {{- else }} - {{- fail "Only ClusterIP and NodePort services are supported in common chart" }} - {{- end }} - {{- include "common.classes.service.ports" (dict "svcType" $svcType "values" $values ) | trim | nindent 2 }} - selector: - {{- include "common.labels.selectorLabels" . | nindent 4 }} -{{- end }} diff --git a/library/common/2105.0.0/templates/classes/_service_ports.tpl b/library/common/2105.0.0/templates/classes/_service_ports.tpl deleted file mode 100644 index a61900b42a..0000000000 --- a/library/common/2105.0.0/templates/classes/_service_ports.tpl +++ /dev/null @@ -1,19 +0,0 @@ -{{/* -Render all the ports and additionalPorts for a Service object. -*/}} -{{- define "common.classes.service.ports" -}} - {{- $values := .values -}} - {{- $ports := $values.ports -}} - {{- if $ports -}} - ports: - {{- range $_ := $ports }} - - port: {{ .port }} - targetPort: {{ .targetPort | default "http" }} - protocol: {{ .protocol | default "TCP" }} - name: {{ .name | default "http" }} - {{- if (and (eq $.svcType "NodePort") (not (empty .nodePort))) }} - nodePort: {{ .nodePort }} - {{ end }} - {{- end -}} - {{- end -}} -{{- end }} diff --git a/library/common/2105.0.0/templates/lib/chart/_annotations.tpl b/library/common/2105.0.0/templates/lib/chart/_annotations.tpl deleted file mode 100644 index ad80be1e90..0000000000 --- a/library/common/2105.0.0/templates/lib/chart/_annotations.tpl +++ /dev/null @@ -1,6 +0,0 @@ -{{/* -Common workload annotations -*/}} -{{- define "common.annotations" -}} -rollme: {{ randAlphaNum 5 | quote }} -{{- end -}} diff --git a/library/common/2105.0.0/templates/lib/chart/_capabilities.tpl b/library/common/2105.0.0/templates/lib/chart/_capabilities.tpl deleted file mode 100644 index 7a3c13c8b2..0000000000 --- a/library/common/2105.0.0/templates/lib/chart/_capabilities.tpl +++ /dev/null @@ -1,27 +0,0 @@ -{{/* -Return the appropriate apiVersion for DaemonSet objects. -*/}} -{{- define "common.capabilities.daemonset.apiVersion" -}} -{{- print "apps/v1" -}} -{{- end -}} - -{{/* -Return the appropriate apiVersion for Deployment objects. -*/}} -{{- define "common.capabilities.deployment.apiVersion" -}} -{{- print "apps/v1" -}} -{{- end -}} - -{{/* -Return the appropriate apiVersion for StatefulSet objects. -*/}} -{{- define "common.capabilities.statefulset.apiVersion" -}} -{{- print "apps/v1" -}} -{{- end -}} - -{{/* -Return the appropriate apiVersion for StatefulSet objects. -*/}} -{{- define "common.capabilities.cronjob.apiVersion" -}} -{{- print "batch/v1beta1" -}} -{{- end -}} diff --git a/library/common/2105.0.0/templates/lib/chart/_labels.tpl b/library/common/2105.0.0/templates/lib/chart/_labels.tpl deleted file mode 100644 index f64aead636..0000000000 --- a/library/common/2105.0.0/templates/lib/chart/_labels.tpl +++ /dev/null @@ -1,24 +0,0 @@ -{{/* -Common labels shared across objects. -*/}} -{{- define "common.labels" -}} -helm.sh/chart: {{ include "common.names.chart" . }} -{{ include "common.labels.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels shared across objects. -*/}} -{{- define "common.labels.selectorLabels" -}} -app.kubernetes.io/name: {{ include "common.names.name" . }} -app.kubernetes.io/instance: {{ include "common.names.releaseName" . }} -{{ if hasKey .Values "extraSelectorLabels" }} -{{ range $selector := .Values.extraSelectorLabels }} -{{ printf "%s: %s" $selector.key $selector.value }} -{{ end }} -{{ end }} -{{- end }} diff --git a/library/common/2105.0.0/templates/lib/chart/_names.tpl b/library/common/2105.0.0/templates/lib/chart/_names.tpl deleted file mode 100644 index e98c6b4e6f..0000000000 --- a/library/common/2105.0.0/templates/lib/chart/_names.tpl +++ /dev/null @@ -1,66 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "common.names.name" -}} -{{- $values := (.common | default dict) -}} -{{- $name := (default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-") }} -{{- if hasKey $values "nameSuffix" -}} - {{- $name = (printf "%v-%v" $name $values.nameSuffix) -}} -{{ end -}} -{{- print $name -}} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "common.names.fullname" -}} -{{- $values := (.common | default dict) -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- $name = (.Release.Name | trunc 63 | trimSuffix "-") }} -{{- else }} -{{- $name = (printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-") }} -{{- end }} -{{- if hasKey $values "nameSuffix" -}} - {{- $name = (printf "%v-%v" $name $values.nameSuffix) -}} -{{ end -}} -{{- print $name -}} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "common.names.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Determine service account name for deployment or statefulset. -*/}} -{{- define "common.names.serviceAccountName" -}} -{{- if .Values.serviceAccountNameOverride }} -{{- .Values.serviceAccountNameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-service-account" (include "common.names.releaseName" .) | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} - - -{{/* -Determine release name -This will add a suffix to the release name if nameSuffix is set -*/}} -{{- define "common.names.releaseName" -}} -{{- $values := (.common | default dict) -}} -{{- if hasKey $values "nameSuffix" -}} - {{- printf "%v-%v" .Release.Name $values.nameSuffix -}} -{{- else -}} - {{- print .Release.Name -}} -{{ end -}} -{{- end -}} diff --git a/library/common/2105.0.0/templates/lib/containers/_environment.tpl b/library/common/2105.0.0/templates/lib/containers/_environment.tpl deleted file mode 100644 index d757f459c1..0000000000 --- a/library/common/2105.0.0/templates/lib/containers/_environment.tpl +++ /dev/null @@ -1,41 +0,0 @@ -{{/* -Render environment variable -*/}} -{{- define "common.containers.environmentVariable" -}} -{{- $envVariable := . -}} -{{- include "common.schema.validateKeys" (dict "values" $envVariable "checkKeys" (list "name")) -}} -{{- if $envVariable.valueFromSecret -}} -{{- include "common.schema.validateKeys" (dict "values" $envVariable "checkKeys" (list "secretName" "secretKey")) -}} -- name: {{ $envVariable.name | quote }} - valueFrom: - secretKeyRef: - name: {{ $envVariable.secretName | quote }} - key: {{ $envVariable.secretKey | quote }} -{{- else -}} -{{- include "common.schema.validateKeys" (dict "values" $envVariable "checkKeys" (list "value")) -}} -- name: {{ $envVariable.name | quote }} - value: {{ $envVariable.value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Render environment variables -*/}} -{{- define "common.containers.environmentVariables" -}} -{{- $values := . -}} -{{- include "common.schema.validateKeys" (dict "values" $values "checkKeys" (list "environmentVariables")) -}} -{{- range $envVariable := $values.environmentVariables -}} -{{- include "common.containers.environmentVariable" $envVariable | nindent 0 -}} -{{- end -}} -{{- end -}} - -{{/* -Render environment variables if present -*/}} -{{- define "common.containers.allEnvironmentVariables" -}} -{{- $values := . -}} -{{- include "common.schema.validateKeys" (dict "values" $values "checkKeys" (list "environmentVariables")) -}} -{{- if $values.environmentVariables -}} -env: {{- include "common.containers.environmentVariables" $values | nindent 2 -}} -{{- end -}} -{{- end -}} diff --git a/library/common/2105.0.0/templates/lib/containers/_image.tpl b/library/common/2105.0.0/templates/lib/containers/_image.tpl deleted file mode 100644 index 4a5a368008..0000000000 --- a/library/common/2105.0.0/templates/lib/containers/_image.tpl +++ /dev/null @@ -1,9 +0,0 @@ -{{/* -Retrieve image configuration for container -*/}} -{{- define "common.containers.imageConfig" -}} -{{- $values := . -}} -{{- include "common.schema.validateKeys" (dict "values" $values "checkKeys" (list "repository" "tag" "pullPolicy")) -}} -image: "{{ $values.repository }}:{{ $values.tag }}" -imagePullPolicy: {{ $values.pullPolicy }} -{{- end -}} diff --git a/library/common/2105.0.0/templates/lib/containers/_resource.tpl b/library/common/2105.0.0/templates/lib/containers/_resource.tpl deleted file mode 100644 index fd4f6eef02..0000000000 --- a/library/common/2105.0.0/templates/lib/containers/_resource.tpl +++ /dev/null @@ -1,10 +0,0 @@ -{{/* -Retrieve GPU Configuration -*/}} -{{- define "common.containers.gpuConfiguration" -}} -{{- $values := . -}} -{{ if $values.gpuConfiguration }} -resources: - limits: {{- toYaml $values.gpuConfiguration | nindent 4 }} -{{ end }} -{{- end -}} diff --git a/library/common/2105.0.0/templates/lib/deployments/_utils.tpl b/library/common/2105.0.0/templates/lib/deployments/_utils.tpl deleted file mode 100644 index b8b2f76ad5..0000000000 --- a/library/common/2105.0.0/templates/lib/deployments/_utils.tpl +++ /dev/null @@ -1,41 +0,0 @@ -{{/* -Retrieve deployment metadata -*/}} -{{- define "common.deployment.metadata" -}} -metadata: - name: {{ template "common.names.fullname" . }} - labels: {{ include "common.labels.selectorLabels" . | nindent 4 }} -{{- end -}} - - -{{/* -Retrieve replicas/strategy/selector -*/}} -{{- define "common.deployment.common_spec" -}} -replicas: {{ (default 1 .Values.replicas) }} -strategy: - type: {{ (default "Recreate" .Values.updateStrategy ) }} -selector: - matchLabels: {{ include "common.labels.selectorLabels" . | nindent 4 }} -{{- end -}} - - -{{/* -Retrieve deployment pod's metadata -*/}} -{{- define "common.deployment.pod.metadata" -}} -metadata: - name: {{ template "common.names.fullname" . }} - labels: {{ include "common.labels.selectorLabels" . | nindent 4 }} - annotations: {{ include "common.annotations" . | nindent 4 }} -{{- end -}} - - -{{/* -Retrieve common deployment configuration -*/}} -{{- define "common.deployment.common_config" -}} -apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }} -kind: Deployment -{{ include "common.deployment.metadata" . | nindent 0 }} -{{- end -}} diff --git a/library/common/2105.0.0/templates/lib/networking/_dns.tpl b/library/common/2105.0.0/templates/lib/networking/_dns.tpl deleted file mode 100644 index 3a748a4aae..0000000000 --- a/library/common/2105.0.0/templates/lib/networking/_dns.tpl +++ /dev/null @@ -1,12 +0,0 @@ -{{/* -DNS Configuration -*/}} -{{- define "common.networking.dnsConfiguration" }} -{{ if .dnsPolicy }} -dnsPolicy: {{ .dnsPolicy }} -{{ end }} -{{ if .dnsConfig }} -dnsConfig: - {{ toYaml .dnsConfig | nindent 2 }} -{{ end }} -{{- end }} diff --git a/library/common/2105.0.0/templates/lib/resources/_certs.tpl b/library/common/2105.0.0/templates/lib/resources/_certs.tpl deleted file mode 100644 index 9e091595e9..0000000000 --- a/library/common/2105.0.0/templates/lib/resources/_certs.tpl +++ /dev/null @@ -1,26 +0,0 @@ -{{/* -Retrieve true/false if certificate is available in ixCertificates -*/}} -{{- define "common.resources.cert_present" -}} -{{- $values := . -}} -{{- include "common.schema.validateKeys" (dict "values" . "checkKeys" (list "commonCertOptions")) -}} -{{- hasKey $values.Values.ixCertificates ($values.commonCertOptions.certKeyName | toString) -}} -{{- end -}} - - -{{/* -Retrieve certificate from variable name -*/}} -{{- define "common.resources.cert" -}} -{{- $values := . -}} -{{- include "common.schema.validateKeys" (dict "values" . "checkKeys" (list "commonCertOptions")) -}} -{{- $certKey := ($values.commonCertOptions.certKeyName | toString) -}} -{{- if hasKey $values.Values.ixCertificates $certKey -}} -{{- $cert := get $values.Values.ixCertificates $certKey -}} -{{- if $values.commonCertOptions.publicKey -}} -{{ $cert.certificate }} -{{- else -}} -{{ $cert.privatekey }} -{{- end -}} -{{- end -}} -{{- end -}} diff --git a/library/common/2105.0.0/templates/lib/schema/_utils.tpl b/library/common/2105.0.0/templates/lib/schema/_utils.tpl deleted file mode 100644 index 8577a0b615..0000000000 --- a/library/common/2105.0.0/templates/lib/schema/_utils.tpl +++ /dev/null @@ -1,19 +0,0 @@ -{{/* -Checks if a list of keys are present in a dictionary -*/}} -{{- define "common.schema.validateKeys" -}} -{{- $values := . -}} -{{- if and (hasKey $values "values") (hasKey $values "checkKeys") -}} -{{- $missingKeys := list -}} -{{- range $values.checkKeys -}} -{{- if eq (hasKey $values.values . ) false -}} -{{- $missingKeys = mustAppend $missingKeys . -}} -{{- end -}} -{{- end -}} -{{- if $missingKeys -}} -{{- fail (printf "Missing %s from dictionary" ($missingKeys | join ", ")) -}} -{{- end -}} -{{- else -}} -{{- fail "A dictionary and list of keys to check must be provided" -}} -{{- end -}} -{{- end -}} diff --git a/library/common/2105.0.0/templates/lib/storage/_appStorage.tpl b/library/common/2105.0.0/templates/lib/storage/_appStorage.tpl deleted file mode 100644 index 0651870eb1..0000000000 --- a/library/common/2105.0.0/templates/lib/storage/_appStorage.tpl +++ /dev/null @@ -1,72 +0,0 @@ -{{/* -Define appVolumeMounts for container -*/}} -{{- define "common.storage.configureAppVolumeMountsInContainer" -}} -{{- include "common.schema.validateKeys" (dict "values" . "checkKeys" (list "appVolumeMounts")) -}} -{{- $appVolumeMounts := .appVolumeMounts -}} -{{- if $appVolumeMounts -}} -{{ range $name, $avm := $appVolumeMounts }} -{{- if (default true $avm.enabled) -}} -{{ if $avm.containerNameOverride }} -{{ $name = $avm.containerNameOverride }} -{{ end }} -- name: {{ $name }} - mountPath: {{ $avm.mountPath }} - {{ if $avm.subPath }} - subPath: {{ $avm.subPath }} - {{ end }} -{{- end -}} -{{ end }} -{{- end -}} -{{- end -}} - - -{{/* -Define hostPath for appVolumes -*/}} -{{- define "common.storage.configureAppVolumes" -}} -{{- include "common.schema.validateKeys" (dict "values" . "checkKeys" (list "appVolumeMounts")) -}} -{{- $values := . -}} -{{- if $values.appVolumeMounts -}} -{{- range $name, $av := $values.appVolumeMounts -}} -{{ if (default true $av.enabled) }} -- name: {{ $name }} - {{ if or $av.emptyDir $.emptyDirVolumes }} - emptyDir: {} - {{- else -}} - hostPath: - {{ if $av.hostPathEnabled }} - path: {{ required "hostPath not set" $av.hostPath }} - {{ else }} - {{- include "common.schema.validateKeys" (dict "values" $values "checkKeys" (list "ixVolumes")) -}} - {{- include "common.schema.validateKeys" (dict "values" $av "checkKeys" (list "datasetName")) -}} - {{- $volDict := dict "datasetName" $av.datasetName "ixVolumes" $values.ixVolumes -}} - path: {{ include "common.storage.retrieveHostPathFromiXVolume" $volDict }} - {{ end }} - {{ end }} -{{ end }} -{{- end -}} -{{- end -}} -{{- end -}} - - -{{/* -Get all volumes configuration -*/}} -{{- define "common.storage.allAppVolumes" -}} -{{- $appVolumeMounts := .appVolumeMounts -}} -{{- if $appVolumeMounts -}} -volumes: {{- include "common.storage.configureAppVolumes" . | nindent 2 -}} -{{- end -}} -{{- end -}} - - -{{/* -Get all container volume moutns configuration -*/}} -{{- define "common.storage.allContainerVolumeMounts" -}} -{{- $appVolumeMounts := .appVolumeMounts -}} -{{- if $appVolumeMounts -}} -volumeMounts: {{- include "common.storage.configureAppVolumeMountsInContainer" . | nindent 2 -}} -{{- end -}} -{{- end -}} diff --git a/library/common/2105.0.0/templates/lib/storage/_ixvolumes.tpl b/library/common/2105.0.0/templates/lib/storage/_ixvolumes.tpl deleted file mode 100644 index f45b9d8d96..0000000000 --- a/library/common/2105.0.0/templates/lib/storage/_ixvolumes.tpl +++ /dev/null @@ -1,11 +0,0 @@ -{{/* -Retrieve host path from ix volumes based on dataset name -*/}} -{{- define "common.storage.retrieveHostPathFromiXVolume" -}} -{{- range $index, $hostPathConfiguration := $.ixVolumes }} -{{- $dsName := base $hostPathConfiguration.hostPath -}} -{{- if eq $.datasetName $dsName -}} -{{- $hostPathConfiguration.hostPath -}} -{{- end -}} -{{- end }} -{{- end -}} diff --git a/library/common/2112.0.0/.helmignore b/library/common/2112.0.0/.helmignore deleted file mode 100644 index 0e8a0eb36f..0000000000 --- a/library/common/2112.0.0/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/library/common/2112.0.0/Chart.yaml b/library/common/2112.0.0/Chart.yaml deleted file mode 100644 index bcf75581f2..0000000000 --- a/library/common/2112.0.0/Chart.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v2 -name: common -description: A library chart for iX Official Catalog - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: library - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2206.0.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -appVersion: v1 diff --git a/library/common/2112.0.0/README.md b/library/common/2112.0.0/README.md deleted file mode 100644 index f8784843a2..0000000000 --- a/library/common/2112.0.0/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Library Chart for iX Official Catalog iX Chart - -**WARNING: THIS CHART IS NOT MEANT TO BE INSTALLED DIRECTLY** - -This is a [Helm Library Chart](https://helm.sh/docs/topics/library_charts/#helm). It's purpose is for grouping common logic between the k8s@home charts. - -Since a lot of charts follow the same pattern this library was built to reduce maintenance cost between the charts that use it and try achieve a goal of being DRY. - -## Introduction - -This chart provides common template helpers which can be used to develop new charts using [Helm](https://helm.sh) package manager. diff --git a/library/common/2112.0.0/templates/_serviceaccount.tpl b/library/common/2112.0.0/templates/_serviceaccount.tpl deleted file mode 100644 index b96d4009a9..0000000000 --- a/library/common/2112.0.0/templates/_serviceaccount.tpl +++ /dev/null @@ -1,11 +0,0 @@ -{{/* -Common service account -*/}} -{{- define "common.serviceaccount" -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "common.names.serviceAccountName" . | quote }} - namespace: {{ .Release.Namespace | quote }} - labels: {{- include "common.labels.selectorLabels" . | nindent 4 -}} -{{- end -}} diff --git a/library/common/2112.0.0/templates/classes/_service.tpl b/library/common/2112.0.0/templates/classes/_service.tpl deleted file mode 100644 index c63ab9b933..0000000000 --- a/library/common/2112.0.0/templates/classes/_service.tpl +++ /dev/null @@ -1,41 +0,0 @@ -{{/* -This template serves as a blueprint for all Service objects that are created -within the common library. -*/}} -{{- define "common.classes.service" -}} -{{- $values := .commonService -}} -{{- $serviceName := include "common.names.fullname" . -}} -{{- if hasKey $values "nameSuffix" -}} - {{- $serviceName = (printf "%v-%v" $serviceName $values.nameSuffix) -}} -{{ end -}} -{{- $svcType := $values.type | default "" -}} -apiVersion: v1 -kind: Service -metadata: - name: {{ $serviceName }} - labels: - {{- include "common.labels" . | nindent 4 }} - {{- if $values.labels }} - {{ toYaml $values.labels | nindent 4 }} - {{- end }} - {{- if $values.annotations }} - {{- with $values.annotations }} - annotations: - {{ toYaml . | nindent 4 }} - {{- end }} - {{- end }} -spec: - {{- if (or (eq $svcType "ClusterIP") (empty $svcType)) }} - type: ClusterIP - {{- if $values.clusterIP }} - clusterIP: {{ $values.clusterIP }} - {{end}} - {{- else if eq $svcType "NodePort" }} - type: {{ $svcType }} - {{- else }} - {{- fail "Only ClusterIP and NodePort services are supported in common chart" }} - {{- end }} - {{- include "common.classes.service.ports" (dict "svcType" $svcType "values" $values ) | trim | nindent 2 }} - selector: - {{- include "common.labels.selectorLabels" . | nindent 4 }} -{{- end }} diff --git a/library/common/2112.0.0/templates/classes/_service_ports.tpl b/library/common/2112.0.0/templates/classes/_service_ports.tpl deleted file mode 100644 index a61900b42a..0000000000 --- a/library/common/2112.0.0/templates/classes/_service_ports.tpl +++ /dev/null @@ -1,19 +0,0 @@ -{{/* -Render all the ports and additionalPorts for a Service object. -*/}} -{{- define "common.classes.service.ports" -}} - {{- $values := .values -}} - {{- $ports := $values.ports -}} - {{- if $ports -}} - ports: - {{- range $_ := $ports }} - - port: {{ .port }} - targetPort: {{ .targetPort | default "http" }} - protocol: {{ .protocol | default "TCP" }} - name: {{ .name | default "http" }} - {{- if (and (eq $.svcType "NodePort") (not (empty .nodePort))) }} - nodePort: {{ .nodePort }} - {{ end }} - {{- end -}} - {{- end -}} -{{- end }} diff --git a/library/common/2112.0.0/templates/lib/chart/_annotations.tpl b/library/common/2112.0.0/templates/lib/chart/_annotations.tpl deleted file mode 100644 index ad80be1e90..0000000000 --- a/library/common/2112.0.0/templates/lib/chart/_annotations.tpl +++ /dev/null @@ -1,6 +0,0 @@ -{{/* -Common workload annotations -*/}} -{{- define "common.annotations" -}} -rollme: {{ randAlphaNum 5 | quote }} -{{- end -}} diff --git a/library/common/2112.0.0/templates/lib/chart/_capabilities.tpl b/library/common/2112.0.0/templates/lib/chart/_capabilities.tpl deleted file mode 100644 index 7a3c13c8b2..0000000000 --- a/library/common/2112.0.0/templates/lib/chart/_capabilities.tpl +++ /dev/null @@ -1,27 +0,0 @@ -{{/* -Return the appropriate apiVersion for DaemonSet objects. -*/}} -{{- define "common.capabilities.daemonset.apiVersion" -}} -{{- print "apps/v1" -}} -{{- end -}} - -{{/* -Return the appropriate apiVersion for Deployment objects. -*/}} -{{- define "common.capabilities.deployment.apiVersion" -}} -{{- print "apps/v1" -}} -{{- end -}} - -{{/* -Return the appropriate apiVersion for StatefulSet objects. -*/}} -{{- define "common.capabilities.statefulset.apiVersion" -}} -{{- print "apps/v1" -}} -{{- end -}} - -{{/* -Return the appropriate apiVersion for StatefulSet objects. -*/}} -{{- define "common.capabilities.cronjob.apiVersion" -}} -{{- print "batch/v1beta1" -}} -{{- end -}} diff --git a/library/common/2112.0.0/templates/lib/chart/_labels.tpl b/library/common/2112.0.0/templates/lib/chart/_labels.tpl deleted file mode 100644 index f64aead636..0000000000 --- a/library/common/2112.0.0/templates/lib/chart/_labels.tpl +++ /dev/null @@ -1,24 +0,0 @@ -{{/* -Common labels shared across objects. -*/}} -{{- define "common.labels" -}} -helm.sh/chart: {{ include "common.names.chart" . }} -{{ include "common.labels.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels shared across objects. -*/}} -{{- define "common.labels.selectorLabels" -}} -app.kubernetes.io/name: {{ include "common.names.name" . }} -app.kubernetes.io/instance: {{ include "common.names.releaseName" . }} -{{ if hasKey .Values "extraSelectorLabels" }} -{{ range $selector := .Values.extraSelectorLabels }} -{{ printf "%s: %s" $selector.key $selector.value }} -{{ end }} -{{ end }} -{{- end }} diff --git a/library/common/2112.0.0/templates/lib/chart/_names.tpl b/library/common/2112.0.0/templates/lib/chart/_names.tpl deleted file mode 100644 index e98c6b4e6f..0000000000 --- a/library/common/2112.0.0/templates/lib/chart/_names.tpl +++ /dev/null @@ -1,66 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "common.names.name" -}} -{{- $values := (.common | default dict) -}} -{{- $name := (default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-") }} -{{- if hasKey $values "nameSuffix" -}} - {{- $name = (printf "%v-%v" $name $values.nameSuffix) -}} -{{ end -}} -{{- print $name -}} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "common.names.fullname" -}} -{{- $values := (.common | default dict) -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- $name = (.Release.Name | trunc 63 | trimSuffix "-") }} -{{- else }} -{{- $name = (printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-") }} -{{- end }} -{{- if hasKey $values "nameSuffix" -}} - {{- $name = (printf "%v-%v" $name $values.nameSuffix) -}} -{{ end -}} -{{- print $name -}} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "common.names.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Determine service account name for deployment or statefulset. -*/}} -{{- define "common.names.serviceAccountName" -}} -{{- if .Values.serviceAccountNameOverride }} -{{- .Values.serviceAccountNameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-service-account" (include "common.names.releaseName" .) | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} - - -{{/* -Determine release name -This will add a suffix to the release name if nameSuffix is set -*/}} -{{- define "common.names.releaseName" -}} -{{- $values := (.common | default dict) -}} -{{- if hasKey $values "nameSuffix" -}} - {{- printf "%v-%v" .Release.Name $values.nameSuffix -}} -{{- else -}} - {{- print .Release.Name -}} -{{ end -}} -{{- end -}} diff --git a/library/common/2112.0.0/templates/lib/containers/_environment.tpl b/library/common/2112.0.0/templates/lib/containers/_environment.tpl deleted file mode 100644 index d757f459c1..0000000000 --- a/library/common/2112.0.0/templates/lib/containers/_environment.tpl +++ /dev/null @@ -1,41 +0,0 @@ -{{/* -Render environment variable -*/}} -{{- define "common.containers.environmentVariable" -}} -{{- $envVariable := . -}} -{{- include "common.schema.validateKeys" (dict "values" $envVariable "checkKeys" (list "name")) -}} -{{- if $envVariable.valueFromSecret -}} -{{- include "common.schema.validateKeys" (dict "values" $envVariable "checkKeys" (list "secretName" "secretKey")) -}} -- name: {{ $envVariable.name | quote }} - valueFrom: - secretKeyRef: - name: {{ $envVariable.secretName | quote }} - key: {{ $envVariable.secretKey | quote }} -{{- else -}} -{{- include "common.schema.validateKeys" (dict "values" $envVariable "checkKeys" (list "value")) -}} -- name: {{ $envVariable.name | quote }} - value: {{ $envVariable.value | quote }} -{{- end -}} -{{- end -}} - -{{/* -Render environment variables -*/}} -{{- define "common.containers.environmentVariables" -}} -{{- $values := . -}} -{{- include "common.schema.validateKeys" (dict "values" $values "checkKeys" (list "environmentVariables")) -}} -{{- range $envVariable := $values.environmentVariables -}} -{{- include "common.containers.environmentVariable" $envVariable | nindent 0 -}} -{{- end -}} -{{- end -}} - -{{/* -Render environment variables if present -*/}} -{{- define "common.containers.allEnvironmentVariables" -}} -{{- $values := . -}} -{{- include "common.schema.validateKeys" (dict "values" $values "checkKeys" (list "environmentVariables")) -}} -{{- if $values.environmentVariables -}} -env: {{- include "common.containers.environmentVariables" $values | nindent 2 -}} -{{- end -}} -{{- end -}} diff --git a/library/common/2112.0.0/templates/lib/containers/_image.tpl b/library/common/2112.0.0/templates/lib/containers/_image.tpl deleted file mode 100644 index 2b2b04561d..0000000000 --- a/library/common/2112.0.0/templates/lib/containers/_image.tpl +++ /dev/null @@ -1,9 +0,0 @@ -{{/* -Retrieve image configuration for container -*/}} -{{- define "common.containers.imageConfig" -}} -{{- $values := . -}} -{{- include "common.schema.validateKeys" (dict "values" $values "checkKeys" (list "repository" "tag" "pullPolicy")) -}} -image: "{{ $values.repository }}{{- if hasKey $values "postfix" -}}-{{ $values.postfix }}{{- end -}}:{{ $values.tag }}" -imagePullPolicy: {{ $values.pullPolicy }} -{{- end -}} diff --git a/library/common/2112.0.0/templates/lib/containers/_port.tpl b/library/common/2112.0.0/templates/lib/containers/_port.tpl deleted file mode 100644 index d7226c9bd6..0000000000 --- a/library/common/2112.0.0/templates/lib/containers/_port.tpl +++ /dev/null @@ -1,15 +0,0 @@ -{{/* -Retrieve ports configuration for container -*/}} -{{- define "common.containers.configurePorts" -}} -{{- if .ports -}} -ports: -{{- range $index, $port := .ports -}} -{{- include "common.schema.validateKeys" (dict "values" $port "checkKeys" (list "protocol" "containerPort")) }} -- protocol: {{ $port.protocol }} - containerPort: {{ $port.containerPort }} - {{ if hasKey $port "hostPort" }}hostPort: {{ $port.hostPort }}{{ end }} - {{ if hasKey $port "name" }}name: {{ $port.name }}{{ end }} -{{- end -}} -{{- end -}} -{{- end -}} diff --git a/library/common/2112.0.0/templates/lib/containers/_resource.tpl b/library/common/2112.0.0/templates/lib/containers/_resource.tpl deleted file mode 100644 index fd4f6eef02..0000000000 --- a/library/common/2112.0.0/templates/lib/containers/_resource.tpl +++ /dev/null @@ -1,10 +0,0 @@ -{{/* -Retrieve GPU Configuration -*/}} -{{- define "common.containers.gpuConfiguration" -}} -{{- $values := . -}} -{{ if $values.gpuConfiguration }} -resources: - limits: {{- toYaml $values.gpuConfiguration | nindent 4 }} -{{ end }} -{{- end -}} diff --git a/library/common/2112.0.0/templates/lib/deployments/_utils.tpl b/library/common/2112.0.0/templates/lib/deployments/_utils.tpl deleted file mode 100644 index b8b2f76ad5..0000000000 --- a/library/common/2112.0.0/templates/lib/deployments/_utils.tpl +++ /dev/null @@ -1,41 +0,0 @@ -{{/* -Retrieve deployment metadata -*/}} -{{- define "common.deployment.metadata" -}} -metadata: - name: {{ template "common.names.fullname" . }} - labels: {{ include "common.labels.selectorLabels" . | nindent 4 }} -{{- end -}} - - -{{/* -Retrieve replicas/strategy/selector -*/}} -{{- define "common.deployment.common_spec" -}} -replicas: {{ (default 1 .Values.replicas) }} -strategy: - type: {{ (default "Recreate" .Values.updateStrategy ) }} -selector: - matchLabels: {{ include "common.labels.selectorLabels" . | nindent 4 }} -{{- end -}} - - -{{/* -Retrieve deployment pod's metadata -*/}} -{{- define "common.deployment.pod.metadata" -}} -metadata: - name: {{ template "common.names.fullname" . }} - labels: {{ include "common.labels.selectorLabels" . | nindent 4 }} - annotations: {{ include "common.annotations" . | nindent 4 }} -{{- end -}} - - -{{/* -Retrieve common deployment configuration -*/}} -{{- define "common.deployment.common_config" -}} -apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }} -kind: Deployment -{{ include "common.deployment.metadata" . | nindent 0 }} -{{- end -}} diff --git a/library/common/2112.0.0/templates/lib/networking/_dns.tpl b/library/common/2112.0.0/templates/lib/networking/_dns.tpl deleted file mode 100644 index 3a748a4aae..0000000000 --- a/library/common/2112.0.0/templates/lib/networking/_dns.tpl +++ /dev/null @@ -1,12 +0,0 @@ -{{/* -DNS Configuration -*/}} -{{- define "common.networking.dnsConfiguration" }} -{{ if .dnsPolicy }} -dnsPolicy: {{ .dnsPolicy }} -{{ end }} -{{ if .dnsConfig }} -dnsConfig: - {{ toYaml .dnsConfig | nindent 2 }} -{{ end }} -{{- end }} diff --git a/library/common/2112.0.0/templates/lib/resources/_certs.tpl b/library/common/2112.0.0/templates/lib/resources/_certs.tpl deleted file mode 100644 index 9e091595e9..0000000000 --- a/library/common/2112.0.0/templates/lib/resources/_certs.tpl +++ /dev/null @@ -1,26 +0,0 @@ -{{/* -Retrieve true/false if certificate is available in ixCertificates -*/}} -{{- define "common.resources.cert_present" -}} -{{- $values := . -}} -{{- include "common.schema.validateKeys" (dict "values" . "checkKeys" (list "commonCertOptions")) -}} -{{- hasKey $values.Values.ixCertificates ($values.commonCertOptions.certKeyName | toString) -}} -{{- end -}} - - -{{/* -Retrieve certificate from variable name -*/}} -{{- define "common.resources.cert" -}} -{{- $values := . -}} -{{- include "common.schema.validateKeys" (dict "values" . "checkKeys" (list "commonCertOptions")) -}} -{{- $certKey := ($values.commonCertOptions.certKeyName | toString) -}} -{{- if hasKey $values.Values.ixCertificates $certKey -}} -{{- $cert := get $values.Values.ixCertificates $certKey -}} -{{- if $values.commonCertOptions.publicKey -}} -{{ $cert.certificate }} -{{- else -}} -{{ $cert.privatekey }} -{{- end -}} -{{- end -}} -{{- end -}} diff --git a/library/common/2112.0.0/templates/lib/schema/_utils.tpl b/library/common/2112.0.0/templates/lib/schema/_utils.tpl deleted file mode 100644 index 8577a0b615..0000000000 --- a/library/common/2112.0.0/templates/lib/schema/_utils.tpl +++ /dev/null @@ -1,19 +0,0 @@ -{{/* -Checks if a list of keys are present in a dictionary -*/}} -{{- define "common.schema.validateKeys" -}} -{{- $values := . -}} -{{- if and (hasKey $values "values") (hasKey $values "checkKeys") -}} -{{- $missingKeys := list -}} -{{- range $values.checkKeys -}} -{{- if eq (hasKey $values.values . ) false -}} -{{- $missingKeys = mustAppend $missingKeys . -}} -{{- end -}} -{{- end -}} -{{- if $missingKeys -}} -{{- fail (printf "Missing %s from dictionary" ($missingKeys | join ", ")) -}} -{{- end -}} -{{- else -}} -{{- fail "A dictionary and list of keys to check must be provided" -}} -{{- end -}} -{{- end -}} diff --git a/library/common/2112.0.0/templates/lib/storage/_appStorage.tpl b/library/common/2112.0.0/templates/lib/storage/_appStorage.tpl deleted file mode 100644 index b97a8b2c09..0000000000 --- a/library/common/2112.0.0/templates/lib/storage/_appStorage.tpl +++ /dev/null @@ -1,75 +0,0 @@ -{{/* -Define appVolumeMounts for container -*/}} -{{- define "common.storage.configureAppVolumeMountsInContainer" -}} -{{- include "common.schema.validateKeys" (dict "values" . "checkKeys" (list "appVolumeMounts")) -}} -{{- $appVolumeMounts := .appVolumeMounts -}} -{{- if $appVolumeMounts -}} -{{ range $name, $avm := $appVolumeMounts }} -{{- if (default true $avm.enabled) -}} -{{ if $avm.containerNameOverride }} -{{ $name = $avm.containerNameOverride }} -{{ end }} -- name: {{ $name }} - mountPath: {{ $avm.mountPath }} - {{ if $avm.subPath }} - subPath: {{ $avm.subPath }} - {{ end }} - {{ if $avm.readOnly }} - readOnly: {{ $avm.readOnly }} - {{ end }} -{{- end -}} -{{ end }} -{{- end -}} -{{- end -}} - - -{{/* -Define hostPath for appVolumes -*/}} -{{- define "common.storage.configureAppVolumes" -}} -{{- include "common.schema.validateKeys" (dict "values" . "checkKeys" (list "appVolumeMounts")) -}} -{{- $values := . -}} -{{- if $values.appVolumeMounts -}} -{{- range $name, $av := $values.appVolumeMounts -}} -{{ if (default true $av.enabled) }} -- name: {{ $name }} - {{ if or $av.emptyDir $.emptyDirVolumes }} - emptyDir: {} - {{- else -}} - hostPath: - {{ if $av.hostPathEnabled }} - path: {{ required "hostPath not set" $av.hostPath }} - {{ else }} - {{- include "common.schema.validateKeys" (dict "values" $values "checkKeys" (list "ixVolumes")) -}} - {{- include "common.schema.validateKeys" (dict "values" $av "checkKeys" (list "datasetName")) -}} - {{- $volDict := dict "datasetName" $av.datasetName "ixVolumes" $values.ixVolumes -}} - path: {{ include "common.storage.retrieveHostPathFromiXVolume" $volDict }} - {{ end }} - {{ end }} -{{ end }} -{{- end -}} -{{- end -}} -{{- end -}} - - -{{/* -Get all volumes configuration -*/}} -{{- define "common.storage.allAppVolumes" -}} -{{- $appVolumeMounts := .appVolumeMounts -}} -{{- if $appVolumeMounts -}} -volumes: {{- include "common.storage.configureAppVolumes" . | nindent 2 -}} -{{- end -}} -{{- end -}} - - -{{/* -Get all container volume moutns configuration -*/}} -{{- define "common.storage.allContainerVolumeMounts" -}} -{{- $appVolumeMounts := .appVolumeMounts -}} -{{- if $appVolumeMounts -}} -volumeMounts: {{- include "common.storage.configureAppVolumeMountsInContainer" . | nindent 2 -}} -{{- end -}} -{{- end -}} diff --git a/library/common/2112.0.0/templates/lib/storage/_hostpathValidation.tpl b/library/common/2112.0.0/templates/lib/storage/_hostpathValidation.tpl deleted file mode 100644 index 046d0e7807..0000000000 --- a/library/common/2112.0.0/templates/lib/storage/_hostpathValidation.tpl +++ /dev/null @@ -1,56 +0,0 @@ -{{/* -Validate list of host path in a specific format -*/}} -{{- define "common.storage.hostPathsValidation" -}} - {{- $allowed_paths := (list "mnt" "sys" "dev" "cluster") -}} - {{- range . -}} - {{- $host_p := splitList "/" . -}} - {{- $host_p := (without $host_p "") -}} - {{- $error_msg := (printf "Invalid hostpath %s. Path must be a valid path under a given pool e.g `/mnt/tank/somepath` is valid whereas `/mnt` or `/mnt/tank` are invalid examples." .) -}} - {{- if and (eq (index $host_p 0) "mnt") (lt ($host_p | len) 3) -}} - {{- fail $error_msg -}} - {{- else if (eq (index $host_p 0) "cluster") -}} - {{- if (lt ($host_p | len) 2) -}} - {{- fail $error_msg -}} - {{- else if (eq (index $host_p 1) "ctdb_shared_vol") -}} - {{- fail $error_msg -}} - {{- end -}} - {{- else if not (has (index $host_p 0) $allowed_paths) -}} - {{- fail $error_msg -}} - {{- end -}} - {{- end -}} -{{- end -}} - -{{/* -Validate app volume mount's host path -*/}} -{{- define "common.storage.appHostPathsValidate" -}} - {{- $host_p := list -}} - {{- range $path_name := .appVolumeMounts -}} - {{- if ($path_name.hostPathEnabled) -}} - {{- $host_p = mustAppend $host_p $path_name.hostPath -}} - {{- end -}} - {{- end -}} - {{- include "common.storage.hostPathsValidation" $host_p -}} -{{- end -}} - - -{{/* -Validate extra volume mount's host path -*/}} -{{- define "common.storage.extraHostPathsValidate" -}} - {{- $host_p := list -}} - {{- range $index, $hostPathConfiguration := .extraAppVolumeMounts -}} - {{- $host_p = mustAppend $host_p $hostPathConfiguration.hostPath -}} - {{- end -}} - {{- include "common.storage.hostPathsValidation" $host_p -}} -{{- end -}} - - -{{/* -Validate volumes mount's host paths -*/}} -{{- define "common.storage.hostPathValidate" -}} - {{- include "common.storage.extraHostPathsValidate" . -}} - {{- include "common.storage.appHostPathsValidate" . -}} -{{- end -}} diff --git a/library/common/2112.0.0/templates/lib/storage/_ixvolumes.tpl b/library/common/2112.0.0/templates/lib/storage/_ixvolumes.tpl deleted file mode 100644 index f45b9d8d96..0000000000 --- a/library/common/2112.0.0/templates/lib/storage/_ixvolumes.tpl +++ /dev/null @@ -1,11 +0,0 @@ -{{/* -Retrieve host path from ix volumes based on dataset name -*/}} -{{- define "common.storage.retrieveHostPathFromiXVolume" -}} -{{- range $index, $hostPathConfiguration := $.ixVolumes }} -{{- $dsName := base $hostPathConfiguration.hostPath -}} -{{- if eq $.datasetName $dsName -}} -{{- $hostPathConfiguration.hostPath -}} -{{- end -}} -{{- end }} -{{- end -}}