Kubernetes - Server properties through configmap
I see that the properties are loaded through environment variable that points to properties file on the file system or through an argument (absolute path) to the server (see com.netflix.conductor.server.Main.java). I am in the process of deploying the conductor on kubernetes and have the properties be configured through configMaps. Need some help on how I can do this.
Hi,
If you are storing the entire properties file in a configMap, you could probably refer to Add ConfigMap data to a specific path in the Volume
This would allow you to mount your custom properties file in the server container with a specific path (i.e. path: config-custom.properties) and set then CONFIG_PROP=config-custom.properties as an environment variable in the container spec
However, I have not implemented this yet
Hi,
I did get this working for my deployment, here's the gist of it:
-
Create a configMap with your properties file:
$ kubectl create configmap conductor-properties --from-file=config/config.properties -
Add a volume to your deployment's PodSpec:
volumes: - name: config-volume configMap: name: conductor-properties items: - key: config.properties path: config.properties -
Mount the volume as part of the container, your properties are mounted to
/app/config/config.properties:volumeMounts: - name: config-volume mountPath: /app/config -
Set the
CONFIG_PROPenvironment variable for your container:env: - name: CONFIG_PROP value: "config.properties"
I exactly did that and worked. Thank you @c-n-d