OpenShift Simple Pod Running inside an OpenShift Project

From NovaOrdis Knowledge Base
Jump to navigation Jump to search



This is the procedure to deploy a simple pod that starts executing inside an OpenShift project and permits arbitrary process execution inside it. This could prove useful while troubleshooting network issues which need running network utilities and tests from "inside the project". The pod will initialize a container based on a generic image, available in the Docker Hub. The pod will be started as soon as it is declared. Since there is no replication controller, the pod will be terminated and it will disappear when it is deleted.


The pod can be created from the following template:

apiVersion: v1
kind: Pod
  name: centos-loop
  - name: centos-loop
        memory: 128Mi

The command from the container specification is optional, if missing, the image's command will be executed.

Alternatively, a similar pod that contains oc can be created from

oc process -f | oc create -f -

To open a shell inside the container:

oc rsh centos-loop

To execute the probe remotely:

oc exec centos-loop /opt/probe

When you don't need it anymore:

oc delete centos-loop