common
by tina.junold
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:
| Value | Type | Read by |
|---|---|---|
global.imageRegistry | string | images.image |
global.imagePullSecrets | list of names or {name: ...} maps | images.renderPullSecrets |
global.storageClass | string | storage.class |
global.defaultStorageClass | string | storage.class |
global.compatibility.openshift.adaptSecurityContext | auto, force or disabled | compatibility.renderSecurityContext |
global.compatibility.omitEmptySeLinuxOptions | boolean | compatibility.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.
| Helper | Arguments | Renders |
|---|---|---|
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.standard | customLabels, context | the app.kubernetes.io/* and helm.sh/chart labels, merged with custom labels |
labels.matchLabels | customLabels, context | the selector labels, app.kubernetes.io/name and app.kubernetes.io/instance |
labels.value | a string | the string sanitized for use as a label value |
tplvalues.render | value, context, scope | a value with templates rendered, optionally inside a scope |
tplvalues.merge | values, context, scope | several rendered values merged, the first wins |
images.image | imageRoot, global, chart | registry/repository:tag or @digest, the tag defaults to appVersion |
images.renderPullSecrets | images, context | an imagePullSecrets block from global.imagePullSecrets and each image's pullSecrets |
affinities.pods | type, customLabels, component, extraMatchLabels, topologyKey, extraNamespaces, extraPodAffinityTerms, context | a soft or hard pod (anti-)affinity |
affinities.nodes | type, key, values | a soft or hard node affinity |
compatibility.renderSecurityContext | secContext, context | a securityContext without enabled, adapted for OpenShift when global.compatibility.openshift.adaptSecurityContext asks for it |
resources.preset | type | requests and limits for nano, micro, small, medium, large, xlarge or 2xlarge |
ingress.backend | serviceName, servicePort | an Ingress backend, by port name or number |
ingress.certManagerRequest | annotations | true when the annotations request a cert-manager certificate |
secrets.lookup | secret, key, defaultValue, context | the base64 value of a deployed Secret's key, otherwise the default encoded |
secrets.passwords.manage | secret, key, providedValues, length, strong, honorProvidedValues, failOnNew, skipB64enc, skipQuote, context | a password that survives upgrades: deployed, provided or generated |
storage.class | persistence, global | a storageClassName line, "-" for an empty one |
utils.getValueFromKey | key, context | the 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.*.apiVersionhelpers are gone. Write the API version directly:apps/v1,batch/v1,networking.k8s.io/v1,policy/v1,autoscaling/v2. secrets.passwords.managefails on upgrade with its own message instead of calling the Bitnami validation helpers.utils.getValueFromKeyrenders nothing for a missing path instead of failing.- The affinity helpers render templates in
extraNamespacesagainst 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartcommon is pinned at v1.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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