common

by joaquinito2051

Helm chartv2.2.1App 2.2.1

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.

Azure-ready Charts with Containers from marketplace.azurecr.io

This Helm Chart has been configured to pull the Container Images from the Azure Marketplace Public Repository. The following command allows you to download and install all the charts from this repository.

$ helm repo add bitnami-azure https://marketplace.azurecr.io/helm/v1/repo

TL;DR

dependencies:
  - name: common
    version: 1.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.

Prerequisites

  • Kubernetes 1.19+
  • Helm 3.2.0+

Parameters

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

Affinities

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

Capabilities

Helper identifierDescriptionExpected Input
common.capabilities.kubeVersionReturn the target Kubernetes version (using client default if .Values.kubeVersion is not set).. Chart context
common.capabilities.cronjob.apiVersionReturn the appropriate apiVersion for cronjob.. 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.policy.apiVersionReturn the appropriate apiVersion for podsecuritypolicy.. Chart context
common.capabilities.networkPolicy.apiVersionReturn the appropriate apiVersion for networkpolicy.. Chart context
common.capabilities.apiService.apiVersionReturn the appropriate apiVersion for APIService.. Chart context
common.capabilities.hpa.apiVersionReturn the appropriate apiVersion for Horizontal Pod Autoscaler. 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 Names (deprecated: use common.images.renderPullSecrets instead)dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global
common.images.renderPullSecretsReturn the proper Docker Image Registry Secret Names (evaluates values as templates)dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "context" $

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
common.ingress.supportsPathTypePrints "true" if the pathType field is supported. Chart context
common.ingress.supportsIngressClassnamePrints "true" if the ingressClassname field is supported. Chart context
common.ingress.certManagerRequestPrints "true" if required cert-manager annotations for TLS signed certificates are set in the Ingress annotationsdict "annotations" .Values.path.to.the.ingress.annotations

Labels

Helper identifierDescriptionExpected Input
common.labels.standardReturn Kubernetes standard labels. Chart context
common.labels.matchLabelsLabels to use on deploy.spec.selector.matchLabels and svc.spec.selector. Chart context

Names

Helper identifierDescriptionExpected Input
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.namespaceAllow the release namespace to be overridden. Chart context
common.names.fullname.namespaceCreate a fully qualified app name adding the installation's namespace. 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.secrets.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.storage.classReturn the proper Storage Classdict "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.getvalue

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 v2.2.1 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