OpenShift4

What is Openshift?

It is a platform as a service

oc explain

oc explain pod.spec.container.env

How to create pod

oc create -f pod.yaml

oc get pods

OC rsh

The oc rsh command in OpenShift allows you to “step inside” a running container and interact with it as if you were using a regular command prompt. It’s like opening a door to the container and being able to run commands and access files inside it.

  1. You need a tool called oc (OpenShift command-line tool) to use oc rsh. It helps you connect to an OpenShift cluster.
  2. You find the container you want to access within a group of containers called a “pod.”
  3. You use the oc rsh a command followed by the pod’s name to enter the container. It’s like opening the door to the container.
  4. Once inside, you can run commands and navigate the container’s files as if you were using a regular command prompt. You can check logs, run scripts, and do other things that the container allows.
  5. When you’re done, you exit the container by typing exit or pressing Ctrl+D. It’s like closing the door behind you.

Remember, it’s important to be careful when using oc rsh it because you can make changes that affect the container and the application running inside it.

OC delete

The oc delete command in OpenShift is used to delete various resources within an OpenShift cluster. It allows you to remove objects like pods, services, deployments, routes, and more.

oc delete <resource-type> <resource-name>

oc get pods –watch