OpenShift Pod Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 19: Line 19:
=Pod Status=
=Pod Status=


  oc [-n ''<project-name>''] [[oc get#pods|get pods]]
The most complete information set is generated by "oc get -o yaml pod ..." and "oc describe pod ...":
 
  oc [-n ''<project-name>''] [[oc get#pods|get pods]
oc [-n ''<project-name>''] -o yaml [[oc get#pod|get pod]]] ''<pod-name>''
  oc [-n ''<project-name>''] [[Oc_describe#pod|describe]] pod ''<pod-name>''
  oc [-n ''<project-name>''] [[Oc_describe#pod|describe]] pod ''<pod-name>''
  oc [-n ''<project-name>''] [[Oc_describe#pod|describe]] pod/''<pod-name>''
  oc [-n ''<project-name>''] [[Oc_describe#pod|describe]] pod/''<pod-name>''

Revision as of 23:00, 16 October 2017

External

Internal

List Pods for a Project

oc get projects

oc get -n <project-name> pods

List Pods on Nodes

oadm manage-node <node-name> --list-pods

Pod Status

The most complete information set is generated by "oc get -o yaml pod ..." and "oc describe pod ...":

oc [-n <project-name>] [[oc get#pods|get pods]
oc [-n <project-name>] -o yaml get pod] <pod-name>
oc [-n <project-name>] describe pod <pod-name>
oc [-n <project-name>] describe pod/<pod-name>
oc [-n <project-name>] edit pod/<pod-name>

Update a Pod Defintion

Stopping Pods

A pod can be stopped by deleting its associated "pod" object:

oc delete pod/logging-fluentd-3kz30

The controller (either replication or DamonSet) will detect that the pod is missing and it will start a new one.

Scaling Down and Up the Number of Replicas associated with a DeploymentConfig

This procedure can be applied after a configuration change, such as a modification in the ConfigMap.

Identify the name of the deployment config:

oc get dc -o name --selector=....

or

oc get dc

Then set the number of replicas to 0:

oc scale deploymentconfig/<deploymentconfig-name> --replicas=0

After all pods associated with deployment configuration have been stopped, scale it back up again.

oc scale deploymentconfig/<deploymentconfig-name> --replicas=1