configmap

by stakater

Helm chartv1.0.5Verified publisher

ConfigMap chart that runs on kubernetes

About this chart

configmaps

This chart is used to apply configmaps. You can specify any number of configmaps. This chart can come in handy when a public chart does not offer additional configmaps. You have to use the following format to specify a configmap:

- name: configmap-name
  labels:
    app: app-name
  annotations: {}
  data:

Installing

For installing the chart, run the following commands:

helm repo add stable https://kubernetes-charts.storage.googleapis.com/

helm repo update

helm install stable/configmaps -f values.yaml --namespace <namespace-name>

Usage

The following quickstart let's you set up configmaps chart:

  1. Update the values.yaml and set the following properties
KeyDescriptionExampleDefault Value
namename of the configmapconfigmapnameconfigmapname
datadata contains the configmap dataclientid: testid``
annotationsannotations for configmapconfigmap.reloader.stakater.com/reload: "foo-configmap"{}
labelslabel for configmapapp: app-nameapp: app-name

Example

Configmaps chart is used to create configmaps for other charts which does not support creation of additional configmaps. For example, we need additional configmap for keycloak chart which would contain our realm configurations but there is no support for creation of additional configmap. Below are the steps, that explains how to achieve this using configmaps chart.

  • Update the values.yaml file to create a configmap.
ConfigMaps:
- name: keycloak-configmap
  labels:
    app: "keycloak"
  annotations: {}
  data:
    realm.json: |-
      { your realm data }
  • Deploy the configmaps chart. This will create a configmap with name keycloak-configmap containing our keycloak realm configurations.
  • Now, to mount this configmap in keycloak, update the values.yaml of keycloak and update extraVolumes and extraVolumeMounts
extraVolumes: |
  - name: keycloak-config
    configMap:
      name: keycloak-configmap
extraVolumeMounts: |
  - name: keycloak-config
    mountPath: /opt/jboss/keycloak/standalone/configuration/import/realm.json
    subPath: realm.json
  • Deploy the keycloak chart and we can see the additional configmap keycloak-configmap mounted on path /opt/jboss/keycloak/standalone/configuration/import/realm.json

Deploy configmap with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has configmap 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 chartconfigmap is pinned at v1.0.5 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