<?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 ⚙️: Rishabh Jain</title>
    <description>The latest articles on The Ops Community ⚙️ by Rishabh Jain (@cloudy05).</description>
    <link>https://community.ops.io/cloudy05</link>
    <image>
      <url>https://community.ops.io/images/RVOkPLIqQDDOe-NX2x5cUcB-pL08I08SUV2Ysfy6ulA/rs:fill:90:90/g:sm/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL3Vz/ZXIvcHJvZmlsZV9p/bWFnZS8yNDMzLzk5/NDk0YjQyLWFiOTEt/NDliZi1iNzIwLWM1/NWE0YjM3NzFhMy5q/cGc</url>
      <title>The Ops Community ⚙️: Rishabh Jain</title>
      <link>https://community.ops.io/cloudy05</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://community.ops.io/feed/cloudy05"/>
    <language>en</language>
    <item>
      <title>Must-Know Flags for kubectl describe</title>
      <dc:creator>Rishabh Jain</dc:creator>
      <pubDate>Sun, 30 Jul 2023 07:52:52 +0000</pubDate>
      <link>https://community.ops.io/cloudy05/must-know-flags-for-kubectl-describe-2j16</link>
      <guid>https://community.ops.io/cloudy05/must-know-flags-for-kubectl-describe-2j16</guid>
      <description>&lt;p&gt;The kubectl describe command is an invaluable tool for inspecting the detailed configuration and runtime state of Kubernetes objects like pods, deployments, and services. It is very useful for troubleshooting issues in a Kubernetes cluster.&lt;/p&gt;

&lt;p&gt;The describe command works for any Kubernetes object kind such as nodes, namespaces, ingresses, etc. - not just pods. It is commonly combined with grep to extract specific details from the verbose output. Moreover, we can make the describe command even more powerful by passing flags to it in combination with grep.&lt;/p&gt;

&lt;p&gt;1) &lt;strong&gt;-i flag&lt;/strong&gt; → The -i flag enables case-insensitive matching for the regular expression pattern.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl describe &amp;lt;object_type&amp;gt; &amp;lt;obejct_name&amp;gt; | grep -i "keyword_you_are_searching"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl describe pod pod1 | grep -i "image"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://community.ops.io/images/vlC7ZdAHsiruYG_RbJcJ7VmnbU5-bFs1jIC1eIG9Wc0/w:800/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL2Ruam5r/d2Q2cmlzamRpMnp6/aDUyLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/vlC7ZdAHsiruYG_RbJcJ7VmnbU5-bFs1jIC1eIG9Wc0/w:800/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL2Ruam5r/d2Q2cmlzamRpMnp6/aDUyLnBuZw" alt='kubectl describe pod pod1 | grep -i "image"' width="571" height="47"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2) &lt;strong&gt;-A flag&lt;/strong&gt; → The -A flag is used to print lines of trailing context after matching lines.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl describe &amp;lt;object_type&amp;gt; &amp;lt;obejct_name&amp;gt; | grep -i -A &amp;lt;no_of_lines_you_want_to_print&amp;gt; "keyword_you_are_searching"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl describe pod pod1 | grep -i -A 8 "image"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://community.ops.io/images/FjdKrySu_yRD4YUDoNOcgV6zuhdJYlMbkYeh9U_Rsjo/w:800/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL21rbnY0/b3EzbDhvdnJnYW5w/NmdrLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/FjdKrySu_yRD4YUDoNOcgV6zuhdJYlMbkYeh9U_Rsjo/w:800/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL21rbnY0/b3EzbDhvdnJnYW5w/NmdrLnBuZw" alt='kubectl describe pod pod1 | grep -i -A 8 "image"' width="571" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3) &lt;strong&gt;-B flag&lt;/strong&gt; → The -B flag will print lines before the matching lines.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl describe &amp;lt;object_type&amp;gt; &amp;lt;obejct_name&amp;gt; | grep -i -B &amp;lt;no_of_lines_you_want_to_print&amp;gt; "keyword_you_are_searching"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl describe pod pod1 | grep -i -B 8 "image"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://community.ops.io/images/ZsUUp2iRfh5FjEtSrtzHj4_Adj9R5MmjTUjwQJn28_E/w:800/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL2NpdHVp/MGVneGQxd2I0NGRy/eW8zLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/ZsUUp2iRfh5FjEtSrtzHj4_Adj9R5MmjTUjwQJn28_E/w:800/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL2NpdHVp/MGVneGQxd2I0NGRy/eW8zLnBuZw" alt='kubectl describe pod pod1 | grep -i -B 8 "image"' width="571" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>kubernetes</category>
      <category>aws</category>
    </item>
  </channel>
</rss>
