OpenShift - List deployment environment variables

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 Buy Me A Coffee

Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.





Please enter 64629 in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |