<?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 Abhishek Panda on Medium]]></title>
        <description><![CDATA[Stories by Abhishek Panda on Medium]]></description>
        <link>https://medium.com/@abhishek.panda0620?source=rss-419ed15e35f4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*rvFqiXd-B8wFQNsz</url>
            <title>Stories by Abhishek Panda on Medium</title>
            <link>https://medium.com/@abhishek.panda0620?source=rss-419ed15e35f4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 13:23:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abhishek.panda0620/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[Logical Ports and App Assignments]]></title>
            <link>https://medium.com/@abhishek.panda0620/logical-ports-and-app-assignments-92fb66648a8c?source=rss-419ed15e35f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/92fb66648a8c</guid>
            <category><![CDATA[logical-port]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Abhishek Panda]]></dc:creator>
            <pubDate>Tue, 02 Jun 2026 11:05:40 GMT</pubDate>
            <atom:updated>2026-06-02T11:05:40.003Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4dVokD-353XIlIj4gn2g6g.png" /></figure><h3>Your app is not “running on localhost.”</h3><p>It is running on a specific port.</p><p>That single number decides where network traffic goes inside the operating system.</p><p>Miss it, hardcode it incorrectly, or collide with another process, and your application fails immediately.</p><p>Most developers first notice ports after seeing this:</p><pre>Error: listen EADDRINUSE: address already in use :::3000</pre><p>That error is not random.</p><p>It means another process already owns that port.</p><p>To understand why this happens, you need to understand how logical ports actually work.</p><h3>What a Logical Port Actually Is</h3><p>A logical port is a 16-bit integer ranging from:</p><pre>0 → 65535</pre><p>TCP and UDP use these numbers to route network traffic to the correct application process.</p><p>Without ports, your operating system could not tell the difference between:</p><ul><li>a browser request</li><li>a PostgreSQL connection</li><li>an SSH session</li><li>a backend API request</li></ul><p>Every network application binds itself to a port.</p><p>Example:</p><pre>app.listen(3000)</pre><p>This tells the OS:</p><blockquote><em>Send incoming traffic for port </em><em>3000 to this process.</em></blockquote><p>That is the entire mechanism behind local servers, APIs, databases, and web apps.</p><p>Ports are software-level identifiers. They are not physical connectors.</p><h3>Why Multiple Apps Can Run on the Same Machine</h3><p>A single machine can run:</p><ul><li>Nginx</li><li>PostgreSQL</li><li>Redis</li><li>Docker</li><li>VS Code live server</li><li>Node.js APIs</li></ul><p>all at the same time because each service uses a different port.</p><p>Example:</p><blockquote>HTTP:80</blockquote><blockquote>HTTPS:443</blockquote><blockquote>SSH:22</blockquote><blockquote>PostgreSQL:5432</blockquote><blockquote>Redis:6379</blockquote><p>The kernel maps traffic using:</p><ul><li>IP address</li><li>port number</li><li>transport protocol</li></ul><p>That combination uniquely identifies the connection.</p><h3>The 3 Port Ranges You Actually Need to Know</h3><p>Not all ports are treated equally.</p><p>The Internet Assigned Numbers Authority (IANA) divides them into 3 ranges.</p><p>RangeNameUsage0–1023System PortsReserved OS services1024–49151Registered PortsApplication servers49152–65535Ephemeral PortsTemporary outbound traffic</p><h3>1. System Ports (0–1023)</h3><p>These ports are reserved for core infrastructure services.</p><p>Examples:</p><blockquote>22:SSH</blockquote><blockquote>53:DNS</blockquote><blockquote>80:HTTP</blockquote><blockquote>443:HTTPS</blockquote><p>Linux and macOS block normal users from binding to these ports.</p><p>Try this:</p><pre>app.listen(80)</pre><p>You will probably get:</p><pre>EACCES: permission denied</pre><p>Why?</p><p>Because low-numbered ports are considered privileged.</p><p>Historically, only trusted system services were allowed to use them.</p><h3>The Hidden Problem With the 1000–2000 Range</h3><p>Many enterprise environments aggressively restrict ports in this range.</p><p>Reason:</p><p>Legacy software.</p><p>Corporate firewalls often inspect or block these automatically.</p><p>Using random ports in this range for internal tooling can create networking issues that are extremely annoying to debug.</p><h3>2. Registered Ports (1024–49151)</h3><p>This is where most developer applications live.</p><p>Examples:</p><p>Port | CommonUsage</p><p>3000 | Node.js</p><p>5000 | Flask</p><p>5432 | PostgreSQL</p><p>6379 | Redis</p><p>8080 |Alternate HTTP</p><p>This range avoids admin permission issues while remaining stable for long-running applications.</p><p>But there is a problem.</p><p>Everyone uses the same defaults.</p><p>That is why these conflicts happen constantly:</p><pre>EADDRINUSE :::3000</pre><p>or:</p><pre>Port 5432 already in use</pre><p>Common collision ports:</p><ul><li>3000</li><li>5432</li><li>6379</li><li>8080</li></ul><p>If Docker, PostgreSQL, Redis, or another local server is already running, your app fails to start.</p><h3>3. Ephemeral Ports (49152–65535)</h3><p>These are temporary ports assigned automatically by the OS.</p><p>You rarely interact with them directly.</p><p>Example:</p><pre>curl https://example.com</pre><p>Your machine may create a connection like:</p><pre>192.168.1.5:53144 → example.com:443</pre><p>What happened here:</p><ul><li>443 is the server port</li><li>53144 is a temporary client port</li></ul><p>The OS dynamically allocates that temporary port for the outbound connection.</p><p>Once the connection closes, the port gets released back into the pool.</p><p>This is how your browser can open dozens of tabs simultaneously without collisions.</p><h3>Understanding EADDRINUSE</h3><p>This is one of the most common networking errors developers hit.</p><pre>EADDRINUSE</pre><p>Meaning:</p><blockquote><em>Another process already owns that port.</em></blockquote><p>Typical causes:</p><ul><li>a crashed dev server still running</li><li>duplicate Node.js processes</li><li>Docker containers still alive</li><li>PostgreSQL already running</li><li>hot reload failures</li></ul><h3>Find the Process Blocking the Port</h3><h3>Linux/macOS</h3><pre>lsof -i :3000</pre><p>Example:</p><pre>node   4128 user   TCP *:3000 (LISTEN)</pre><p>Kill it:</p><pre>kill -9 4128</pre><h3>Windows</h3><pre>netstat -ano | findstr :3000</pre><p>Terminate it:</p><pre>taskkill /PID 4128 /F</pre><h3>Why Hardcoding Ports Is a Production Mistake</h3><p>This is fine for tutorials:</p><pre>app.listen(3000)</pre><p>It is bad practice in production systems.</p><p>Use environment variables instead:</p><pre>app.listen(process.env.PORT)</pre><p>Or:</p><pre>const port = process.env.PORT || 3000<br>app.listen(port)</pre><p>This single change prevents deployment failures across cloud platforms and containers.</p><h3>Why Environment-Based Ports Matter</h3><h3>Cloud Platforms Assign Ports Dynamically</h3><p>Platforms like:</p><ul><li>Heroku</li><li>Railway</li><li>Render</li></ul><p>inject ports automatically.</p><p>Hardcoded ports break deployments instantly.</p><h3>Docker Separates Internal and External Ports</h3><p>Example:</p><pre>docker run -p 8080:3000 app</pre><p>Meaning:</p><p>Host | Container</p><p>8080 | 3000</p><p>Inside the container, the app still runs on 3000.</p><p>Outside, users access 8080.</p><p>Hardcoding assumptions about external ports causes broken routing and failed deployments.</p><h3>Scaling Requires Flexible Ports</h3><p>Production systems rarely run a single app instance.</p><p>Schedulers like:</p><ul><li>Kubernetes</li><li>ECS</li><li>Nomad</li></ul><p>spin up multiple replicas dynamically.</p><p>Port assignment becomes infrastructure-controlled.</p><p>Your application should adapt automatically.</p><h3>Final Takeaway</h3><p>Ports are not a minor networking detail.</p><p>They are the routing layer between your application and the operating system.</p><p>Understanding:</p><ul><li>privileged ports</li><li>application port ranges</li><li>ephemeral ports</li><li>port conflicts</li><li>environment-based assignment</li></ul><p>makes debugging dramatically easier.</p><p>Especially when working with:</p><ul><li>Docker</li><li>Kubernetes</li><li>APIs</li><li>reverse proxies</li><li>databases</li><li>cloud deployments</li></ul><p>The difference between a smooth deployment and a broken production rollout is often just one occupied port.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92fb66648a8c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Cache Invalidation Is Harder Than Caching: The Best Caching Strategy for Real Systems]]></title>
            <link>https://medium.com/@abhishek.panda0620/why-cache-invalidation-is-harder-than-caching-the-best-caching-strategy-for-real-systems-93d5e673a2c9?source=rss-419ed15e35f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/93d5e673a2c9</guid>
            <category><![CDATA[backend-engineering]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[caching-strategies]]></category>
            <dc:creator><![CDATA[Abhishek Panda]]></dc:creator>
            <pubDate>Tue, 28 Apr 2026 04:46:34 GMT</pubDate>
            <atom:updated>2026-04-28T04:46:34.450Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8-OpmBl-S2kzoeEd40JU4w.png" /></figure><p>Your system usually isn’t slow because your database is bad.</p><p>It becomes slow because your application keeps asking the same expensive question repeatedly.</p><p>The same user profile. The same dashboard summary. The same permission check. The same analytics report.</p><p>At small scale, this feels harmless.</p><p>At production scale, it becomes expensive.</p><p>That is where caching enters.</p><p>Most engineers learn caching early. Very few learn cache invalidation properly.</p><p>And that is where real production issues begin.</p><h3>The Real Problem</h3><p>Imagine a simple function that fetches a user from the database:</p><pre>def get_user(user_id):<br>    return db.query(f&quot;SELECT * FROM users WHERE id = {user_id}&quot;)</pre><p>This works.</p><p>Until it runs thousands of times per minute.</p><p>Now your database becomes the bottleneck.</p><p>This is common in:</p><ul><li>user profile lookups</li><li>permissions and role checks</li><li>dashboard widgets</li><li>reports and analytics</li><li>third-party API responses</li><li>configuration-heavy systems</li></ul><p>The database is answering the same question repeatedly.</p><p>That is not a database problem. That is an architecture problem.</p><h3>The Best Default Strategy: Cache-Aside Pattern</h3><p>The most practical caching strategy for most systems is <strong>Cache-Aside</strong> (also called Lazy Loading).</p><p>The flow is simple:</p><ol><li>Check cache first</li><li>If cache miss → fetch from database</li><li>Store result in cache</li><li>Return response</li></ol><p>Example using Python and Redis:</p><pre>import redis<br>import json<br><br>cache = redis.Redis()<br><br><br>def get_user(user_id):<br>    key = f&quot;user:{user_id}&quot;<br><br>    cached = cache.get(key)<br>    if cached:<br>        return json.loads(cached)<br><br>    user = db.fetch_user(user_id)<br><br>    cache.setex(<br>        key,<br>        3600,<br>        json.dumps(user)<br>    )<br><br>    return user</pre><p>This gives you:</p><ul><li>faster reads</li><li>reduced database load</li><li>better scalability</li><li>simpler architecture</li></ul><p>This is usually the best default choice.</p><p>But this is only half the story.</p><h3>Why Cache Invalidation Is Hard</h3><p>Let’s say the user updates their profile.</p><pre>def update_user(user_id, new_data):<br>    db.update_user(user_id, new_data)</pre><p>Now the database is correct.</p><p>But the cache still contains old data.</p><p>That means users may see stale information.</p><p>The common fix is:</p><pre>cache.delete(f&quot;user:{user_id}&quot;)</pre><p><strong>This works… until it doesn’t.</strong></p><p>Problems start appearing:</p><ul><li>someone forgets to delete cache in another update path</li><li>race conditions cause stale reads</li><li>deployment changes leave old cache behind</li><li>multiple services invalidate inconsistently</li></ul><p>This is why engineers say:</p><blockquote>There are only two hard things in Computer Science: cache invalidation and naming things.</blockquote><p>The real challenge is not caching.</p><p>It is invalidating safely.</p><h3>A Better Strategy: Versioned Cache Invalidation</h3><p>Instead of deleting cache keys manually, use <strong>versioned cache keys</strong>.</p><p>The idea is simple:</p><p>Instead of: <strong><em>user:42</em></strong></p><p>Use: <strong><em>user:v3:42</em></strong></p><p>When data changes, increment the version.</p><p>Example</p><pre>def get_user(user_id):<br>    version = cache.get(f&quot;user_version:{user_id}&quot;) or 1<br>    key = f&quot;user:v{version}:{user_id}&quot;<br><br>    cached = cache.get(key)<br>    if cached:<br>        return json.loads(cached)<br><br>    user = db.fetch_user(user_id)<br><br>    cache.setex(<br>        key,<br>        3600,<br>        json.dumps(user)<br>    )<br><br>    return user</pre><p>Invalidation becomes:</p><pre>def update_user(user_id, new_data):<br>    db.update_user(user_id, new_data)<br>    cache.incr(f&quot;user_version:{user_id}&quot;)</pre><p>No delete. No race condition. No hunting for forgotten invalidation paths.</p><p>Old cache becomes naturally stale.</p><p>This is significantly safer in real production systems.</p><p>Especially during:</p><ul><li>deployments</li><li>distributed systems</li><li>high traffic APIs</li><li>permission-heavy applications</li><li>dashboard-heavy platforms</li></ul><p>This is where caching becomes engineering — not just optimization.</p><h3>Preventing Cache Stampede</h3><p>Another production issue appears when the cache expires.</p><p>Imagine 500 requests arriving at the same moment.</p><p>The cache has just expired.</p><p>All 500 requests hit the database.</p><p>This is called a <strong>cache stampede</strong>.</p><p>It can cause sudden traffic spikes and database overload.</p><p>Solutions include:</p><ul><li>distributed locking</li><li>stale-while-revalidate</li><li>refresh-ahead strategies</li><li>background cache warming</li></ul><p>For hot data like dashboards and reports, this matters a lot.</p><p>Caching is not just about speed. It is about protecting your system under failure.</p><h3><strong>What Not To Do</strong></h3><p>Avoid these common mistakes:</p><h4>1. Blind cache.delete() everywhere</h4><p>This creates fragile systems.</p><h4>2. Infinite TTL</h4><p>This creates permanent stale data.</p><h4>3. Caching everything</h4><p>Not everything should be cached. Cache expensive reads, not every read.</p><h4>4. Treating cache as the source of truth</h4><p>Your database should remain the source of truth for critical systems.</p><p>Especially for:</p><ul><li>payments</li><li>inventory</li><li>financial transactions</li><li>compliance-heavy systems</li></ul><h3>The Best Production Strategy</h3><p>For most backend systems, the strongest practical approach is:</p><h4>Cache-Aside + TTL + Versioned Invalidation</h4><p>This gives the best balance of:</p><ul><li>performance</li><li>consistency</li><li>deployment safety</li><li>scale</li><li>operational simplicity</li></ul><p>It works well with Redis, Laravel, Python services, microservices, and enterprise APIs.</p><p>This is the strategy many teams eventually arrive at after learning the hard way.</p><h3>Final Thought</h3><p>Caching is easy.</p><p>Cache invalidation is architecture.</p><p>The best caching strategy is not the fastest one.</p><p>It is the safest one during failure, deployment, and scale.</p><p>That is what production engineering is really about.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93d5e673a2c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Control Your AWS EC2 Instance from Slack with a Slash Command]]></title>
            <link>https://awstip.com/control-your-aws-ec2-instance-from-slack-with-a-slash-command-a08dce0106c5?source=rss-419ed15e35f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/a08dce0106c5</guid>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[scrip]]></category>
            <category><![CDATA[slack]]></category>
            <dc:creator><![CDATA[Abhishek Panda]]></dc:creator>
            <pubDate>Wed, 22 Apr 2026 07:00:29 GMT</pubDate>
            <atom:updated>2026-04-23T13:10:32.808Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Stop SSH-ing into a bastion just to start your dev box. One `/ec2 start` from Slack and you’re done.</em></p><blockquote>Ever found yourself opening the AWS console just to start or stop a dev EC2 instance? Or worse — leaving it running overnight because you forgot to shut it down? I built a small Slack slash command that lets me type `/ec2 start`, `/ec2 stop`, or `/ec2 status` directly from Slack and have it act on my instance instantly.</blockquote><p>In this post I’ll walk you through building the same thing from scratch — no API Gateway, no third-party bots, just a single Lambda function behind a Function URL with proper Slack signature verification.</p><p><strong>What We’re Building</strong></p><pre>/ec2 start<br>    │<br>    ▼<br>Slack → Lambda Function URL → Lambda (Python) → EC2 API</pre><p>Three slash commands:</p><p>- `/ec2 status` — shows current instance state with an emoji</p><p>- `/ec2 start` — starts the instance (state-aware, won’t re-start if already running)</p><p>- `/ec2 stop` — stops the instance (state-aware, won’t re-stop if already stopped)</p><p>Here’s what it looks like in Slack:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TFFLnBMQDq19bglnYYT6hA.png" /></figure><h4><strong>Why Lambda Function URL Instead of API Gateway?</strong></h4><p>API Gateway costs ~$3.50/million requests. Lambda Function URLs are free. For a personal dev tool that gets hit a few times a day, Function URLs are the right call. The only trade-off is that Slack authentication has to be handled in code — but we’d want to do that anyway</p><p><strong>Prerequisites</strong></p><p>- AWS account with permissions to create Lambda functions, IAM roles, and EC2 actions</p><p>- An EC2 instance already running (we’re just controlling it, not creating it)</p><p>- A Slack workspace where you can install apps</p><p><strong>Step 1: Create the Slack App</strong></p><p>1. Go to [https://api.slack.com/apps](https://api.slack.com/apps) → <strong>**Create New App**</strong> → <strong>**From scratch**</strong></p><p>2. Give it a name (e.g. <em>*EC2 Control*</em>) and pick your workspace</p><p>3. Go to <strong>**Basic Information**</strong> → <strong>**App Credentials**</strong> → copy the <strong>**Signing Secret**</strong> (not the Verification Token — they look similar but are different things)</p><p>4. Go to <strong>**Slash Commands**</strong> → <strong>**Create New Command**</strong>:</p><p>- <strong>**Command:**</strong> `/ec2`</p><p>- <strong>**Request URL:**</strong> <em>*(we’ll fill this in after deploying Lambda)*</em></p><p>- <strong>**Short Description:**</strong> `Control EC2 instance`</p><p>- <strong>**Usage Hint:**</strong> `start | stop | status`</p><p>5. <strong>**Install App**</strong> → your workspace</p><p>Keep the Signing Secret handy — it goes into Lambda as an environment variable.</p><p><strong>Step 2: Create the Lambda Function</strong></p><p>In the AWS console (or CLI), create a new Lambda function:</p><p>- <strong>**Name:**</strong> `control_ec2_from_slack`</p><p>- <strong>**Runtime:**</strong> Python 3.13+</p><p>- <strong>**Architecture:**</strong> x86_64</p><p>Once created, go to <strong>**Runtime settings**</strong> → <strong>**Edit**</strong> and set the <strong>**Handler**</strong> to:</p><pre>app.lambda_handler</pre><p>This tells Lambda to look for a file named `app/lambda_handler.py` and call the `lambda_handler` function inside it.</p><p><strong>Step 3: Set Environment Variables</strong></p><p>In Lambda → <strong>**Configuration**</strong> → <strong>**Environment variables**</strong>, add:</p><blockquote>`AWS_REGION_NAME` — `us-east-1` <em>*(or your region)*</em></blockquote><blockquote>`INSTANCE_ID` — Your EC2 instance ID</blockquote><blockquote>`SLACK_SIGNING_SECRET` — The signing secret from Step 1</blockquote><blockquote>`ALLOWED_USER_IDS` — Your Slack user ID <em>*(optional but recommended)*</em></blockquote><p>To find your Slack user ID: click your name in Slack → <strong>**View full profile**</strong> → <strong>**⋮**</strong> → <strong>**Copy member ID**</strong></p><p>`AWS_REGION_NAME` is named this way intentionally — `AWS_REGION` is a reserved Lambda runtime variable and cannot be overridden.</p><p><strong>Step 4: IAM — Give Lambda Permission to Control EC2</strong></p><p>Go to your Lambda function’s execution role → <strong>**Add inline policy**</strong> named `EC2ControlDevInstance`:</p><pre>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Sid&quot;: &quot;ControlDevInstance&quot;,<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Action&quot;: [&quot;ec2:StartInstances&quot;, &quot;ec2:StopInstances&quot;],<br>      &quot;Resource&quot;: &quot;arn:aws:ec2:us-east-1:&lt;YOUR_ACCOUNT_ID&gt;:instance/&lt;YOUR_INSTANCE_ID&gt;&quot;<br>    },<br>    {<br>      &quot;Sid&quot;: &quot;DescribeInstancesInRegion&quot;,<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Action&quot;: &quot;ec2:DescribeInstances&quot;,<br>      &quot;Resource&quot;: &quot;*&quot;,<br>      &quot;Condition&quot;: {<br>        &quot;StringEquals&quot;: {&quot;ec2:Region&quot;: &quot;us-east-1&quot;}<br>      }<br>    }<br>  ]<br>}</pre><p>Scope `StartInstances`/`StopInstances` to the specific instance ARN — not `*`. `DescribeInstances` requires `Resource: *` by AWS design, but the condition locks it to your region.</p><p><strong>Step 5: Create a Lambda Function URL</strong></p><p>Go to Lambda → <strong>**Configuration**</strong> → <strong>**Function URL**</strong> → <strong>**Create function URL**</strong>:</p><p>- <strong>**Auth type:**</strong> `NONE` <em>*(Slack auth is handled in code via HMAC)*</em></p><p>This gives you a public HTTPS endpoint. Copy it.</p><p><strong>Step 6: Write and Deploy the Lambda Code</strong></p><p>The full source is on GitHub: <strong>**[github.com/YOUR_USERNAME/slack-based-ec2-control]**</strong></p><p>The handler does five things in order on every request:</p><p><strong>**1. Size guard**</strong> — reject anything over 4 KB (Slack payloads are tiny; anything larger is suspicious)</p><p><strong>**2. Slack signature verification**</strong> — this is the core security check. Slack signs every request with your signing secret using HMAC-SHA256. We verify it with constant-time comparison to prevent timing attacks, and reject requests older than 5 minutes to block replay attacks:</p><pre>def _verify_slack_signature(headers: dict, raw_body: str) -&gt; bool:<br>    ts  = headers.get(&quot;x-slack-request-timestamp&quot;, &quot;&quot;)<br>    sig = headers.get(&quot;x-slack-signature&quot;, &quot;&quot;)<br>    if abs(time.time() - int(ts)) &gt; 300:  # 5-minute window<br>        return False<br>    basestring = f&quot;v0:{ts}:{raw_body}&quot;.encode()<br>    expected   = &quot;v0=&quot; + hmac.new(SIGNING_SECRET, basestring, hashlib.sha256).hexdigest()<br>    return hmac.compare_digest(expected, sig)</pre><p><strong>**3. Allow-list checks**</strong> — if `ALLOWED_USER_IDS` is set, only those users can run the command. Same for team and channel. All fail closed — a misconfigured value blocks rather than allows.</p><p><strong>**4. Command validation**</strong> — strict allow-list of `{start, stop, status}`. Anything else returns a usage hint.</p><p><strong>**5. State-aware EC2 action**</strong> — before calling `start_instances` or `stop_instances`, we check the current state. This avoids confusing AWS errors and gives the user a clear message:</p><p>| State | `/ec2 start` | `/ec2 stop` |</p><p>| `stopped` | ✅ starts it | “already stopped” |</p><p>| `running` | “already running” | ✅ stops it |</p><p>| `pending` | “already starting — wait” | ⚠️ “wait until running” |</p><p>| `stopping` | ⚠️ “wait until stopped” | “already stopping — wait” |</p><p>| `terminated` | ❌ cannot start | ❌ cannot stop |</p><p>Deploy with:</p><pre>zip -j function.zip app/lambda_handler.py<br>aws lambda update-function-code \<br>  --function-name control_ec2_from_slack \<br>  --region us-east-1 \<br>  --zip-file fileb://function.zip</pre><p><strong>Step 7: Connect Slack to Lambda</strong></p><p>Go back to your Slack app → <strong>**Slash Commands**</strong> → edit `/ec2` → paste your Lambda Function URL as the <strong>**Request URL**</strong> → <strong>**Save**</strong>.</p><p><strong>Testing</strong></p><p><strong>**Quick sanity check**</strong> — an unsigned request should return `401`, not `403`:</p><pre>curl -i -X POST &#39;&lt;YOUR_FUNCTION_URL&gt;&#39; \<br>  -H &#39;Content-Type: application/x-www-form-urlencoded&#39; \<br>  -d &#39;text=status&#39;<br># Expected: HTTP/2 401  {&quot;text&quot;: &quot;:x: Unauthorized.&quot;}</pre><p>If you get `403`, re-check the resource policy (Step 5 gotcha). If you get `401`, everything is wired correctly and Slack’s signed requests will pass through.</p><p>Then from Slack:</p><pre>/ec2 status   → 🔴 i-0xxx is stopped<br>/ec2 start    → ✅ Starting i-0xxx (requested by @you)<br>/ec2 status   → ⏳ i-0xxx is pending<br>/ec2 start    → ⏳ i-0xxx is already starting up — please wait.<br>/ec2 status   → 🟢 i-0xxx is running</pre><p>The EC2 console confirms it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z_El39dzXpODHAQv6oT6Xg.png" /></figure><p>And the Lambda function in the AWS console:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pjYfSGkLp2UULecSPSKfZA.png" /></figure><p><strong>Live Tail Logs</strong></p><pre>aws logs tail /aws/lambda/control_ec2_from_slack --follow --since 5m</pre><p>Every action produces a structured audit log line:</p><pre>ec2_action user=user.name user_id=U9662DW0190 channel=C0… action=start instance=i-0xxx</pre><p><strong>What’s Next</strong></p><p>A few things I’m planning to add:</p><p>- <strong>**Auto-stop scheduler**</strong> — a CloudWatch Events rule that stops the instance every night at 8 PM so I can’t forget</p><p>- <strong>**Slack button confirmation for `/ec2 stop`**</strong> — interactive message with a confirm button to avoid fat-fingering</p><p>- <strong>**Multiple instance support**</strong> — `/ec2 start staging`, `/ec2 stop prod`</p><p><strong>Wrapping Up</strong></p><p>The whole thing is ~250 lines of Python with no external dependencies beyond boto3 (which Lambda already includes). The key insight is that Lambda Function URLs give you a free, secure-enough HTTPS endpoint as long as you implement Slack’s HMAC verification yourself — which is straightforward and gives you full control over the auth logic.</p><p>Full source code and setup notes: <a href="https://github.com/abhishekpanda0620/slack-based-ec2-control">https://github.com/abhishekpanda0620/slack-based-ec2-control</a></p><p><em>If this was useful, follow me for more posts on AWS, DevOps tooling, and automation.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a08dce0106c5" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/control-your-aws-ec2-instance-from-slack-with-a-slash-command-a08dce0106c5">Control Your AWS EC2 Instance from Slack with a Slash Command</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Git Advanced for DevOps Engineers: Beyond git commit and git push]]></title>
            <link>https://aws.plainenglish.io/git-advanced-for-devops-engineers-beyond-git-commit-and-git-push-be6e99534b43?source=rss-419ed15e35f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/be6e99534b43</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Abhishek Panda]]></dc:creator>
            <pubDate>Mon, 19 Jan 2026 06:31:33 GMT</pubDate>
            <atom:updated>2026-01-19T06:39:42.250Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ApLHevlsTbYdOMB8XpH4g.png" /></figure><p>If you are working as a DevOps engineer, Git is not just a version control system; it is the backbone of CI/CD, GitOps, collaboration, and incident recovery. Knowing basic Git commands is no longer enough. In this blog, we will go deep into <strong>advanced Git concepts that every DevOps engineer must master</strong>, with real-world use cases.</p><h3>Why DevOps Engineers Need Advanced Git Skills</h3><p>In DevOps, Git is used to:</p><ul><li>Trigger CI/CD pipelines</li><li>Manage infrastructure as code (Terraform, Helm, Kubernetes manifests)</li><li>Implement GitOps workflows</li><li>Perform rollbacks during incidents</li><li>Collaborate safely across multiple teams</li></ul><p>A mistake in Git can:</p><ul><li>Trigger a faulty deployment</li><li>Break production infrastructure</li><li>Lose critical commit history</li></ul><p>That is why <strong>advanced Git knowledge is not optional, it is mandatory</strong>.</p><h3>1. Git Internals (How Git Really Works)</h3><p>Understanding Git internals helps you debug complex issues.</p><h3>Git Objects</h3><p>Git stores everything as objects:</p><ul><li><strong>Blob:</strong> file content</li><li><strong>Tree: </strong>directory structure</li><li><strong>Commit: </strong>snapshot + metadata</li><li><strong>Tag: </strong>reference to a commit</li></ul><pre>git cat-file -t &lt;hash&gt;<br>git cat-file -p &lt;hash&gt;</pre><p>Why this matters for DevOps:</p><ul><li>Recover lost commits</li><li>Understand detached HEAD issues</li><li>Debug corrupted repositories</li></ul><h3>2. Rebase vs Merge (Production-Grade Understanding)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*jECyLZrrKunlHAdJ2N6B6A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*uaw7Xbi3SWn8w3zfRqaOgQ.png" /></figure><h3>Merge</h3><ul><li>Preserves full history</li><li>Creates merge commits</li><li>Safer for shared branches</li></ul><h3>Rebase</h3><ul><li>Creates linear history</li><li>Rewrites commit hashes</li><li>Dangerous on shared branches</li></ul><pre>git rebase main</pre><h4>DevOps Best Practice</h4><ul><li><strong>Use merge for </strong><strong>main / </strong><strong>production branches</strong></li><li><strong>Use rebase for feature branches only</strong></li></ul><h3>3. Interactive Rebase (Clean Commit History)</h3><p>Interactive rebase is extremely powerful.</p><pre>git rebase -i HEAD~5</pre><p>You can:</p><ul><li>Squash commits</li><li>Reword commit messages</li><li>Drop unwanted commits</li></ul><p>Why it matters:</p><ul><li>Clean PRs</li><li>Better audit trails</li><li>Easier rollbacks</li></ul><h3>4. Git Cherry-Pick (Surgical Fixes)</h3><p>Cherry-pick applies a specific commit to another branch.</p><pre>git cherry-pick &lt;commit-hash&gt;</pre><p>DevOps use case:</p><ul><li>Hotfix applied to production without merging entire feature branch</li><li>Backporting fixes to release branches</li></ul><h3>5. Git Reflog (Your Safety Net)</h3><p>Reflog tracks every movement of HEAD.</p><pre>git reflog</pre><p>Why DevOps engineers love reflog:</p><ul><li>Recover deleted branches</li><li>Restore lost commits</li><li>Undo bad rebases</li></ul><pre>git reset --hard HEAD@{2}</pre><h3>6. Git Reset vs Revert (Critical Difference)</h3><h3>Reset</h3><ul><li>Rewrites history</li><li>Dangerous on shared branches</li></ul><pre>git reset --hard HEAD~1</pre><h3>Revert</h3><ul><li>Creates a new commit</li><li>Safe for production</li></ul><pre>git revert &lt;commit-hash&gt;</pre><h3>Rule of Thumb</h3><ul><li><strong>Production branch → revert</strong></li><li><strong>Local mistakes → reset</strong></li></ul><h3>7. Git Bisect (Finding Breaking Commits)</h3><p>Git bisect helps find the exact commit that introduced a bug.</p><pre>git bisect start<br>git bisect bad<br>git bisect good &lt;commit&gt;</pre><p>Why this is gold for DevOps:</p><ul><li>Faster incident root cause analysis</li><li>Identify breaking infra or pipeline changes</li></ul><h3>8. Submodules vs Subtree</h3><h3>Submodules</h3><ul><li>External repo reference</li><li>Requires manual updates</li></ul><pre>git submodule update --init</pre><h3>Subtree</h3><ul><li>Code is copied into main repo</li><li>Easier CI/CD integration</li></ul><h3>DevOps Recommendation</h3><ul><li>Prefer <strong>subtree</strong> for shared pipeline templates</li><li>Use <strong>submodules</strong> only when isolation is required</li></ul><h3>9. Git Hooks (Local Automation)</h3><p>Git hooks allow automation before or after Git actions.</p><p>Examples:</p><ul><li>Pre-commit linting</li><li>Secret scanning</li><li>Commit message validation</li></ul><pre>.git/hooks/pre-commit</pre><p>DevOps use case:</p><ul><li>Prevent secrets from entering Git</li><li>Enforce branch naming rules</li></ul><h3>10. Git for GitOps (Real DevOps Power)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*UKJOUNGRJzqtsB9eeREjAw.png" /></figure><p>In GitOps:</p><ul><li>Git is the <strong>single source of truth</strong></li><li>Every change is auditable</li><li>Rollbacks are Git-based</li></ul><p>Best practices:</p><ul><li>One repo per environment (or strict folder separation)</li><li>Protect main branches</li><li>Mandatory PR reviews</li></ul><h3>11. Advanced Git Aliases (Boost Productivity)</h3><pre>git config --global alias.st status<br>git config --global alias.co checkout<br>git config --global alias.lg &quot;log --oneline --graph --all&quot;</pre><h3>12. A Practical Git Branching Strategy for DevOps Teams</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lKTF7ay94Ls6jbhfen9dfQ.png" /></figure><p>In DevOps environments, a branching strategy must optimize for:</p><ul><li>Safe production deployments</li><li>Fast rollbacks</li><li>Parallel feature development</li><li>Clear audit trails</li></ul><p>A <strong>simple and production-friendly strategy</strong> looks like this:</p><p><strong>Main branches</strong></p><ul><li>main (or production) – always deployable</li><li>develop (optional) – integration branch</li></ul><p><strong>Supporting branches</strong></p><ul><li>feature/* – short-lived feature work</li><li>hotfix/* – urgent production fixes</li><li>release/* – stabilization before major releases (optional)</li></ul><p><strong>Rules that matter in production</strong></p><ul><li>Never force-push to main</li><li>Use PRs with mandatory reviews</li><li>Revert on main, never reset</li><li>Delete feature branches after merge</li></ul><p>This approach works well with:</p><ul><li>CI/CD pipelines</li><li>GitOps workflows</li><li>Infrastructure-as-Code repositories</li></ul><p><strong>Common branching strategies used in DevOps teams:</strong></p><ul><li><strong>Trunk-based development</strong> : Small, frequent commits to main, heavy CI, feature flags</li><li><strong>GitFlow:</strong> Multiple long-lived branches (develop, release, hotfix)</li><li><strong>GitHub Flow:</strong> Lightweight, PR-driven, production-ready main</li><li><strong>GitLab Flow: </strong>GitHub Flow + environment branches</li><li><strong>OneFlow</strong>: Simplified GitFlow without develop</li></ul><p>For most DevOps and GitOps teams:</p><ul><li><strong>GitHub Flow + short-lived feature branches</strong> is the sweet spot</li><li>Trunk-based is ideal once CI/CD maturity is high</li><li>Complex flows should be avoided unless strictly required</li></ul><p>The goal is not complexity; <strong>the goal is safety</strong>.</p><h3>Common Git Mistakes DevOps Engineers Should Avoid</h3><ul><li>Rebasing shared branches</li><li>Force pushing to production</li><li>Mixing infra and app code without strategy</li><li>Ignoring commit message standards</li></ul><h3>Final Thoughts</h3><p>Advanced Git is not about memorizing commands : it is about <strong>using Git safely in high-impact environments</strong>.</p><p>If you work with:</p><ul><li>CI/CD pipelines</li><li>Kubernetes</li><li>Terraform</li><li>GitOps</li></ul><p>Then mastering advanced Git concepts will <strong>directly improve system reliability and your DevOps credibility</strong>.</p><h3>If you found this useful,</h3><ul><li>Clap 👏 on Medium</li><li>Share with fellow DevOps engineers</li><li>Follow for more DevOps deep dives</li></ul><p>Happy Git-ing! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be6e99534b43" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/git-advanced-for-devops-engineers-beyond-git-commit-and-git-push-be6e99534b43">Git Advanced for DevOps Engineers: Beyond git commit and git push</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Security is Not an Afterthought: Shift-Left with Gitleaks, Trivy & Cosign]]></title>
            <link>https://awstip.com/security-is-not-an-afterthought-shift-left-with-gitleaks-trivy-cosign-470046fb0b1c?source=rss-419ed15e35f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/470046fb0b1c</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[devsecops]]></category>
            <dc:creator><![CDATA[Abhishek Panda]]></dc:creator>
            <pubDate>Sat, 03 Jan 2026 11:12:33 GMT</pubDate>
            <atom:updated>2026-01-21T07:52:33.220Z</atom:updated>
            <content:encoded><![CDATA[<h3>Part 3: The Security Shield</h3><p><em>This is Part 3 of a 3-part series on building an open-source DevSecOps Platform.</em></p><ul><li><a href="https://medium.com/@abhishek.panda0620/how-i-built-a-production-grade-devsecops-platform-so-you-dont-have-to-b91b1c1558d6">Read Part 1: The Infrastructure Foundation</a></li><li><a href="https://medium.com/@abhishek.panda0620/gitops-at-scale-managed-vs-self-hosted-argocd-on-aws-68f38a8651a7?postPublishedType=initial">Read Part 2: GitOps-First Deployment</a></li><li><strong>Part 3: Shift-Left Security (Gitleaks, Trivy, Cosign)</strong></li></ul><p>We have built a solid infrastructure (Part 1) and a GitOps deployment engine (Part 2). But a fast pipeline that deploys vulnerable code is just a <strong>fast way to get hacked</strong>.</p><p>In this final part, we tackle the “Sec” in DevSecOps.</p><p>We are not just adding a firewall. We are adding <strong>Defense in Depth</strong> — embedding security checks at every stage of the pipeline, from the developer’s laptop to the production cluster.</p><h3>The Problem: Secret Sprawl &amp; Supply Chain Attacks</h3><ol><li><strong>Secret Sprawl</strong>: A developer accidentally commits an AWS key. It’s in the git history forever.</li><li><strong>Vulnerable Dependencies</strong>: You use a library that has a Critical CVE.</li><li><strong>Supply Chain Attacks</strong>: Someone injects malicious code into your docker image between build and deploy.</li></ol><h3>The Solution: Shift-Left Security</h3><p>“Shift Left” means moving security checks earlier in the process. We don’t wait for a penetration test. We fail the build if you try to commit a secret.</p><h4>Layer 1: The “Laptop” Defense (Pre-Commit)</h4><p>We use <strong>Gitleaks</strong> via pre-commit hooks. If you try to git commit a secret, it blocks you.</p><pre># .pre-commit-config.yaml<br>  - repo: https://github.com/gitleaks/gitleaks<br>    rev: v8.18.4<br>    hooks:<br>      - id: gitleaks<br>        entry: gitleaks protect --verbose --redact --staged<br></pre><p><strong>Result</strong>: You <em>cannot</em> push a secret unless you explicitly bypass it (which is logged).</p><h4>Layer 2: The CI Gate (Trivy &amp; Semgrep)</h4><p>Inside our GitHub Actions pipeline, we run a battery of tests. If any of these fail, the “Merge” button is disabled.</p><ol><li><strong>Semgrep (SAST)</strong>: Scans your <em>code</em> for insecurity (e.g., SQL injection patterns).</li><li><strong>Trivy (SCA)</strong>: Scans your <em>dependencies</em> (npm, pip) for known CVEs.</li><li><strong>EOL Check</strong>: A custom tool I added to ensure we aren’t using “End of Life” Node.js or Python versions.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TfnyA1xVkFYWydsgeMuexA.png" /></figure><h4>Layer 3: Supply Chain Integrity (Cosign)</h4><p>How do you know the container running in Prod is the same one you built in CI? <strong>Digital Signatures</strong>.</p><p>We use <strong>Cosign</strong> (part of Sigstore) to sign our container images.</p><pre># .github/workflows/ci.yml<br>- name: Sign image with a key<br>  run: |<br>    cosign sign --yes --key env://COSIGN_PRIVATE_KEY &quot;${TAGS}&quot;</pre><p>In the cluster, we can use a Policy Controller (like Kyverno or Gatekeeper) to <em>reject</em> any image that isn’t signed by our key.</p><h4>Layer 4: The Build Summary</h4><p>We aggregate all these results into a nice GitHub Actions summary so developers don’t have to dig through 10,000 lines of logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-vwC_lrlEYuppK8rnMnUNg.png" /></figure><h3>Conclusion: The Ultimate Platform</h3><p>And there you have it.</p><p>We built a platform that:</p><ol><li><strong>Foundation</strong>: Uses Layered Terraform to manage state safely.</li><li><strong>Deployment</strong>: Uses GitOps (ArgoCD) to manage 100+ apps.</li><li><strong>Security</strong>: Uses Gitleaks, Trivy, and Cosign to catch bad things before they happen.</li></ol><p>The best part? It’s all open source. You can fork it, modify it, and use it as the blueprint for your company’s internal developer platform.</p><p><strong>Clone the repo here</strong>: <a href="https://github.com/abhishekpanda0620/devsecops-platform-template">github.com/abhishekpanda0620/devsecops-platform-template</a></p><p>Happy Building! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=470046fb0b1c" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/security-is-not-an-afterthought-shift-left-with-gitleaks-trivy-cosign-470046fb0b1c">Security is Not an Afterthought: Shift-Left with Gitleaks, Trivy &amp; Cosign</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GitOps at Scale: Managed vs. Self-Hosted ArgoCD on AWS]]></title>
            <link>https://awstip.com/gitops-at-scale-managed-vs-self-hosted-argocd-on-aws-68f38a8651a7?source=rss-419ed15e35f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/68f38a8651a7</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[aws-eks]]></category>
            <category><![CDATA[argo-cd]]></category>
            <category><![CDATA[gitops]]></category>
            <dc:creator><![CDATA[Abhishek Panda]]></dc:creator>
            <pubDate>Tue, 30 Dec 2025 09:49:16 GMT</pubDate>
            <atom:updated>2026-01-21T07:52:40.390Z</atom:updated>
            <content:encoded><![CDATA[<h3>Part 2: The Deployment Engine</h3><p><em>This is Part 2 of a 3-part series on building an open-source DevSecOps Platform.</em></p><ul><li><a href="https://medium.com/@abhishek.panda0620/how-i-built-a-production-grade-devsecops-platform-so-you-dont-have-to-b91b1c1558d6">Read Part 1: The Infrastructure Foundation</a></li><li><strong>Part 2: GitOps-First Deployment with ArgoCD</strong></li><li>[Coming Soon] Part 3: Shift-Left Security</li></ul><p>In Part 1, we built the <strong>Infrastructure Foundation</strong> (VPC, EKS, OIDC). Now, we need to deploy applications.</p><p>But we aren’t going to use kubectl apply. We aren&#39;t going to use helm install from a laptop.</p><p>We are going to use <strong>GitOps</strong>.</p><p>In this post, I’ll compare <strong>AWS Managed ArgoCD</strong> vs. <strong>Self-Managed ArgoCD</strong>, and show you how to implement the “App of Apps” pattern to manage 100+ microservices as easily as one.</p><h3>Why GitOps? (vs. CI/CD scripts)</h3><p>Before we deploy, let’s ask: Why not just use kubectl apply in GitHub Actions?</p><ol><li><strong>Drift Detection</strong>: If someone manually changes a replica count in the cluster, standard CI pipelines won’t know using kubectl. GitOps tools (ArgoCD) will scream &quot;Out of Sync&quot; immediately.</li><li><strong>Audit Trail</strong>: The Git commit history <em>is</em> your deployment history. Who changed prod? git blame.</li><li><strong>Security</strong>: Your CI system doesn’t need “God Mode” access to the cluster. The cluster <em>pulls</em> from Git. No creds leaving the perimeter.</li><li><strong>Rollbacks</strong>: git revert. Done.</li></ol><h3>The Debate: Managed vs. Self-Hosted</h3><p>AWS recently announced <strong>EKS Capabilities</strong>, allowing you to install ArgoCD as a managed add-on. I implemented <em>both</em> options in this platform so you can choose.</p><h4>AWS Managed Argo CD</h4><ul><li><strong>Maintenance</strong>: AWS handles upgrades &amp; patches automatically.</li><li><strong>Auth</strong>: Integrates natively with AWS IAM Identity Center (SSO).</li><li><strong>Cost</strong>: Free (during preview) or usage-based pricing.</li><li><strong>Customization</strong>: Limited. You get an “Opinionated” setup.</li></ul><h4>Self-Managed (Helm)</h4><ul><li><strong>Maintenance</strong>: You are responsible for Helm chart upgrades.</li><li><strong>Auth</strong>: Flexible DEX integration (GitHub, Google, SAML, LDAP).</li><li><strong>Cost</strong>: You pay only for the compute (EC2/Fargate) resources.</li><li><strong>Customization</strong>: Unlimited. Install any plugin (Vault, CMPs, etc.).</li></ul><p><strong>My Verdict</strong>: For “Plain Vanilla” GitOps, <strong>AWS Managed</strong> is incredible. It removes the operational burden. But if you need complex plugins (like Vault integration or custom cmp), stick to <strong>Self-Managed</strong>.</p><h3>The Implementation: “App of Apps” Pattern</h3><p>Managing 50 separate ArgoCD applications is a nightmare. The “App of Apps” pattern solves this by having one <strong>Root Application</strong> that manages the others.</p><h4>1. The Root Application (<em>infra/argocd/root-app.yaml</em>)</h4><p>This file is the “One Ring to Rule Them All”. It points ArgoCD to a folder containing <em>other</em> applications.</p><pre>apiVersion: argoproj.io/v1alpha1<br>kind: Application<br>metadata:<br>  name: devsecops-platform<br>  namespace: argocd<br>spec:<br>  project: default<br>  source:<br>    repoURL: https://github.com/my-org/platform.git<br>    path: infra/argocd/apps  # &lt;--- The magic folder<br>    targetRevision: HEAD<br>  destination:<br>    server: https://kubernetes.default.svc<br>    namespace: argocd<br>  syncPolicy:<br>    automated:<br>      selfHeal: true<br>      prune: true</pre><h4>2. The Apps Folder (infra/argocd/apps/)</h4><p>Inside this folder, we drop declarative files for everything we want:</p><ul><li>monitoring.yaml (Prometheus/Grafana)</li><li>security.yaml (Falco/Trivy)</li><li>user-service.yaml (Our demo app)</li></ul><p>ArgoCD watches the root, sees these files, and spins up the child apps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i3ag6W5QYg27rM35ynomlw.png" /></figure><h3>The CI/CD Pipeline Integration</h3><p>GitOps doesn’t replace CI. It complements it.</p><ol><li><strong>CI (GitHub Actions)</strong>: Builds docker image, tests it, scans it, helps it.</li><li><strong>CD (GitOps)</strong>: ARgoCD detects the new image tag in Git and syncs it.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zX7w03EGyVMLP8v8bBaX6g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RtQjmJdxCNTUJeTbHcTgMA.png" /></figure><h3>Terraform Bootstrapping</h3><p>We use Terraform to “bootstrap” ArgoCD. The cluster is born with ArgoCD already running.</p><pre># infra/terraform/environments/dev/addons/main.tf<br>module &quot;eks_gitops&quot; {<br>  source = &quot;../../../modules/eks-gitops&quot;<br>  # Choose your fighter<br>  enable_managed_argocd = false<br>  enable_helm_argocd    = true<br>  # Bootstrap the root app automatically<br>  deploy_root_application = true<br>  gitops_repo_url         = var.gitops_repo_url<br>}</pre><h3>What’s Next?</h3><p>We have secure Infrastructure (Part 1) and a Deployment Engine (Part 2).</p><p>But how do we ensure that what we are deploying isn’t vulnerable?</p><p>In <strong>Part 3</strong>, we will tackle <strong>Shift-Left Security</strong>, adding Gitleaks, Trivy, and Cosign to our pipeline.</p><p><em>Check out the code: </em><a href="https://github.com/abhishekpanda0620/devsecops-platform-template"><em>DevSecOps Platform Template</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68f38a8651a7" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/gitops-at-scale-managed-vs-self-hosted-argocd-on-aws-68f38a8651a7">GitOps at Scale: Managed vs. Self-Hosted ArgoCD on AWS</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Built a Production-Grade DevSecOps Platform (So You Don’t Have To)]]></title>
            <link>https://awstip.com/how-i-built-a-production-grade-devsecops-platform-so-you-dont-have-to-b91b1c1558d6?source=rss-419ed15e35f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b91b1c1558d6</guid>
            <category><![CDATA[aws-eks]]></category>
            <category><![CDATA[devsecops-solutions]]></category>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[load-balancing]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Abhishek Panda]]></dc:creator>
            <pubDate>Sun, 28 Dec 2025 14:29:55 GMT</pubDate>
            <atom:updated>2025-12-30T12:15:22.772Z</atom:updated>
            <content:encoded><![CDATA[<h3>Part 1: The Infrastructure Foundation</h3><p><em>This is Part 1 of a 3-part series on building an open-source DevSecOps Platform.</em></p><ul><li><strong>Part 1: The Infrastructure Foundation (Layered Terraform &amp; EKS)</strong></li><li>[Coming Soon] Part 2: GitOps-First Deployment with ArgoCD</li><li>[Coming Soon] Part 3: Shift-Left Security (Gitleaks, Trivy, Cosign)</li></ul><p>“Hello World” tutorials are great, but they rarely survive in production. When I set out to build a reference <strong>DevSecOps Platform</strong>, I didn’t want just a Kubernetes cluster; I wanted a <strong>Production-Ready Framework</strong> that solves the real headaches of Platform Engineering:</p><ul><li><strong>State Management</strong>: Avoiding the “Monolithic State File” of Doom.</li><li><strong>Dependency Hell</strong>: How to manage VPCs, Clusters, and Addons without circular dependencies.</li><li><strong>Security</strong>: Security not as an afterthought, but baked into the infrastructure.</li></ul><p>In this post, I’ll walk you through the <strong>Infrastructure Foundation</strong> of the platform, specifically how we used a <strong>Layered Terraform Architecture</strong> to build a robust AWS EKS environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z_ZUNvyh8hqFDmqbQb8UsA.png" /></figure><h3>The Problem: The “Monolithic” Terraform Anti-Pattern</h3><p>We’ve all been there: main.tf starts at 100 lines. Then you add a VPC. Then an EKS cluster. Then RDS. Then Helm charts. Suddenly, you have a 2,000-line file, and terraform plan takes 10 minutes to run.</p><p>If one helm chart fails, your entire infrastructure pipeline turns red. This is the Monolithic Anti-Pattern.</p><p>The Solution: Layered Architecture<br>We split our infrastructure into two distinct layers with separate lifecycles and state files:</p><p><strong>Level 1: Foundation (<em>infra/terraform/environments/dev/foundation</em>)</strong></p><p>What it is: The “slow-changing” stuff. VPCs, Subnets, EKS Cluster, OIDC Providers, ECR Repositories.<br>- Frequency: Deployed once, rarely changed.<br>- Risk: High (wrong move deletes the cluster).<br><strong>Level 2: Addons (<em>infra/terraform/environments/dev/addons</em>)</strong></p><p>What it is: The “fast-changing” stuff. ArgoCD, Kubernetes Manifests, Helm Charts.<br>- Frequency: Changed often as we add tools.<br>- Risk: Low (worst case, we reinstall a tool).<br><strong>Directory Structure</strong></p><pre>infra/terraform/environments/dev/<br>├── foundation/          # Layer 1<br>│   ├── main.tf<br>│   ├── modules/vpc<br>│   ├── modules/eks<br>│   └── backend.tf       # State: dev/foundation.tfstate<br>│<br>└── addons/              # Layer 2<br>    ├── main.tf<br>    ├── modules/eks-gitops<br>    └── backend.tf       # State: dev/addons.tfstate</pre><p>This separation allows us to destroy and recreate the “Addons” layer (e.g., to upgrade ArgoCD) without ever touching the underlying EKS cluster.</p><h3>Key Technical Challenges Solved</h3><h4>1. Dynamic Remote State</h4><p>Use backend.tf with empty configuration and pass the details at init time. This keeps your code DRY (Don&#39;t Repeat Yourself) and secure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oO8SeEaTOeq-e98l78DHwg.png" /></figure><pre># Init command<br>terraform init -backend-config=dev.tfbackend</pre><h4>2. The VPC Peering “Chicken and Egg”</h4><p>Connecting a new VPC to an existing shared services VPC is classic Terraform pain. We solved this by modularizing the VPC to accept peer_vpc_id as an optional variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wL-F8_-DZ5XXmiiYwg0yJQ.png" /></figure><h3>Looking specific modules?</h3><ul><li><strong>VPC Module</strong>: Pre-configured with Public/Private subnets and proper tagging for AWS Load Balancers (kubernetes.io/role/elb).</li><li><strong>EKS Module</strong>: Uses AWS-managed node groups and addons.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bMh_y-EQ-0KPv2wStvRhGw.png" /></figure><p><strong>ECR Module</strong>: We also provision the Container Registry in the foundation layer. Why? because your CI/CD foundation needs a place to push images before it can deploy anything.</p><pre>module &quot;ecr&quot; {<br>  source = &quot;../../../modules/ecr&quot;<br>  repository_name      = &quot;${var.repository_name}-${var.environment}&quot;<br>  image_tag_mutability = &quot;IMMUTABLE&quot;<br>  scan_on_push         = true<br>}</pre><p><em>Note: </em><em>scan_on_push = true is a free security win from AWS!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3_809Qseaab5iU6xBQTY5Q.png" /></figure><p><strong>OIDC Module</strong>: Stop storing long-lived AWS keys in GitHub Secrets! We provision an OIDC provider to let GitHub Actions assume an IAM role temporarily.</p><pre>module &quot;github_oidc&quot; {<br>  source      = &quot;../../../modules/github-oidc&quot;<br>  github_org  = var.github_org<br>  github_repo = var.github_repo<br>}</pre><h3>What’s Next?</h3><p>We have a running EKS cluster, separate state files, and a secure network. But a cluster without apps is just an expensive heater.</p><p>In <strong>Part 2</strong>, we will dive into <strong>GitOps</strong>, removing kubectl apply from our vocabulary and letting ArgoCD take the wheel.</p><p><em>Check out the full code on </em><a href="https://github.com/abhishekpanda0620/devsecops-platform-template"><em>GitHub</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b91b1c1558d6" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/how-i-built-a-production-grade-devsecops-platform-so-you-dont-have-to-b91b1c1558d6">How I Built a Production-Grade DevSecOps Platform (So You Don’t Have To)</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Practical Way To Understand Networking: The Story Of How A Simple System Breaks]]></title>
            <link>https://awstip.com/a-practical-way-to-understand-networking-the-story-of-how-a-simple-system-breaks-dc48b7ab08d5?source=rss-419ed15e35f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc48b7ab08d5</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[infrastructure]]></category>
            <dc:creator><![CDATA[Abhishek Panda]]></dc:creator>
            <pubDate>Thu, 11 Dec 2025 07:54:02 GMT</pubDate>
            <atom:updated>2025-12-11T08:59:29.448Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ta9CLziS4O2vNzAC93PqXw.png" /></figure><p>Most people meet networking the same way they meet JavaScript hoisting or tax paperwork. A wall of terms appears out of nowhere. TCP. DNS. Proxies. Ports. Subnets. You stare at them and feel the same energy as reading instructions for assembling furniture written in five languages you do not speak.</p><p>I want to tell you a different story. A story that begins with one simple application that works perfectly, then falls apart piece by piece as more people start using it. Every time something breaks, a new networking concept steps in to fix the mess. By the end of this journey, you will understand why these concepts exist and how they connect.</p><p>Let us begin with something easy.</p><h3>One Server. One User. Zero Problems.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gn-RANtZ76_PcAz03h5cZg.png" /></figure><p>Imagine you build a small application on your laptop. It serves a single page. It accepts a request. It sends a response. You feel powerful. The world is simple.</p><p>A friend tries to access it, so you open a port and share the IP. They connect. It works again. Life is good.</p><p>Then more friends show up.</p><h3>The First Crack: Too Many Requests</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R-28khyT2TZ0qsuzF5S40A.png" /></figure><p>Suddenly the server freezes. Some requests load forever. Others fail. You realize your machine can only handle so much traffic. This is the first moment where networking reveals itself.</p><p>Before we fix the problem, we need to understand what is happening.</p><p>A client is sending a request. The server is trying to respond. That relationship is the heart of every application. But this relationship becomes strained when the number of clients grows faster than the server can handle.</p><p>You need more machines.</p><h3>Scaling Out Forces You Into a Puzzle</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*Jp4za9nEZg9Pho7SqQ7eEg.png" /></figure><p>So you add another server. Now you have Server A and Server B. They both run the same application. This should fix everything.</p><p>Except it does not.</p><p>Your users do not know which server to contact. If they guess wrong or hit the same server repeatedly, you are back to the same bottleneck.</p><p>This introduces a new concept.</p><h3>The Traffic Controller: Load Balancers</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oX09K3vzUq_Y-7zZLnqtew.png" /></figure><p>A load balancer sits in front of your servers and decides where each request should go. Think of it as a person at the entrance of a club pointing people toward different lines so no one door gets overwhelmed.</p><p>Clients still see only one entry point. The balancing happens invisibly behind the scenes. Now the system breathes again.</p><p>Until something else breaks.</p><h3>Invisible Names, Real Problems</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vIgD1UGtDIukXOkM0f4CnA.png" /></figure><p>Your servers have IP addresses. Your load balancer has an IP address. You are managing everything manually and it feels fragile.</p><p>Now imagine moving your application to a different machine or restarting a container. IPs change. Connections break. Users get errors.</p><p>This is where names become more reliable than numbers.</p><p>DNS arrives to solve the problem. It maps easy to remember names to whichever IP addresses you currently use. That simple layer of indirection saves your sanity.</p><p>But the story is not over. Far from it.</p><h3>When Systems Grow, They Start Hiding Things</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B9qz7B7glTphijQcA32Pxg.png" /></figure><p>As your application becomes more complex, you add internal services. Maybe a database. Maybe an authentication service. Maybe a caching layer.</p><p>You do not want these internal pieces exposed to the outside world. They should speak only to the parts of your system that need them.</p><p>This is where proxies enter.</p><h3>Proxies Make Conversations Safer and Cleaner</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X0Ae1Vc2r1qt52X0ipqH1Q.png" /></figure><p>A proxy stands between the outside world and your internal services. It inspects requests, routes them intelligently, filters what should be allowed, and hides what should remain private.</p><p>It is like having a receptionist who knows which rooms visitors can enter and which doors stay locked.</p><p>But now you face a bigger challenge.</p><h3>Containers Rewrite the Rules</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b8ca7klHVMqsBHY2XmxmpA.png" /></figure><p>You move your application into containers because deployments become smoother and scaling becomes faster. Containers make developers happy, but they introduce a new world of networking quirks.</p><p>Each container has its own network space. Containers can talk to each other, but only if you configure the virtual pipes between them. Virtual networks form. Bridges connect them. Local DNS entries appear. Routing tables grow.</p><p>You did not ask for any of this, but you needed the flexibility containers provide. Networking adjusts itself to keep up.</p><p>Now your system works again. For a moment.</p><h3>The Real Chaos Begins: Distributed Systems</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jgJgWk9pqtZ7YSQ4KVARhA.png" /></figure><p>Your once simple application is now a constellation of containers running across multiple machines. Services depend on other services. Some run in different clusters. Some scale automatically. Some require strict security boundaries.</p><p>One DNS mistake can break half the application. One network policy can block two services that desperately need to talk. One slow service can delay every request passing through it.</p><p>You realize that networking is no longer a layer beneath your application. It has become the nervous system of everything you build.</p><p>To survive this stage, you pick up new concepts.</p><p>Service discovery. Internal load balancing. Network policies. East west traffic. Heartbeat checks. Health probes. Zero trust boundaries.</p><p>Each term represents a new fix for a new problem created by scale.</p><h3>The Big Picture You Finally See</h3><p>Networking is not a list of protocols you memorize. It is a story of problems that appear only when systems grow beyond one machine.</p><p>If you understand the story, you understand the concepts.</p><p>One server works until it does not.<br> More servers work until they do not.<br> Containers work until they do not.<br> Distributed systems work until they do not.</p><p>Networking exists to keep the whole ecosystem functional.</p><h3>A Simple Way To Learn Better</h3><p>If you want these ideas to feel natural instead of intimidating, try this:</p><blockquote>1-Build a tiny server and connect to it from another device.</blockquote><blockquote>2-Add a second server and put a real load balancer in front of them.</blockquote><blockquote>3-Containerize everything and observe how networking changes inside containers.</blockquote><blockquote>4-Add another service and make them communicate.</blockquote><blockquote>5-Introduce a failure and test how your system responds.</blockquote><p>You will learn more from this sequence than from memorizing any list of layers.</p><h3>Final Thoughts</h3><p>Networking becomes easier when you treat it as a series of stories. Systems grow. They break. You learn the concept that fixes the break. You repeat the cycle. Over time, the names become familiar. The connections make sense. The big picture reveals itself.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc48b7ab08d5" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/a-practical-way-to-understand-networking-the-story-of-how-a-simple-system-breaks-dc48b7ab08d5">A Practical Way To Understand Networking: The Story Of How A Simple System Breaks</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Weird Analogy That Helped Me Understand Kubernetes in 10 Minutes]]></title>
            <link>https://medium.com/@abhishek.panda0620/the-weird-analogy-that-helped-me-understand-kubernetes-in-10-minutes-9ee299fda786?source=rss-419ed15e35f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ee299fda786</guid>
            <category><![CDATA[orchestration]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubernetes-cluster]]></category>
            <dc:creator><![CDATA[Abhishek Panda]]></dc:creator>
            <pubDate>Sun, 07 Dec 2025 15:50:08 GMT</pubDate>
            <atom:updated>2025-12-07T15:50:08.490Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9PEu2VOV9adMgQeC3O5Xww.png" /></figure><p>Let us be honest. Kubernetes looks terrifying the first time you see it.</p><p>Pods, Deployments, API servers, controllers. Somehow everything is distributed, self healing, auto scaling, magical, and also incredibly confusing.</p><p>I spent weeks trying to understand it by reading documentation, diagrams, and architecture charts that looked like alien blueprints.</p><p>Then one day, purely out of frustration, I started visualizing Kubernetes as something completely different.</p><p>A housing colony.</p><p>And suddenly everything clicked.</p><p>If you are a beginner trying to wrap your head around Kubernetes architecture, this analogy will make it much easier.</p><h3>Pods are Rooms Where Your App Lives</h3><p>Pods are the smallest unit in Kubernetes. Think of a pod as a room in which your application lives.</p><p>One room equals one app. Sometimes you have two apps in the same room which means two containers, but they share everything like roommates.</p><p>If a pod dies, Kubernetes replaces it with a new one. Strict landlord energy.</p><h3>Deployments are Building Management</h3><p>Deployments are like the building management team.</p><p>You tell them:</p><ul><li>I need three rooms</li><li>If any room breaks, fix it</li><li>If I renovate the room which means update the app, roll it out safely</li></ul><p>Deployments maintain a desired state.</p><p>If you say you want three rooms and only two exist, deployment creates one more. If one gets destroyed, deployment replaces it.</p><h3>Nodes are Buildings in the Colony</h3><p>A node is the actual machine, VM, or server where pods run.</p><p>Think of it as a building.</p><p>It has CPU, memory, network, and the uncle who checks everything which we will get to next.</p><p>Your pods which are rooms live inside these buildings.</p><p>If a node fails which is basically a building collapsing, Kubernetes moves the pods to another node.</p><h3>Kubelet is the Uncle Who Checks Everything Daily</h3><p>Every node has a kubelet which is like that one uncle in every colony who wakes up early and inspects everything.</p><p>He checks:</p><ul><li>Are all pods alive</li><li>Is everything running</li><li>Should I call someone</li></ul><p>Kubelet constantly reports back to the control plane.</p><h3>Service is the Address</h3><p>Here is a fun problem. Your pod which is your room keeps getting replaced when it fails. So how do people reach it</p><p>You cannot just say Go to Room 402. Room 402 may no longer exist.</p><p>So Kubernetes gives your app a stable address which is a Service.</p><p>Even if pods die, restart, or move to another building, the address stays the same.</p><h3>Ingress is the Colony Main Gate</h3><p>Your app needs to be accessed from the outside world.</p><p>Ingress is the main gate of the colony.</p><p>It decides who gets in, which room they can go to, and who gets blocked at the gate.</p><h3>The Control Plane is the Colony Office</h3><p>This is the heart of Kubernetes.</p><p>If nodes and pods are the buildings and rooms, the control plane is the colony office where decisions are made.</p><h3>API Server is the Reception Desk</h3><p>Every request goes through here. kubectl talks to the API server.</p><h3>Scheduler is the Room Allocation Guy</h3><p>Scheduler decides which pod should live in which building. It checks capacity, rules, constraints, and assigns rooms.</p><h3>Controller Manager is the Overachiever</h3><p>This part watches everything. If the actual state does not match what you wanted, it fixes it immediately.</p><h3>etcd is the Brain</h3><p>etcd stores the entire cluster state. If etcd goes down, Kubernetes forgets everything.</p><h3>Bringing It Together</h3><p>Here is how Kubernetes works when everything is running.</p><ol><li>You tell Kubernetes what you want</li><li>The control plane figures out how to achieve it</li><li>Pods get created on nodes</li><li>Kubelet ensures they are alive</li><li>Deployments maintain the desired count</li><li>Services provide stable addresses</li><li>Ingress exposes apps to the outside world</li><li>The whole system self heals when things break</li></ol><p>Kubernetes is essentially a self maintaining housing colony for containers.</p><p>Once you see it like this, the architecture stops feeling intimidating.</p><h3>Final Thoughts</h3><p>Kubernetes does not have to be complicated. Most explanations are just too abstract and too academic.</p><p>But when you map it to something familiar which is rooms, buildings, and colony management, it becomes intuitive.</p><p>This mental model helped me understand Kubernetes years ago, and I hope it helps you too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ee299fda786" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Copy-Pasting Dockerfiles: Understand Them Instead ]]></title>
            <link>https://medium.com/@abhishek.panda0620/stop-copy-pasting-dockerfiles-understand-them-instead-d5442cc2db58?source=rss-419ed15e35f4------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5442cc2db58</guid>
            <category><![CDATA[containerization]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <dc:creator><![CDATA[Abhishek Panda]]></dc:creator>
            <pubDate>Wed, 30 Jul 2025 06:03:26 GMT</pubDate>
            <atom:updated>2025-07-30T10:48:52.422Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-VWsVkQQetjMJ17oDNi5qg.png" /></figure><p>If you’re getting into Docker and find yourself copy-pasting Dockerfile examples from ChatGPT without actually knowing what they do, this one&#39;s for you.</p><p>Let’s break down each Dockerfile instruction in plain English so you can <strong>build your own Docker images with confidence</strong> (and without vibes-based debugging 😅).</p><h3>What’s a Dockerfile Anyway?</h3><p>A Dockerfile is like a recipe. It tells Docker how to build an image—what base to use, what dependencies to install, what commands to run, and what to do when the container starts.</p><p>Let’s go step-by-step through the most common Dockerfile instructions:</p><h3>📦 FROM</h3><pre>FROM ubuntu:bookworm-slim</pre><p>Sets the <strong>base image</strong>. It’s like saying: “Start with this OS or runtime.”</p><p><strong>Pro Tip:</strong> Use a lightweight base image (like alpine or slim versions) to speed up builds and reduce container start time.</p><h3>📂 WORKDIR</h3><pre>WORKDIR /app</pre><p>Sets the <strong>working directory</strong> inside your container. Every command that follows will run from this path.</p><h3>🌿 ENV</h3><pre>ENV NODE_ENV=production<br>ENV PORT=3000</pre><p>Your app inside the container can then read those values from the environment, like process.env.NODE_ENV in Node.js.</p><h3>🧰 ARG</h3><pre>ARG NODE_VERSION=24</pre><p>Lets you <strong>pass build-time variables</strong> into the image. These aren’t available at runtime, only when building.</p><p><strong>Pro Tip:</strong> Use ARG for install-time configs and ENV for app runtime settings.</p><h3>📥 COPY</h3><pre>COPY . /app</pre><p>Copies files from your host (your PC/laptop) into the image. Useful for transferring source code, configs, etc.</p><h3>🧩 <strong>ADD</strong></h3><pre>ADD source.tar.gz /app/</pre><p>Similar to COPY, but with superpowers. It can copy files <strong>and</strong> automatically extract compressed archives or even fetch files from URLs.</p><p><strong>Pro Tip:</strong> Use COPY if you don’t need the extra magic: it’s clearer and less surprising.</p><h3>⚙️ RUN</h3><pre>RUN apt update &amp;&amp; apt install -y nginx</pre><p>Executes shell commands at <strong>build time</strong>. Used for installing packages or compiling code.</p><h3>🚀 CMD</h3><pre>CMD [&quot;node&quot;, &quot;index.js&quot;]</pre><p>This is what runs when the container <strong>starts up</strong>. Think of it as the default action.</p><p>You can override this when using docker run.</p><h3>🔒 ENTRYPOINT</h3><pre>ENTRYPOINT [&quot;entrypoint.sh&quot;]</pre><p>Similar to CMD, but <strong>harder to override</strong>. Use this if your container has <em>one clear purpose</em>.</p><p><strong>Pro Tip:</strong> You can combine ENTRYPOINT and CMD to set a fixed command with optional default args that users can override.</p><h3>📣 EXPOSE</h3><pre>EXPOSE 80</pre><p>Just <strong>documents</strong> which port the container listens on. <strong>Doesn’t actually expose it to the world</strong> unless you do so in docker run.</p><h3>💾 VOLUME</h3><pre>VOLUME [&quot;/data&quot;]</pre><p>Declares a spot in the container for <strong>persistent data: </strong>survives even if the container is destroyed.</p><h3>🏷️ LABEL</h3><pre>LABEL maintainer=&quot;you@example.com&quot;</pre><p>Attaches metadata to your image. Can be useful for docs, ownership, versioning, etc.</p><h3>👤 USER</h3><pre>USER node</pre><p>Sets the user the container runs as. <strong>Don’t run as root</strong> in production — it’s a security risk.</p><h3>🧼 SHELL</h3><pre>SHELL [&quot;/bin/bash&quot;, &quot;-c&quot;]</pre><p>Changes the default shell used by RUN instructions (defaults to sh). Rarely needed, but handy sometimes.</p><h3>🧠 ONBUILD</h3><pre>ONBUILD COPY . /app</pre><p>Sets up instructions that will <strong>trigger later</strong>, if this image is used as a base image by another Dockerfile. Mostly used in base images/frameworks.</p><h3>❤️‍🩹 HEALTHCHECK</h3><pre>HEALTHCHECK --interval=30s CMD curl -f http://localhost/ || exit 1<br></pre><p>Tells Docker how to check if your container is still alive and kicking. This helps you catch issues early and restart containers if needed.</p><h3>✨ Bonus Tips</h3><ul><li>Use .dockerignore to skip unnecessary files like node_modules or .git.</li><li>Keep your layers small to optimize build time and image size.</li><li>Try <strong>multi-stage builds</strong> to separate building from final output (advanced, but powerful!).</li></ul><h3>🎯 Final Thoughts</h3><p>You don’t need to memorize every instruction overnight. But knowing <strong>what each one actually does</strong> will save you tons of time and debugging pain later.</p><p>So next time you see a random Dockerfile online — don’t just copy-paste it. <strong>Understand it. Customize it. Make it yours.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5442cc2db58" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>