A DeploymentConfig in OpenShift is a REST object that defines the template for a pod and manages deploying new images or configuration changes. It can be POSTed to the API server to create a new instance. A single deployment configuration is usually analogous to a single micro-service.

A DeploymentConfig (DC) in OpenShift is more or less equivalent to a Kubernetes Deployment. The main difference is that there are a few things you can do with a DeploymentConfig (around triggers) that you can’t do with a Deployment.

After a deployment to an OpenShift namespace, many pod environment variables are reset to their default values. If you need to temporarily change an environment variable (for example, change LOG_LEVEL=INFO to LOG_LEVEL=DEBUG), you can change the DeploymentConfig through the OpenShift web interface or with a command like this:

oc edit dc/ste4site-service-test

This will open up your default editor with the current DeploymentConfig. Make your changes, save the file, and close the editor. The DeploymentConfig will update and the pod will redeploy.

For changes that you need to make regularly such as changing environment variables in the DepoymentConfig, you can do it programmatically. For example, this command sets the LOG_LEVEL environment variable to DEBUG, which will create a new pod with the new configuration:

oc set env dc/ste4site-service-test LOG_LEVEL=DEBUG

https://www.mankier.com/1/kubectl-set-env

You can also multiple variables in one command by appending them with a space, like this:

oc set env dc/ste4site-service-test LOG_LEVEL=DEBUG API_USERNAME=apiuser API_PASSWORD=pwd123 API_HOST=10.0.1.112

As I work with pods throughout the day, I keep the most common changes I need to make in my notes so they can be easily pasted into a terminal. This helps me maintain my focus and speeds up my work.