{"id":15967,"date":"2023-05-18T11:54:17","date_gmt":"2023-05-18T11:54:17","guid":{"rendered":"http:\/\/shivaprogramming.com\/blog\/?p=15967"},"modified":"2023-10-20T22:36:32","modified_gmt":"2023-10-20T22:36:32","slug":"openshift-4","status":"publish","type":"post","link":"http:\/\/shivaprogramming.com\/blog\/openshift-4\/","title":{"rendered":"OpenShift4"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">What is Openshift?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is a platform as a service <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">oc explain <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> oc explain pod.spec.container.env<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">How to create pod<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">oc create -f  pod.yaml<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">oc get pods<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>OC rsh<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>oc rsh<\/code> command in OpenShift allows you to &#8220;step inside&#8221; a running container and interact with it as if you were using a regular command prompt. It&#8217;s like opening a door to the container and being able to run commands and access files inside it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>You need a tool called <code>oc<\/code> (OpenShift command-line tool) to use <code>oc rsh<\/code>. It helps you connect to an OpenShift cluster.<\/li>\n\n\n\n<li>You find the container you want to access within a group of containers called a &#8220;pod.&#8221;<\/li>\n\n\n\n<li>You use the <code>oc rsh<\/code> a command followed by the pod&#8217;s name to enter the container. It&#8217;s like opening the door to the container.<\/li>\n\n\n\n<li>Once inside, you can run commands and navigate the container&#8217;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.<\/li>\n\n\n\n<li>When you&#8217;re done, you exit the container by typing <code>exit<\/code> or pressing <code>Ctrl+D<\/code>. It&#8217;s like closing the door behind you.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Remember, it&#8217;s important to be careful when using <code>oc rsh<\/code> it because you can make changes that affect the container and the application running inside it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">OC delete<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>oc delete<\/code> 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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">oc delete &lt;resource-type&gt; &lt;resource-name&gt;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">oc get pods &#8211;watch<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[56],"class_list":["post-15967","post","type-post","status-publish","format-standard","hentry","category-puppet-configuration-management-tool","tag-openshift"],"_links":{"self":[{"href":"http:\/\/shivaprogramming.com\/blog\/wp-json\/wp\/v2\/posts\/15967","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/shivaprogramming.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/shivaprogramming.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/shivaprogramming.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/shivaprogramming.com\/blog\/wp-json\/wp\/v2\/comments?post=15967"}],"version-history":[{"count":9,"href":"http:\/\/shivaprogramming.com\/blog\/wp-json\/wp\/v2\/posts\/15967\/revisions"}],"predecessor-version":[{"id":15993,"href":"http:\/\/shivaprogramming.com\/blog\/wp-json\/wp\/v2\/posts\/15967\/revisions\/15993"}],"wp:attachment":[{"href":"http:\/\/shivaprogramming.com\/blog\/wp-json\/wp\/v2\/media?parent=15967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/shivaprogramming.com\/blog\/wp-json\/wp\/v2\/categories?post=15967"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/shivaprogramming.com\/blog\/wp-json\/wp\/v2\/tags?post=15967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}