I have 2 files as follows:
_config-dev.yaml
frontend:
NODE_ENV: dev
REACT_APP_API_URL: 'https://my-dev-apiurl/'
database:
DB_USER: admin-dev
DB_PASSWORD: password-dev
_config-stag.yaml
frontend:
NODE_ENV: stag
REACT_APP_API_URL: 'https://my-stag-api-url/'
database:
DB_USER: admin-stag
DB_PASSWORD: password-stag
myConfigMap.yaml
kind: ConfigMap
apiVersion: v1
metadata:
name: {{ .Release.Name }}-frontend
namespace: {{ .Values.global.namespace }}
data:
# Here I want to insert only frontend data from _config-dev.yaml file if my {{ eq .Values.global.environment "dev" }} like below
NODE_ENV: dev
REACT_APP_API_URL: 'https://my-dev-apiurl/'
# if my {{ eq .Values.global.environment "stag" }} i want to get frontend values from _config-dev.yaml like below
NODE_ENV: stag
REACT_APP_API_URL: 'https://my-stag-api-url/'
Can anyone figure out how to insert the data as per above scenario mentioned in myConfigMap.yaml file as a comment under data:.