<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>The Ops Community ⚙️: Mauro Franchini</title>
    <description>The latest articles on The Ops Community ⚙️ by Mauro Franchini (@jhoval).</description>
    <link>https://community.ops.io/jhoval</link>
    <image>
      <url>https://community.ops.io/images/5k17h52J9HSmcRRaqg-BrvJ2z3pZsnqfk6gEKEznZr4/rs:fill:90:90/g:sm/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL3Vz/ZXIvcHJvZmlsZV9p/bWFnZS84NjAvNGJj/MTZlODUtOTViMC00/YWRkLTk4MTItZjhm/N2RjMzZmYTAwLnBu/Zw</url>
      <title>The Ops Community ⚙️: Mauro Franchini</title>
      <link>https://community.ops.io/jhoval</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://community.ops.io/feed/jhoval"/>
    <language>en</language>
    <item>
      <title>Deploy interactive bash Pod within a Kubernetes cluster</title>
      <dc:creator>Mauro Franchini</dc:creator>
      <pubDate>Thu, 16 Jun 2022 15:56:13 +0000</pubDate>
      <link>https://community.ops.io/jhoval/fire-up-an-interactive-bash-pod-within-a-kubernetes-cluster-1pln</link>
      <guid>https://community.ops.io/jhoval/fire-up-an-interactive-bash-pod-within-a-kubernetes-cluster-1pln</guid>
      <description>&lt;p&gt;In those cases where you need a throw-away interactive shell within your cluster:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ kubectl run test-shell --rm -i --tty --image ubuntu -- bash&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You may, of course, use a different image or shell. Some of the arguments explained:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;test-shell:&lt;/strong&gt; This ends up being the name of the Deployment that is created. Your pod name will typically be this plus a unique hash or ID at the end.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;--rm:&lt;/strong&gt; Delete any resources we've created once we detach. When you exit out of your session, this cleans up the Deployment and Pod.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;-i/--tty:&lt;/strong&gt; The combination of these two are what allows us to attach to an interactive session. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;--:&lt;/strong&gt; Delimits the end of the kubectl run options from the positional arg (bash).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;bash:&lt;/strong&gt; Overrides the container's CMD. In this case, we want to launch bash as our container's command.&lt;/p&gt;

&lt;p&gt;Notes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you don't see a command prompt, try pressing enter. &lt;/li&gt;
&lt;li&gt;You'll need to update your apt cache before you can install packages:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;$ apt update&lt;/code&gt;&lt;br&gt;
&lt;code&gt;$ apt install telnet&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once you are done with your troubleshooting:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ exit&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Post-exit, the Deployment and Pod that kubectl created will both be &lt;strong&gt;stopped&lt;/strong&gt; and &lt;strong&gt;deleted&lt;/strong&gt;, taking with it our container and anything we did within it.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>tutorials</category>
      <category>devops</category>
      <category>cloudops</category>
    </item>
  </channel>
</rss>
