<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Emrah Genç (Hepsiburada/Bilgi Teknolojileri) on Medium]]></title>
        <description><![CDATA[Stories by Emrah Genç (Hepsiburada/Bilgi Teknolojileri) on Medium]]></description>
        <link>https://medium.com/@emrah.genc?source=rss-aea6a5e2b855------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*jbNt6mMm-HlUU_qv</url>
            <title>Stories by Emrah Genç (Hepsiburada/Bilgi Teknolojileri) on Medium</title>
            <link>https://medium.com/@emrah.genc?source=rss-aea6a5e2b855------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 16:15:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@emrah.genc/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Powerful Tool for Kubernetes: kubectl-deployments Plug-in]]></title>
            <link>https://medium.com/@emrah.genc/powerful-tool-for-kubernetes-kubectl-deployments-plug-in-54f969ed8adc?source=rss-aea6a5e2b855------2</link>
            <guid isPermaLink="false">https://medium.com/p/54f969ed8adc</guid>
            <dc:creator><![CDATA[Emrah Genç (Hepsiburada/Bilgi Teknolojileri)]]></dc:creator>
            <pubDate>Mon, 16 Dec 2024 06:28:32 GMT</pubDate>
            <atom:updated>2024-12-16T06:28:32.002Z</atom:updated>
            <content:encoded><![CDATA[<p>Kubernetes is a popular container orchestration tool in the modern application development world. However, sometimes managing applications tied to changes in ConfigMap data or restarting them within a Kubernetes cluster requires more flexibility. This is where the <strong>kubectl-deployments</strong> plug-in comes into play.</p><p>In this article, we will briefly explain the concept of kubectl plug-ins and then detail the installation and usage of the <a href="https://github.com/emrahgenc/extended-kubectl">kubectl-deployments</a> plug-in.</p><h3>What is a Kubectl Plug-in?</h3><p>Kubectl plug-ins are tools that allow you to develop custom commands to interact with your Kubernetes cluster. Plug-ins extend the default kubectl commands, offering more customization and productivity.</p><p>A plug-in file is typically named in the format kubectl-&lt;plugin-name&gt; and can be executed using the kubectl &lt;plugin-name&gt; command.</p><h3>What is kubectl-deployments Plug-in?</h3><p><a href="https://github.com/emrahgenc/extended-kubectl">kubectl-deployments</a> is a kubectl plug-in that allows you to list or restart applications (deployments) linked to or using a specific key in a configmap within your Kubernetes cluster.</p><h3>Features:</h3><ol><li>List applications using a specific configmap and key.</li><li>Easily restart these applications.</li><li>Provides simple and advanced command options for ease of use.</li></ol><p>This plug-in is ideal for quickly addressing issues arising from changes in configmap contents.</p><h3>How to Install kubectl-deployments Plug-in</h3><p>Follow these steps to install the plug-in:</p><ol><li><strong>Download the Plug-in File:</strong></li></ol><pre>curl -sLo kubectl-deployments https://raw.githubusercontent.com/emrahgenc/extended-kubectl/master/plugin/kubectl-deployments &amp;&amp; \<br>  chmod +x kubectl-deployments &amp;&amp; mv -i kubectl-deployments /usr/local/bin</pre><p>2.<strong> Verify Installation:<br> </strong>Ensure the plug-in is installed:</p><pre>kubectl deployments version</pre><h3>Setting Up a Test Environment</h3><p>Before diving into the usage of the <strong>kubectl-deployments</strong> plug-in, let’s set up a simple test environment to understand its capabilities. This setup will include a sample ConfigMap and a Deployment that references this ConfigMap.</p><h3>Example ConfigMap</h3><p>The ConfigMap below stores a configuration value under the key sample-config-key.</p><pre>apiVersion: v1<br>kind: ConfigMap<br>metadata:<br>  name: sample-config<br>  namespace: custom-namespace<br>data:<br>  sample-config-key: &quot;example-value&quot;</pre><h3>Example Deployment</h3><p>The Deployment uses the sample-config-key from the ConfigMap as an environment variable. This setup will help us observe how the plug-in interacts with applications tied to ConfigMap keys.</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: example-deployment<br>  namespace: custom-namespace<br>spec:<br>  replicas: 1<br>  selector:<br>    matchLabels:<br>      app: example-app<br>  template:<br>    metadata:<br>      labels:<br>        app: example-app<br>    spec:<br>      containers:<br>      - name: example-container<br>        image: nginx:latest<br>        env:<br>        - name: CONFIG_VALUE<br>          valueFrom:<br>            configMapKeyRef:<br>              name: sample-config<br>              key: sample-config-key</pre><h3>Deploying to the Cluster</h3><p>Apply the ConfigMap and Deployment to your cluster:</p><pre>kubectl apply -f configmap.yaml<br>kubectl apply -f deployment.yaml</pre><p>Verify that the Deployment is running:</p><pre>kubectl get deployments -n custom-namespace</pre><p>Once this test environment is set up, you can proceed to use the <strong>kubectl-deployments</strong> plug-in to list and restart applications based on ConfigMap changes.</p><h3>How to Use kubectl-deployments Plug-in</h3><p>The plug-in offers two main functions: get and restart. These commands enable you to list or restart applications linked to a specific key in a configmap.</p><h4>Help Commands</h4><p>To view all available options:</p><pre>kubectl deployments --help</pre><p>Or</p><pre>kubectl deployments --h</pre><h3>1. Listing Applications (Get)</h3><p>To list applications using a configmap and key:<br><strong>Simple Usage:</strong></p><pre>kubectl deployments get sample-config sample-config-key</pre><p><strong>Specifying a Namespace:</strong></p><pre>kubectl deployments get sample-config sample-config-key -n custom-namespace</pre><p><strong>Advanced Usage:</strong></p><pre>kubectl deployments get \<br>  --configmap sample-config \<br>  --key sample-key \<br>  --namespace custom-namespace</pre><p><strong><em>Note</em></strong><em>: If no key is specified, only applications that use the configmap will be listed.</em></p><h3>2. Restarting Applications (Restart)</h3><p>To restart applications linked to a configmap and key:</p><p><strong>Simple Usage:</strong></p><pre>kubectl deployments restart sample-config sample-config-key</pre><p><strong>Specifying a Namespace:</strong></p><pre>kubectl deployments restart sample-config sample-config-key -n custom-namespace</pre><p><strong>Advanced Usage:</strong></p><pre>kubectl deployments restart \<br>  --configmap sample-config \<br>  --key sample-key \<br>  --namespace custom-namespace</pre><p><strong><em>Note</em></strong><em>: If no key is specified, only applications that use the configmap will be restarted.</em></p><h3>Conclusion</h3><p><a href="https://github.com/emrahgenc/extended-kubectl">kubectl-deployments</a> plug-in makes it easier to manage your applications in a Kubernetes cluster and quickly restart those affected by configmap changes.</p><p>For more information and contributions, visit the <a href="https://github.com/emrahgenc/extended-kubectl">GitHub repository</a>. Wishing you a more efficient working experience in your Kubernetes environment!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54f969ed8adc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>