I have a ConfigMap for a nginx ingress controller. Are there any commands I can use that can generate a helm install script for the ConfigMap?
Clarification: I was wondering if there is some way to generate from a ConfigMap a helm install script, an install ingress shell script. There may not be such a thing. Just asking. It would be a nice feature.
It is not possible to directly generate a Helm install script from a ConfigMap. But you can create a Helm chart that uses the ConfigMap. ConfigMaps allow you to decouple configuration artifacts from image content to keep containerized applications portable.
Create test-chart
Create templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: my-config
labels:
app: {{ template "app.prefix" . }}
data:
application.conf: |-
{{ .Files.Get "config/application.config" | nindent 4 }}
and provide your own values.yaml
The Helm is looking for the "config" under the "templates" folder.
Try moving the config folder under templates:
/chart
/templates
my-config-map.yaml
/config
application.config
or change (.Files.Glob "config/") to (.Files.Glob "../config/")
Finally Install chart / use --dry-run Go to main directory ~/test-chart
, where you have files like below charts Chart.yaml configmap templates values.yaml
Now you can helm install
chart or use --dry-run
option before, to check how configuration YAMLs would look like. You have to display what YAML gets executed by Helm using the: --dry-run --debug options at the end of helm install command. there is controller executed with the: --configmap={namespace-where-the-nginx-ingress-is-deployed}/{name-of-the-helm-chart}-nginx-ingress-controller
. In order to load your ConfigMap you need to override it with your own (check out the namespace).