2

I am trying to understand whats is the difference between BuildConfig and DeploymentConfig?

I need to set some environment vairiables (DB details) to the container and the values should be picked from ConfigMap. So, where should this piece go?

 envFrom:
 - configMapRef:
  name: assetextraction

I suppose it should be in DeploymentConfig, let me know if otherwise and please direct me with sample example that uses Configmap to setup environment variables in DC. Also mention whats the relevant terms in Kubernetes for BC and DC?

jack
  • 803
  • 3
  • 15
  • 26

1 Answers1

2

First off BuildConfig and DeploymentConfig are OpenShift-specific resource types. DeploymentConfigs were created before Kubernetes Deployments but are similar concept. You would most likely set envVars in the DeploymentConfig. From my example, I have:

template:
  spec:
    containers:
      - envFrom:
          - configMapRef:
              name: steve-test1

From the command line you can use oc set env command and it will make the changes to an existing deployment for you.

oc set env dc/your-app-name --from configmap/your-config-map-name

You can find further information on usage in the chapter 'Configuration and Secrets' of the free eBook Deploying to OpenShift.

Graham Dumpleton
  • 57,726
  • 6
  • 119
  • 134
SteveS
  • 407
  • 2
  • 11