You can mount any ConfigMap into your ECD by using the extraConfigMapMounts
list in the specification. This is useful if you want to customize the APL logging configuration for ECDs as described in Customizing APL Logging for ECDs (3.2).
To mount an arbitrary ConfigMap:
Create a ConfigMap in your Kubernetes cluster.
Example - Creating a ConfigMapapiVersion: v1 kind: ConfigMap metadata: name: my-config-map data: my-file.txt: | Hello world!
Create an ECD with a specification that contains an
extraConfigMapMounts
list.
Example - Creating ECD with extraConfigMapMountsapiVersion: mz.digitalroute.com/v1alpha1 kind: ECDeployment metadata: name: my-ecd spec: jvmArgs: - Xms512m - Xmx512m resources: limits: memory: 640Mi requests: memory: 640Mi extraConfigMapMounts: - configMapName: my-config-map mountPath: /mnt/my-config name: my-config-vol
The file specified in the ConfigMap will be available in /mnt/my-config/my-file.txt
in the created EC pod.
If you want to inspect the ECD Pod specification, you can use the following kubectl
command:
kubectl exec -it <EC Pod> -- ls -la /mnt/my-config
You can now see that an extra Volume is present:
volumes: - configMap: defaultMode: 420 name: my-config-map name: my-config-vol
and that an extra VolumeMount is present:
volumeMounts: - mountPath: /mnt/my-config name: my-config-vol
Add Comment