-
Story
-
Resolution: Unresolved
-
Undefined
-
None
-
None
-
None
As a user, I want to be able to consume information from a ConfigMap within my templates.
Example:
Similar to what the policygenerator offers, it would be great to get information from ConfigMaps when rendering the templates.
Sometimes we may want to copy the entire configmap, other times we may want to reference specific data from the configmap.
Some examples of how this could work:
Let's say I have this template:
etcd:
managed:
storage:
persistentVolume:
size: 8Gi
storageClassName: lvms-local
restoreSnapshotURL: null
type: PersistentVolume
Since there is information I could have as parameters (like PV Size or StorageClassName) but SiteConfig doesn't have these fields, I could configure them in a configmap like this:
apiVersion: v1
kind: ConfigMap
metadata:
name: myparams
namespace: myns
data:
etcd: |-
managed:
storage:
persistentVolume:
size: 8Gi
storageClassName: lvms-local
restoreSnapshotURL: null
type: PersistentVolume
And consume them like this:
etcd: {{ .CopyFromConfigMap.myns.myparams.etcd }}
Or maybe I want to have my configmap like this:
apiVersion: v1 kind: ConfigMap metadata: name: myparams namespace: myns data: etcd-storageclass: lvms-local etcd-pv-size: 8Gi
And consume them like this:
etcd:
managed:
storage:
persistentVolume:
size: {{ .CopyFromConfigMap.myns.myparams.etcd-pv-size }}
storageClassName: {{ .CopyFromConfigMap.myns.myparams.etcd-storageclass }}
restoreSnapshotURL: null
type: PersistentVolume