[ad_1]
I have a JSON file mounted by configMap:
apiVersion: v1
data:
config.json: |
{{- toPrettyJson $.Values.serviceConfig | nindent 4 }}
kind: ConfigMap
metadata:
name: service-config
namespace: {{ .Release.Namespace }}
In deployment.yaml, it’s:
spec:
... ...
volumes:
- name: config-vol
configMap:
name: passthru-send-config
containers:
- name: {{ .Chart.Name }}
... ...
volumeMounts:
- mountPath: /src/config
name: config-vol
My application needs to get that JSON file and use it, but how to retreive it by Go code. I searched it on the Internet but found nothing. If it’s not able to retrieve, how can we use it? It’s my first time touching the configMap, and I’m sorry if it’s a dumb question. Thank you in advance!
[ad_2]