<?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 Mahalingam SRE on Medium]]></title>
        <description><![CDATA[Stories by Mahalingam SRE on Medium]]></description>
        <link>https://medium.com/@lingeshcbz?source=rss-7f0d447b5ae1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*XKU2Srjl1fRBaqxO</url>
            <title>Stories by Mahalingam SRE on Medium</title>
            <link>https://medium.com/@lingeshcbz?source=rss-7f0d447b5ae1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 01:25:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lingeshcbz/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[ Why SSH Doesn’t Just Use Public/Private Keys to Encrypt Everything — and How Diffie-Hellman &…]]></title>
            <link>https://medium.com/@lingeshcbz/why-ssh-doesnt-just-use-public-private-keys-to-encrypt-everything-and-how-diffie-hellman-eb9a2c691950?source=rss-7f0d447b5ae1------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb9a2c691950</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ssh-keys]]></category>
            <category><![CDATA[sre]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Mahalingam SRE]]></dc:creator>
            <pubDate>Thu, 10 Jul 2025 01:24:33 GMT</pubDate>
            <atom:updated>2025-07-10T01:24:33.098Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>🔐 Why SSH Doesn’t Just Use Public/Private Keys to Encrypt Everything — and How Diffie-Hellman &amp; ECDH Work</strong></h3><h3>📝 Table of Contents</h3><ul><li><a href="#-introduction">🤔 Introduction</a></li><li><a href="#-step-1-authenticating-with-asymmetric-keys">🔑 Step 1: Authenticating with Asymmetric Keys</a></li><li><a href="#%EF%B8%8F-step-2-creating-a-shared-secret-with-dhecdh">⚙️ Step 2: Creating a Shared Secret with DH/ECDH</a></li><li><a href="#-ascii-diagram-dh-handshake">🔍 ASCII Diagram: DH Handshake</a></li><li><a href="#-step-3-switching-to-fast-symmetric-encryption">⚡ Step 3: Switching to Fast Symmetric Encryption</a></li><li><a href="#-real-ssh-example-ssh--vvv">📦 Real SSH Example (</a><a href="#-real-ssh-example-ssh--vvv">ssh -vvv)</a></li><li><a href="#-why-this-design">🤯 Why This Design?</a></li><li><a href="#-tldr">🧠 TL;DR</a></li><li><a href="#-common-questions">💡 Common Questions</a></li><li><a href="#-conclusion--next-steps">🚀 Conclusion &amp; Next Steps</a></li></ul><h3>🤔 Introduction</h3><blockquote><em>“If the SSH server has a public/private key pair, why not encrypt everything with it?”<br> “What’s Diffie-Hellman (DH) or ECDH doing here?”<br> “And why do we end up with AES or ChaCha20 in the end?”</em></blockquote><p>These are great questions — and answering them helps you <em>truly</em> understand why SSH is secure, fast, and has forward secrecy.</p><p>Let’s break it down step by step.</p><h3>🔑 Step 1: Authenticating with Asymmetric Keys</h3><p>When you ssh alice@host.example.com:</p><p>✅ The SSH server proves it is who it says it is:</p><ul><li>The server has a <strong>private key</strong> (kept secret)</li><li>And a <strong>public key</strong> you see in known_hosts</li></ul><p>During handshake:</p><ul><li>Server signs data with its private key.</li><li>Client verifies signature with server’s public key.</li></ul><p>This step <strong>prevents man-in-the-middle attacks</strong>:</p><ul><li>Client ensures it really talks to host.example.com, not an impostor.</li></ul><p>If you use your own SSH key, your client also signs data to prove your identity to the server.</p><p><strong>But</strong>: this part <em>only</em> proves identities.<br> It doesn’t yet create a fresh session key for encryption.</p><h3>⚙️ Step 2: Creating a Shared Secret with DH/ECDH</h3><p>Once identities are verified, we need to agree on an encryption key — <strong>without sending it over the network</strong>.</p><p>This is where Diffie-Hellman (DH) or Elliptic Curve Diffie-Hellman (ECDH) comes in.</p><p>They let both sides compute a <strong>shared secret </strong><strong>K</strong>, even though an eavesdropper sees only public data.</p><h3>🔍 ASCII Diagram: DH Handshake</h3><pre>Client                            Server<br>  |                                 |<br>  | -- send A = g^a mod p --------&gt; |<br>  |                                 |<br>  | &lt;-- send B = g^b mod p -------- |<br>  |                                 |<br>Compute:                          Compute:<br>K = B^a mod p                    K = A^b mod p</pre><p><strong>Result:</strong></p><ul><li>Both have the same K</li><li>Neither a nor b was sent across the network</li></ul><p>With ECDH, the process is similar, but uses elliptic curve points instead of g^a mod p.</p><h3>⚡ Step 3: Switching to Fast Symmetric Encryption</h3><p>Now both sides share K.</p><p>They derive:</p><ul><li>Encryption keys</li><li>MAC (integrity) keys</li></ul><p>And start encrypting data with <strong>symmetric ciphers</strong>:</p><ul><li>AES (aes128-ctr, aes256-gcm)</li><li>ChaCha20 (chacha20-poly1305@openssh.com)</li></ul><p>✅ Symmetric crypto is fast<br> ✅ Each session has a fresh key → <strong>forward secrecy</strong><br> ✅ If someone later steals the server’s private key, past sessions stay safe</p><h3>📦 Real SSH Example (ssh -vvv)</h3><p>Run:</p><pre>ssh -vvv user@host</pre><p>You’ll see:</p><pre>debug1: kex: algorithm: curve25519-sha256<br>debug1: kex: host key algorithm: ecdsa-sha2-nistp256<br>debug1: kex: server-&gt;client cipher: chacha20-poly1305@openssh.com MAC: &lt;implicit&gt;</pre><p>Breakdown:</p><ul><li>Authenticate server → ecdsa-sha2-nistp256</li><li>Key exchange → curve25519-sha256 (ECDH)</li><li>Encrypt session → chacha20-poly1305</li></ul><h3>🤯 Why This Design?</h3><ul><li><strong>Asymmetric crypto (RSA, ECDSA):</strong> Prove identity → slow → not used to encrypt data</li><li><strong>DH / ECDH:</strong> Create fresh session key → forward secrecy</li><li><strong>Symmetric crypto (AES, ChaCha20):</strong> Fast encryption for large data streams</li></ul><p>This combo is secure <em>and</em> fast.</p><h3>🧠 TL;DR</h3><p>✅ SSH server’s public/private key proves identity<br> ✅ DH/ECDH key exchange builds fresh shared secret<br> ✅ Session uses symmetric cipher → fast &amp; secure<br> ✅ Past sessions stay safe even if server keys are leaked later</p><h3>💡 Common Questions</h3><p><strong>Q:</strong> Why not just encrypt the data with server’s public key?<br> <strong>A:</strong> Slow &amp; no forward secrecy. DH/ECDH fixes that.</p><p><strong>Q:</strong> What is curve25519?<br> <strong>A:</strong> Modern fast elliptic curve used in ECDH.</p><p><strong>Q:</strong> Does SSH rekey?<br> <strong>A:</strong> Yes, for very long sessions, it renegotiates new keys.</p><h3>🚀 Conclusion &amp; Next Steps</h3><p>Next time you SSH into a server:</p><ul><li>You’re using asymmetric crypto to authenticate</li><li>DH/ECDH to securely agree on a symmetric key</li><li>Fast ciphers like AES or ChaCha20 to encrypt the session</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb9a2c691950" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Understanding Static Pods in Kubernetes — and How the Control Plane Boots Itself]]></title>
            <link>https://medium.com/@lingeshcbz/understanding-static-pods-in-kubernetes-and-how-the-control-plane-boots-itself-852e1532d6d7?source=rss-7f0d447b5ae1------2</link>
            <guid isPermaLink="false">https://medium.com/p/852e1532d6d7</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubernetes-cluster]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[sre]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Mahalingam SRE]]></dc:creator>
            <pubDate>Sat, 05 Jul 2025 12:10:10 GMT</pubDate>
            <atom:updated>2025-07-05T12:10:10.168Z</atom:updated>
            <content:encoded><![CDATA[<h3>🧩 Understanding Static Pods in Kubernetes — and How the Control Plane Boots Itself</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iCFd-rMhmvF6ALH24WIAXQ.png" /></figure><blockquote>Ever wondered: “If Kubernetes itself runs everything as pods, who runs the very first pods — like the API server, scheduler, etcd?</blockquote><p>If you’ve played around with Kubernetes, you’ve likely deployed workloads as <strong>Deployments</strong>, <strong>StatefulSets</strong>, or <strong>DaemonSets</strong>. These are all <em>managed</em> by controllers inside the Kubernetes <strong>control plane</strong>. But here’s a puzzle:</p><p>⚙ <strong>If the control plane itself is just pods… how do those pods get created in the first place?</strong><br> How does the cluster bootstrap itself <em>before</em> there is even an API server to talk to?</p><p>The answer lies in one of Kubernetes’ lesser-known but critical building blocks:<br> ✅ <strong>Static Pods</strong>.</p><h3>🌱 What are Static Pods?</h3><p>A <em>Static Pod</em> is a special kind of pod that’s managed directly by the <strong>kubelet</strong>, rather than by the Kubernetes API server.</p><ul><li>They are defined by placing a pod manifest file (usually YAML) <strong>directly on the node’s filesystem</strong>.</li><li>The kubelet watches this directory and ensures the pod defined in the file is running.</li><li>The kubelet doesn’t care if there’s an API server or controller manager — it runs the pod <em>independently</em>.</li></ul><p>So, in contrast to typical pods that live in etcd and are managed through the API server, <strong>static pods bypass the API server entirely</strong>.</p><h3>🛠 How do Static Pods work?</h3><p>By default, the kubelet can be configured with a --pod-manifest-path or --config pointing to a directory on the node (e.g., /etc/kubernetes/manifests).</p><p>Here’s what happens:</p><ul><li>Kubelet scans this directory periodically.</li><li>If it finds YAML files describing pods, it creates and runs them <em>directly</em>.</li><li>If the YAML changes, kubelet automatically updates the running pod.</li></ul><p>No API server is involved; no etcd is needed.</p><h3>📦 What do Static Pods look like?</h3><p>A static pod YAML looks almost identical to any other pod manifest:</p><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: kube-apiserver<br>  namespace: kube-system<br>spec:<br>  containers:<br>  - name: kube-apiserver<br>    image: k8s.gcr.io/kube-apiserver:v1.32.0<br>    command:<br>    - kube-apiserver<br>    - --advertise-address=192.168.1.100<br>    - --etcd-servers=https://127.0.0.1:2379<br>    </pre><p>Just drop this file into /etc/kubernetes/manifests on the node running the control plane.</p><h3>⚡ So… who creates the control plane components?</h3><p>In production (especially with kubeadm), the control plane components — like:</p><ul><li>kube-apiserver</li><li>kube-controller-manager</li><li>kube-scheduler</li><li>etcd</li></ul><p>are all initially run as <strong>static pods</strong>.</p><p>When you install a Kubernetes cluster with kubeadm init, it:</p><ul><li>Writes YAML manifests for these components into /etc/kubernetes/manifests.</li><li>The kubelet on the control plane node notices them and starts the containers.</li></ul><p>Since kubelet runs outside the cluster and doesn’t need the API server, it can start these critical pods even when there is <em>no</em> cluster yet.</p><h3>🧩 The chicken-and-egg problem — solved</h3><blockquote>If everything in Kubernetes is run inside pods… who creates the first pod?</blockquote><p>That’s the neat trick:</p><ul><li>The <strong>kubelet</strong> is the only thing that runs <em>outside</em> the cluster.</li><li>It starts first (as a systemd service on the node).</li><li>It sees static pod manifests → starts the API server.</li><li>Once the API server is up, other controllers (like controller-manager, scheduler) can start working.</li><li>Now, the rest of the cluster can be managed <em>via the API</em>.</li></ul><h3>📊 Static Pods vs. normal pods: quick comparison</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ca-XnhYjMmf-ooxZ4wgQhQ.png" /></figure><h3>🔐 Where do we use static pods in practice?</h3><ul><li>Bootstrap the <strong>control plane</strong>.</li><li>Small clusters or single-node dev clusters.</li><li>Self-hosted addons that must run before the API server.</li></ul><p>In production, <strong>you rarely use static pods for applications</strong> — only for critical system components.</p><h3>🛡 Static pods still appear in the API server!</h3><p>A cool detail:</p><ul><li>When kubelet starts a static pod, it also <em>registers a read-only mirror pod</em> with the API server (once it’s running).</li><li>This lets you see static pods with:</li></ul><pre>kubectl get pods -n kube-system</pre><p>But these mirror pods are <em>read-only</em> — you can’t delete or update static pods via kubectl.</p><h3>🚀 Summary</h3><p>✅ Static pods are the hidden bootstrap magic of Kubernetes:</p><ul><li>Let kubelet run critical pods even when the API server doesn’t exist yet.</li><li>Used to run etcd, kube-apiserver, controller-manager, and scheduler.</li></ul><p>Without static pods, the Kubernetes cluster couldn’t even start.</p><p>Next time you install a cluster, peek into /etc/kubernetes/manifests — you’ll see the heart of your control plane.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=852e1532d6d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Understanding PKI, HTTPS, and Certificates: How the Internet Stays Secure ️]]></title>
            <link>https://medium.com/@lingeshcbz/understanding-pki-https-and-certificates-how-the-internet-stays-secure-%EF%B8%8F-8d5779244085?source=rss-7f0d447b5ae1------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d5779244085</guid>
            <category><![CDATA[https]]></category>
            <category><![CDATA[cyber-security-awareness]]></category>
            <category><![CDATA[tls-certificate]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[sre]]></category>
            <dc:creator><![CDATA[Mahalingam SRE]]></dc:creator>
            <pubDate>Sat, 31 May 2025 12:55:33 GMT</pubDate>
            <atom:updated>2025-06-01T09:46:43.042Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JwFbYHyHplKsKZhitP1i-A.png" /></figure><h3>Introduction</h3><p>The modern internet is built on trust. Whether you’re logging into your bank, shopping online, or sending an email, you rely on encryption to keep your data safe from prying eyes. At the heart of this trust lies <strong>PKI (Public Key Infrastructure)</strong>, <strong>HTTPS</strong>, and <strong>digital certificates</strong>.</p><p>This blog explores how PKI and HTTPS work together, how certificates are generated and verified, and how they protect us even from sophisticated attacks like fake banking websites. We’ll break down symmetric and asymmetric encryption and explain the critical role of Certificate Authorities (CAs).</p><h3>What is PKI (Public Key Infrastructure)?</h3><p>PKI is a system that uses a pair of cryptographic keys (public and private) to encrypt and authenticate data. It provides the framework for:</p><ul><li>Secure communication (confidentiality)</li><li>Data integrity</li><li>Authentication (identity verification)</li></ul><p>PKI is the backbone of <strong>HTTPS</strong>, VPNs, digital signatures, and encrypted emails.</p><h3>HTTPS: The Secure Web Protocol</h3><p><strong>HTTPS (Hypertext Transfer Protocol Secure)</strong> is the secure version of HTTP. It uses <strong>TLS (Transport Layer Security)</strong> to encrypt the data transmitted between your browser and the server.</p><p>When you see a lock icon in your browser, it means:</p><ul><li>The website has a <strong>valid certificate</strong> issued by a trusted CA</li><li>Your connection is encrypted (TLS in use)</li><li>The identity of the website is verified</li></ul><h3>Symmetric vs Asymmetric Encryption</h3><h3>Symmetric Encryption</h3><ul><li>Uses a <strong>single key</strong> for both encryption and decryption.</li><li>Very fast but not ideal for sharing keys securely.</li><li>Example: AES (Advanced Encryption Standard)</li></ul><h3>Asymmetric Encryption</h3><ul><li>Uses a <strong>pair of keys</strong>: a public key and a private key.</li><li>Data encrypted with one can only be decrypted with the other.</li><li>Example: RSA, ECC</li></ul><h3>How HTTPS Uses Both</h3><ol><li><strong>Asymmetric</strong> encryption is used during the TLS handshake to securely exchange a session key.</li><li>Then <strong>symmetric</strong> encryption takes over for the actual data transfer (because it’s faster).</li></ol><h3>How Certificates Are Generated and Verified</h3><h3>Certificate Generation</h3><ol><li>A website generates a <strong>key pair</strong> (public/private).</li><li>It creates a <strong>Certificate Signing Request (CSR)</strong> containing the public key and domain name.</li><li>This CSR is sent to a <strong>Certificate Authority (CA)</strong>.</li><li>The CA verifies the domain and identity, then issues a <strong>signed certificate</strong>.</li></ol><h3>What’s in a Certificate?</h3><ul><li>Public Key</li><li>Domain Name</li><li>Issuer (the CA)</li><li>Validity Period</li><li>CA’s Digital Signature</li></ul><h3>Certificate Chain</h3><p>A certificate is trusted if it is part of a chain leading up to a <strong>root CA</strong>, which is trusted by your browser.</p><h3>How Attackers Try to Break Encryption</h3><p>Attackers might try:</p><ul><li><strong>Eavesdropping (MITM attack)</strong>: Intercepting data in transit.</li><li><strong>Phishing</strong>: Creating a fake website that looks like a real one (e.g., fakebank.com).</li><li><strong>Certificate Spoofing</strong>: Creating a certificate that pretends to be for a legitimate domain.</li></ul><p>However, even if an attacker creates an <strong>exact clone of a banking website</strong>, your browser won’t trust it unless the certificate is signed by a <strong>trusted CA</strong>.</p><h3>Role of Certificate Authorities (CAs)</h3><p>CAs are the gatekeepers of trust in PKI. They:</p><ul><li>Verify identities</li><li>Issue and sign certificates</li><li>Maintain <strong>Certificate Revocation Lists (CRLs)</strong></li><li>Are audited and vetted by browser vendors</li></ul><h3>Popular CAs</h3><ul><li>Let’s Encrypt (free, automated)</li><li>DigiCert</li><li>GlobalSign</li><li>Sectigo</li></ul><h3>How Browsers Trust Certificates</h3><ul><li>Browsers maintain a list of <strong>trusted root CAs</strong>.</li><li>If a certificate chains back to one of these, it’s trusted.</li><li>If not, the browser shows a warning like “Your connection is not private.”</li></ul><h3>Example: Visiting a Banking Website</h3><ol><li>You visit <a href="https://mybank.com./">https://mybank.com.</a></li><li>The server sends its certificate.</li><li>Your browser:</li></ol><ul><li>Checks the certificate’s validity</li><li>Follows the chain of trust to a known CA</li><li>Verifies the certificate’s digital signature</li></ul><p>4. If all checks pass, a secure session is established using TLS.</p><h3>Best Practices for HTTPS and Certificates</h3><ul><li>Use <strong>strong encryption</strong> (TLS 1.2 or 1.3 only)</li><li>Regularly renew certificates before expiry</li><li>Use <strong>Let’s Encrypt</strong> for automated certificate management</li><li>Implement <strong>HTTP Strict Transport Security (HSTS)</strong></li><li>Monitor for certificate revocation and misuse</li></ul><h3>🔐 SSL vs TLS — What’s the Deal?</h3><p><strong>SSL (Secure Sockets Layer)</strong> and <strong>TLS (Transport Layer Security)</strong> are encryption protocols that secure communication over the internet — like when you visit <a href="https://yourbank.com./">https://yourbank.com.</a></p><h4>✅ TLS is the newer, safer version.</h4><p>SSL came first in the 1990s, but it’s now considered <strong>outdated and insecure</strong>. It had multiple flaws and has been officially deprecated. TLS was introduced as an upgrade to SSL, offering <strong>better security, performance, and encryption methods</strong>.</p><p>Today, we use <strong>TLS 1.2 and TLS 1.3</strong> — they are the gold standards for secure communication. When you see “SSL certificate” on a website, it’s really using <strong>TLS</strong>, but the old name stuck (like people still saying “dial” a phone number).</p><h3>🧠 How Are They Different?</h3><ul><li><strong>TLS fixes major security flaws</strong> found in SSL.</li><li>It supports <strong>stronger encryption algorithms</strong> and is more efficient.</li><li>TLS 1.3 is faster — it reduces the number of steps needed to establish a secure connection.</li><li>SSL is no longer supported by modern browsers or systems.</li></ul><p>If you’re running a website or app:</p><ul><li>Don’t use SSL.</li><li>Use <strong>TLS 1.2 or TLS 1.3 only</strong>.</li><li>Even if you buy an “SSL certificate,” make sure your server supports only modern TLS versions.</li></ul><h3>Understanding Certificate Details — What’s Inside That HTTPS Lock?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pGXoOgv5JKJprk4ceI7FzQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Js8yR_TK6GnaiIO46EK0JQ.png" /></figure><p>The red arrow guides you to check the below content of HTTPS (TLS) certificates (chrome browser)</p><p>When you visit a secure website like https://badssl.com, your browser checks something called a <strong>digital certificate</strong>. It helps verify that:</p><ul><li>The website is who it claims to be.</li><li>Your communication is encrypted and safe from prying eyes.</li><li>You’re not being tricked by a fake or malicious site.</li></ul><p>Let’s break down what’s inside that certificate using a real-world example from *.badssl.com.</p><h3>🧾 Break down</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ozcn6BcjMbF-erKbtuPcQQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*1EKtQlVMdsTqDWn6N870iA.png" /></figure><ul><li><strong>Common Name (CN)</strong>: This shows the domain the certificate is valid for. In this case, it&#39;s a <strong>wildcard certificate</strong> for all subdomains of badssl.com.</li><li><strong>Organization (O) &amp; OU</strong>: These are optional fields. Many modern certificates (especially free ones like Let’s Encrypt) don’t include verified organization info.</li></ul><h3>🏢 Issuer Details</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gK29bbTovTQK5V7Ylkj6FQ.png" /></figure><p>Let’s Encrypt is a well-known and trusted Certificate Authority. Your browser trusts it to verify sites are real.</p><h3>📅 Validity Period</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UKjjWNSqpOmpRn0dYeq9pw.png" /></figure><p>Let’s Encrypt uses <strong>short-lived certs</strong> (90 days) for security reasons.</p><h3>🔐 Fingerprint &amp; Public Key</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KCP20GxFg-N1736laQCOQQ.png" /></figure><ul><li>The <strong>fingerprint</strong> ensures integrity — it’s like a digital thumbprint.</li><li>The <strong>public key</strong> is used in the TLS handshake simplified (explained below).</li></ul><h3>🧠 Why This Matters</h3><p>If this certificate fails validation (e.g., expired, mismatched domain, or untrusted issuer), the browser blocks the connection with a warning.</p><h3>📸 How to View a Certificate in Your Browser</h3><h3>🧭 Google Chrome</h3><ol><li>Click the 🔒 lock in the address bar.</li><li>Select <strong>“Connection is secure” → “Certificate is valid”</strong>.</li><li>Inspect tabs like <strong>Details</strong>, <strong>Issuer</strong>, and <strong>Validity</strong>.</li></ol><h3>🦊 Mozilla Firefox</h3><ol><li>Click the 🔒 lock → <strong>Connection secure</strong>.</li><li>Click <strong>More Information → View Certificate</strong>.</li><li>Explore the certificate structure and hierarchy.</li></ol><p>You can also use tools like openssl</p><pre>openssl s_client -connect badssl.com:443</pre><h3>🔐 Simple Story of HTTPS Connection:</h3><ol><li><strong>Browser says “Hello” to Server</strong></li></ol><ul><li>“Hi! I want to talk securely. Here’s what I can use for encryption.”</li></ul><p><strong>2. Server replies</strong></p><ul><li>“Hello! Here’s my <strong>certificate</strong> that proves who I am. It includes my <strong>public key</strong>.”</li></ul><p><strong>3. Browser creates a secret (symmetric key)</strong></p><ul><li>The browser stores the certificates sent by server and its public key associated with it, then it makes a <strong>random secret key</strong>.</li><li>It <strong>encrypts this secret key</strong> using the server’s <strong>public key</strong> (from the certificate).</li><li>Sends the <strong>encrypted secret key</strong> to the server.</li></ul><p><strong>4. Server uses its private key</strong></p><ul><li>The server <strong>decrypts the secret key</strong> using its <strong>private key</strong>.</li><li>Now <strong>both the browser and server have the same secret key for enctypt and decrypt</strong>.</li></ul><p><strong>5. They use that secret key for the rest of the chat</strong></p><ul><li>This key is used to <strong>encrypt and decrypt all future messages</strong>.</li><li>This is called <strong>symmetric encryption</strong> — fast and secure.</li></ul><h3>🧠 Why this way?</h3><blockquote><strong>Asymmetric encryption</strong> (public/private key) is used <strong>only at the start</strong> to <strong>send the secret safely</strong>.</blockquote><blockquote>Then <strong>symmetric encryption</strong> is used for the rest of the session because it’s <strong>much faster</strong>.</blockquote><h3>📌 Final Summary:</h3><ul><li>Browser gets server’s <strong>public key</strong></li><li>Browser makes a <strong>secret key</strong></li><li>Browser sends the <strong>secret encrypted</strong></li><li>Server <strong>decrypts it</strong></li><li>Now both use the <strong>same secret key</strong> to talk securely</li></ul><h3>🔁 TLS Handshake Simplified</h3><pre>sequenceDiagram<br>    participant Client<br>    participant Server<br><br>    Client-&gt;&gt;Server: Hello (supported TLS versions + random data)<br>    Server-&gt;&gt;Client: Hello + Server Certificate + Public Key<br>    Client-&gt;&gt;Server: Key Exchange (encrypts key with server&#39;s public key)<br>    Server-&gt;&gt;Client: Decrypts key with its private key<br>    Client-&gt;&gt;Server: Encrypted HTTP requests start<br>    Server-&gt;&gt;Client: Encrypted HTTP responses</pre><blockquote><em>TLS uses </em><strong><em>asymmetric encryption</em></strong><em> to establish the session, and </em><strong><em>symmetric encryption</em></strong><em> (faster) for actual data exchange.</em></blockquote><h3>🛠️ Generate Your Own TLS Certificate (Using OpenSSL)</h3><p>Want to test locally? Here&#39;s how to create your own self-signed cert:</p><h3>🔧 Step 1: Generate a private key</h3><pre>openssl genrsa -out private.key 2048</pre><h3>🔧 Step 2: Generate a certificate signing request (CSR)</h3><pre>openssl req -new -key private.key -out request.csr</pre><p>Fill in details like CN, Org, etc.</p><h3>🔧 Step 3: Create a self-signed certificate</h3><pre>openssl x509 -req -days 365 -in request.csr -signkey private.key -out certificate.crt</pre><p>You can now use certificate.crt and private.key in a local web server like NGINX or Apache for testing HTTPS.</p><p>⚠️ <strong>Note</strong>: Browsers will warn that your cert is “untrusted” unless it’s signed by a recognized CA — and that’s where <strong>trusted authorities like Let’s Encrypt</strong> come in.</p><h3>😂 Fun Analogy</h3><blockquote><em>A TLS certificate is like a passport.<br> If the passport photo (CN) doesn’t match the person (domain), or the passport isn’t from a trusted country (CA), the border agent (browser) says: ❌ &quot;Access denied!&quot;</em></blockquote><h3>✅ Wrap Up</h3><ul><li>Certificates are critical for verifying identity and encrypting data.</li><li>TLS is the modern secure protocol — not SSL.</li><li>Let’s Encrypt makes it easy to secure sites for free.</li><li>Use tools like OpenSSL or browser inspection to explore certs yourself.</li><li>Always auto-renew certificates and disable outdated TLS versions.</li></ul><h3>Conclusion</h3><p>PKI, HTTPS, and digital certificates are the silent guardians of the modern internet. By combining symmetric and asymmetric encryption with trusted third parties (CAs), they ensure that your online data stays private and secure.</p><p>Understanding how this system works helps you appreciate the complexity and importance of something as simple as the lock icon in your browser. So next time you log in to your bank or favorite e-commerce site, you’ll know exactly what’s keeping your data safe.</p><p>Stay secure, and trust the chain!Conclusion</p><p>PKI, HTTPS, and digital certificates are the silent guardians of the modern internet. By combining symmetric and asymmetric encryption with trusted third parties (CAs), they ensure that your online data stays private and secure.</p><p>Understanding how this system works helps you appreciate the complexity and importance of something as simple as the lock icon in your browser. So next time you log in to your bank or favorite e-commerce site, you’ll know exactly what’s keeping your data safe.</p><p>Stay secure, and trust the chain!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d5779244085" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Service Catalog: Control, Consistency & Compliance in Cloud Resource Provisioning]]></title>
            <link>https://medium.com/@lingeshcbz/aws-service-catalog-control-consistency-compliance-in-cloud-resource-provisioning-ebbaa21197e5?source=rss-7f0d447b5ae1------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebbaa21197e5</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[sre]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[cloud-engineering]]></category>
            <dc:creator><![CDATA[Mahalingam SRE]]></dc:creator>
            <pubDate>Fri, 23 May 2025 11:08:25 GMT</pubDate>
            <atom:updated>2025-05-23T11:12:02.997Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*NMX_c0_j0pWsg_OJnRcK0w.png" /></figure><p>Cloud sprawl. Unchecked costs. Inconsistent configurations. These are nightmares for platform and DevOps engineers managing large-scale cloud environments. Fortunately, <strong>AWS Service Catalog</strong> offers a way to tame this chaos.</p><p>In this blog, we’ll explore what AWS Service Catalog is, what problem it solves, and how it can help enterprises manage cloud resources in a controlled, scalable, and secure way. We’ll also walk through a real-time use case with examples, and close with pros, cons, and key considerations.</p><h3>🧠 What is AWS Service Catalog?</h3><p><strong>AWS Service Catalog</strong> is a service that enables organizations to <strong>create, manage, and distribute approved IT service portfolios</strong> for use on AWS. Think of it as a <strong>self-service cloud provisioning portal</strong> — backed by governance.</p><p>Platform and DevOps teams use Service Catalog to define and curate a list of <strong>approved resources</strong> (EC2 instances, RDS databases, VPCs, Lambda functions, etc.) bundled into products (CloudFormation templates). Developers and end-users can launch these products, but within the guardrails defined by the admins.</p><h3>🎯 What Problem Does It Solve?</h3><p>✅ <strong>Standardization</strong>: Eliminates configuration drift by enforcing consistent infrastructure setups.</p><p>✅ <strong>Access Control</strong>: Provides fine-grained control over who can provision what.</p><p>✅ <strong>Self-Service</strong>: Empowers teams to launch resources without waiting for central IT approval.</p><p>✅ <strong>Governance</strong>: Ensures compliance with organizational policies via guardrails and tagging.</p><p>✅ <strong>Cost Management</strong>: Reduces the risk of overprovisioning and shadow IT.</p><h3>🛠️ Core Concepts</h3><ul><li><strong>Portfolio</strong>: A collection of products managed by admins.</li><li><strong>Product</strong>: A CloudFormation template representing one or more AWS resources.</li><li><strong>Constraints</strong>: Rules to limit how products are used (e.g., instance type restrictions).</li><li><strong>Launch Path</strong>: Role-based permissions that allow users to launch products.</li></ul><h3>📈 Real-Time Use Case: Enabling Developer Self-Service in a Fintech Company</h3><h3>Scenario</h3><p>A fintech company wants to allow developers to deploy standardised environments for microservices (with EC2, RDS, and VPC components), <strong>without giving them full IAM or CloudFormation privileges</strong>.</p><h3>Challenge</h3><p>Developers are constantly requesting infrastructure. Provisioning manually or granting IAM permissions is risky. There’s a need to:</p><ul><li><strong>Speed up deployments</strong></li><li><strong>Avoid misconfigured environments</strong></li><li><strong>Maintain governance and cost control</strong></li></ul><h3>Solution with AWS Service Catalog</h3><ol><li><strong>Platform team</strong> creates CloudFormation templates for a “Standard Microservice Stack”:</li></ol><ul><li>EC2 instance with AMI</li><li>RDS PostgreSQL database</li><li>Predefined VPC, subnets, and security groups</li><li>CloudWatch alarms</li><li>SSM enabled for secure access</li></ul><p>2. They publish it as a <strong>Product</strong> in a <strong>Portfolio</strong> called Dev Environments.</p><p>3. Add <strong>constraints</strong>:</p><ul><li>EC2 instance type = t3.micro to avoid overprovisioning</li><li>DB storage size = 20GB max</li><li>Mandatory tags: Team, Project, CostCenter</li></ul><p>4. Assign <strong>IAM launch roles</strong> to dev teams via <strong>Launch Paths</strong>.</p><p>5. Developers use the AWS Console or CLI to launch the stack, choosing parameters (e.g., environment name), but <strong>can’t edit the underlying infrastructure template</strong>.</p><h3>Result</h3><ul><li>Developers can deploy a complete environment in minutes.</li><li>Platform team retains control.</li><li>Billing and tagging are enforced.</li><li>Less back-and-forth with infra teams.</li></ul><h3>✅ Positives (Why You Might Love It)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KTXTewT4LiuQK3fD6ByWrA.png" /></figure><h3>❌ Negatives (Trade-offs to Consider)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t4hiWfU4KqSlCWqjaFNBKQ.png" /></figure><h3>🔄 Alternatives</h3><ul><li><strong>Terraform Cloud + Sentinel</strong> — For orgs using Terraform and wanting policy-as-code.</li><li><strong>AWS Control Tower + Account Factory</strong> — For org-wide landing zones and account setup.</li><li><strong>Backstage with Plugins</strong> — For developer portals and internal platforms.</li><li><strong>Jenkins/GitLab CI/CD Pipelines</strong> — If infra is deployed only via pipelines.</li></ul><h3>🧪 When Should You Use AWS Service Catalog?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*McTWa9uRT-arXPpSsE7-aQ.png" /></figure><h3>🏁 Final Thoughts</h3><p>AWS Service Catalog is a powerful tool that bridges the gap between agility and control. If you’re building a platform engineering team, setting up a cloud center of excellence, or just trying to bring order to AWS chaos, this is a valuable addition to your toolbox.</p><p>Yes, it comes with a learning curve, and yes, it’s tightly coupled with CloudFormation — but the <strong>ROI in terms of governance, security, and scalability</strong> is hard to beat.</p><blockquote><em>🚀 Build fast. Govern smart. That’s the AWS Service Catalog promise.</em></blockquote><h3>📚 Further Reading</h3><ul><li><a href="https://docs.aws.amazon.com/servicecatalog/latest/adminguide/introduction.html">AWS Service Catalog Official Docs</a></li><li><a href="https://docs.aws.amazon.com/controltower/latest/userguide/account-factory.html">Control Tower and Service Catalog Integration</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebbaa21197e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ultimate Guide to AWS Lambda: Zero to Hero]]></title>
            <link>https://medium.com/@lingeshcbz/the-ultimate-guide-to-aws-lambda-zero-to-hero-3917fb5d6ea8?source=rss-7f0d447b5ae1------2</link>
            <guid isPermaLink="false">https://medium.com/p/3917fb5d6ea8</guid>
            <category><![CDATA[aws-certification]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[sre]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Mahalingam SRE]]></dc:creator>
            <pubDate>Sat, 19 Apr 2025 04:45:23 GMT</pubDate>
            <atom:updated>2025-04-19T04:45:23.717Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-IbfgHdNdfBYyK-Z901LaA.jpeg" /></figure><p>AWS Lambda is one of the core services in the serverless ecosystem. Whether you’re a beginner exploring serverless architectures or an experienced developer looking to optimize performance, this guide walks you through everything you need to know about AWS Lambda — from core concepts to advanced patterns.</p><h3>🚀 What is AWS Lambda?</h3><p>AWS Lambda lets you run code without provisioning or managing servers. You upload your function code, configure triggers (like API Gateway ,S3, Event bridge), and AWS handles the rest — autoscaling, patching, and high availability.</p><h3>🔧 How Does AWS Lambda Work?</h3><ol><li><strong>Trigger:</strong> Lambda is invoked by an event — this could be an API Gateway HTTP request, an S3 upload, a DynamoDB stream, or more.</li><li><strong>Container Creation:</strong> AWS spins up a container with the specified runtime (e.g., Python, Node.js, Java).</li><li><strong>Code Execution:</strong> Your code runs within this container.</li><li><strong>Shutdown:</strong> After execution, the container is frozen and reused if new invocations come soon.</li></ol><h3>📦 Integration with Other AWS Services</h3><p>Lambda integrates deeply with many AWS services:</p><ul><li><strong>API Gateway</strong>: Trigger Lambda via REST or HTTP APIs.</li><li><strong>S3</strong>: Run code when objects are uploaded or changed.</li><li><strong>DynamoDB Streams</strong>: Process real-time changes.</li><li><strong>EventBridge</strong>: React to event patterns and schedules.</li><li><strong>SNS/SQS</strong>: Process messages asynchronously.</li></ul><h3>⏱️ Provisioned Concurrency &amp; Cold Starts</h3><h3>What is a Cold Start?</h3><p>A cold start occurs when Lambda has to initialize a new instance to handle a request. This can take hundreds of milliseconds or more.</p><h3>Provisioned Concurrency</h3><ul><li>Keeps Lambda instances warm and pre-initialized.</li><li>Reduces latency to near-zero.</li><li>Useful for latency-sensitive apps.</li></ul><blockquote><em>💡 Even if no requests come in, AWS keeps provisioned instances alive.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9aF9_FJuz7YkhdVO33fQgQ.png" /></figure><h3>🔢 Versions and Aliases</h3><h3>What is a Version?</h3><ul><li>Immutable snapshot of your Lambda code and config.</li><li>Allows rollback and consistency.</li></ul><h3>What is an Alias?</h3><ul><li>A friendly name pointing to a version (e.g., prod, dev).</li><li>You can update the alias without changing your app.</li></ul><h3>Real-World Analogy</h3><ul><li>Lambda is a book.</li><li>Versions = editions of the book.</li><li>Aliases = sticky notes saying “read this version.”</li></ul><h3>Why Use Them?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*agRcFXXc1pr9UDvox5Ek-w.png" /></figure><h3>🧱 Lambda Layers</h3><h3>What Are Layers?</h3><p>Reusable packages (code, libraries, binaries) that you can attach to one or more Lambda functions.</p><h3>Benefits</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1tAr7PtUXqToUZFW4n5OiA.png" /></figure><h3>Use Cases</h3><ul><li>Common libraries (e.g., requests, pandas)</li><li>Helper files (e.g., utils.py)</li><li>Binaries/config files</li><li>Language runtimes (advanced use)</li></ul><h3>Example: Adding requests as a Layer</h3><pre>mkdir -p python<br>pip install requests -t python/<br>zip -r requests-layer.zip python<br>aws lambda publish-layer-version \<br>  --layer-name requests-layer \<br>  --zip-file fileb://requests-layer.zip \<br>  --compatible-runtimes python3.12</pre><pre>aws lambda update-function-configuration \<br>  --function-name my-function \<br>  --layers arn:aws:lambda:region:account-id:layer:requests-layer:1</pre><h3>📬 Destinations for Success/Failure</h3><p>Lambda can send invocation results (success or failure) to other services for post-processing.</p><h3>Applies to Asynchronous Events Only</h3><p>(e.g., triggered by S3, SNS, EventBridge, or InvocationType=Event)</p><h3>Supported Destinations</h3><p>Success — — — — — — — — →SNS, SQS, Lambda, EventBridge</p><p>Failure — — — — — — — — — →SNS, SQS, Lambda, EventBridge</p><h3>Why Use It?</h3><ul><li>Trigger retries or alerts</li><li>Conditional flows (e.g., success triggers next Lambda)</li><li>Replace DLQ (Dead Letter Queue) with smarter logic</li></ul><h3>🧑‍💻 Real-Life Use Case: Lambda in an E-commerce Backend</h3><p>Let’s say you’re building an online store, but instead of a NoSQL database like DynamoDB, you’re using <strong>Amazon Aurora PostgreSQL</strong>. Here’s how Lambda fits into that architecture:</p><h3>💡 Architecture</h3><ul><li><strong>Frontend</strong>: React or Vue.js SPA</li><li><strong>API Gateway</strong>: Handles HTTP requests and routes to Lambda</li><li><strong>Lambda Functions</strong>:</li><li>getProducts – Queries the Aurora PostgreSQL database for product data</li><li>createOrder – Inserts new orders and triggers downstream processing</li><li>sendConfirmationEmail – Triggered via EventBridge or Lambda Destinations</li><li><strong>Database</strong>: Aurora PostgreSQL</li><li><strong>Notifications</strong>: SES or SNS</li></ul><h3>🔄 Example Flow: Customer Places an Order</h3><ol><li>Customer submits an order from the frontend.</li><li>API Gateway invokes the createOrder Lambda.</li><li>createOrder:</li></ol><ul><li>Validates input and authentication.</li><li>Opens a <strong>pooled</strong> connection to Aurora PostgreSQL (e.g., via RDS Proxy).</li><li>Inserts the order into a orders table.</li><li>Emits an event to <strong>EventBridge</strong>.</li></ul><p>4. A second Lambda (sendConfirmationEmail) is triggered and sends an email via <strong>SES</strong>.</p><p>💡 <strong>Tip</strong>: Use <strong>Amazon RDS Proxy</strong> to manage DB connections efficiently and avoid Lambda concurrency issues overwhelming Aurora.</p><h3>🗃️ Sample Table Schema (PostgreSQL)</h3><pre>CREATE TABLE products (<br>  id SERIAL PRIMARY KEY,<br>  name TEXT NOT NULL,<br>  price NUMERIC(10, 2) NOT NULL,<br>  in_stock BOOLEAN DEFAULT TRUE<br>);</pre><pre>CREATE TABLE orders (<br>  id UUID PRIMARY KEY,<br>  customer_email TEXT NOT NULL,<br>  product_id INT REFERENCES products(id),<br>  quantity INT,<br>  order_date TIMESTAMP DEFAULT now()<br>);</pre><p>This hybrid setup combines the best of <strong>serverless scalability</strong> with the power and reliability of a <strong>relational database</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NE3mHyGRwNDIyL7b1oh6sw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OZZE-hq-HoPWlcTsLjv35A.png" /></figure><h3>🔐 Lambda IAM Roles &amp; Permissions</h3><p>Each Lambda function runs with a specific IAM role, also known as its <strong>execution role</strong>. This defines what AWS services and resources the function can interact with.</p><h3>🧾 Key Points:</h3><ul><li>Defined when the Lambda function is created (or updated later).</li><li>Attached policies should follow <strong>principle of least privilege</strong>.</li><li>Automatically provides access to write logs to <strong>CloudWatch Logs</strong> if permissions are included.</li><li>Required for invoking other AWS services (e.g., S3, DynamoDB, Aurora, SNS, SQS, SES).</li></ul><h3>✍️ Example IAM Policy for a Lambda:</h3><pre>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Action&quot;: [&quot;dynamodb:PutItem&quot;, &quot;dynamodb:GetItem&quot;],<br>      &quot;Resource&quot;: &quot;arn:aws:dynamodb:us-west-2:123456789012:table/orders&quot;<br>    },<br>    {<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Action&quot;: [&quot;logs:CreateLogGroup&quot;, &quot;logs:CreateLogStream&quot;, &quot;logs:PutLogEvents&quot;],<br>      &quot;Resource&quot;: &quot;*&quot;<br>    }<br>  ]<br>}</pre><h3>🔐 Resource-Based Policies</h3><p>Lambda supports resource-based IAM policies to control who can invoke or manage your function.</p><h3>Why Use Them?</h3><ul><li>Allow S3, SNS, EventBridge to trigger Lambda</li><li>Enable cross-account access</li><li>Secure non-proxy API Gateway invocations</li></ul><h3>Example Use Cases</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4c8ZgyQ1BlIihMdsyHt-ww.png" /></figure><h3>🔍 AWS X-Ray for Tracing</h3><p>AWS X-Ray lets you trace requests through your entire app and pinpoint performance issues.</p><h3>What It Does</h3><ul><li>Tracks requests end-to-end</li><li>Captures latency per service</li><li>Visualizes call graphs</li><li>Finds cold starts, bottlenecks, and errors</li></ul><h3>With Lambda, X-Ray Can:</h3><ul><li>Trace each invocation</li><li>Capture downstream calls (e.g., DynamoDB)</li><li>Visualize invocation paths</li></ul><h3>Common Use Cases</h3><ul><li>Debugging errors</li><li>Measuring cold start impact</li><li>Understanding flow of complex systems</li><li>Viewing service maps</li></ul><h3>Example Flow: API Gateway -&gt; Lambda -&gt; DynamoDB</h3><p>Each node is traced with:</p><ul><li>Response time</li><li>Error rate</li><li>Cold start flag</li></ul><h3>📊 Monitoring &amp; Logging with CloudWatch</h3><p>AWS Lambda automatically integrates with <strong>Amazon CloudWatch</strong> for logs and metrics, helping you observe and troubleshoot your functions.</p><h3>📋 What Gets Logged?</h3><p>Every Lambda invocation logs:</p><ul><li><strong>START</strong>: Invocation ID and version</li><li><strong>LOG</strong>: Any print() or logging output</li><li><strong>END</strong>: Duration and memory usage</li><li><strong>REPORT</strong>: Metrics like billed duration, max memory used, etc.</li></ul><h3>📈 Metrics Available</h3><p>CloudWatch collects default Lambda metrics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*laaJ5u8Zz2T_-O49efQqOA.png" /></figure><h3>🔔 Create Alarms</h3><p>You can create CloudWatch Alarms for thresholds:</p><ul><li>Alert on high error rates</li><li>Alert if invocations drop unexpectedly</li><li>Alert if duration spikes (e.g., due to DB slowness)</li></ul><h3>🛡️ Best Practices for IAM Roles:</h3><ul><li><strong>One role per function</strong> (unless functions share identical permissions).</li><li><strong>Don’t overgrant</strong> — avoid &quot;Action&quot;: &quot;*&quot; or &quot;Resource&quot;: &quot;*&quot; unless absolutely necessary.</li><li>Rotate access for secrets using <strong>AWS Secrets Manager</strong> or <strong>Parameter Store</strong>.</li><li>Audit roles using <strong>IAM Access Analyzer</strong> or <strong>AWS Config</strong>.</li></ul><h3>🧠 Final Thoughts</h3><p>AWS Lambda is a powerful tool for modern, serverless applications. When used with best practices — like provisioned concurrency, aliases, layers, and destination handling — it can provide enterprise-grade reliability and flexibility.</p><p>Whether you’re building APIs, processing events, or gluing services together, Lambda is the Swiss Army knife of AWS compute.</p><p>Start small. Scale infinitely.</p><p>Happy building! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3917fb5d6ea8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Splunk: Unlocking Insights with Powerful SPL Queries ]]></title>
            <link>https://medium.com/@lingeshcbz/mastering-splunk-unlocking-insights-with-powerful-spl-queries-ad62dd6679e3?source=rss-7f0d447b5ae1------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad62dd6679e3</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[splunk]]></category>
            <category><![CDATA[logs]]></category>
            <category><![CDATA[sdlc]]></category>
            <category><![CDATA[sre]]></category>
            <dc:creator><![CDATA[Mahalingam SRE]]></dc:creator>
            <pubDate>Wed, 02 Apr 2025 01:17:52 GMT</pubDate>
            <atom:updated>2025-04-02T01:17:52.787Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t5k4yN_GmXD5UGLxkLWzGA.png" /></figure><h3>Introduction</h3><p>In today’s data-driven world, organizations generate massive volumes of logs from applications, cloud environments, and infrastructure. Splunk, a leading log management and analysis platform, helps DevOps, security teams, and IT professionals make sense of this data through powerful search, visualization, and alerting capabilities.</p><p>This blog explores <strong>Splunk’s core use cases, essential SPL (Search Processing Language) queries, and key tools</strong> that help unlock valuable insights.</p><h3>Why Splunk?</h3><p>Splunk is more than just a log aggregator — it transforms raw log data into actionable intelligence. Here are some key benefits:</p><p>✅ <strong>Real-time monitoring</strong> — Detect issues as they happen.<br> ✅ <strong>Log analysis &amp; troubleshooting</strong> — Quickly pinpoint system failures.<br> ✅ <strong>Security &amp; compliance</strong> — Identify threats and ensure regulatory compliance.<br> ✅ <strong>Operational intelligence</strong> — Improve system performance with data-driven decisions.</p><h3>1. What is Splunk?</h3><p>Splunk is a powerful tool used to search, monitor, and analyze machine-generated data. It collects data from various sources, such as logs, events, and metrics, providing real-time insights that help organizations understand and manage their systems efficiently.</p><h3>2. Splunk’s Role in DevOps</h3><h4>a. Log Aggregation and Analysis</h4><p>Splunk centralizes logs from different application and infrastructure components. DevOps teams can search and analyze logs in real time, making it easier to detect and resolve issues quickly.</p><h4>b. Monitoring and Alerts</h4><p>Splunk enables teams to set up alerts based on specific conditions or patterns in the data. This helps identify anomalies and potential issues before they impact the system.</p><h4>c. Performance Optimization</h4><p>By analyzing performance metrics, Splunk helps teams pinpoint areas that need improvement, ensuring applications and infrastructure run efficiently.</p><h4>d. Security and Compliance</h4><p>Splunk plays a key role in security monitoring and compliance by tracking security-related events and ensuring adherence to industry standards.</p><h3>3. How Splunk is Used in DevOps</h3><h4>a. Real-time Troubleshooting</h4><p>If an application experiences a sudden increase in errors, Splunk helps DevOps teams quickly search logs, find the root cause, and resolve the issue.</p><h4>b. Continuous Monitoring</h4><p>Splunk continuously tracks key performance metrics and sends alerts if they go beyond the expected range, ensuring system stability and reliability.</p><h4>c. Anomaly Detection</h4><p>Using machine learning, Splunk identifies unusual patterns in data, helping teams detect security threats and performance issues before they escalate.</p><h3>4. Benefits of Using Splunk in DevOps</h3><h4>a. Faster Issue Resolution</h4><p>Splunk’s real-time search and analysis capabilities help teams quickly identify and fix problems, reducing system downtime.</p><h4>b. Data-Driven Decisions</h4><p>With powerful analytics, DevOps teams can make informed decisions that improve system performance and efficiency.</p><h4>c. Improved Collaboration</h4><p>By providing a centralized data analysis platform, Splunk enhances collaboration between development and operations teams, promoting a unified approach to problem-solving.</p><h3>Core Use Cases of Splunk</h3><h3>1. Log Analysis &amp; Troubleshooting</h3><p>Imagine an application in <strong>AWS EKS</strong> that experiences frequent crashes. With Splunk, engineers can quickly filter logs to find <strong>errors or exceptions</strong> and diagnose the issue.</p><p>🔹 <strong>Example SPL Query:</strong></p><pre>index=&quot;app_logs&quot; (&quot;error&quot; OR &quot;exception&quot;) earliest=-24h</pre><p>✅ Searches for errors or exceptions in application logs over the last 24 hours.</p><h3>2. Monitoring Kubernetes (EKS) Logs</h3><p>For teams running applications on <strong>Amazon EKS</strong>, monitoring cluster activity is crucial. You can track pod-level issues and status codes.</p><p>🔹 <strong>Example SPL Query (Finding 4xx and 5xx Errors in Pods):</strong></p><pre>index=&quot;k8s_logs&quot; cluster_name=&quot;eks-prod&quot; (status&gt;=400 AND status&lt;600)<br>| stats count by status pod</pre><p>✅ This helps identify which Kubernetes pods are experiencing the most errors.</p><h3>3. Security &amp; Compliance: Detecting Unauthorized Access</h3><p>Security teams rely on Splunk to detect unauthorized logins and potential cyber threats.</p><p>🔹 <strong>Example SPL Query (Failed SSH Logins by IP Address):</strong></p><pre>index=&quot;security_logs&quot; sourcetype=&quot;linux_secure&quot; &quot;failed password&quot;<br>| stats count by src_ip<br>| sort -count</pre><p>✅ Identifies IPs attempting brute-force SSH attacks.</p><h3>4. Performance Monitoring &amp; API Latency Tracking</h3><p>Splunk helps DevOps teams track API response times and detect slow requests.</p><p>🔹 <strong>Example SPL Query (API Response Time Monitoring):</strong></p><pre>index=&quot;api_logs&quot; sourcetype=&quot;nginx_access&quot; <br>| stats avg(response_time) as avg_response_time by endpoint<br>| sort -avg_response_time</pre><p>✅ Identifies slow API endpoints by calculating average response time.</p><h3>Key Splunk Tools &amp; Features</h3><h3>1. Splunk Search &amp; Reporting</h3><p>🔹 Provides a powerful search bar to filter logs, analyze events, and create reports.</p><h3>2. Splunk Dashboards</h3><p>🔹 Create real-time <strong>visualizations</strong> of log trends, errors, and system performance.</p><h3>3. Splunk Alerts</h3><p>🔹 Set up alerts for <strong>high error rates, unauthorized logins, or application failures</strong>.</p><p>🔹 <strong>Example Alert Query (Trigger if HTTP 500 errors exceed 50 in 10 minutes):</strong></p><pre>index=&quot;web_logs&quot; status=500 earliest=-10m<br>| stats count<br>| where count &gt; 50</pre><h3>4. Splunk Enterprise Security (SIEM)</h3><p>🔹 Detects security threats, insider attacks, and compliance violations.</p><h3>5. Splunk Machine Learning Toolkit (MLTK)</h3><p>🔹 Enables anomaly detection, predictive analytics, and log pattern recognition.</p><h3>Advanced SPL Queries &amp; Visualizations</h3><h3>1. Visualizing Error Trends with Timechart</h3><pre>index=&quot;app_logs&quot; &quot;error&quot;<br>| timechart span=1h count as error_count</pre><p>✅ Generates an hourly error trend chart to detect peak failure times.</p><h3>2. Identifying Top 3 Hosts with Most Errors</h3><pre>index=&quot;system_logs&quot; &quot;error&quot;<br>| top limit=3 host</pre><p>✅ Helps prioritize debugging by identifying hosts generating the most errors.</p><h3>1. Basic Search Queries</h3><h3>a. Using AND in Splunk</h3><p><strong>Definition:</strong> Returns results that match all specified conditions.</p><p><strong>Example:</strong> Find logs where <strong>status is 500</strong> and <strong>source is “nginx”</strong>.</p><pre>index=&quot;web_logs&quot; status=500 AND source=&quot;nginx&quot;</pre><p>✅ Retrieves only logs where <strong>both</strong> conditions are met.</p><h3>b. Using OR in Splunk</h3><p><strong>Definition:</strong> Returns results that match <strong>any</strong> of the given conditions.</p><p><strong>Example:</strong> Find logs where <strong>status is 400 or 500</strong>.</p><pre>index=&quot;web_logs&quot; (status=400 OR status=500)</pre><p>✅ Retrieves logs where <strong>either</strong> status code is present.</p><h3>c. Searching for Status Codes (4xx &amp; 5xx)</h3><p><strong>Definition:</strong> Filters logs where HTTP status codes indicate errors.</p><p><strong>Example:</strong> Find all client (4xx) and server (5xx) errors.</p><pre>index=&quot;web_logs&quot; status&gt;=400 AND status&lt;600</pre><p>✅ Retrieves all HTTP <strong>4xx and 5xx errors</strong> for troubleshooting.</p><h3>d. Searching for Specific Error Codes (400, 500, etc.)</h3><p><strong>Definition:</strong> Filters logs to find specific status codes.</p><p><strong>Example:</strong> Find logs where status code is either <strong>400 or 500</strong>.</p><pre>index=&quot;web_logs&quot; (status=400 OR status=500)</pre><p>✅ Useful for debugging both client and server errors.</p><h3>2. Combining Multiple Conditions</h3><h3>Example: Find 4xx or 5xx Errors from a Specific Source</h3><pre>index=&quot;web_logs&quot; (status=400 OR status=500) AND source=&quot;nginx&quot;</pre><p>✅ Retrieves error logs from an <strong>nginx server</strong>.</p><h3>3. Triggering Alerts in Splunk</h3><h3>Example: Alert When HTTP 500 Errors Exceed 50 in 10 Minutes</h3><pre>index=&quot;web_logs&quot; status=500 earliest=-10m<br>| stats count <br>| where count &gt; 50</pre><p>✅ This can be set as an <strong>alert</strong> to notify when too many server errors occur in a short period.</p><h3>4. Using search in Splunk</h3><h3>Example: Search for Logs Containing a Specific Keyword</h3><pre>index=&quot;app_logs&quot; &quot;error&quot;</pre><p>✅ Searches logs for the word <strong>“error”</strong> in all fields.</p><h3>5. Using eval for Custom Fields &amp; Conditions</h3><h3>Example: Categorize Response Times</h3><pre>index=&quot;api_logs&quot;<br>| eval response_category = if(response_time&gt;1, &quot;Slow&quot;, &quot;Fast&quot;)</pre><p>✅ Creates a new field response_category based on <strong>response time</strong>.</p><h3>6. Using stats for Aggregated Data</h3><h3>Example: Count Total Errors by Status Code</h3><pre>index=&quot;web_logs&quot; status&gt;=400 AND status&lt;600<br>| stats count by status</pre><p>✅ Shows the <strong>total count of each error code (400, 401, 500, etc.)</strong>.</p><h3>7. Using count to Measure Events</h3><h3>Example: Count Total Log Entries in the Last Hour</h3><pre>index=&quot;web_logs&quot; earliest=-1h<br>| stats count</pre><p>✅ Helps track <strong>log volume trends</strong>.</p><h3><strong>K8S related SPL queries</strong></h3><h3>1. Search for Container Restart Events</h3><p>Track containers that are restarting, in “CrashLoopBackOff”, or have other restart issues.</p><pre>index=&quot;k8s_logs&quot; <br>sourcetype=&quot;k8s_container&quot; <br>cluster_name=&quot;k8s-cluster-prod&quot; <br>namespace=&quot;dev-namespace&quot; <br>pod=&quot;app-pod-*&quot; <br>(&quot;restarting&quot; OR &quot;CrashLoopBackOff&quot; OR &quot;OOMKilled&quot; OR &quot;Exited&quot; OR &quot;Killed&quot; OR &quot;Failed&quot;)<br>| stats count by pod, status</pre><h3>2. Search for Pod Crash or Termination Events</h3><p>Track when pods are crashing, exiting, or killed.</p><pre>index=&quot;k8s_logs&quot; <br>sourcetype=&quot;k8s_pod&quot; <br>cluster_name=&quot;k8s-cluster-prod&quot; <br>namespace=&quot;dev-namespace&quot; <br>pod=&quot;app-pod-*&quot; <br>(&quot;CrashLoopBackOff&quot; OR &quot;OOMKilled&quot; OR &quot;Exited&quot; OR &quot;Failed&quot;)<br>| stats count by pod, status</pre><h3>3. Search for Logs from a Specific Pod</h3><p>Find logs for a specific pod to troubleshoot issues.</p><pre>index=&quot;k8s_logs&quot; <br>sourcetype=&quot;k8s_container&quot; <br>cluster_name=&quot;k8s-cluster-prod&quot; <br>namespace=&quot;dev-namespace&quot; <br>pod=&quot;app-pod-123&quot; <br>| stats count by message</pre><h3>4. Search for Errors in Application Logs</h3><p>Look for “error” or “exception” in logs for specific pods.</p><pre>index=&quot;k8s_logs&quot; <br>sourcetype=&quot;k8s_app&quot; <br>cluster_name=&quot;k8s-cluster-prod&quot; <br>namespace=&quot;dev-namespace&quot; <br>pod=&quot;app-pod-*&quot; <br>(&quot;error&quot; OR &quot;exception&quot;)<br>| stats count by pod, message</pre><h3>5. Search for Pod Resource Usage (Memory/CPU)</h3><p>Track resource usage for pods to check for performance bottlenecks.</p><pre>index=&quot;k8s_logs&quot; <br>sourcetype=&quot;k8s_metrics&quot; <br>cluster_name=&quot;k8s-cluster-prod&quot; <br>namespace=&quot;dev-namespace&quot; <br>pod=&quot;app-pod-*&quot; <br>| stats avg(cpu_usage), avg(memory_usage) by pod</pre><h3>6. Search for High Number of Requests (API or Web Traffic)</h3><p>Track API or web traffic requests to a specific service or pod.</p><pre>index=&quot;k8s_logs&quot; <br>sourcetype=&quot;k8s_ingress&quot; <br>cluster_name=&quot;k8s-cluster-prod&quot; <br>namespace=&quot;dev-namespace&quot; <br>pod=&quot;app-pod-*&quot; <br>| stats sum(requests) by pod</pre><h3>7. Search for Failed Deployments or Rollouts</h3><p>Check for failed deployments or rollouts in the Kubernetes cluster.</p><pre>index=&quot;k8s_logs&quot; <br>sourcetype=&quot;k8s_deployment&quot; <br>cluster_name=&quot;k8s-cluster-prod&quot; <br>namespace=&quot;dev-namespace&quot; <br>pod=&quot;app-pod-*&quot; <br>(&quot;failed&quot; OR &quot;error&quot;)<br>| stats count by deployment, status</pre><h3>8. Search for Kubernetes Node Status (Up/Down)</h3><p>Monitor the health of Kubernetes nodes.</p><pre>index=&quot;k8s_logs&quot; <br>sourcetype=&quot;k8s_node&quot; <br>cluster_name=&quot;k8s-cluster-prod&quot; <br>namespace=&quot;dev-namespace&quot; <br>pod=&quot;*&quot;<br>| stats count by node, status</pre><h3>9. Search for Logs from Failed Jobs</h3><p>Check logs for failed jobs within a Kubernetes namespace.</p><pre>index=&quot;k8s_logs&quot; <br>sourcetype=&quot;k8s_job&quot; <br>cluster_name=&quot;k8s-cluster-prod&quot; <br>namespace=&quot;dev-namespace&quot; <br>pod=&quot;app-pod-*&quot; <br>(&quot;failed&quot; OR &quot;error&quot;)<br>| stats count by job, status</pre><h3>10. Search for Kubernetes Events (Pod Scheduling, Failures)</h3><p>Analyze events for pod scheduling failures or other issues.</p><pre>index=&quot;k8s_logs&quot; <br>sourcetype=&quot;k8s_event&quot; <br>cluster_name=&quot;k8s-cluster-prod&quot; <br>namespace=&quot;dev-namespace&quot; <br>pod=&quot;app-pod-*&quot; <br>(&quot;failed&quot; OR &quot;scheduling&quot;)<br>| stats count by event_type, pod</pre><h3>Explanation of Each Query:</h3><ol><li><strong>Restart Events</strong>:</li></ol><ul><li>Tracks any issues causing pods to restart or fail, including CrashLoopBackOff and OOMKilled events.</li></ul><p><strong>2. Pod Crash/Termination</strong>:</p><ul><li>Filters for crash or termination events, useful for diagnosing container terminations.</li></ul><p><strong>3. Specific Pod Logs</strong>:</p><ul><li>Isolates logs from a specific pod to drill into potential issues within that pod.</li></ul><p><strong>4. Errors in Application Logs</strong>:</p><ul><li>Filters for errors and exceptions in the logs, helping identify application-level issues.</li></ul><p><strong>5. Resource Usage</strong>:</p><ul><li>Analyzes average CPU and memory usage for each pod, helping identify resource bottlenecks.</li></ul><p><strong>6. Web/API Traffic</strong>:</p><ul><li>Tracks incoming web or API requests, identifying traffic patterns or spikes.</li></ul><p><strong>7. Failed Deployments</strong>:</p><ul><li>Finds failed Kubernetes deployments or rollouts, helping with troubleshooting.</li></ul><p><strong>8. Node Status</strong>:</p><ul><li>Keeps track of the status of nodes, making sure all nodes are healthy.</li></ul><p><strong>9. Failed Jobs</strong>:</p><ul><li>Looks for failed job statuses within the cluster, useful for debugging failed jobs or cron jobs.</li></ul><p><strong>10. Kubernetes Events</strong>:</p><ul><li>Filters events related to pod scheduling failures or other issues, providing insight into event-driven problems.</li></ul><h3>Conclusion</h3><p>Splunk is an essential tool for DevOps, SRE, and Security teams, providing <strong>real-time insights into logs, security events, and performance metrics</strong>. With powerful SPL queries, dashboards, and alerts, you can transform raw logs into valuable intelligence.</p><p>💡 <strong>Are you ready to optimize your log analysis with Splunk? Try these queries today!</strong> 🚀</p><h3>Key Splunk Keywords &amp; Topics for SEO</h3><ul><li><strong>Splunk SPL queries</strong></li><li><strong>Splunk use cases</strong></li><li><strong>Splunk for Kubernetes (EKS) logging</strong></li><li><strong>Splunk for DevOps and monitoring</strong></li><li><strong>Splunk security and SIEM</strong></li><li><strong>Splunk dashboards and visualization</strong></li><li><strong>How to use Splunk for log analysis</strong></li><li><strong>Splunk API monitoring and performance tracking</strong></li><li><strong>Splunk best practices for troubleshooting</strong></li></ul><p>🚀 Comment you favourite and most used SPL query 💡🔥</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad62dd6679e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Unbreakable Mindset: 21 Brutal Truths That Will Force You to Level Up]]></title>
            <link>https://medium.com/@lingeshcbz/the-unbreakable-mindset-21-brutal-truths-that-will-force-you-to-level-up-0b36964cfcb4?source=rss-7f0d447b5ae1------2</link>
            <guid isPermaLink="false">https://medium.com/p/0b36964cfcb4</guid>
            <category><![CDATA[stoicism]]></category>
            <category><![CDATA[discipline]]></category>
            <category><![CDATA[david-goggins]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[motivational]]></category>
            <dc:creator><![CDATA[Mahalingam SRE]]></dc:creator>
            <pubDate>Mon, 24 Mar 2025 03:04:50 GMT</pubDate>
            <atom:updated>2025-03-24T03:04:50.338Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eLF8jm_Cyl7uyRqo6viB2Q.png" /><figcaption>AI generated</figcaption></figure><p>Life doesn’t give a damn about your excuses. It will break you, test you, and push you into the abyss if you let it. But some of us? We fight back. We refuse to be average. We take the pain, swallow it, and use it as fuel. These 21 quotes aren’t just words — they’re weapons. Weapons I’ve used to carve my path through failure, doubt, and hardship. And if you’re serious about becoming the best version of yourself, you’ll take these truths and apply them like your life depends on it — because it does.</p><h3>1. “I had to invent a guy who didn’t exist.” — David Goggins</h3><p>Who you are today isn’t enough. If you want to be unstoppable, you have to create a version of yourself that scares the hell out of you. Goggins became his own superhero because no one was coming to save him. Neither is anyone coming to save you.</p><h3>2. “Remaining calm when triggered is the number one life skill.”</h3><p>Emotions are a trap. The moment you react, you lose control. Mastering your mind means standing in the storm and not flinching.</p><h3>3. “Don’t forget every reason why you wanted to be here.” — David Goggins</h3><p>When the grind gets unbearable, remember your ‘why.’ Pain fades, but regret? Regret haunts.</p><h3>4. “Be strict with yourself, tolerant with others.” — Stoicism</h3><p>Self-discipline is your duty. Hold yourself to a higher standard, but don’t expect the same from others. Your war is yours alone.</p><h3>5. “A warrior prays for peace and prepares for war.”</h3><p>You don’t wait for chaos to come before you get ready. You stay sharp so that when the storm hits, you own it.</p><h3>6. “Be the most dangerous but not harmful.”</h3><p>You want to be a wolf, not a rabid dog. Develop power, but wield it with control. The truly strong never have to prove it.</p><h3>7. “No matter how hard you work, you can work harder.”</h3><p>There’s always another level. Just when you think you’ve given your all, dig deeper. Growth happens in that extra push.</p><h3>8. “The will must be stronger than the skill.”</h3><p>Raw talent means nothing without an unshakable will. The strongest competitors aren’t always the most skilled — they just refuse to quit.</p><h3>9. “The universe always falls in love with a stubborn heart.”</h3><p>Persistence is the currency of success. Refuse to be ignored. Refuse to give up. The world bends to the relentless.</p><h3>10. “The trouble is, you think you have time.”</h3><p>You don’t. Every second wasted is a second you’ll never get back. Act now.</p><h3>11. “Train insane or remain the same.”</h3><p>Your results reflect your effort. If you want to be great, you need to be willing to suffer for it.</p><h3>12. “Tough is the default mode in life. If it’s easy, something is off.”</h3><p>If your life is comfortable, you’re doing it wrong. Pressure creates diamonds. Weakness loves comfort.</p><h3>13. “The smarter you get, the faster you lose friends.”</h3><p>Growth is lonely. As you evolve, people will fall away. Let them. Not everyone is meant to follow you to the top.</p><h3>14. “Trust the process and believe in it.”</h3><p>Success isn’t instant. It’s built brick by brick. Stay consistent, stay patient, and watch it unfold.</p><h3>15. “Surround yourself with people who talk about ideas, vision, dreams, money — not people.”</h3><p>Your circle dictates your future. Choose wisely. Gossip and drama are distractions. Elevate or stagnate.</p><h3>16. “Don’t be sad about people, because they will all die.”</h3><p>Harsh but real. Life is fleeting. Don’t waste time mourning relationships that were never meant to last.</p><h3>17. “It’s not the size of you in the fight, but the size of the fight in you.”</h3><p>Mindset trumps everything. The fiercest competitor isn’t always the biggest — it’s the one who refuses to lose.</p><h3>18. “Discipline is remembering what you want.”</h3><p>Temptation will always be there. Discipline is the bridge between who you are and who you want to be.</p><h3>19. “The fear we don’t face becomes our limits.”</h3><p>Fear doesn’t go away — it grows when ignored. Face it, conquer it, and level up.</p><h3>20. “Better late than never.”</h3><p>Stop making excuses. Start now. Progress is always better than stagnation.</p><h3>21. “Discipline is the bridge between goal and accomplishment.”</h3><p>Dreaming is easy. Execution is what separates the great from the forgotten.</p><h3>Final Words: Will You Apply This or Just Read It?</h3><p>These truths will either change your life or be just another blog you scrolled past. The choice is yours. The weak will nod and move on. The strong will take action. Which one are you?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0b36964cfcb4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Authentication, Authorization, and Admission Controllers in Kubernetes]]></title>
            <link>https://medium.com/@lingeshcbz/understanding-authentication-authorization-and-admission-controllers-in-kubernetes-3a4554bd7c6b?source=rss-7f0d447b5ae1------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a4554bd7c6b</guid>
            <category><![CDATA[sre]]></category>
            <category><![CDATA[cka-exam]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Mahalingam SRE]]></dc:creator>
            <pubDate>Sat, 22 Mar 2025 03:12:15 GMT</pubDate>
            <atom:updated>2025-03-22T03:15:11.035Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xtUekOXdRPIiBqUXojXSMA.png" /></figure><h3>Introduction</h3><p>Kubernetes is a powerful container orchestration system, but securing access to its resources is crucial. Kubernetes enforces security through three key mechanisms:</p><ol><li><strong>Authentication</strong> — Identifies who is making the request.</li><li><strong>Authorization</strong> — Determines what actions the authenticated user can perform.</li><li><strong>Admission Controllers</strong> — Enforce policies and validations before executing requests.</li></ol><p>In this blog, we’ll explore these security layers with detailed examples and a simplified analogy to understand their real-world significance.</p><h3>1. Authentication in Kubernetes</h3><h3>What is Authentication?</h3><p>Authentication verifies the identity of a user or service making a request to the Kubernetes API server. It answers the question: <strong>“Who are you?”</strong></p><h3>Authentication Methods</h3><p>Kubernetes does not have a built-in user management system. Instead, it relies on external authentication methods:</p><ul><li><strong>Client Certificates</strong> — Uses SSL certificates to authenticate users.</li><li><strong>Bearer Tokens</strong> — Static tokens stored in Kubernetes.</li><li><strong>OIDC (OpenID Connect)</strong> — Integrates with identity providers like AWS IAM, Google, or Okta.</li><li><strong>Webhook Token Authentication</strong> — Validates requests via an external authentication service.</li></ul><h3>Example: Authenticating with OIDC</h3><p>Let’s say a developer wants to access an EKS cluster integrated with AWS IAM and OIDC. The authentication flow is:</p><ol><li>The developer runs a kubectl get pods command.</li><li>Kubernetes verifies the identity using an <strong>OIDC token</strong> issued by AWS.</li><li>If the token is valid, Kubernetes moves to the authorization step.</li><li>If the token is invalid, Kubernetes <strong>rejects</strong> the request immediately.</li></ol><h3>2. Authorization in Kubernetes</h3><h3>What is Authorization?</h3><p>Once authenticated, Kubernetes checks <strong>what actions</strong> the user is allowed to perform. This answers the question: <strong>“Do you have permission to do this?”</strong></p><h3>Authorization Methods</h3><ul><li><strong>Role-Based Access Control (RBAC)</strong> — The most commonly used method, defining user permissions with <strong>Roles</strong> and <strong>RoleBindings</strong>.</li><li><strong>Attribute-Based Access Control (ABAC)</strong> — Uses attributes (e.g., labels) for fine-grained permissions.</li><li><strong>Webhook Authorization</strong> — Calls an external service to validate permissions.</li></ul><h3>Example: Role-Based Access Control (RBAC)</h3><p>Suppose a developer, Maha, wants to create a pod in the dev namespace. Kubernetes will:</p><ol><li>Check if Mahais <strong>authenticated</strong>.</li><li>Check if Maha has an RBAC <strong>RoleBinding</strong> allowing her to create pods in dev.</li><li>If Maha has the correct role, Kubernetes <strong>approves</strong> the request.</li><li>If Maha lacks the required role, Kubernetes <strong>denies</strong> the request.</li></ol><h4>RBAC Example YAML</h4><pre>apiVersion: rbac.authorization.k8s.io/v1<br>kind: Role<br>metadata:<br>  namespace: dev<br>  name: pod-creator<br>rules:<br>- apiGroups: [&quot;&quot;]<br>  resources: [&quot;pods&quot;]<br>  verbs: [&quot;create&quot;]<br>---<br>apiVersion: rbac.authorization.k8s.io/v1<br>kind: RoleBinding<br>metadata:<br>  namespace: dev<br>  name: maha-pod-creator<br>subjects:<br>- kind: User<br>  name: maha<br>  apiGroup: rbac.authorization.k8s.io<br>roleRef:<br>  kind: Role<br>  name: pod-creator<br>  apiGroup: rbac.authorization.k8s.io</pre><p>If Mahatries to create a pod in the prod namespace, Kubernetes will reject the request.</p><h3>3. Admission Controllers in Kubernetes</h3><h3>What is an Admission Controller?</h3><p>Admission Controllers perform an additional layer of validation <strong>before</strong> a request is executed. They check compliance policies, security constraints, and best practices.</p><h3>Types of Admission Controllers</h3><ul><li><strong>Validating Admission Controllers</strong> — Block invalid requests (e.g., ensuring security policies are met).</li><li><strong>Mutating Admission Controllers</strong> — Modify requests before they are accepted (e.g., adding default labels).</li></ul><h3>Example: Preventing Pods from Using the latest Image Tag</h3><p>To ensure deployments are stable, we want to prevent developers from using latest as an image tag.</p><h4>PodSecurityPolicy Admission Controller YAML</h4><pre>apiVersion: policy/v1beta1<br>kind: PodSecurityPolicy<br>metadata:<br>  name: prevent-latest-tag<br>spec:<br>  allowedHostPaths: []<br>  requiredDropCapabilities:<br>  - ALL<br>  forbiddenSysctls:<br>  - &quot;*&quot;<br>  rules:<br>  - field: spec.containers[*].image<br>    operation: NotEquals<br>    value: latest</pre><h3>Flow of Admission Control</h3><ol><li>A developer submits a kubectl apply -f pod.yaml request.</li><li>Authentication ✅ (User is verified).</li><li>Authorization ✅ (User has the required role).</li><li>Admission Controller ❌ (Policy blocks the latest image tag).</li><li>🚫 Kubernetes rejects the request.</li></ol><h3>Bringing It All Together: A Real-Life Analogy</h3><p>Imagine Kubernetes as a <strong>high-security office building</strong> where people must pass through multiple checkpoints:</p><ol><li><strong>Authentication (ID Check at the Entrance)</strong> 🚪</li></ol><ul><li>The security guard checks your ID to confirm who you are.</li><li>If you don’t have an ID, you’re not allowed in.</li></ul><p><strong>2. Authorization (Permission to Access Specific Areas)</strong> 🏢</p><ul><li>Even if you have an ID, security checks <strong>if you have permission</strong> to enter certain rooms.</li><li>Example: A regular employee can enter the work area but <strong>cannot access the server room</strong>.</li></ul><p><strong>3. Admission Controller (Security Policy Checks Inside the Building)</strong> 🔒</p><ul><li>Once inside, additional security rules apply.</li><li>Example: Even authorized employees cannot bring USB devices into the server room (enforcing security policies).</li></ul><p>🔹 <strong>If all checks pass, you’re allowed in and can do your work.</strong> 🔹 <strong>If any check fails, access is denied.</strong></p><h3>Conclusion</h3><p>Securing a Kubernetes cluster requires multiple layers of protection:</p><ul><li><strong>Authentication</strong> confirms identity.</li><li><strong>Authorization</strong> ensures correct permissions.</li><li><strong>Admission Controllers</strong> enforce security policies.</li></ul><p>By properly configuring these mechanisms, organizations can <strong>prevent unauthorized access, enforce compliance, and improve Kubernetes security</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a4554bd7c6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding kubectl create, kubectl apply, kubectl replace, and kubectl replace --force in…]]></title>
            <link>https://medium.com/@lingeshcbz/understanding-kubectl-create-kubectl-apply-kubectl-replace-and-kubectl-replace-force-in-f5a0735b1e6e?source=rss-7f0d447b5ae1------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5a0735b1e6e</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cka]]></category>
            <category><![CDATA[ckad-exam]]></category>
            <category><![CDATA[sre]]></category>
            <dc:creator><![CDATA[Mahalingam SRE]]></dc:creator>
            <pubDate>Sat, 15 Mar 2025 07:12:10 GMT</pubDate>
            <atom:updated>2025-03-15T07:12:10.902Z</atom:updated>
            <content:encoded><![CDATA[<h3>Understanding kubectl create, kubectl apply, kubectl replace, and kubectl replace --force in Kubernetes</h3><p>Managing resources in Kubernetes efficiently requires understanding different kubectl commands. Often, users get confused between kubectl create, kubectl apply, kubectl replace, and kubectl replace --force. In this blog, we&#39;ll break down each command with use cases, practical examples, and best practices.</p><h3>1. kubectl create - Create a Resource (Fails if Exists)</h3><h3>Description:</h3><ul><li>kubectl create is used to <strong>create new resources</strong> in Kubernetes.</li><li>If the resource <strong>already exists</strong>, the command <strong>fails with an error</strong>.</li><li>It is an <strong>imperative</strong> approach, meaning you specify exactly what should be created.</li></ul><h3>Use Case:</h3><p>✅ When you want to <strong>ensure a new resource is created</strong> without modifying existing ones.</p><h3>Example:</h3><pre>kubectl create -f pod.yaml</pre><p>🔹 <strong>If </strong><strong>pod.yaml defines a Pod named </strong><strong>my-pod, it will be created.</strong></p><h3>What Happens If the Resource Exists?</h3><pre>Error from server (AlreadyExists): pods &quot;my-pod&quot; already exists</pre><p><strong>Solution:</strong> Use kubectl apply instead of create if you expect updates.</p><h3>2. kubectl apply - Create or Update Incrementally (Declarative Approach)</h3><h3>Description:</h3><ul><li>kubectl apply <strong>creates or updates</strong> a resource <strong>incrementally</strong>.</li><li>It merges the changes without overriding fields <strong>not specified in the new YAML</strong>.</li><li>It <strong>does not remove extra fields added dynamically by Kubernetes or users</strong>.</li><li>Ideal for <strong>GitOps, Terraform, and Infrastructure as Code (IaC) workflows</strong>.</li></ul><h3>Use Case:</h3><p>✅ When managing Kubernetes resources declaratively with incremental updates. ✅ When multiple tools/users modify the resource, and you don’t want to override their changes.</p><h3>Example:</h3><pre>kubectl apply -f deployment.yaml</pre><p>🔹 <strong>If the Deployment doesn’t exist, it will be created.</strong> 🔹 <strong>If the Deployment exists, only the changed fields are updated.</strong></p><h3>Example Scenario:</h3><p>1️⃣ You deploy a Pod with kubectl apply -f pod.yaml:</p><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: my-pod<br>  labels:<br>    app: frontend<br>spec:<br>  containers:<br>    - name: nginx<br>      image: nginx:1.21</pre><p>2️⃣ Someone manually adds a label:</p><pre>kubectl label pod my-pod env=production</pre><p>3️⃣ You update pod.yaml with a new image version:</p><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: my-pod<br>  labels:<br>    app: frontend<br>spec:<br>  containers:<br>    - name: nginx<br>      image: nginx:1.22</pre><p>4️⃣ Running kubectl apply -f pod.yaml <strong>updates the image but keeps the manually added label (</strong><strong>env=production)</strong>.</p><h3>3. kubectl replace - Fully Overwrite a Resource (Imperative Approach)</h3><h3>Description:</h3><ul><li>kubectl replace <strong>overwrites the entire resource</strong>.</li><li>It removes fields that <strong>are not present in the new YAML</strong>.</li><li>If the resource <strong>does not exist, it fails</strong>.</li></ul><h3>Use Case:</h3><p>✅ When you want to <strong>fully reset a resource</strong> to match exactly what is in your YAML. ✅ When kubectl apply doesn’t work due to field restrictions (e.g., changing spec.selector).</p><h3>Example:</h3><pre>kubectl replace -f pod.yaml</pre><p>🔹 <strong>If </strong><strong>my-pod exists, it will be fully replaced with the new YAML.</strong> 🔹 <strong>If </strong><strong>my-pod does not exist, it fails.</strong></p><h3>Key Difference from kubectl apply:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UypJoW5WGREwrmd-7xx56g.png" /></figure><h3>4. kubectl replace --force - Delete &amp; Recreate a Resource</h3><h3>Description:</h3><ul><li>Equivalent to:</li></ul><pre>kubectl delete -f resource.yaml --force --grace-period=0 <br>kubectl apply -f resource.yaml</pre><ul><li><strong>Deletes and recreates the resource</strong>.</li><li>Useful when <strong>modifying immutable fields</strong> (e.g., spec.selector in a Service or Deployment).</li><li><strong>Resets all dynamically added metadata (UID, resourceVersion, etc.).</strong></li></ul><h3>Use Case:</h3><p>✅ When you need to modify <strong>immutable fields</strong>. <br>✅ When a resource is in a broken state and needs to be forcefully recreated.</p><h3>Example:</h3><pre>kubectl replace --force -f pod.yaml</pre><p>🔹 <strong>Deletes </strong><strong>my-pod and creates a new one with a fresh UID.</strong> 🔹 <strong>Any dynamically added metadata or manual changes are lost.</strong></p><h3>Final Comparison Table</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SC6EZejlyn4CwrYMhoLc1Q.png" /></figure><h3>Best Practices for Choosing the Right Command</h3><p>✅CommandCreating a new resourcekubectl create or kubectl apply</p><p>✅Applying changes incrementally (GitOps/Terraform)kubectl apply</p><p>✅Overwriting an existing resource completelykubectl replace</p><p>✅Modifying immutable fields or force recreationkubectl replace --force</p><h3>Conclusion</h3><p>Understanding kubectl create, kubectl apply, kubectl replace, and kubectl replace --force helps in managing Kubernetes resources effectively. While kubectl apply is ideal for declarative management, kubectl replace is useful when full replacement is necessary. Use kubectl replace --force only when absolutely needed to avoid unnecessary disruptions.</p><p>🚀 <strong>Which command do you use the most? Share your thoughts in the comments!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5a0735b1e6e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Namespaces: A Complete Guide]]></title>
            <link>https://medium.com/@lingeshcbz/kubernetes-namespaces-a-complete-guide-3be567dfa93a?source=rss-7f0d447b5ae1------2</link>
            <guid isPermaLink="false">https://medium.com/p/3be567dfa93a</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cka-exam]]></category>
            <category><![CDATA[sre]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes-cluster]]></category>
            <dc:creator><![CDATA[Mahalingam SRE]]></dc:creator>
            <pubDate>Sat, 15 Mar 2025 06:24:15 GMT</pubDate>
            <atom:updated>2025-03-15T06:24:15.272Z</atom:updated>
            <content:encoded><![CDATA[<h3>kubeKubernetes Namespaces: A Complete Guide</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cb0eweIeX8nTD_WRu_Gh6g.png" /></figure><h3>Introduction</h3><p>Kubernetes is designed to manage containerized applications efficiently at scale. When multiple teams, projects, or applications share a single Kubernetes cluster, <strong>Namespaces (NS)</strong> provide a way to logically separate resources, ensuring isolation and better organization.</p><p>In this article, we will explore everything about Kubernetes namespaces, including their associated commands, best practices, how they work with DNS, resource quotas, and more.</p><h3>What is a Kubernetes Namespace?</h3><p>A <strong>Namespace</strong> is a virtual cluster within a physical Kubernetes cluster that helps organize and manage resources effectively. Namespaces allow different teams or applications to share the same cluster while ensuring resource isolation.</p><p>For example, you can create separate namespaces for development, staging, and production environments within the same cluster.</p><h3>Why Use Namespaces?</h3><ul><li><strong>Resource isolation</strong>: Prevents conflicts between different teams and applications.</li><li><strong>Access control</strong>: Helps apply <strong>RBAC (Role-Based Access Control)</strong> to restrict user permissions.</li><li><strong>Resource management</strong>: Allows setting limits via <strong>ResourceQuotas</strong>.</li><li><strong>Environment separation</strong>: Helps differentiate between dev, staging, and prod environments.</li></ul><h3>Default Namespaces in Kubernetes &amp; Their Uses</h3><p>Kubernetes comes with <strong>4 built-in namespaces</strong>:</p><p>default<br>Kubernetes includes this namespace so that you can start using your new cluster without first creating a namespace.</p><p>kube-node-lease<br>This namespace holds <a href="https://kubernetes.io/docs/concepts/architecture/leases/">Lease</a> objects associated with each node. Node leases allow the kubelet to send <a href="https://kubernetes.io/docs/concepts/architecture/nodes/#node-heartbeats">heartbeats</a> so that the control plane can detect node failure.</p><p>kube-public<br>This namespace is readable by <em>all</em> clients (including those not authenticated). This namespace is mostly reserved for cluster usage, in case that some resources should be visible and readable publicly throughout the whole cluster. The public aspect of this namespace is only a convention, not a requirement.</p><p>kube-system<br>The namespace for objects created by the Kubernetes system.</p><h3>Note:</h3><p>🚨 <em>Avoid creating namespaces with the prefix </em><em>kube-, since it is reserved for Kubernetes system namespaces.</em></p><h3>Working with Namespaces in Kubernetes</h3><h3>1️⃣ List Available Namespaces</h3><pre>kubectl get namespaces or kubectl get ns</pre><p>Example output:</p><pre>NAME              STATUS   AGE<br>default           Active   10d<br>kube-system       Active   10d<br>kube-public       Active   10d<br>kube-node-lease   Active   10d</pre><h3>2️⃣ Create a New Namespace</h3><h4>Method 1: Using kubectl</h4><pre>kubectl create namespace my-namespace</pre><h4>Method 2: Using a YAML Manifest</h4><pre>apiVersion: v1<br>kind: Namespace<br>metadata:<br>  name: my-namespace</pre><p>Apply the manifest:</p><pre>kubectl apply -f namespace.yaml</pre><h3>3️⃣ Deploy Resources into a Specific Namespace</h3><p>To deploy resources in a specific namespace, define it in the YAML manifest:</p><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: my-pod<br>  namespace: my-namespace<br>spec:<br>  containers:<br>    - name: my-container<br>      image: nginx</pre><p>Apply it:</p><pre>kubectl apply -f pod.yaml</pre><h3>4️⃣ View Resources in a Namespace</h3><pre>kubectl get pods -n my-namespace</pre><h3>5️⃣ Delete a Namespace</h3><pre>kubectl delete namespace my-namespace</pre><p>🚨 <strong>Warning:</strong> Deleting a namespace <strong>removes all resources</strong> within it.</p><h3>Setting a Namespace as Default</h3><p>By default, Kubernetes uses the default namespace. To change the default namespace for your kubectl context:</p><pre>kubectl config set-context --current --namespace=my-namespace</pre><p>Now, all commands will automatically apply to my-namespace.</p><p>To check the current namespace:</p><pre>kubectl config view --minify | grep namespace</pre><h3>Switching Between Clusters &amp; Namespaces</h3><p>If you are working with multiple clusters, you may need to switch between them:</p><h3>List All Contexts (Clusters &amp; Namespaces)</h3><pre>kubectl config get-contexts</pre><h3>Switch to a Specific Cluster</h3><pre>kubectl config use-context my-cluster</pre><h3>Switch Namespace for the Current Context</h3><pre>kubectl config set-context --current --namespace=my-namespace</pre><h3>Namespaces &amp; Resource Quotas</h3><p>Namespaces allow enforcing resource limits via <strong>ResourceQuotas</strong> to prevent excessive consumption.</p><h3>Example: Setting a Resource Quota</h3><pre>apiVersion: v1<br>kind: ResourceQuota<br>metadata:<br>  name: namespace-quota<br>  namespace: my-namespace<br>spec:<br>  hard:<br>    pods: &quot;10&quot;<br>    requests.cpu: &quot;4&quot;<br>    requests.memory: &quot;4Gi&quot;<br>    limits.cpu: &quot;8&quot;<br>    limits.memory: &quot;8Gi&quot;</pre><p>Apply it:</p><pre>kubectl apply -f resource-quota.yaml</pre><p>To check applied quotas:</p><pre>kubectl get resourcequotas -n my-namespace</pre><h3>Namespaces and DNS in Kubernetes</h3><p>Each Kubernetes <strong>Service</strong> is assigned a DNS name based on its namespace.</p><h3>How Kubernetes DNS Works with Namespaces</h3><ul><li>A Service in the default namespace is accessible as my-service.</li><li>A Service in my-namespace is accessible as:</li></ul><pre>my-service.my-namespace.svc.cluster.local</pre><h3>Example: Inter-Service Communication</h3><p>Assume we have a backend Service (backend-service) in the backend namespace:</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: backend-service<br>  namespace: backend<br>spec:<br>  ports:<br>    - port: 80</pre><p>A frontend Pod in another namespace can communicate using:</p><pre>curl http://backend-service.backend.svc.cluster.local</pre><h3>How to Resolve DNS Inside a Pod</h3><p>Run this inside a Pod to check DNS resolution:</p><pre>nslookup backend-service.backend.svc.cluster.local</pre><h3>Best Practices for Using Namespaces</h3><p>✅ <strong>Use namespaces to separate environments</strong> (e.g., dev, staging, prod). ✅ <strong>Apply ResourceQuotas to prevent overuse of cluster resources.<br></strong> ✅ <strong>Use RBAC to enforce access control per namespace.<br></strong> ✅ <strong>Avoid using the </strong><strong>default namespace for production workloads.<br></strong> ✅ <strong>Use fully qualified domain names (FQDN) for cross-namespace communication.<br></strong> ✅ <strong>Do not create namespaces with </strong><strong>kube- prefix (reserved for system use).</strong></p><h3>Conclusion</h3><p>Kubernetes Namespaces provide a powerful way to <strong>organize, isolate, and manage</strong> resources in a cluster. Whether you are working with multiple teams, different environments, or setting up resource quotas, <strong>Namespaces are essential for maintaining order in a Kubernetes cluster</strong>.</p><p>Please feel free to share your thoughts in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3be567dfa93a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>