Bootstrap FreeKB - OpenShift - List replicaset environment variables
OpenShift - List replicaset environment variables

Updated:   |  OpenShift articles

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.

Replicas is the number of pods that should be created for the deployment.

The oc get deployments command can be used to view the applications that have been deployed in the namespace.

oc get deployments -n project001

 

Something like this should be returned.

NAME            DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
app001          1         1         1            1           205d

 

The oc get replicaset (or oc get rs) command can be used to display the number of replicas for each deployment.

oc get replicaset --namespace project001

 

Something like this should be returned. In this example, the deployment has 1 replica.

NAME                      DESIRED   CURRENT   READY   AGE
app001-5b9879db6d         1         1         1       205d

 

The oc set env --list command can be used to list the environment variables for each replica set.

~]$ oc set env replicaset --list 
FOO: Hello

 

The oc set env command can be used to add or update a replica sets environment variables.

~]# oc set env replicaset/app001-5b9879db6d BAR="World"
replicaset.apps/app001-5b9879db6d updated

 

Now the replica set should have both environment variables listed.

~]$ oc set env replicaset --list 
FOO: Hello
BAR: World

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


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