OpenShift Simple Pod Running inside an OpenShift Project: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 12: Line 12:


  oc process -f https://raw.githubusercontent.com/NovaOrdis/playground/master/openshift/templates/standalone-pod-template.yaml | oc create -f -
  oc process -f https://raw.githubusercontent.com/NovaOrdis/playground/master/openshift/templates/standalone-pod-template.yaml | oc create -f -
Alternatively it can be created from the following content:
apiVersion: v1
kind: Pod
metadata:
  name: standalone-pod
spec:
  containers:
  - name: oc
    image: docker.io/openshiftdemos/oc
    command: ["/bin/bash", "-c", "sleep 1000000"]
    resources:
      limits:
        memory: 128Mi
then:
oc rsh standalone-pod
When you don't need it anymore:
oc delete standalone-pod

Revision as of 21:59, 8 December 2017

Internal

Overview

This is the procedure to deploy a simple pod that starts executing inside an OpenShift project and permits attaching. This could prove useful while troubleshooting network issues which need running network utilities and tests from "inside the project".

Procedure

Use the following template: https://github.com/NovaOrdis/playground/blob/master/openshift/templates/standalone-pod-template.yaml

oc process -f https://raw.githubusercontent.com/NovaOrdis/playground/master/openshift/templates/standalone-pod-template.yaml | oc create -f -

Alternatively it can be created from the following content:

apiVersion: v1
kind: Pod
metadata:
  name: standalone-pod
spec:
  containers:
  - name: oc
    image: docker.io/openshiftdemos/oc
    command: ["/bin/bash", "-c", "sleep 1000000"]
    resources:
      limits:
        memory: 128Mi

then:

oc rsh standalone-pod

When you don't need it anymore:

oc delete standalone-pod