common

by SVTECH-NMAA

Helm chartv1.5.3App 1.4.3Verified publisher

A Library Helm Chart for grouping common logic between bitnami charts. This chart is not deployable by itself.

About this chart

Bitnami Common Library Chart

A Helm Library Chart for grouping common logic between bitnami charts.

TL;DR

dependencies:
  - name: common
    version: 0.x.x
    repository: https://charts.bitnami.com/bitnami
$ helm dependency update
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "common.names.fullname" . }}
data:
  myvalue: "Hello World"

Introduction

This chart provides a common template helpers which can be used to develop new charts using Helm package manager.

Bitnami charts can be used with Kubeapps for deployment and management of Helm Charts in clusters. This Helm chart has been tested on top of Bitnami Kubernetes Production Runtime (BKPR). Deploy BKPR to get automated TLS certificates, logging and monitoring for your applications.

Prerequisites

  • Kubernetes 1.12+
  • Helm 3.1.0

Parameters

The following table lists the helpers available in the library which are scoped in different sections.

Affinities

Helper identifierDescriptionExpected Input
common.affinities.node.softReturn a soft nodeAffinity definitiondict "key" "FOO" "values" (list "BAR" "BAZ")
common.affinities.node.hardReturn a hard nodeAffinity definitiondict "key" "FOO" "values" (list "BAR" "BAZ")
common.affinities.pod.softReturn a soft podAffinity/podAntiAffinity definitiondict "component" "FOO" "context" $
common.affinities.pod.hardReturn a hard podAffinity/podAntiAffinity definitiondict "component" "FOO" "context" $

Capabilities

Helper identifierDescriptionExpected Input
common.capabilities.kubeVersionReturn the target Kubernetes version (using client default if .Values.kubeVersion is not set).. Chart context
common.capabilities.deployment.apiVersionReturn the appropriate apiVersion for deployment.. Chart context
common.capabilities.statefulset.apiVersionReturn the appropriate apiVersion for statefulset.. Chart context
common.capabilities.ingress.apiVersionReturn the appropriate apiVersion for ingress.. Chart context
common.capabilities.rbac.apiVersionReturn the appropriate apiVersion for RBAC resources.. Chart context
common.capabilities.crd.apiVersionReturn the appropriate apiVersion for CRDs.. Chart context
common.capabilities.supportsHelmVersionReturns true if the used Helm version is 3.3+. Chart context

Errors

Helper identifierDescriptionExpected Input
common.errors.upgrade.passwords.emptyIt will ensure required passwords are given when we are upgrading a chart. If validationErrors is not empty it will throw an error and will stop the upgrade action.dict "validationErrors" (list $validationError00 $validationError01) "context" $

Images

Helper identifierDescriptionExpected Input
common.images.imageReturn the proper and full image namedict "imageRoot" .Values.path.to.the.image "global" $, see ImageRoot for the structure.
common.images.pullSecretsReturn the proper Docker Image Registry Secret Namesdict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global

Ingress

Helper identifierDescriptionExpected Input
common.ingress.backendGenerate a proper Ingress backend entry depending on the API versiondict "serviceName" "foo" "servicePort" "bar", see the Ingress deprecation notice for the syntax differences

Labels

Helper identifierDescriptionExpected Input
common.labels.standardReturn Kubernetes standard labels. Chart context
common.labels.matchLabelsReturn the proper Docker Image Registry Secret Names. Chart context

Names

Helper identifierDescriptionExpected Inpput
common.names.nameExpand the name of the chart or use .Values.nameOverride. Chart context
common.names.fullnameCreate a default fully qualified app name.. Chart context
common.names.chartChart name plus version. Chart context

Secrets

Helper identifierDescriptionExpected Input
common.secrets.nameGenerate the name of the secret.dict "existingSecret" .Values.path.to.the.existingSecret "defaultNameSuffix" "mySuffix" "context" $ see ExistingSecret for the structure.
common.secrets.keyGenerate secret key.dict "existingSecret" .Values.path.to.the.existingSecret "key" "keyName" see ExistingSecret for the structure.
common.passwords.manageGenerate secret password or retrieve one if already created.dict "secret" "secret-name" "key" "keyName" "providedValues" (list "path.to.password1" "path.to.password2") "length" 10 "strong" false "chartName" "chartName" "context" $, length, strong and chartNAme fields are optional.
common.secrets.existsReturns whether a previous generated secret already exists.dict "secret" "secret-name" "context" $

Storage

Helper identifierDescriptionExpected Input
common.affinities.node.softReturn a soft nodeAffinity definitiondict "persistence" .Values.path.to.the.persistence "global" $, see Persistence for the structure.

TplValues

Helper identifierDescriptionExpected Input
common.tplvalues.renderRenders a value that contains templatedict "value" .Values.path.to.the.Value "context" $, value is the value should rendered as template, context frequently is the chart context $ or .

Utils

Helper identifierDescriptionExpected Input
common.utils.fieldToEnvVarBuild environment variable name given a field.dict "field" "my-password"
common.utils.secret.getvaluePrint instructions to get a secret value.dict "secret" "secret-name" "field" "secret-value-field" "context" $
common.utils.getValueFromKeyGets a value from .Values object given its key pathdict "key" "path.to.key" "context" $
common.utils.getKeyFromListReturns first .Values key with a defined value or first of the list if all non-defineddict "keys" (list "path.to.key1" "path.to.key2") "context" $

Validations

Helper identifierDescriptionExpected Input
common.validations.values.single.emptyValidate a value must not be empty.dict "valueKey" "path.to.value" "secret" "secret.name" "field" "my-password" "subchart" "subchart" "context" $ secret, field and subchart are optional. In case they are given, the helper will generate a how to get instruction. See ValidateValue
common.validations.values.multiple.emptyValidate a multiple values must not be empty. It returns a shared error for all the values.dict "required" (list $validateValueConf00 $validateValueConf01) "context" $. See ValidateValue
common.validations.values.mariadb.passwordsThis helper will ensure required password for MariaDB are not empty. It returns a shared error for all the values.dict "secret" "mariadb-secret" "subchart" "true" "context" $ subchart field is optional and could be true or false it depends on where you will use mariadb chart and the helper.
common.validations.values.postgresql.passwordsThis helper will ensure required password for PostgreSQL are not empty. It returns a shared error for all the values.dict "secret" "postgresql-secret" "subchart" "true" "context" $ subchart field is optional and could be true or false it depends on where

Deploy common with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has common on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartcommon is pinned at v1.5.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply