conductor icon indicating copy to clipboard operation
conductor copied to clipboard

Kubernetes - Server properties through configmap

Open jkaipa opened this issue 8 years ago • 3 comments

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.

jkaipa avatar Oct 03 '18 18:10 jkaipa

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

c-n-d avatar Oct 11 '18 01:10 c-n-d

Hi,

I did get this working for my deployment, here's the gist of it:

  1. Create a configMap with your properties file:

    $ kubectl create configmap conductor-properties --from-file=config/config.properties
    
  2. Add a volume to your deployment's PodSpec:

    volumes:
    - name: config-volume
       configMap:
         name: conductor-properties
         items:
         - key: config.properties
           path: config.properties
    
  3. Mount the volume as part of the container, your properties are mounted to /app/config/config.properties:

    volumeMounts:
    - name: config-volume
      mountPath: /app/config
    
  4. Set the CONFIG_PROP environment variable for your container:

    env:
    - name: CONFIG_PROP
      value: "config.properties"
    

c-n-d avatar Oct 11 '18 02:10 c-n-d

I exactly did that and worked. Thank you @c-n-d

jkaipa avatar Oct 12 '18 15:10 jkaipa