configmap
by stakater
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:
- Update the
values.yamland set the following properties
| Key | Description | Example | Default Value |
|---|---|---|---|
| name | name of the configmap | configmapname | configmapname |
| data | data contains the configmap data | clientid: testid | `` |
| annotations | annotations for configmap | configmap.reloader.stakater.com/reload: "foo-configmap" | {} |
| labels | label for configmap | app: app-name | app: 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.yamlfile 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-configmapcontaining our keycloak realm configurations. - Now, to mount this configmap in keycloak, update the values.yaml of keycloak and update
extraVolumesandextraVolumeMounts
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-configmapmounted 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartconfigmap is pinned at v1.0.5 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