common

by tina.junold

Helm chartv1.1.0App 1.0.1Apache-2.0Verified publisher

Library chart with the naming, labelling, image and templating helpers shared by the ideaplexus charts. A dependency-free replacement for the subset of bitnami/common they use.

About this chart

common

Library chart with the naming, labelling, image and templating helpers shared by the ideaplexus charts. A dependency-free replacement for the subset of bitnami/common they use.

Source Code

Usage

A library chart installs nothing on its own. Add it as a dependency:

dependencies:
  - name: common
    version: 1.x.x
    repository: https://charts.ideaplexus.com

Then run helm dependency update and call the helpers with include:

metadata:
  name: {{ include "common.names.fullname" . }}
  labels: {{- include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" $) | nindent 4 }}

Global values

The helpers read the values of the chart that includes them. Helm validates this chart's values.schema.json against the copy of global it hands the library, so a wrongly typed global value fails the install of every chart that depends on it:

ValueTypeRead by
global.imageRegistrystringimages.image
global.imagePullSecretslist of names or {name: ...} mapsimages.renderPullSecrets
global.storageClassstringstorage.class
global.defaultStorageClassstringstorage.class
global.compatibility.openshift.adaptSecurityContextauto, force or disabledcompatibility.renderSecurityContext
global.compatibility.omitEmptySeLinuxOptionsbooleancompatibility.renderSecurityContext

Other keys under global are left to the including chart.

Helpers

Every helper is prefixed with common., like in bitnami/common. Helm template names are global, so a chart cannot use this library and bitnami/common side by side — including through a Bitnami subchart, which brings its own copy. Whichever is loaded last silently wins.

HelperArgumentsRenders
names.name.chart name or nameOverride
names.fullname.<release>-<name>, fullnameOverride, or the release name alone if it contains the chart name
names.namespace.release namespace or namespaceOverride
names.chart.<chart>-<version> for the helm.sh/chart label
labels.standardcustomLabels, contextthe app.kubernetes.io/* and helm.sh/chart labels, merged with custom labels
labels.matchLabelscustomLabels, contextthe selector labels, app.kubernetes.io/name and app.kubernetes.io/instance
labels.valuea stringthe string sanitized for use as a label value
tplvalues.rendervalue, context, scopea value with templates rendered, optionally inside a scope
tplvalues.mergevalues, context, scopeseveral rendered values merged, the first wins
images.imageimageRoot, global, chartregistry/repository:tag or @digest, the tag defaults to appVersion
images.renderPullSecretsimages, contextan imagePullSecrets block from global.imagePullSecrets and each image's pullSecrets
affinities.podstype, customLabels, component, extraMatchLabels, topologyKey, extraNamespaces, extraPodAffinityTerms, contexta soft or hard pod (anti-)affinity
affinities.nodestype, key, valuesa soft or hard node affinity
compatibility.renderSecurityContextsecContext, contexta securityContext without enabled, adapted for OpenShift when global.compatibility.openshift.adaptSecurityContext asks for it
resources.presettyperequests and limits for nano, micro, small, medium, large, xlarge or 2xlarge
ingress.backendserviceName, servicePortan Ingress backend, by port name or number
ingress.certManagerRequestannotationstrue when the annotations request a cert-manager certificate
secrets.lookupsecret, key, defaultValue, contextthe base64 value of a deployed Secret's key, otherwise the default encoded
secrets.passwords.managesecret, key, providedValues, length, strong, honorProvidedValues, failOnNew, skipB64enc, skipQuote, contexta password that survives upgrades: deployed, provided or generated
storage.classpersistence, globala storageClassName line, "-" for an empty one
utils.getValueFromKeykey, contextthe value at a dotted path into .Values

The templates carry a usage example above each definition.

Migrating from bitnami/common

The helpers above keep the names, arguments and output of their bitnami/common 2.41.0 counterparts, so switching only means changing the dependency's repository. The differences:

  • The capabilities.*.apiVersion helpers are gone. Write the API version directly: apps/v1, batch/v1, networking.k8s.io/v1, policy/v1, autoscaling/v2.
  • secrets.passwords.manage fails on upgrade with its own message instead of calling the Bitnami validation helpers.
  • utils.getValueFromKey renders nothing for a missing path instead of failing.
  • The affinity helpers render templates in extraNamespaces against the chart context. With bitnami/common they failed.

License

Apache-2.0. The helpers are derived from bitnami/common, Copyright Broadcom, Inc.; see NOTICE in the chart.


Autogenerated from chart metadata using helm-docs v1.14.2

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.1.0 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