How to create config file for helm. Like how we can mention cert and key in helm config file

2/17/2020
apiVersion: v1
kind: configMap
data:
 [service]
  port: 3000
  Environment: "dev"
 [database]
  name:
  host:
  port:
[kube]
  server:
  cert:
  key:
metadata:
  name:
  namespace:

How we can add value when we create this file as helm config file

-- Soumya Singh
kubernetes
kubernetes-helm

1 Answer

2/17/2020

As @Harsh Manvar mentioned in comments

you add values inside values.yaml which store the values and use that values inside helm chart.

There is a link to helm documentation about how to do it.

Specially part with

Values files can contain more structured content, too. For example, we could create a favorite section in our values.yaml file, and then add several keys there:

values.yaml

favorite:
  drink: coffee
  food: pizza

ConfigMap

apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ .Release.Name }}-configmap
data:
  myvalue: "Hello World"
  drink: {{ .Values.favorite.drink }}
  food: {{ .Values.favorite.food }}

Hope this answer your question.

-- jt97
Source: StackOverflow