<?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 Mani on Medium]]></title>
        <description><![CDATA[Stories by Mani on Medium]]></description>
        <link>https://medium.com/@moneymanav9211?source=rss-967577596bbf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Mani on Medium</title>
            <link>https://medium.com/@moneymanav9211?source=rss-967577596bbf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 06:40:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@moneymanav9211/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[UnexpectedAdmissionError in Kubernetes: What It Means and What to Do”]]></title>
            <link>https://medium.com/@moneymanav9211/unexpectedadmissionerror-in-kubernetes-what-it-means-and-what-to-do-38d322697bf9?source=rss-967577596bbf------2</link>
            <guid isPermaLink="false">https://medium.com/p/38d322697bf9</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[go]]></category>
            <category><![CDATA[kubernetes-cluster]]></category>
            <category><![CDATA[containers]]></category>
            <dc:creator><![CDATA[Mani]]></dc:creator>
            <pubDate>Sat, 12 Apr 2025 12:23:02 GMT</pubDate>
            <atom:updated>2025-04-12T12:53:13.300Z</atom:updated>
            <content:encoded><![CDATA[<p>​In Kubernetes environments, managing pod states is crucial for maintaining cluster health and performance. A notable issue has been observed where pods enter an UnexpectedAdmissionError state and are not automatically reclaimed by Kubernetes, leading to residual failed pods within the cluster.</p><p><strong>Understanding the </strong><strong>UnexpectedAdmissionError State</strong></p><p>The UnexpectedAdmissionError state occurs when a pod fails during the admission process, often due to system abnormalities or misconfigurations. In such cases, the pod is not admitted to the node, resulting in its status being marked as UnexpectedAdmissionError. This situation can arise after events like abnormal system restarts or when the kubelet rejects the pod due to specific constraints or errors.</p><p><strong>Challenges in Automatic Reclamation</strong></p><p>One of the primary concerns with pods in the UnexpectedAdmissionError state is that they are not automatically deleted or reclaimed by Kubernetes. This behavior leads to the accumulation of failed pods, which can clutter the cluster and potentially impact its performance and resource utilization. The lack of automatic cleanup means that these pods remain in the cluster until they are manually addressed.​</p><p><strong>Manual Cleanup as a Workaround</strong></p><p>In the absence of automatic reclamation, a common workaround is to manually delete the failed pods. This can be achieved using the kubectl delete command with appropriate field selectors to target pods in the Failed state. For example:​</p><p>kubectl delete pods — field-selector status.phase=Failed -n &lt;namespace&gt;</p><p>This command deletes all pods in the Failed state within the specified namespace, effectively removing those that encountered unexpected admission errors.</p><p><strong>Recommendations for Cluster Administrators</strong></p><p>To mitigate the impact of pods remaining in the UnexpectedAdmissionError state, cluster administrators should consider the following approaches:</p><ol><li><strong>Monitoring and Alerts</strong>: Implement monitoring solutions to detect pods that enter the UnexpectedAdmissionError state promptly. Setting up alerts can help administrators take timely action to address such pods.</li><li><strong>Automation of Cleanup</strong>: Develop scripts or use Kubernetes operators to automate the detection and deletion of pods in the Failed state. This reduces the manual effort required and ensures that residual failed pods do not accumulate.</li><li><strong>Investigate Root Causes</strong>: Regularly investigate the underlying causes leading to pods entering the UnexpectedAdmissionError state. Addressing these root causes can reduce the frequency of such occurrences and improve overall cluster stability.​</li></ol><p>By proactively managing pods in the UnexpectedAdmissionError state and implementing strategies for their timely removal, administrators can maintain a cleaner and more efficient Kubernetes cluster environment.</p><p>If you liked the article please give a clap and also provide the feedback.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38d322697bf9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Signals: Synchronous vs. Asynchronous]]></title>
            <link>https://medium.com/@moneymanav9211/linux-signals-synchronous-vs-asynchronous-e52eece62cee?source=rss-967577596bbf------2</link>
            <guid isPermaLink="false">https://medium.com/p/e52eece62cee</guid>
            <category><![CDATA[linux-signals]]></category>
            <category><![CDATA[commands]]></category>
            <category><![CDATA[c-plus-plus-language]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Mani]]></dc:creator>
            <pubDate>Mon, 31 Mar 2025 12:06:36 GMT</pubDate>
            <atom:updated>2025-03-31T12:06:36.581Z</atom:updated>
            <content:encoded><![CDATA[<p>In Linux, <strong>signals</strong> are used for <strong>inter-process communication (IPC)</strong> and <strong>exception handling</strong>. They notify a process that an event has occurred. Signals can be classified into <strong>synchronous</strong> and <strong>asynchronous</strong> signals.</p><h3>Synchronous Signals</h3><p>Synchronous signals happen because of a process’s own actions, usually due to an execution error. These signals are sent to the process that caused them.</p><p><strong>Examples of Synchronous Signals:</strong></p><ul><li><strong>SIGSEGV (Segmentation Fault):</strong> Trying to access invalid memory</li><li><strong>SIGFPE (Floating Point Exception):</strong> Dividing by zero</li><li><strong>SIGILL (Illegal Instruction):</strong> Running an invalid CPU instruction</li><li><strong>SIGBUS (Bus Error):</strong> Accessing memory incorrectly (e.g., misalignment)</li></ul><h3>Asynchronous Signals</h3><p>Asynchronous signals come from outside a process, usually from another process or the operating system. They aren’t triggered by the process itself.</p><p><strong>Examples of Asynchronous Signals:</strong></p><ul><li><strong>SIGINT (Interrupt Signal):</strong> Sent when you press <strong>Ctrl + C</strong></li><li><strong>SIGTERM (Termination Signal):</strong> Requests a process to stop</li><li><strong>SIGHUP (Hangup Signal):</strong> Sent when a terminal closes</li><li><strong>SIGKILL (Kill Signal):</strong> Forcefully stops a process (<strong>kill -9 PID</strong>)</li><li><strong>SIGCHLD (Child Signal):</strong> Sent to a parent process when a child process exits</li></ul><p><strong>Handling of Synchronous and Asynchronous Signals:</strong></p><p>In a multi-threaded process, synchronous and asynchronous signals are handled differently.</p><p>To handle asynchronous signals, you can create a separate thread that continuously waits for signals in a loop. When the kernel delivers a signal, this thread can take the necessary action.</p><p>Synchronous signals, on the other hand, are delivered directly to the thread that caused them. This means you cannot delegate their handling to a separate thread. One option is to register a signal handler in each thread, but this approach is inefficient because any change in the handler would need to be updated in every thread.</p><p>A better approach is to register a global signal handler in the main thread before starting other threads. This way, all threads inherit the handler, allowing you to manage synchronous signals across threads with a single handler. <strong>This method is especially useful for generating a backtrace from your application</strong>.</p><p>Thanks for reading and please drop feedback if you have. Also, If you liked the article, please do not forget to clap.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e52eece62cee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Use a Service Account in an Ephemeral Container]]></title>
            <link>https://medium.com/@moneymanav9211/how-to-use-a-service-account-in-an-ephemeral-container-fb0fb5099f67?source=rss-967577596bbf------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb0fb5099f67</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[ephemeral]]></category>
            <category><![CDATA[kubernetes-operator]]></category>
            <dc:creator><![CDATA[Mani]]></dc:creator>
            <pubDate>Sun, 30 Mar 2025 11:04:30 GMT</pubDate>
            <atom:updated>2025-03-30T11:04:30.731Z</atom:updated>
            <content:encoded><![CDATA[<pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: my-pod<br>  namespace: default<br>spec:<br>  serviceAccountName: my-service-account<br>  containers:<br>    - name: main-container<br>      image: busybox<br>      command: [&quot;sleep&quot;, &quot;3600&quot;]<br>      volumeMounts:<br>      - mountPath: /var/run/secrets/kubernetes.io/serviceaccount<br>        name: kube-api-access-jh7hg<br>        readOnly: true<br>  volumes:<br>  - name: kube-api-access-jh7hg<br>    projected:<br>      defaultMode: 420<br>      sources:<br>      - serviceAccountToken:<br>          expirationSeconds: 3607<br>          path: token<br>      - configMap:<br>          items:<br>          - key: ca.crt<br>            path: ca.crt<br>          name: kube-root-ca.crt<br>      - downwardAPI:<br>          items:<br>          - fieldRef:<br>              apiVersion: v1<br>              fieldPath: metadata.namespace<br>            path: namespace</pre><p>A <strong>Service Account</strong> in Kubernetes is a special type of account that allows <strong>pods</strong> to securely interact with the <strong>Kubernetes API</strong>. In Kubernetes, we can specify the <strong>service account name</strong> inside the <strong>pod manifest</strong>. When a pod starts, Kubernetes automatically <strong>creates a volume</strong> from the service account and <strong>mounts it</strong> inside each container. Once the service account is mounted, the container can use it to communicate with the <strong>Kubernetes API</strong>. However, a container <strong>cannot</strong> interact with the API unless it has a <strong>service account with the correct permissions</strong>.</p><p>When we add an <strong>ephemeral container</strong> to a pod, the <strong>Pod Controller does not mount the service account</strong> inside it. This means the ephemeral container <strong>cannot</strong> access the Kubernetes API by default. If you try to interact with the API from the ephemeral container, you will get an <strong>authentication error</strong> because it does not have the necessary credentials.</p><p>To fix this, we need to <strong>manually mount the service account</strong> inside the ephemeral container. Here’s how:</p><ol><li><strong>Find the Service Account Volume</strong></li></ol><ul><li>Check the <strong>manifest file</strong> of the running pod.</li><li>Identify the <strong>volume name</strong> used for the service account.</li></ul><p><strong>Manually Mount the Volume</strong></p><ul><li>Use the same <strong>service account volume name</strong> and mount it inside the ephemeral container.</li><li>Kubernetes <strong>always</strong> mounts the service account at: /var/run/secrets/kubernetes.io/serviceaccount</li></ul><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: my-pod<br>  namespace: default<br>spec:<br>  serviceAccountName: my-service-account<br>  containers:<br>    - name: main-container<br>      image: busybox<br>      command: [&quot;sleep&quot;, &quot;3600&quot;]<br>      volumeMounts:<br>      - mountPath: /var/run/secrets/kubernetes.io/serviceaccount<br>        name: kube-api-access-jh7hg<br>        readOnly: true<br>  ephemeralContainers:<br>    - name: debug-container<br>      image: busybox<br>      command: [&quot;sh&quot;]<br>      tty: true<br>      volumeMounts:<br>      - mountPath: /var/run/secrets/kubernetes.io/serviceaccount<br>        name: kube-api-access-jh7hg<br>        readOnly: true<br>  volumes:<br>  - name: kube-api-access-jh7hg<br>    projected:<br>      defaultMode: 420<br>      sources:<br>      - serviceAccountToken:<br>          expirationSeconds: 3607<br>          path: token<br>      - configMap:<br>          items:<br>          - key: ca.crt<br>            path: ca.crt<br>          name: kube-root-ca.crt<br>      - downwardAPI:<br>          items:<br>          - fieldRef:<br>              apiVersion: v1<br>              fieldPath: metadata.namespace<br>            path: namespace</pre><p>Above is the final pod manifests.</p><p>In our case, we have a <strong>Kubernetes controller</strong> that deploys applications inside the cluster. Instead of manually mounting the service account every time, we added logic inside our <strong>custom Kubernetes controller</strong> to <strong>automatically</strong> mount the service account for ephemeral containers.</p><p>By doing this, we ensure that ephemeral containers can interact with the <strong>Kubernetes API</strong> securely and without issues.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb0fb5099f67" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Ran a Hidden Container Inside My Pod]]></title>
            <link>https://medium.com/@moneymanav9211/how-i-ran-a-hidden-container-inside-my-pod-b0335d89e3c4?source=rss-967577596bbf------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0335d89e3c4</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[pods]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[ephemeral]]></category>
            <dc:creator><![CDATA[Mani]]></dc:creator>
            <pubDate>Fri, 28 Mar 2025 13:52:17 GMT</pubDate>
            <atom:updated>2025-03-28T13:52:17.207Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>How I Ran a Hidden Container Inside My Pod</strong></p><p>I was working on a requirement to develop an API that triggers DPDK packet capture. Since we use a Kubernetes custom controller and custom resource to manage our application’s lifecycle, our initial idea was to create a custom resource and a controller for it. Whenever a user created this custom resource, the controller would launch an ephemeral container to capture DPDK packets.</p><p>We implemented this approach, but during testing, we noticed an issue — each time we added an ephemeral container, a new manifest entry was added to the pod. Over time, this caused the pod’s manifest file to grow significantly, leading to two major problems:</p><ol><li>It could put extra load on <strong>etcd</strong>.</li></ol><p>2. The output of kubectl describe pod became cluttered and difficult to read.</p><p>We assumed Kubernetes would provide an API to delete the manifest of a finished ephemeral container. However, after researching similar issues, we were surprised to learn that Kubernetes does not currently offer a way to erase these entries.</p><p>This led to an interesting idea: <strong>run a single ephemeral container and keep it running indefinitely</strong>. Instead of adding a new ephemeral container each time the user triggers DPDK packet capture, we reuse the same ephemeral container. This approach allowed us to:</p><ol><li>Run a <strong>hidden</strong> container that wasn’t visible to others.</li></ol><p>2. Prevent the pod’s manifest file from growing uncontrollably.</p><p>That’s how we successfully managed to run a hidden debug container inside our pod.</p><p>If you liked my article. Please do not forget to give feedback and clap.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0335d89e3c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How can we make our lives easy?]]></title>
            <link>https://medium.com/@moneymanav9211/how-can-we-make-our-lives-easy-4cebd3272d42?source=rss-967577596bbf------2</link>
            <guid isPermaLink="false">https://medium.com/p/4cebd3272d42</guid>
            <dc:creator><![CDATA[Mani]]></dc:creator>
            <pubDate>Wed, 17 Jul 2024 09:24:32 GMT</pubDate>
            <atom:updated>2024-07-17T09:24:32.619Z</atom:updated>
            <content:encoded><![CDATA[<p>One day I was talking with a group of people and suddenly one person took my name and said can I ask you a question. I got nervous since I was not comfortable speaking in front of a group, especially when I was the center of the conversation but I was not even wanted to say no because that would make me feel like I am running away from the question. After taking a 30-second pause and analyzing everything I collected all the courage I had and said “Yes you can ask”.</p><p>The question he asked was “How can we make our life easy”. It might sound like an easy question but was not easy for me to answer. In the next few paragraphs, I am going to share my answer.</p><p><strong>My answer</strong></p><p>You have asked a very complex and tricky question in a simple sentence. How can we make our life easier, it is a very general question because the problems faced by us differ from person to person. And our life could be made easier by having better ways to solve those problems without getting overwhelmed with the problems. Since the above question is general and very difficult to answer. I am going to narrow down the question. I am going to answer in my own context. I will be sharing points about how can i make my life easy.</p><p>One of the major problems I face in my life is overthinking and having low self-esteem issues. Even after completing my education from one of the top nits I face issues related to low confidence and I always underestimate my own potential. Due to above mentioned reasons I am not able to utilize my own potential. Even after having a good understanding of things I refrain from doing presentations because of hidden and illogical fears. Since I have mentioned a few of the major problems that I face in my life, coming to solutions and ways by which I can make my life easy. I will be addressing each problem one by one. Talking about how can i overcome overthinking. The reason I do overthinking is because I always have unrealistic expectations of myself and spend most of my time in my head, thinking about why I am not able to achieve them. I should start writing my expectations to have clarity about it and make sure it is not unrealistic. This will help me to have realistic goals. Next, I should start engaging myself with more and more people. Start creating hobbies for myself and this will help me to be in the present moment and not be in my head all the time and thinking negatively about myself.</p><p>To deal with low self-esteem. I should start reminding myself about the achievements that I have achieved till now. Each day in the morning or evening I should write down the goals and tasks that I have completed. By reminding all these things I would be able to make myself aware of my capability. After knowing my strength I would start having more confidence in myself. I hope that will improve my self-esteem. In the end, I would like to mention one more thing I have worked a lot on my communication skills and have tremendous progress, have taken part in multiple debates, and spoken in front of different online and offline groups. But still, sometimes start doubting my communication skills and I hate this.</p><p>A general advice for everyone which helped me quite a lot and made my life easy is that stop comparing yourself with others. Start comparing your current self with what you were yesterday. This is a better metric to track your progress rather than comparing with others. You should know that we all have different question papers in our lives so we can not compare two people. If you are doing so then you are being unfair to yourself.</p><p>Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4cebd3272d42" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>