How can i use templates and parameter files on kubernetes

is there a way to use templates and parameters in kubernetes? (its supported in openshift)


- env:
- name: REDIS_URL
value: ${REDIS_URL}


  • name: REDIS_URL
    displayName: REDIS_URL
    value: actual redis URL

in openshift, i am able to use template parameter file based on the env (dev.env) and deploy using dynamic values.

for ex:

file name - dev.env contains
env: dev
profile: dev
url: dev_url

file name - test.env contains
env: test
profile: test
url: test_url

command during deployment

if (env == dev)
oc process -f deployment.yaml --param-file=dev.env

elif (env == test)
oc process -f deployment.yaml --param-file=test.env


pls let me know, if there is a similar support provided in kubernetes (i am new to kubernetes)
also let me know, if you need more details.

@k8sGuy: if you know the solution, pls reply.

Hello, saravanaprabu
You can use configMaps in the kubernetes.

1 Like

Another option is to use Helm, which is a sort of package manager for K8s. Helm allows you to set up template files and variable files (contained in a “Helm Chart”) for deploying your own resources to a K8s cluster. It takes a bit to learn Helm (I have only started it myself) but once you have it figured out it can be quite powerful.

1 Like