An image contains the code used to create a deployment. Then, a deployment can be created from an image, which should then create a replica set (which is the number of pods that should be created), and then the pods should be created.
If you are not familiar with the oc command, refer to OpenShift - Getting Started with the oc command.
There are different ways to configure a container with environment variables.
The oc get deployments command can be used to display the deployments in a project.
~]$ oc get deployments
NAME READY UP-TO-DATE AVAILABLE AGE
my-app 1/1 1 1 125d
The oc describe deployment command can be used to display the environment variables being used by the deployment. In this example, there is a single variable name "FOO" that contains a value of "bar".
~]$ oc describe deployment my-app
Pod Template:
Containers:
my-container:
Environment:
FOO: bar
Or the oc get deployments with the --output yaml or --output json option can be used.
~]$ oc get deployment my-app --output yaml
spec:
template:
spec:
containers:
- env:
- name: FOO
value: bar
Or the oc set env replicaset --list command can be used.
~]$ oc set env replicaset --list
FOO: bar
Did you find this article helpful?
If so, consider buying me a coffee over at