<?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 Naveen Alok on Medium]]></title>
        <description><![CDATA[Stories by Naveen Alok on Medium]]></description>
        <link>https://medium.com/@naveenalok?source=rss-f86742c262c4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Fa23yygEX-52jP_N.jpg</url>
            <title>Stories by Naveen Alok on Medium</title>
            <link>https://medium.com/@naveenalok?source=rss-f86742c262c4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 18:26:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@naveenalok/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[AI Writes 40% of Our Code - And It’s Creating a Ticking Time Bomb]]></title>
            <link>https://naveenalok.medium.com/ai-writes-40-of-our-code-and-its-creating-a-ticking-time-bomb-e547901e3766?source=rss-f86742c262c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/e547901e3766</guid>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ai-coding]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Naveen Alok]]></dc:creator>
            <pubDate>Fri, 03 Apr 2026 21:45:47 GMT</pubDate>
            <atom:updated>2026-04-03T21:45:47.656Z</atom:updated>
            <content:encoded><![CDATA[<h3>We’ve solved the generation problem. We haven’t solved the memory problem.</h3><p><em>GitHub: </em><a href="https://github.com/automationpi/mergelore"><em>automationpi/mergelore</em></a></p><p>Your team adopted AI coding tools six months ago. Claude Code, Copilot, Cursor — one of them, maybe all three. PRs are shipping faster. Velocity is up. Stakeholders are happy.</p><p><strong><em>Then something quietly breaks.</em></strong></p><p>An engineer opens a PR, looks fine. The diff is clean, the tests pass, the AI reviewer leaves a thumbs up. You merge it.</p><p>Two weeks later, a production incident. You dig through the postmortem and find it: three months ago, your team fought this exact bug. PR #287. There was a post-mortem. There was a decision. Someone had explicitly written in the PR description: <em>“Do not change this. Ever. Here’s why.”</em></p><p>The AI that wrote the new code had no idea. The AI that reviewed it had no idea. The human who merged it was on their 12th PR of the day and didn’t remember either.</p><p>This is the memory problem. And in 2026, as AI generates nearly half of all code shipped, it is the fastest-growing blind spot in software engineering.</p><h3>Every AI code review tool is solving the wrong problem</h3><p>Right now, there are dozens of excellent tools attacking the code review bottleneck. CodeRabbit, Qodo, Greptile, Copilot Code Review — they are genuinely good at what they do. They analyze your diff, understand the code, catch bugs, flag security issues, suggest improvements.</p><p>All of them review the <strong>present</strong>. None of them remember the <strong>past</strong>.</p><p>Think about what a truly senior engineer brings to a code review that an AI reviewer doesn’t. It’s not pattern recognition — AI is better at that. It’s not syntax — AI has that covered. What a senior engineer has is <em>episodic memory</em>. They remember the incident from last November. They remember the architecture discussion that went on for two weeks before a decision was made. They remember the PR where someone tried this exact approach and it failed spectacularly.</p><p>That memory lives in merged PRs, in review comment threads, in Slack conversations that nobody indexed. When someone leaves the team, it leaves with them. When an AI coding agent writes new code, it has never had access to it at all.</p><blockquote><em>Researchers at arXiv named this the </em><strong><em>“Decision Shadow”</em></strong><em> — the reasoning behind a commit is discarded even though the code change is preserved. Every merged PR captures what changed. None of them preserve why.</em></blockquote><h3>The numbers are stark</h3><p>In 2025, 41% of all code shipped was AI-generated or assisted. That code carries <strong>1.7× more defects</strong> per PR than human-written code — not because the models are bad, but because they lack context that humans take for granted.</p><p>PR review time increased <strong>91%</strong> while PR volume increased <strong>98%</strong>. Teams are drowning. Senior engineers are reviewing more PRs, faster, with less context. The idea that a human reviewer will catch every architectural regression is increasingly fiction.</p><p>Cursor’s acquisition of Graphite in December 2025 for well over its last $290 million valuation was the clearest market signal yet: the industry knows that review is now the constraint, not generation. But even the most sophisticated review tools are only addressing half the problem.</p><p>They can tell you whether your code is correct. They cannot tell you whether your code contradicts a decision your team made six months ago.</p><h3>A real scenario that happens in every growing codebase</h3><p>Here’s what I mean, concretely.</p><p><strong>The connection pool incident.</strong> Your backend team had a Redis connection pool crisis last November. At 100 concurrent connections, Redis started exhausting file descriptors under load. Production went down for 40 minutes. The post-mortem was thorough. PR #287 reduced maxConnections to 20, with the description: <em>&quot;Load tested at 5K req/s. Pool size of 20 is the maximum before file descriptor exhaustion. Do not modify without load testing.&quot;</em></p><p>Six months later, a new engineer uses Claude Code to add a Redis-backed feature. It looks at the configuration, sees maxConnections: 20, thinks that seems low for a high-traffic service, and sets it to 100. The AI reviewer looks at the diff. Sees a configuration change. Doesn&#39;t flag it — there&#39;s nothing syntactically wrong, and without knowing about PR #287, there&#39;s no reason to. The human reviewer is on their 12th PR of the day.</p><p>Three weeks later, 3 AM. Your on-call engineer is fighting a production incident that feels eerily familiar.</p><p><strong>The accessibility regression.</strong> Your frontend team spent two sprints replacing every custom dropdown with native &lt;select&gt; elements after a WCAG audit. PR #156 documented the policy explicitly. Copilot generates a new settings component with a custom div-based dropdown — cleaner code, actually, more flexible. Nothing in the diff suggests a problem. The accessibility policy exists in PR #156&#39;s review thread, not in any file the AI can read.</p><p><strong>The migration that locked the database.</strong> PR #412 tried to add a default value to a 50 million row table. It locked production for 8 minutes. PR #415 documented the lesson: <em>“Large tables must use ADD COLUMN without DEFAULT, then backfill in batches.”</em> Claude Code generates a migration. It adds a column with a default value. The migration looks standard. There’s no linter rule that catches “this table has 50 million rows.”</p><h3>What the gap actually looks like</h3><p>Every existing tool sits in one of two categories:</p><ul><li><strong>Present-aware reviewers</strong> (CodeRabbit, Copilot, Qodo): Excellent at the current diff. Zero historical awareness. They know <em>what</em> changed. They don’t know <em>why the previous version existed</em>.</li><li><strong>Codebase-aware reviewers</strong> (Greptile, Augment): They understand the structure of your code today. They can trace function calls, find dependencies, understand architecture. But they don’t know what decisions were made <em>over time</em>. They see the current state, not the history of choices that created it.</li></ul><p>The gap — institutional memory — is completely unaddressed by any existing tool.</p><h3>Introducing mergelore</h3><p>This is the problem that <strong>mergelore</strong> was built to solve.</p><p>mergelore is an open-source GitHub Action that gives every PR access to your team’s institutional memory. When a PR opens, mergelore queries the history of your merged PRs, identifies the ones most relevant to the current change, and sends that context to an LLM for analysis. If the current PR conflicts with a past decision — reverses an architectural choice, re-introduces a removed pattern, changes a value that was hardcoded for a reason — mergelore flags it before it ships.</p><p>The setup is eight lines of YAML (updated to the latest v0.2.1 release):</p><p>YAML</p><pre>name: mergelore<br>on:<br>  pull_request:<br>    types: [opened, synchronize, reopened]<br>  issue_comment:<br>    types: [created]<br><br>permissions:<br>  pull-requests: write<br>  contents: read<br><br>jobs:<br>  review:<br>    runs-on: ubuntu-latest<br>    steps:<br>      - uses: actions/checkout@v4<br>      - uses: automationpi/mergelore/action@v0.2.1<br>        with:<br>          anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}</pre><p>Add your API key as a repository secret and every PR gets reviewed against your team’s history. No new infrastructure. No new processes. No database to maintain. Just add it to your workflow.</p><h3>The plugin architecture: start simple, grow as needed</h3><p>mergelore is designed around a three-tier model. You start with what you need and add complexity only when it earns its place.</p><ul><li><strong>Tier 0 — diff-only review.</strong> Just an API key. The LLM reviews the diff on its own merits. No historical context. Good for small repos or for testing the tool.</li><li><strong>Tier 1 — git-native memory (default).</strong> mergelore queries your merged PRs via the GitHub API. It scores them by file overlap and keyword relevance, sends the most relevant ones as context to the LLM. No extra infrastructure. This is the right starting point for most teams, and it’s surprisingly effective.</li><li><strong>Tier 2 — vector search.</strong> A separate indexer service extracts the full PR content (title, body, review comments, files, linked issues), chunks it into 512-token segments, embeds it, and stores it in Qdrant with metadata. The CI action queries the vector store — the embedding model never runs in CI. This tier is for large repos, high-volume teams, or organizations that need semantic retrieval across thousands of PRs.</li></ul><p>The key architectural decision: <strong>the embedding model runs in the indexer, never in CI.</strong> This keeps CI fast. Changing the embedding model is a one-line config change in the indexer — zero changes to any workflow file.</p><h3>Human-in-the-loop: findings are the beginning, not the end</h3><p>The most important design decision in mergelore is that every finding is a question, not a judgment.</p><p>When mergelore flags a conflict, the author can respond with:</p><ul><li>/mergelore-acknowledge — &quot;I saw this, I understand, continuing anyway&quot;</li><li>/mergelore-override [reason] — &quot;I disagree with this finding — here&#39;s why&quot;</li><li>/mergelore-update-record — &quot;This PR IS the new decision — update the memory after merge&quot;</li></ul><p><strong>Override decisions are written back as data.</strong> When someone overrides a finding with a reason, that reason becomes part of the institutional memory. The next time someone makes a similar change, mergelore has richer context. Over time, the tool learns what your team’s actual standards are — not just what the code history implies, but what the humans decided when edge cases arose.</p><p>This is the virtuous loop that makes mergelore different from a static ruleset. It gets smarter with every PR, every override, every decision your team makes.</p><h3>For regulated industries: fully self-hosted</h3><p>Every serious competitor in this space — CodeRabbit, Qodo, Greptile — is commercial SaaS. Your code goes through their infrastructure. For teams in pharma, finance, or healthcare, that’s often a hard no.</p><p>mergelore is MIT licensed, fully open source, and designed to run entirely within your own infrastructure. In fact, there is no centralized mergelore backend at all:</p><ul><li>The GitHub Action runs on your GitHub Actions runner. The only external calls are to the LLM provider you choose (Claude or OpenAI).</li><li>The indexer writes to your own Qdrant instance — Docker or Kubernetes, your VPC, your control. No data passes through mergelore’s infrastructure.</li><li>Use nomic-embed-text as the local embedding model and every byte stays inside your network. No OpenAI calls, no external API calls at all.</li><li>All images are published to Docker Hub and GHCR (automationpi/mergelore-action:v0.2.1 and automationpi/mergelore-indexer:v0.2.1) and signed with cosign. Verify the supply chain before pulling.</li></ul><p>For platform engineering teams running on AKS, EKS, or GKE, the Helm chart (coming in v0.3.0) will deploy the full stack — action runner, indexer service, Qdrant — in a single helm install.</p><h3>The open source bet</h3><p>There’s a reason mergelore is open source and always will be.</p><p>Trust, in developer tooling, is not an abstract value. It’s the thing that determines whether a security-conscious team adopts your tool or passes on it. An open-source tool with a clean architecture, an auditable codebase, and no telemetry can earn that trust. A SaaS product, however well-designed, has a higher bar to clear for teams that manage sensitive intellectual property.</p><p>The institutional memory problem is urgent enough, and universal enough, that it deserves a solution that anyone can deploy without a procurement process, a vendor review, or a data processing agreement.</p><p>mergelore is that solution.</p><h3>Getting started</h3><p>The repository is at <a href="https://github.com/automationpi/mergelore">github.com/automationpi/mergelore</a>.</p><p>Add the workflow file, drop in your Anthropic API key, open a PR. Your repo’s history starts working for you immediately.</p><p>If you want to try OpenAI instead:</p><p>YAML</p><pre>- uses: automationpi/mergelore/action@v0.2.1<br>  with:<br>    llm-provider: openai<br>    openai-api-key: ${{ secrets.OPENAI_API_KEY }}</pre><p>If you want diff-only mode without any historical context:</p><p>YAML</p><pre>- uses: automationpi/mergelore/action@v0.2.1<br>  with:<br>    anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}<br>    memory-provider: none</pre><h3>The problem is only going to get worse</h3><p>AI coding agents are not slowing down. In 2026, the question is not whether your team uses AI to generate code — it’s how you manage the institutional memory that AI has never had access to.</p><p>Every existing review tool helps you catch what’s wrong with the current PR. mergelore helps you catch what the current PR doesn’t know about your codebase’s history.</p><p>Your reviewers are good. But they’re reviewing more PRs than ever, faster than ever, across more files than any single human can know. Give them the context they’d have if they’d personally reviewed every PR in the repo’s history.</p><p>That’s what mergelore does.</p><p><em>mergelore is open source under the MIT license. Contributions welcome.</em></p><p><em>GitHub: </em><a href="https://github.com/automationpi/mergelore"><em>automationpi/mergelore</em></a></p><p><em>Built by Naveen Alok — Senior Platform Engineer, open source contributor, and author.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e547901e3766" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Meet gh-context: Effortless Multi-Account Switching for GitHub CLI]]></title>
            <link>https://naveenalok.medium.com/meet-gh-context-effortless-multi-account-switching-for-github-cli-6fe7026ac4b9?source=rss-f86742c262c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fe7026ac4b9</guid>
            <dc:creator><![CDATA[Naveen Alok]]></dc:creator>
            <pubDate>Wed, 20 Aug 2025 23:36:52 GMT</pubDate>
            <atom:updated>2025-08-20T23:36:52.199Z</atom:updated>
            <content:encoded><![CDATA[<p>There’s this very specific kind of chaos that only happens when you juggle <strong>personal</strong> and <strong>work</strong> GitHub accounts.</p><p>I hit this wall almost every week: I’m moving fast, fixing a tiny bug, and… <strong>push rejected</strong>.<br>Wrong account. My laptop thinks I’m “work-me,” but I’m actually in a personal repo. I run gh auth switch, Git still whines, SSH vs HTTPS gets moody, and somewhere in ~/.config/gh/hosts.yml a past version of me made a “creative” choice.</p><p>I wanted the <strong>kubectx</strong> experience for GitHub CLI — pick a context and move on. So I built a small GitHub CLI extension called <strong>gh-context</strong>. It lets you create named contexts (like work, personal), switch between them, and even <strong>bind a repo</strong> to a context so you stop pushing from the wrong account at 6:03 PM on a Friday.</p><p>This post is the how + why, in a practical, copy-pasteable way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Tmrwsf9xgP2U_rT-" /></figure><h3>What this fixes (in real life)</h3><ul><li>Accidentally pushing from your <strong>work</strong> account to a <strong>personal</strong> repo (or vice versa)</li><li>Manually editing hosts.yml like it’s 2004</li><li>SSH vs HTTPS roulette per repository</li><li>No per-repo “default account”</li></ul><h3>Install</h3><p>Prerequisite: You need the official GitHub CLI (gh) and to be logged in at least once:<br> gh auth login</p><p><strong>Install </strong><strong>gh extension:</strong></p><pre>gh extension install automationpi/gh-context</pre><h3>Quick demo</h3><p><strong>Create a context from your current login:</strong></p><pre>gh context new --from-current --name personal<br>✓ Created context &#39;personal&#39; → automationpi@github.com (ssh)</pre><p><strong>Create another context explicitly (hostname, user, transport):</strong></p><pre>gh context new --hostname github.com --user devexcom --transport https --name work<br>✓ Created context &#39;work&#39; → devexcom@github.com (https)</pre><p><strong>List available contexts:</strong></p><pre>gh context list<br>Available contexts:<br>  personal  (automationpi@github.com, ssh)<br>  work          (devexcom@github.com, https)</pre><p><strong>Switch whenever you like:</strong></p><p>Use gh context use &lt;name&gt; from anywhere to flip your active account on the spot. Behind the scenes it switches auth, syncs your Git credentials, and refreshes tokens so the change actually sticks. From then on, both gh commands and Git ops use that context until you switch again—hop back anytime with gh context use personal or gh context use work.</p><pre>gh context use work<br>✓ Now using context &#39;work&#39;<br><br>gh context current<br>Active: work (devexcom@github.com, transport=https)</pre><p><strong>Bind a repo to a context (set-and-forget):</strong></p><p>From the repo’s root, run gh context bind &lt;name&gt; to pin this repo to that account so gh auto-uses it here—set and forget, no accidental pushes.</p><pre># inside the repo you want to bind<br>gh context bind work<br>✓ Bound repo to context &#39;work&#39; (.ghcontext created)</pre><p><strong>From now on:</strong></p><pre>gh context apply<br># reads .ghcontext in this repo and switches automatically</pre><p>Optional Bonus: make it hands-free on cd:</p><p>Run gh context shell-hook and paste the snippet into ~/.zshrc or ~/.bashrc—now every time you cd into a repo with .ghcontext, the right account is auto-applied, hands-free.</p><pre>gh context shell-hook<br># copy the printed snippet into your ~/.zshrc or ~/.bashrc<br># it auto-applies the right context when you enter a repo that has .ghcontext</pre><p>Unbind if needed:</p><pre>gh context unbind<br>✓ Removed repo binding</pre><h3>Why I built it (and why it stuck)</h3><p>I don’t want to remember commands. I want <strong>muscle memory</strong>:</p><ul><li>gh context list → what do I have?</li><li>gh context use work → okay, I’m work-me now.</li><li>gh context bind work → this repo = work forever.</li><li>gh context apply → honor the repo’s choice (or do it automatically with the shell hook).</li></ul><p>Think of a <strong>context</strong> as:</p><pre>{ hostname, user, transport (ssh|https), optional ssh host alias }</pre><p><em>Name it. Use it. Forget the rest.</em></p><h3>How it works (plain + safe)</h3><p>Under the hood, it just wraps the official gh auth flows in the right order:</p><ol><li>gh auth switch --hostname &lt;host&gt; --user &lt;user&gt;</li><li>gh auth setup-git (syncs your git credential helper/remotes)</li><li>gh auth refresh -h &lt;host&gt; (best-effort refresh to avoid stale creds)</li></ol><p><strong>No tokens are stored</strong> by the extension.</p><h3>Common gotchas (and the fixes)</h3><ul><li><strong>“No auth for user X on host Y”</strong><br> Run gh auth login --hostname &lt;host&gt; once for that account. Then create/use the context.</li><li><strong>SSH vs HTTPS mismatch</strong><br> Pick it at context creation: --transport ssh|https. You can maintain both styles for different repos.</li><li><strong>Enterprise GitHub</strong><br> Use --hostname ghe.mycompany.com when creating the context.</li><li><strong>CI edge cases</strong><br> Environment variables like GH_TOKEN still override everything (by design). That’s good for pipelines.</li></ul><h3>Why its inspired by kubectx</h3><p>Because that’s the goal: <strong>simple, named contexts</strong> with an optional <strong>per-repo default</strong>.<br> I don’t want to fight my tools when I switch hats. I want to <em>just work</em>. If this saves you one Friday evening, it’s already worth it.</p><h3>Grab it / Feedback</h3><p>Repo: <strong>automationpi/gh-context</strong><br> If you’ve got ideas (JSON output, tests, power-user flags), open an issue or a PR. I’m still polishing it — and I’d love to hear how you use it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fe7026ac4b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Midgard: Reimagining Developer Onboarding and Discovery]]></title>
            <link>https://medium.com/the-heimdall-platform/midgard-reimagining-developer-onboarding-and-discovery-f5b80b90b096?source=rss-f86742c262c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5b80b90b096</guid>
            <category><![CDATA[backstage]]></category>
            <category><![CDATA[devex]]></category>
            <dc:creator><![CDATA[Naveen Alok]]></dc:creator>
            <pubDate>Tue, 26 Nov 2024 09:03:11 GMT</pubDate>
            <atom:updated>2024-11-26T09:03:11.313Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2mvGMSVjN3KAxid5.jpg" /><figcaption>Empowering developers with seamless clarity</figcaption></figure><p><em>Picture this:</em> It’s your first day as a software developer in the 90s. You walk in, practically bouncing with excitement, ready to write some amazing code. But then reality hits you like a ton of bricks — or more specifically, like the stack of dusty manuals dumped on your desk. “Legacy System Configuration,” “Database Setup,” “Enterprise Architecture Guide” and access to some shared folder with more documents — just reading the titles makes your eyes glaze over also you are not sure if you have all the documents to get you started.</p><p>Sound familiar? Whether it’s the 1990s or 2024, the story remains the same. The challenges for a new developer have not changed in decades. Sure, our tools have gotten fancier — we’ve traded paper manuals for digital ones and shared drives for cloud storage — but the core problem hasn’t changed. The information is still scattered, just in more sophisticated places.</p><h3><strong>Breaking Down Walls: Our Journey to Better Developer Onboarding</strong></h3><p>In recent years, as Novo Nordisk rapidly expanded, it became clear that finding the right information wasn’t just a challenge for new developers — it was a struggle for seasoned ones too. The growing maze of tools, documentation, and resources left even experienced developers hunting for answers. That’s why we created Midgard, our internal developer portal built on Backstage, the open-source framework originally developed by Spotify. Midgard streamlines access to everything developers need, bridging the gaps and ensuring no one — new or experienced — loses valuable time to unnecessary complexity.</p><h3>What is Midgard</h3><p>Midgard is a key capability of the Heimdall platform, which is Novo Nordisk’s comprehensive approach to implementing the <a href="https://cnoe.io/docs/reference-implementation/installations/app-idp">Cloud Native Operating Environment (CNOE) blueprint</a>. Heimdall is designed to streamline and accelerate software development within the organization by providing developers with a cohesive set of tools, resources, and infrastructure necessary to efficiently build, test, and deploy applications. As an essential component of Heimdall, Midgard serves as the developer portal and central interface, empowering developers to manage their applications, create runtime environments, and access relevant resources and documentation, all while abstracting away the complexities of the underlying infrastructure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*y5-A1zEM6pL6IRyWfOecCg.png" /><figcaption>Heimdall overview</figcaption></figure><p>Midgard, built on the open-source framework Backstage, serves as the developer portal and central interface for developers to interact with the Heimdall platform. It offers a user-friendly environment where developers can manage their applications, create runtime environments, and access relevant resources and documentation. They can also discover other teams working on similar technology stacks with access to their documentation and codebase.</p><p>By abstracting away the complexities of the underlying infrastructure and integrating with various components of the Heimdall architecture, Midgard empowers developers to focus on writing code and delivering value to their users, without worrying about the details of the platform.</p><h3><strong>Why We Built Midgard</strong></h3><p>As I mentioned, as Novo Nordisk grew, our development setup became more complicated. Our developers had to deal with a maze of tools—GitHub, Azure DevOps, SharePoint, and more. These tools were great but often felt disconnected, each serving a different purpose within the organization.</p><p>For new developers, it took weeks to figure out where everything was, let alone how it all worked together. Even experienced developers struggled to find inspiration or discover solutions across the company because it meant jumping between multiple platforms and dealing with the unavailability of a search engine that could search across all of them to find the right information.</p><p>We needed a one-stop shop for everything a developer needs — and that’s exactly what Midgard provides.</p><h3><strong>The Midgard Difference</strong></h3><p>Midgard isn’t just another tool — it’s like having a knowledgeable friend who knows exactly where everything is and how it all fits together. When you log in, you’re not just getting access to information; you’re getting context, relationships, and most importantly, clarity.</p><p>Let me walk you through what this actually means in practice. Say you’re a new developer assigned to work on a team. Instead of hunting through multiple systems, you open Midgard and everything you need is right there: the system, components &amp; service documentation, its dependencies, and the team information. It’s like having insights into the entire technical landscape.</p><p>Remember the last time you tried to find something specific in your company’s docs? Yeah, that usually ends up being a wild goose chase through multiple platforms. Midgard’s search isn’t just about finding documents — it understands context. As a developer when you have all the information you need at your fingertips, presented in a way that makes sense, you can focus on what really matters: writing great code.</p><p>The real power of Midgard is how everything’s connected. Click on a system, and you can see not just what it does, but how it fits into the bigger picture. Who uses it? Who owns it? What does it depend on? Who should you talk to if you have questions?</p><p>It’s all there, and it all makes sense.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*UgSp6Gz8kX9u2MQO1dONUA.png" /><figcaption>Screenshot of Backstage UI</figcaption></figure><h3><strong>Golden Paths: More Than Just Documentation</strong></h3><p>One thing we’re working on is our Golden Paths. Think of them as the “Novo Nordisk way” of getting things done. But they’re not just boring documentation. These are interactive guides that show you how to do everything — from your first commit, and setting up your development environment to deploying your first change.</p><p>Golden Paths aren’t just about checking off steps; they help you understand why we do things the way we do. They include our best practices, built from years of experience, and present them in a way that’s helpful.</p><p>The first goal of our Golden Paths is to automate tasks that can be used across the organization, like setting up a runtime or creating a templated Git repo, to make life easier for everyone. But it’s not just about automation — it’s about embedding our culture and values into the very tools we use every day.</p><p>For example, we have implemented Runtime as a Service as a golden path, which you can read about in this article: <a href="https://medium.com/the-heimdall-platform/runtime-as-a-service-5a202644a263">Runtime as a Service</a>. It is a good example of how we’ve abstracted away the complexities of the underlying infrastructure to provide developers with a streamlined way to spin up new runtime environments.</p><h3><strong>The Journey Has Just Begun</strong></h3><p>Midgard is more than just a tool — it’s our vision for what the developer experience should be. We’re always iterating, always improving, based on real feedback from our developers. Because at the end of the day, this is about creating an environment where developers can thrive from day one.</p><p>The best part? We’re just getting started. As we continue to grow and evolve, Midgard will grow with us, always adapting to meet the needs of our developers. Because when developers have the tools and information they need to succeed, amazing things happen.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5b80b90b096" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-heimdall-platform/midgard-reimagining-developer-onboarding-and-discovery-f5b80b90b096">Midgard: Reimagining Developer Onboarding and Discovery</a> was originally published in <a href="https://medium.com/the-heimdall-platform">The Heimdall Platform</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Baby Steps with Kubernetes: the AWS way]]></title>
            <link>https://naveenalok.medium.com/baby-steps-with-kubernetes-the-aws-way-bc043551415b?source=rss-f86742c262c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc043551415b</guid>
            <dc:creator><![CDATA[Naveen Alok]]></dc:creator>
            <pubDate>Sat, 23 Nov 2024 13:20:15 GMT</pubDate>
            <atom:updated>2024-11-23T13:25:35.587Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve been experimenting with Kubernetes using tools like Kind, Minikube, or Docker Desktop, you’re probably ready to take the next step — setting up a real production-grade Kubernetes cluster. While these local development tools are great for learning, they don’t quite capture the complexity and considerations of a production environment.<em> Still this is a beginner guide to set the expectations in k8s context.</em></p><p>Setting up a Kubernetes cluster on AWS can seem daunting at first. There’s networking to configure, security groups to set up, and various components to install and integrate. While managed services like EKS exist, understanding how to build a cluster from scratch is invaluable knowledge for any DevOps engineer or cloud architect.</p><p>In this guide, I’ll walk you through creating a production-ready Kubernetes cluster on AWS, drawing from my experience of setting up numerous clusters in production environments. Whether you’re a developer looking to understand Kubernetes infrastructure better, or a DevOps engineer preparing for a production deployment, this guide will help bridge the gap between local development and real-world implementation.</p><h3>Prerequisites</h3><p>Before diving in, make sure you have the following:</p><ul><li><strong>An AWS Account</strong>: Ensure you have the necessary permissions to create EC2 instances, security groups, and other resources.</li><li><strong>AWS CLI Installed and Configured</strong>: You’ll need the AWS Command Line Interface set up with your AWS credentials.</li><li><strong>Basic Understanding of AWS Services</strong>: Familiarity with EC2, VPCs, Security Groups, and IAM roles will be beneficial.</li><li><strong>Basic Knowledge of Kubernetes</strong>: Understanding core concepts like pods, nodes, services, and deployments will help you follow along.</li></ul><h3>Infrastructure Requirements</h3><p>We’ll set up a Kubernetes cluster consisting of one master node and multiple worker nodes.</p><h3>Master Node</h3><ul><li><strong>Instance Type</strong>: t3.medium or larger (minimum 2 vCPUs and 4GB RAM).</li><li><strong>Operating System</strong>: Ubuntu 22.04 LTS.</li><li><strong>Storage</strong>: At least 20GB of SSD storage.</li><li><strong>Network</strong>: Must be able to communicate with worker nodes over specific ports.</li></ul><h3>Worker Nodes</h3><ul><li><strong>Instance Type</strong>: t3.small or larger (minimum 2GB RAM).</li><li><strong>Operating System</strong>: Ubuntu 22.04 LTS.</li><li><strong>Storage</strong>: At least 20GB of SSD storage.</li><li><strong>Network</strong>: Must be able to communicate with the master node and other worker nodes.</li></ul><h3>Step 1: AWS Network Setup</h3><p>Before launching instances, we’ll set up the necessary network components, specifically security groups, to control traffic.</p><h3>Create Security Groups</h3><p>Security groups act as virtual firewalls for your instances to control inbound and outbound traffic.</p><h4>Master Node Security Group</h4><p>Create a security group for the master node with the following inbound rules:</p><p>Protocol Port Range Purpose Source TCP 6443 Kubernetes API Server 0.0.0.0/0 (Restrict in production) TCP 2379-2380 etcd Client Communication VPC CIDR (e.g., 10.0.0.0/16) TCP 10250 Kubelet API VPC CIDR TCP 10259 kube-scheduler VPC CIDR TCP 10257 kube-controller-manager VPC CIDR TCP 22 SSH Access Your IP (e.g., 203.0.113.0/32)</p><h4>Worker Node Security Group</h4><p>Create a security group for the worker nodes with the following inbound rules:</p><p>Protocol Port Range Purpose Source TCP 10250 Kubelet API VPC CIDR TCP 30000–32767 NodePort Services (External Access) 0.0.0.0/0 (Restrict in production) TCP 22 SSH Access Your IP (e.g., 203.0.113.0/32)</p><p><strong>Note</strong>: Always follow the principle of least privilege by restricting access to only necessary sources and ports.</p><h4>Why These Ports?</h4><p>Understanding the purpose of each port helps in configuring the cluster securely:</p><ul><li><strong>6443</strong>: Kubernetes API server listens here for all administrative communication.</li><li><strong>2379–2380</strong>: etcd, the cluster’s key-value store, uses these ports for client communication.</li><li><strong>10250</strong>: Kubelet API on each node, used by the control plane for node management.</li><li><strong>10259 &amp; 10257</strong>: Used by the scheduler and controller-manager for internal cluster communication.</li><li><strong>30000–32767</strong>: Default range for Kubernetes NodePort services, allowing external access to services.</li><li><strong>22</strong>: SSH access to the nodes for management and troubleshooting.</li></ul><p>For detailed information, refer to the <a href="https://kubernetes.io/docs/reference/ports-and-protocols/">Kubernetes Ports and Protocols documentation</a>.</p><h3>Step 2: Launch EC2 Instances</h3><p>With the security groups set up, we can now launch our EC2 instances.</p><h3>Launch the Master Node</h3><ol><li><strong>Navigate to EC2 Dashboard</strong>:</li></ol><p>Log in to your AWS Management Console and go to the EC2 service.</p><p><strong>Click “Launch Instance”</strong>:</p><p>Choose the “Ubuntu Server 22.04 LTS” AMI.</p><p><strong>Select Instance Type</strong>:</p><p>Choose t3.medium or a larger instance type.</p><p><strong>Configure Instance Details</strong>:</p><ul><li><strong>Network</strong>: Select the default VPC or your custom VPC.</li><li><strong>Subnet</strong>: Choose a subnet in your preferred availability zone.</li><li><strong>Auto-assign Public IP</strong>: Enable if you need to access the instance over the internet.</li></ul><p><strong>Add Storage</strong>:<br>Allocate at least 20GB of SSD storage.</p><ol><li><strong>Add Tags (optional)</strong>:<br>Key: Name, Value: k8s-master.</li></ol><p><strong>Configure Security Group</strong>:<br>Select the master node security group you created earlier.</p><p><strong>Review and Launch</strong>:<br>Choose an existing key pair or create a new one for SSH access.</p><h3>Launch Worker Nodes</h3><p>Repeat the steps for the worker nodes, adjusting the instance type and security group accordingly. Remember to tag each instance appropriately (e.g., k8s-worker1, k8s-worker2).</p><h3>Step 3: Base Setup on All Nodes</h3><p>Now we’ll prepare each node for Kubernetes installation.</p><h3>SSH into Each Node</h3><p>Use the key pair you specified during instance launch to SSH into each node:</p><pre>ssh -i /path/to/your-key.pem ubuntu@&lt;instance-public-ip&gt;</pre><h3>Update the System</h3><pre>sudo apt update &amp;&amp; sudo apt upgrade -y</pre><h3>Load Kernel Modules</h3><p>Kubernetes requires certain kernel modules for networking and container functionality.</p><p>Create a configuration file for the modules:</p><pre>sudo tee /etc/modules-load.d/k8s.conf &lt;&lt;EOF<br>overlay<br>br_netfilter<br>EOF</pre><p>Load the modules immediately:</p><pre>sudo modprobe overlay<br>sudo modprobe br_netfilter</pre><p>Verify they are loaded:</p><pre>lsmod | grep -e overlay -e br_netfilter</pre><h3>Configure sysctl</h3><p>Adjust kernel parameters for networking:</p><pre>sudo tee /etc/sysctl.d/k8s.conf &lt;&lt;EOF<br>net.bridge.bridge-nf-call-iptables=1<br>net.bridge.bridge-nf-call-ip6tables=1<br>net.ipv4.ip_forward=1<br>EOF</pre><p>Apply the new settings:</p><pre>sudo sysctl --system</pre><h3>Disable Swap</h3><p>Kubernetes requires swap to be disabled:</p><pre>sudo swapoff -a</pre><p>Prevent swap from being re-enabled after reboot:</p><pre>sudo sed -i &#39;/ swap / s/^/#/&#39; /etc/fstab</pre><h3>Install Required Packages</h3><pre>sudo apt install -y apt-transport-https ca-certificates curl</pre><p><strong>Why These Steps?</strong></p><ul><li><strong>Kernel Modules</strong>: The overlay and br_netfilter modules are necessary for container networking.</li><li><strong>sysctl Settings</strong>: Adjusting net.bridge.bridge-nf-call-iptables and related settings ensures that bridged network traffic is processed correctly.</li><li><strong>Disable Swap</strong>: Kubernetes’ memory management assumes swap is disabled.</li></ul><p>For more details, see the <a href="https://kubernetes.io/docs/setup/production-environment/container-runtimes/">Kubernetes Container Runtime Requirements</a>.</p><h3>Step 4: Install Container Runtime (All Nodes)</h3><p>We’ll install containerd, a lightweight container runtime.</p><h3>Install containerd</h3><pre>sudo apt install -y containerd</pre><h3>Configure containerd</h3><p>Create the default configuration file:</p><pre>sudo mkdir -p /etc/containerd<br>sudo containerd config default | sudo tee /etc/containerd/config.toml</pre><p>Edit the configuration to use systemd as the cgroup driver:</p><pre>sudo sed -i &#39;s/SystemdCgroup = false/SystemdCgroup = true/&#39; /etc/containerd/config.toml</pre><h3>Restart and Enable containerd</h3><pre>sudo systemctl restart containerd<br>sudo systemctl enable containerd</pre><h3>Verify containerd</h3><pre>sudo systemctl status containerd</pre><p><strong>Why containerd?</strong></p><p>containerd is a high-performance container runtime that integrates well with Kubernetes. Using systemd as the cgroup driver ensures better resource management and compatibility with Kubernetes components.</p><h3>Step 5: Install Kubernetes Components (All Nodes)</h3><p>Install kubeadm, kubelet, and kubectl on all nodes.</p><h3>Add Kubernetes Apt Repository</h3><pre>sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg</pre><pre>echo &quot;deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main&quot; | \<br>sudo tee /etc/apt/sources.list.d/kubernetes.list</pre><h3>Install the Packages</h3><pre>sudo apt update<br>sudo apt install -y kubelet kubeadm kubectl<br>sudo apt-mark hold kubelet kubeadm kubectl</pre><p><strong>Explanation:</strong></p><ul><li><strong>kubelet</strong>: Runs on all nodes and manages the lifecycle of containers.</li><li><strong>kubeadm</strong>: Simplifies the process of setting up a Kubernetes cluster.</li><li><strong>kubectl</strong>: Command-line tool to interact with the cluster.</li></ul><h3>Verify Installation</h3><pre>kubeadm version<br>kubectl version --client</pre><h3>Step 6: Initialize the Control Plane (Master Node Only)</h3><p>On the master node, initialize the Kubernetes control plane.</p><h3>Initialize Kubernetes</h3><pre>sudo kubeadm init --pod-network-cidr=10.244.0.0/16</pre><p><strong>Explanation:</strong></p><ul><li><strong>--pod-network-cidr</strong>: Specifies the CIDR for the pod network. We&#39;re using Flannel, which requires 10.244.0.0/16.</li></ul><p>The output will include commands to manage your cluster and the kubeadm join command for worker nodes.</p><h3>Set Up kubectl for the ubuntu User</h3><pre>mkdir -p $HOME/.kube<br>sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config<br>sudo chown $(id -u):$(id -g) $HOME/.kube/config</pre><p>Now you can use kubectl without sudo.</p><p><strong>Why These Steps?</strong></p><ul><li><strong>Initialization</strong>: Sets up the control plane components like the API server, scheduler, and controller manager.</li><li><strong>kubectl Configuration</strong>: Allows the non-root user to interact with the cluster.</li></ul><h3>Step 7: Install a Pod Network Add-on (Master Node)</h3><p>Kubernetes requires a network plugin for pod communication.</p><h3>Install Flannel CNI Plugin</h3><pre>kubectl apply -f https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml</pre><p><strong>Why Flannel?</strong></p><p>Flannel is a simple and easy-to-use network fabric for Kubernetes. It provides a layer 3 network to host containers. For alternatives, consider Calico or Weave Net.</p><h3>Step 8: Join Worker Nodes to the Cluster</h3><p>Use the kubeadm join command from the master node initialization.</p><h3>On Each Worker Node</h3><p>Run the join command (replace with your actual command):</p><pre>sudo kubeadm join &lt;master-ip&gt;:6443 --token &lt;token&gt; \<br>    --discovery-token-ca-cert-hash sha256:&lt;hash&gt;</pre><p><strong>If You Lost the Join Command:</strong></p><p>Generate a new token on the master node:</p><pre>kubeadm token create --print-join-command</pre><p><strong>Why These Steps?</strong></p><p>Joining worker nodes integrates them into the cluster, allowing them to run workloads and communicate with the control plane.</p><h3>Verify the Cluster</h3><h3>On the Master Node</h3><p>Check the nodes:</p><pre>kubectl get nodes</pre><p>You should see all nodes with the STATUS as Ready.</p><h3>Check System Pods</h3><pre>kubectl get pods --all-namespaces</pre><p>Ensure all pods are running, especially those in the kube-system namespace.</p><h3>Deploy a Test Application</h3><p>Deploy Nginx:</p><pre>kubectl create deployment nginx --image=nginx</pre><p>Expose it:</p><pre>kubectl expose deployment nginx --port=80 --type=NodePort</pre><p>Get the service details:</p><pre>kubectl get svc nginx</pre><p>Access the application:</p><pre>curl http://&lt;worker-node-ip&gt;:&lt;node-port&gt;</pre><p>Replace &lt;worker-node-ip&gt; with the IP of a worker node and &lt;node-port&gt; with the port number from the service.</p><h3>Additional Resources</h3><p><strong>Official Kubernetes Documentation</strong>:<br><a href="https://kubernetes.io/docs/home/">Kubernetes Docs</a></p><p><strong>AWS EKS Best Practices</strong>:<br>Even if you’re not using EKS, this guide offers valuable insights.<br><a href="https://aws.github.io/aws-eks-best-practices/">AWS EKS Best Practices Guide</a></p><p><strong>Kubernetes the Hard Way by Kelsey Hightower</strong>:<br>Deep dive into Kubernetes internals by manually building a cluster.<br><a href="https://github.com/kelseyhightower/kubernetes-the-hard-way">Kubernetes the Hard Way</a></p><p>With this knowledge, you’re well on your way to deploying scalable and resilient applications on your own Kubernetes cluster.</p><p>Happy Kubernetes-ing!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc043551415b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Journey to Becoming One of the First Certified Backstage Associates(CBA)]]></title>
            <link>https://naveenalok.medium.com/my-journey-to-becoming-one-of-the-first-certified-backstage-associates-cba-563fe42479ce?source=rss-f86742c262c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/563fe42479ce</guid>
            <dc:creator><![CDATA[Naveen Alok]]></dc:creator>
            <pubDate>Sat, 09 Nov 2024 21:28:28 GMT</pubDate>
            <atom:updated>2024-11-09T21:28:28.448Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*100yZRYiwwoF5yX0pno2KA.png" /></figure><p>After less than a year of working with Backstage in my organization, I received an intriguing email from <strong>The Linux Foundation</strong>. They were launching a new certification program — the Certified Backstage Associate (CBA) — and I was invited to participate in the beta exam. Little did I know I was about to embark on a challenging journey that would test my Backstage knowledge in unexpected ways.</p><h3>The Beta Experience</h3><p>When I first received the invitation for the beta exam scheduled from August 29th to September 12th, 2024, I was both excited and nervous. As someone relatively new to Backstage, I wasn’t sure what to expect. The Linux Foundation was offering an interesting proposition: take the beta exam, provide feedback, and if successful, earn the certification and badge for free. I booked my proctored exam for 10th October.</p><h3>The Exam Reality Check</h3><p>The exam turned out to be quite different from what I initially expected. Here’s what I discovered:</p><ul><li>I was given all the available questions available for certification as a beta tester (unexpectedly)</li><li>The questions were your typical straightforward technical queries but there were a few docker and k8s questions as well which I was not expecting</li><li>You need to score above 60% to pass,</li><li>The exam tests your practical understanding of Backstage, not just theoretical knowledge</li><li>Even with hands-on experience, the questions make you think deeply about Backstage concepts and how things are stitched together.</li></ul><h3>The Waiting Game</h3><p>Unlike regular LinuxFoundation certification exams where you get results in 24–48 hours, this beta phase meant waiting. It took almost a month before I finally received my certification results. During this time, the certification wasn’t even publicly available — making the wait even more suspenseful.</p><h3>Key Takeaways for Future CBA Candidates</h3><p>For those considering taking the CBA exam now that it’s publicly available, here are some insights:</p><ol><li><strong>Real-world experience matters</strong>: My hands-on experience with Backstage, though less than a year, proved invaluable during the exam</li><li><strong>Think practically</strong>: The questions often require you to apply your knowledge to realistic scenarios</li><li><strong>Time management is crucial</strong>: Plan your time wisely during the exam</li><li><strong>Feedback is important</strong>: During the beta, providing detailed feedback was important</li></ol><p>As Backstage continues to gain adoption in the developer platform space, having a standardized way to validate expertise becomes increasingly important. The CBA certification from The Linux Foundation helps establish a baseline of knowledge for professionals working with Backstage.</p><p>** My badge is not available in credly :( **</p><p><em>Have you been working with Backstage? The certification is now publicly available, and I’d encourage you to take this step in validating your expertise! </em><a href="https://training.linuxfoundation.org/certification/certified-backstage-associate-cba/">https://training.linuxfoundation.org/certification/certified-backstage-associate-cba/</a></p><p>Good luck!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=563fe42479ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Backstage Service for Custom OTel Metrics Export]]></title>
            <link>https://naveenalok.medium.com/building-a-backstage-service-for-custom-otel-metrics-export-0b1307246f39?source=rss-f86742c262c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/0b1307246f39</guid>
            <dc:creator><![CDATA[Naveen Alok]]></dc:creator>
            <pubDate>Sat, 14 Sep 2024 07:32:22 GMT</pubDate>
            <atom:updated>2024-09-14T07:32:22.714Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>About Backstage</strong></h3><p><a href="https://backstage.io/">Backstage</a> is an open-source platform for building developer portals, originally developed by Spotify. It streamlines infrastructure tooling, services, and documentation into a single, consistent UI, making it easier for developers to navigate complex environments. Backstage is now a <a href="https://www.cncf.io/projects/backstage/">Cloud Native Computing Foundation (CNCF)</a> incubating project, which underscores its growing adoption and community support.</p><p>Backstage, developed by Spotify, is an open-source platform for building developer portals. While it offers robust features out of the box, you might need to extend its functionality to suit your specific needs — especially when it comes to observability and monitoring. In this article, we’ll walk through the process of creating a Backstage service that sends custom OpenTelemetry (OTel) metrics data.</p><p>By the end of this tutorial, you’ll have a working Backstage service that pushes mock OTel metrics data to an OpenTelemetry Collector via gRPC.</p><h3>Prerequisites</h3><p>Before you begin, ensure you have the following:</p><ol><li><strong>An existing Backstage backend setup.</strong></li><li><strong>Basic knowledge of Backstage plugins and services.</strong></li><li><strong>A running OpenTelemetry Collector</strong>, either locally or remotely.</li><li><strong>Installed </strong><strong>@opentelemetry packages.</strong></li></ol><p>Make sure you have the following @opentelemetry packages installed in your Backstage project:</p><pre>yarn add @opentelemetry/api @opentelemetry/sdk-metrics @opentelemetry/exporter-metrics-otlp-grpc @grpc/grpc-js</pre><h3>Step 1: Create the OpenTelemetry Metrics Service</h3><p>We’ll start by creating a new service that sends mock metrics data to the OpenTelemetry Collector.</p><h3>Create the Service File</h3><p>Navigate to your Backstage project directory and create a new file for the service:</p><pre>touch packages/backend/src/plugins/otel-metrics-service.ts</pre><p>Now, add the following code to otel-metrics-service.ts:</p><pre>import { diag, DiagConsoleLogger, DiagLogLevel } from &#39;@opentelemetry/api&#39;;<br>import { MeterProvider } from &#39;@opentelemetry/sdk-metrics&#39;;<br>import { OTLPMetricExporter } from &#39;@opentelemetry/exporter-metrics-otlp-grpc&#39;;<br>import { PeriodicExportingMetricReader } from &#39;@opentelemetry/sdk-metrics&#39;;<br>import * as grpc from &#39;@grpc/grpc-js&#39;;<br><br>export class OtelMetricsService {<br>  static start() {<br>    diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.ALL);<br>    const metricExporter = new OTLPMetricExporter({<br>      url: &#39;grpc://localhost:4317&#39;,<br>      credentials: grpc.credentials.createInsecure(),<br>    });<br>    const meterProvider = new MeterProvider();<br>    meterProvider.addMetricReader(<br>      new PeriodicExportingMetricReader({<br>        exporter: metricExporter,<br>        exportIntervalMillis: 10000,<br>      }),<br>    );<br>    const meter = meterProvider.getMeter(&#39;backstage-metrics&#39;);<br>    const usersGauge = meter.createObservableGauge(&#39;users_engaged&#39;, {<br>      description: &#39;Number of users engaged with Backstage in the last 28 days&#39;,<br>    });<br>    usersGauge.addCallback((observableResult) =&gt; {<br>      observableResult.observe(350);<br>    });<br>    const weeklySearchesGauge = meter.createObservableGauge(&#39;weekly_searches&#39;, {<br>      description: &#39;Number of searches in the last week&#39;,<br>    });<br>    weeklySearchesGauge.addCallback((observableResult) =&gt; {<br>      observableResult.observe(1565);<br>    });<br>    const weeklyUsersGauge = meter.createObservableGauge(&#39;weekly_users&#39;, {<br>      description: &#39;Number of weekly active users&#39;,<br>    });<br>    weeklyUsersGauge.addCallback((observableResult) =&gt; {<br>      observableResult.observe(505);<br>    });<br>    const templateRunsGauge = meter.createObservableGauge(&#39;template_runs&#39;, {<br>      description: &#39;Number of template runs in the last 28 days&#39;,<br>    });<br>    templateRunsGauge.addCallback((observableResult) =&gt; {<br>      observableResult.observe(7);<br>    });<br>    const feedbackCounter = meter.createCounter(&#39;feedback_items&#39;, {<br>      description: &#39;Number of feedback items collected&#39;,<br>    });<br>    feedbackCounter.add(2);<br>    const requestCounter = meter.createCounter(&#39;test_requests&#39;, {<br>      description: &#39;Test request counter&#39;,<br>    });<br>    setInterval(() =&gt; {<br>      requestCounter.add(1);<br>      console.log(&#39;Test metric recorded&#39;);<br>    }, 10000);<br>  }<br>}</pre><h3>Explanation</h3><p>In this code, we’re creating mock metrics for users, searches, and feedback. These metrics will be sent to the OpenTelemetry Collector every 10 seconds using an insecure gRPC connection, assuming the collector is running locally.</p><p><strong>Configuring the Metric Exporter</strong></p><pre>const metricExporter = new OTLPMetricExporter({<br>  url: &#39;grpc://localhost:4317&#39;,<br>  credentials: grpc.credentials.createInsecure(),<br>});</pre><blockquote>This exporter is configured to send metrics to the OpenTelemetry Collector running locally on port 4317 using gRPC.</blockquote><p><strong>Creating the Meter Provider</strong></p><pre>const meterProvider = new MeterProvider();</pre><blockquote>The `MeterProvider` is responsible for managing metric instruments and collecting metric data.</blockquote><p><strong>Adding a Metric Reader</strong></p><pre>meterProvider.addMetricReader(<br>  new PeriodicExportingMetricReader({<br>    exporter: metricExporter,<br>    exportIntervalMillis: 10000,<br>  }),<br>);</pre><blockquote>A `PeriodicExportingMetricReader` is added to the meter provider, which periodically exports collected metrics every 10,000 milliseconds (10 seconds) using the configured exporter.</blockquote><p><strong>Pushing mock data to OTel</strong></p><p><strong>Pushing Engaged data</strong></p><pre>const usersGauge = meter.createObservableGauge(&#39;users_engaged&#39;, {<br>  description: &#39;Number of users engaged with Backstage in the last 28 days&#39;,<br>});<br>usersGauge.addCallback((observableResult) =&gt; {<br>  observableResult.observe(350);<br>});</pre><blockquote>This gauge reports the number of users engaged over the last 28 days, set to a constant value of 350.</blockquote><p><strong>Pushing Weekly Searches data</strong></p><pre>const weeklySearchesGauge = meter.createObservableGauge(&#39;weekly_searches&#39;, {<br>  description: &#39;Number of searches in the last week&#39;,<br>});<br>weeklySearchesGauge.addCallback((observableResult) =&gt; {<br>  observableResult.observe(1565);<br>});</pre><blockquote>Reports a constant value of 1,565 searches in the last week.</blockquote><p><strong>Pushing Weekly Users data</strong></p><pre>const weeklyUsersGauge = meter.createObservableGauge(&#39;weekly_users&#39;, {<br>  description: &#39;Number of weekly active users&#39;,<br>});<br>weeklyUsersGauge.addCallback((observableResult) =&gt; {<br>  observableResult.observe(505);<br>});</pre><blockquote>Reports 505 weekly active users.</blockquote><p><strong>Pushing Template Runs data</strong></p><pre>const templateRunsGauge = meter.createObservableGauge(&#39;template_runs&#39;, {<br>  description: &#39;Number of template runs in the last 28 days&#39;,<br>});<br>templateRunsGauge.addCallback((observableResult) =&gt; {<br>  observableResult.observe(7);<br>});</pre><blockquote>Reports 7 template runs over the last 28 days</blockquote><h3>Step 2: Integrate the Service into Backstage</h3><p>Next, we’ll integrate the service into the Backstage backend. We’ll initialize the service in the index.ts file where the backend starts.</p><h3>Modify index.ts</h3><p>In your packages/backend/src/index.ts, import the service and call its start() method when the backend initializes:</p><pre>import { createBackend } from &#39;@backstage/backend-defaults&#39;;<br>import { OtelMetricsService } from &#39;./plugins/otel-metrics-service&#39;;<br><br>const backend = createBackend();<br>OtelMetricsService.start();<br>backend.add(import(&#39;@backstage/plugin-app-backend/alpha&#39;));<br>backend.add(import(&#39;@backstage/plugin-proxy-backend/alpha&#39;));<br>backend.add(import(&#39;@backstage/plugin-scaffolder-backend/alpha&#39;));<br>backend.add(import(&#39;@backstage/plugin-techdocs-backend/alpha&#39;));<br>// Add other plugins as needed...<br>backend.start();</pre><p>By adding OtelMetricsService.start(), you ensure that the OpenTelemetry metrics service starts when the Backstage backend does. It will periodically export mock metrics to your collector.</p><h3>Step 3: Set Up the OpenTelemetry Collector</h3><p>You’ll need an OpenTelemetry Collector to receive and process the metrics. If you don’t have one running locally, you can start a basic setup using Docker:</p><pre>docker run --rm -p 4317:4317 -p 9464:9464 \<br>  -v &quot;$(pwd)/otel-collector-config.yaml&quot;:/otel-collector-config.yaml \<br>  otel/opentelemetry-collector:latest \<br>  --config /otel-collector-config.yaml</pre><p>This command assumes you have a configuration file named otel-collector-config.yaml in your current directory. If you don&#39;t, here&#39;s a simple configuration for testing purposes:</p><pre>receivers:<br>  otlp:<br>    protocols:<br>      grpc:<br>        endpoint: &quot;0.0.0.0:4317&quot;  <br><br>processors:<br>  batch:  <br><br>exporters:<br>  logging:  <br>    verbosity: detailed<br><br>service:<br>  pipelines:<br>    traces:<br>      receivers: [otlp]<br>      processors: [batch]<br>      exporters: [logging]<br>    metrics:<br>      receivers: [otlp]<br>      processors: [batch]<br>      exporters: [logging]</pre><h3>Step 4: Run the Backstage Backend</h3><p>With the service integrated, you can now run the Backstage backend:</p><pre>yarn start</pre><p>You should see output indicating that metrics are being recorded and exported:</p><pre>Test metric recorded</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*39aA1xfyksbi9ldWlMGX_Q.png" /><figcaption>Console screenshot : Backstage</figcaption></figure><p>Check your OpenTelemetry Collector or Prometheus/Grafana dashboards to ensure the metrics are being received and processed.</p><h3>Step 5: Verify Metrics in Prometheus or Grafana</h3><p>To visualize or monitor these metrics, you can integrate Prometheus or Grafana with your OpenTelemetry setup. Configure the OpenTelemetry Collector to export metrics to Prometheus, and then visualize the metrics in Grafana.</p><p>Integrating OpenTelemetry with Backstage enhances your application’s observability by providing detailed metrics that can be monitored and analyzed. In this article, we’ve walked through creating a custom service within Backstage to export mock metrics to an OpenTelemetry Collector using gRPC. This foundational setup allows you to extend and customize metrics collection according to your application’s needs.</p><blockquote>For further reading and to deepen your understanding, consider exploring the following resources:</blockquote><p><strong>OpenTelemetry Documentation</strong>:</p><ul><li><a href="https://opentelemetry.io/">OpenTelemetry Official Site</a></li><li><a href="https://github.com/open-telemetry/opentelemetry-js">OpenTelemetry JavaScript SDK</a></li><li><a href="https://opentelemetry.io/docs/collector/">OpenTelemetry Collector</a></li><li><a href="https://opentelemetry.io/docs/reference/specification/metrics/">OpenTelemetry Metrics API</a></li></ul><p><strong>Backstage Documentation</strong>:</p><ul><li><a href="https://backstage.io/">Backstage Official Website</a></li><li><a href="https://github.com/backstage/backstage">Backstage GitHub Repository</a></li><li><a href="https://backstage.io/docs/plugins/overview">Backstage Plugins and Integrations</a></li><li><a href="https://backstage.io/docs/getting-started/">Getting Started with Backstage</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0b1307246f39" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Set Up a Multi-Node Kubernetes Cluster Locally Using Kind]]></title>
            <link>https://naveenalok.medium.com/how-to-set-up-a-multi-node-kubernetes-cluster-locally-using-kind-a9d0c169ca90?source=rss-f86742c262c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9d0c169ca90</guid>
            <dc:creator><![CDATA[Naveen Alok]]></dc:creator>
            <pubDate>Sun, 25 Aug 2024 09:50:07 GMT</pubDate>
            <atom:updated>2024-08-25T09:50:56.203Z</atom:updated>
            <content:encoded><![CDATA[<p>Scope of this article is to enable learners and developers to run a local cluster locally. In this guide, we will walk through the process of setting up a three-node Kubernetes (K8s) cluster on your local machine using Kind (Kubernetes in Docker). This multi-node setup is perfect for simulating a production environment, allowing you to test your applications and Kubernetes configurations locally before deploying them to a real cluster.</p><p><strong>Prerequisites</strong></p><p>Before we begin, ensure you have the following installed on your local machine:</p><ol><li><strong>Docker</strong>: Kind runs Kubernetes clusters in Docker containers, so Docker needs to be installed and running. You can download and install Docker from here.</li><li><strong>kubectl</strong>: kubectl is the command-line tool for interacting with your Kubernetes cluster. You can install it by following the official instructions here.</li><li><strong>Kind</strong>: Install Kind by following the steps below.</li></ol><p><strong>Step 1: Install Kind</strong></p><p><strong>On macOS/Linux (using Homebrew):</strong></p><pre>brew install kind</pre><p><strong>On Windows (using Chocolatey):</strong></p><pre>choco install kind</pre><p><strong>Direct Installation (for other OS):</strong></p><p>Download the latest binary from the <a href="https://github.com/kubernetes-sigs/kind/releases">Kind GitHub releases</a> and move it to a directory in your PATH.</p><pre>curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64<br>chmod +x ./kind<br>mv ./kind /usr/local/bin/kind</pre><p><strong>Step 2: Create a Three-Node Kubernetes Cluster</strong></p><p>With Kind installed, let’s create a multi-node Kubernetes cluster.</p><p><strong>Create a Custom Cluster Configuration</strong></p><p>First, create a configuration file that defines a cluster with one control-plane node and two worker nodes:</p><pre># kind-config.yaml<br>kind: Cluster<br>apiVersion: kind.x-k8s.io/v1alpha4<br>nodes:<br>- role: control-plane<br>- role: worker<br>- role: worker</pre><p>Save this file as kind-config.yaml.</p><p><strong>Create the Cluster</strong></p><p>Use the configuration file to create your Kubernetes cluster:</p><pre>kind create cluster - config=kind-config.yaml</pre><p>Kind will create a cluster with one control-plane node and two worker nodes. This might take a few minutes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*LnADilurYSqnVczJqPw2_Q.png" /><figcaption><strong>Screenshot:</strong> creating a cluster.</figcaption></figure><p><strong>Verify the Cluster</strong></p><p>To ensure that the cluster was created successfully, run the following command:</p><pre>kubectl get nodes</pre><p>You should see three nodes listed: one control-plane node and two worker nodes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*tk8pW8XZvraxAqWbytdPxg.png" /><figcaption><strong>Screenshot:</strong> Take a screenshot showing the output of the kubectl get nodes command.</figcaption></figure><p><strong>Step 3: Deploying a Sample Application on the Multi-Node Cluster</strong></p><p>Now that your cluster is up and running, let’s deploy a simple application to it.</p><p><strong>Deploy an Nginx Application</strong></p><p>We will deploy an Nginx web server using a Kubernetes deployment. This deployment will automatically distribute the pods across the available nodes.</p><pre>kubectl create deployment nginx - image=nginx</pre><p><strong>Scale the Deployment</strong></p><p>To see how the workload is distributed across the nodes, scale the deployment to run multiple replicas:</p><pre>kubectl scale deployment nginx - replicas=3</pre><p>Check the distribution of the pods:</p><pre>kubectl get pods -o wide</pre><p>This command will show on which nodes the Nginx pods are running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*DLBg0QFhTxMYVBjgh9rAtw.png" /><figcaption><strong>Screenshot:</strong> Scaled deployment</figcaption></figure><p><strong>Expose the Deployment</strong></p><p>To access the Nginx service, expose it as a NodePort:</p><pre>kubectl expose deployment nginx - type=NodePort - port=80</pre><p><strong>Access the Application</strong></p><p>Get the NodePort and access the service in your browser:</p><pre>kubectl get service nginx</pre><p>Take note of the NodePort and use it to access the application:</p><pre>http://localhost:&lt;NodePort&gt;</pre><p><strong>Step 4: Managing Your Multi-Node Cluster</strong></p><p><strong>Checking Node Status</strong></p><p>To see the status of your nodes:</p><pre>kubectl get nodes</pre><p><strong>Checking Pod Distribution</strong></p><p>You can observe how the workload is distributed across the nodes by listing the pods with details:</p><pre>kubectl get pods -o wide</pre><p>This will give you an idea of how Kubernetes schedules your workloads across the cluster.</p><p><strong>Deleting the Cluster</strong></p><p>Once you’re done, you can delete the cluster:</p><pre>kind delete cluster</pre><p>This command will remove the entire cluster, freeing up resources on your local machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*OAQSg7ed69-Jxi46oPah5A.png" /><figcaption><strong>Screenshot:</strong> terminal after the cluster deletion.</figcaption></figure><p><strong>Insights and Best Practices</strong></p><p><strong>1. Resource Allocation</strong></p><ul><li>Even though this is a local setup, it’s important to monitor Docker’s resource usage. You can adjust Docker’s CPU and memory allocation to ensure that your multi-node cluster runs smoothly.</li></ul><p><strong>2. Cluster Configurations</strong></p><ul><li>For more complex scenarios, you can modify the Kind configuration file to simulate different environments, such as adding more worker nodes, simulating network partitions, or setting up specific resource constraints.</li></ul><p><strong>3. Realistic Testing</strong></p><ul><li>Use this multi-node setup to test your applications’ behavior in a distributed environment. This can help identify issues related to load balancing, scaling, and node failures before deploying to a production environment.</li></ul><p>You’ve successfully set up a multi-node Kubernetes cluster on your local machine using Kind. This setup provides a powerful way to simulate a production environment for testing and development. By deploying and scaling applications on this cluster, you gain valuable insights into how your application might perform in a real-world scenario.</p><p>This local setup not only saves you the cost and complexity of spinning up multiple cloud VMs but also allows you to learn and test Kubernetes in a controlled environment. It’s an ideal solution for experimenting with new features, troubleshooting configurations, and refining your deployment strategies without relying on cloud resources.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9d0c169ca90" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Up Oh My Zsh for Docker and Kubernetes: A Complete Guide]]></title>
            <link>https://naveenalok.medium.com/setting-up-oh-my-zsh-for-docker-and-kubernetes-a-complete-guide-74d00bc91054?source=rss-f86742c262c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/74d00bc91054</guid>
            <dc:creator><![CDATA[Naveen Alok]]></dc:creator>
            <pubDate>Sat, 17 Aug 2024 12:48:21 GMT</pubDate>
            <atom:updated>2024-08-17T12:48:21.166Z</atom:updated>
            <content:encoded><![CDATA[<p>As developers, we often find ourselves switching between different tools and environments, especially when working with Docker and Kubernetes. A well-configured shell can make this process smoother and more efficient. One of the best ways to enhance your terminal experience is by using Oh My Zsh (<a href="https://ohmyz.sh/">https://ohmyz.sh/</a>), a delightful framework for managing your Zsh configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*XE_KEiUsTU9KIYBt.png" /><figcaption>Source: <a href="https://ohmyz.sh/">https://ohmyz.sh</a></figcaption></figure><p>In this article, I’ll guide you through setting up Oh My Zsh with plugins that are specifically useful for Docker and Kubernetes. Whether you’re new to Zsh or just looking to supercharge your terminal, this guide will help you get up and running.</p><p><strong>Why Oh My Zsh?</strong></p><p>Oh My Zsh is a popular open-source framework that makes managing your Zsh configuration easier and more enjoyable. With its vast array of plugins, themes, and customization options, it can turn your terminal into a powerful development tool.</p><p><strong>Step 1: Install Zsh and Oh My Zsh</strong></p><p>Before we can start configuring, we need to make sure Zsh is installed. If you’re on macOS, Zsh is likely already installed, but if you’re on Linux, you might need to install it manually.</p><p><strong>Installing Zsh</strong></p><p>On <strong>Ubuntu/Debian</strong>, run:</p><pre>sudo apt update<br>sudo apt install zsh -y</pre><p>On <strong>CentOS/RHEL</strong>, run:</p><pre>sudo yum install zsh -y</pre><p>For <strong>macOS</strong> users, if you need to reinstall or update Zsh:</p><pre>brew install zsh</pre><p><strong>Installing Oh My Zsh</strong></p><p>Next, let’s install Oh My Zsh using the official installation script:</p><pre>sh -c &quot;$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)&quot;</pre><p>This will install Oh My Zsh and set Zsh as your default shell. If you’re prompted, log out and back in to make sure Zsh is used as your shell.</p><p><strong>Step 2: Powering Up with Docker and Kubernetes Plugins</strong></p><p>Now that you’ve got Oh My Zsh installed, it’s time to supercharge it with some plugins.</p><p><strong>Enabling the Docker Plugin</strong></p><p>Oh My Zsh includes a Docker plugin that provides useful aliases and functions. To enable it:</p><ol><li>Open your .zshrc file in your favorite text editor:</li></ol><pre>nano ~/.zshrc</pre><ol><li>Find the line that begins with plugins=() and add docker inside the parentheses:</li></ol><pre>plugins=(git docker)</pre><ol><li>Save and close the file, then apply the changes:</li></ol><pre>source ~/.zshrc</pre><p><strong>Adding Kubernetes Plugins</strong></p><p>The next step is to add plugins that will make working with Kubernetes much easier.</p><ol><li><strong>kubectl Plugin</strong>: This plugin provides autocompletion and helpful aliases for kubectl.</li></ol><p>Add kubectl to your plugins list:</p><pre>plugins=(git docker kubectl)</pre><ol><li><strong>kubectx and kubens</strong>: These tools allow you to switch between Kubernetes contexts and namespaces quickly. To install them:</li></ol><p>On <strong>Ubuntu</strong> or <strong>Debian</strong>:</p><pre>sudo apt install kubectx</pre><p>Then, add them to your Zsh plugins list:</p><pre>plugins=(git docker kubectl kubectx)</pre><ol><li>Save and apply these changes:</li></ol><pre>source ~/.zshrc</pre><p><strong>Step 3: Enhancing Your Experience with Syntax Highlighting and Autosuggestions</strong></p><p>To further improve your terminal experience, let’s add two more plugins: <strong>Zsh Syntax Highlighting</strong> and <strong>Zsh Autosuggestions</strong>.</p><p><strong>Installing Zsh Syntax Highlighting</strong></p><p>This plugin highlights commands as you type, making it easier to spot errors before you run them.</p><ol><li>Clone the Zsh Syntax Highlighting repository:</li></ol><pre>git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting</pre><p>Add zsh-syntax-highlighting to your plugins list in .zshrc:</p><pre>plugins=(git docker kubectl kubectx zsh-syntax-highlighting)</pre><ol><li>Save and apply the changes:</li></ol><pre>source ~/.zshrc</pre><p><strong>Installing Zsh Autosuggestions</strong></p><p>This plugin suggests commands as you type based on your history and previous commands.</p><ol><li>Clone the Zsh Autosuggestions repository:</li></ol><pre>git clone https://github.com/zsh-users/zsh-autosuggestions</pre><p>${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions</p><ol><li>Add zsh-autosuggestions to your plugins list:</li></ol><pre>plugins=(git docker kubectl kubectx zsh-syntax-highlighting zsh-autosuggestions)</pre><p>Save and apply the changes:</p><pre>source ~/.zshrc</pre><p><strong>Step 4: Verifying Your Setup</strong></p><p>With everything installed and configured, it’s time to make sure everything is working correctly.</p><ol><li><strong>Docker Plugin</strong>: Type docker in your terminal and press Tab. You should see a list of completions and helpful aliases.</li><li><strong>Kubernetes Plugins</strong>: Type kubectl and press Tab. You should see Kubernetes completions. Additionally, commands like kubectx should be available.</li><li><strong>Syntax Highlighting and Autosuggestions</strong>: Start typing any command, and you should see suggestions in grey, with syntax highlighting helping you avoid errors.</li></ol><p><strong>Step 5: (Optional) Customize Your Zsh Theme</strong></p><p>While you’re customizing, why not give your terminal a fresh look with a new theme? Oh My Zsh comes with a variety of themes. One popular choice is agnoster, which provides a clean, informative prompt.</p><ol><li>Open your .zshrc file and find the line starting with ZSH_THEME.</li><li>Set it to agnoster:</li></ol><pre>ZSH_THEME=&quot;agnoster&quot;</pre><ol><li>Save and apply the changes:</li></ol><pre>source ~/.zshrc</pre><p><strong>Conclusion</strong></p><p>With Oh My Zsh set up and configured for Docker and Kubernetes, your terminal is now a powerful tool that will help you work more efficiently. The plugins you’ve added provide enhanced functionality, making it easier to manage containers, work with Kubernetes clusters, and avoid errors with syntax highlighting and autosuggestions.</p><p>Whether you’re deploying applications or managing complex clusters, this setup will make your workflow smoother and more enjoyable. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74d00bc91054" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The 737 Max Disaster: A Software Testing Nightmare]]></title>
            <link>https://naveenalok.medium.com/the-737-max-disaster-a-software-testing-nightmare-4b187d7682cc?source=rss-f86742c262c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b187d7682cc</guid>
            <dc:creator><![CDATA[Naveen Alok]]></dc:creator>
            <pubDate>Sat, 15 Oct 2022 03:03:51 GMT</pubDate>
            <atom:updated>2022-10-15T03:06:39.495Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*gvhqvDzC6Lm6xwvtwivuLg.png" /></figure><p>When you think of airplane crashes, you probably don’t think of software failure as the leading cause. But that’s exactly what happened to Boeing in March when two brand new 737 Max planes crashed within five months of each other. It was later discovered that there were serious bugs in the plane’s anti-stall software and it&#39;s MCAS (Maneuvering Characteristics Augmentation System). The response from airlines and the general public was swift: The 737 Max fleet was grounded worldwide for months until further investigation.</p><h3>The Software Failures</h3><p>The Boeing 737 Max crashes were due to two separate problems in the software, both of which had to do with the flight control system. The first incident happened on March 10 when the Lion Air flight crashed into the Java Sea off the coast of Indonesia, killing all 189 passengers and crew members on board. The second incident was on October 29, when a Southwest 737 Max flight crashed in the Sangre de Cristo Mountains in New Mexico, killing the 1st officer and injuring the captain. Thankfully, they were able to land safely. The Lion Air flight crashed due to a malfunction in the Maneuvering Characteristics Augmentation System (MCAS). MCAS is a feature on the 737 Max designed to prevent the plane from stalling.</p><h3>What Went Wrong?</h3><p>While many people think that airplane crashes are caused by human error and pilot mistakes, software also has the potential to cause a crash. There are several ways software could cause a crash or a near-miss, including incorrect inputs or incorrect outputs, incorrect calculations, or a software bug. Most importantly a bug that is missed during testing or a bug that never appears in simulated &amp; test conditions.</p><p>The Maneuvering Characteristics Augmentation System (MCAS) software on the Boeing 737 Max has been the subject of much controversy since the first Max crash. The MCAS is responsible for keeping the plane from stalling, which is especially important at low altitudes where there’s less air. The system automatically reduces the angle of the airplane’s nose during takeoff to increase the lift on the wings and keep the plane from stalling. But when the MCAS is activated, the pilots can’t simply turn it off; instead, they have to follow a two-step process to disengage it. The first step is to reduce the vertical speed of the plane, which is measured in feet per minute. The second step is to change the pitch of the nose of the plane. This is much easier said than done, particularly when the plane is in a low-altitude situation where there isn’t much air. This can cause serious problems for pilots, particularly if they don’t know the MCAS is activated.</p><h3>Fix</h3><p>After the first Boeing 737 Max crash, Boeing was quick to release a software update to correct the problem. Operators took the extra step of having their pilots train on the newly corrected software and also had their pilots fly under low-altitude situations to test the new software and make sure it worked as intended.</p><h3>Bottom line</h3><p>One size doesn&#39;t fit all, and the complexity of testing may vary in the domain you are working bug in a payroll system has a different impact than testing aviation software; however, this can’t be an excuse for failing. While the Boeing 737 Max aircraft have been cleared to fly again, it’s important to remember that this wasn’t a problem with the design of the plane itself; it was a problem with a piece of software that could have been tested better.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b187d7682cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Handle Dynamic content with Selenium and Jsoup!]]></title>
            <link>https://naveenalok.medium.com/handle-dynamic-content-with-selenium-and-jsoup-9c82a2ff7372?source=rss-f86742c262c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c82a2ff7372</guid>
            <category><![CDATA[selenium-webdriver]]></category>
            <category><![CDATA[dynamic-web]]></category>
            <category><![CDATA[robustness]]></category>
            <dc:creator><![CDATA[Naveen Alok]]></dc:creator>
            <pubDate>Mon, 06 Jun 2022 11:40:35 GMT</pubDate>
            <atom:updated>2022-06-06T11:40:35.089Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/532/0*nvF9dO32xuhbO_2c" /><figcaption>Selenium with Jsoup</figcaption></figure><p>Today almost every website has some element of user-interaction and content that changes dynamically based on inputs. This calls for a different approach while designing test automation scripts with Selenium or any other automated testing tool. And the standard tools used to automate web applications generally fall short of meeting these challenges. These dynamic websites require special care when designing test code so as not to break them again and again every time we make a change. There are some simple ways to get started with your first tests, but it’s an ongoing process that requires keeping up with the changes made by designers and developers. Luckily, there are some great libraries out there that can help us conquer these challenges.</p><h3>Jsoup for Selenium Automation</h3><p>Jsoup is a Java library for working with real-world HTML. It allows you to select and extract the parts of a web page that you are interested in, as either raw text or XML, and construct new pages from these components. As a library for working with real-world HTML, Jsoup is primarily concerned with solving the problems that you will actually face when dealing with HTML in the wild. JSoup is a lightweight Java library that lets you extract and select data from HTML documents using CSS selectors. In this example we will be using CSS selector method to extend it to be used with Selenium.</p><h3>Getting Started with Jsoup</h3><p>Make sure that Jsoup is available on the classpath before you begin. I use Maven, so I have included a Maven dependency in my pom.xml that you will need to include in the dependencies section.</p><pre>&lt;dependency&gt;<br>   &lt;groupId&gt;org.jsoup&lt;/groupId&gt;<br>   &lt;artifactId&gt;jsoup&lt;/artifactId&gt;<br>   &lt;version&gt;1.15.1&lt;/version&gt;<br>&lt;/dependency&gt;</pre><p>For latest version refer to:</p><p>mvnrepository.com : <a href="https://mvnrepository.com/artifact/org.jsoup/jsoup">https://mvnrepository.com/artifact/org.jsoup/jsoup</a></p><h3>Example : Jsoup + Selenium</h3><p>We will click on a few links on a website without coding for locators (xpath or css selectors) in this example. In real testing scenarios, these would be dynamic text such as a transaction id.</p><p>In this example we are opening a page and clicking on links, however you can click on any webelement like span or div as long as you provide a text.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/596a3bb724c05ff87a4addc8aac3926d/href">https://medium.com/media/596a3bb724c05ff87a4addc8aac3926d/href</a></iframe><p>Git repo for you to play</p><p><a href="https://github.com/automationpi/jsoup-sel">GitHub - automationpi/jsoup-sel</a></p><p>This article discussed how Selenium can be used for testing dynamic websites. It also described how Jsoup can be used as a better alternative for xpath in testing dynamic websites. With the increasing complexity of applications, it’s critical to ensure that your test automation code is designed with challenges in mind. Automated tests can be very useful in making sure that your code works correctly and spots any issues that might be present. However, if the tests are not stable, they can actually cause more problems than they solve. Therefore, it’s important to make sure you are using the right techniques to create your test automation code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c82a2ff7372" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>