<?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 Ayush Kejariwal on Medium]]></title>
        <description><![CDATA[Stories by Ayush Kejariwal on Medium]]></description>
        <link>https://medium.com/@kejariwalayush?source=rss-b93dfb0e077c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*OuKZ-wBRrGOYzjfuNz6TGg.png</url>
            <title>Stories by Ayush Kejariwal on Medium</title>
            <link>https://medium.com/@kejariwalayush?source=rss-b93dfb0e077c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 09:37:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kejariwalayush/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[JSON is Costing You Money: A Protobuf Migration Story]]></title>
            <link>https://kejariwalayush.medium.com/json-is-costing-you-money-a-protobuf-migration-story-48ce3950a7a9?source=rss-b93dfb0e077c------2</link>
            <guid isPermaLink="false">https://medium.com/p/48ce3950a7a9</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <dc:creator><![CDATA[Ayush Kejariwal]]></dc:creator>
            <pubDate>Wed, 17 Dec 2025 05:40:34 GMT</pubDate>
            <atom:updated>2025-12-17T05:40:34.120Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>A survivor’s guide to modernizing your data exchange without losing your mind.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6uB3zZLojgHK_mKPNk0E6A.png" /></figure><p>Let’s be honest for a second. If you’ve been coding in the enterprise space for the last few years, you know the struggle. We used to live in a world of massive, monolithic Java applications where everything just… worked. Java Serialization was this “magic” thing that took our objects and turned them into byte streams, and we didn’t ask too many questions.</p><p>But today? The game has changed completely. We aren’t building monoliths in Bangalore or Hyderabad anymore; we are building dynamic, distributed, cloud-native microservices that need to talk to each other <em>fast</em>. And that old-school serialization? It’s basically a dinosaur. It couples your data to your code structure (bad idea), it’s got security holes that let arbitrary code execute (scary idea), and the payloads are huge (expensive idea).</p><p>So, a while back, I started looking for a better way. I needed something that didn’t care if I was writing in Java &amp;Python. I needed speed. I found <strong>Protocol Buffers (Protobuf)</strong>, and frankly, I haven’t looked back.</p><h3>What is the Deal with Protobuf?</h3><p>If you haven’t used it yet, Protocol Buffers is Google’s answer to data serialization. Think of it as XML or JSON, but smaller, faster, and simpler.</p><p>It’s rapidly becoming the industry standard for a reason. It is designed to keep your data secure, ensure your old code doesn’t break when you update a field (backward compatibility is a lifesaver), and it gives you massive performance gains.</p><p>But the real “killer feature” for me? It forces you into a <strong>“schema-first”</strong> mindset. No more guessing what the payload looks like. You define it, and everyone sticks to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h0bCZ46e9C61fHJk6UMLCQ.png" /></figure><h3>My “Cheatsheet” for migration</h3><p>Transitioning from a brittle, language-locked system to a robust, polyglot architecture isn’t easy, but here is what worked for me and my team:</p><ol><li><strong>Stick to Proto3</strong>: Seriously, just use version 3.15 or later. Use the optional keyword to keep your semantic fidelity high. It makes life so much easier.</li><li><strong>Use Schema Registries</strong>: Don’t deploy blindly. We enforce schema registries (like Google Cloud Pub/Sub schemas) to check compatibility <em>before</em> we push code. It prevents those 3 AM panic calls.</li><li><strong>The </strong><strong>json_name Hack</strong>: This is my favorite tip. If you are integrating with a JavaScript frontend or a Python data science pipeline, you know they love JSON. Protobuf usually likes snake_case, but JSON/Java prefers camelCase. The json_name option in Protobuf lets you define a custom JSON key name while keeping your Protobuf schema clean. It’s a bridge between the two worlds.</li><li><strong>Dual-Write Patterns</strong>: When you are moving systems over, adopt a dual-write pattern to “de-risk” the transition. It allows you to validate the new system without turning off the old one immediately.</li></ol><h3>The Bottom Line</h3><p>Moving to Protobuf isn’t just about saving bytes; it’s about securing your data supply chain and reducing those operational costs that finance hates. It unlocks the real potential of cloud-native architectures.</p><p>So, grab a chai, fire up your IDE, and give Protobuf a shot. Your future self (and your server bill) will thank you.</p><p><strong>SEO Keywords:</strong> Protocol Buffers, Protobuf vs JSON, Microservices Architecture, Data Serialization, Backend Development, Proto3 Tutorial, High Performance Computing, Enterprise Modernization.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48ce3950a7a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Monolith vs Microservices: A Developer’s Journey Through Architectural Chaos and Clarity]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://kejariwalayush.medium.com/monolith-vs-microservices-a-developers-journey-through-architectural-chaos-and-clarity-982614edc2a9?source=rss-b93dfb0e077c------2"><img src="https://cdn-images-1.medium.com/max/1468/1*4e295zEvMW0vD3TPWuojog.png" width="1468"></a></p><p class="medium-feed-snippet">The Tale of Two Architectures</p><p class="medium-feed-link"><a href="https://kejariwalayush.medium.com/monolith-vs-microservices-a-developers-journey-through-architectural-chaos-and-clarity-982614edc2a9?source=rss-b93dfb0e077c------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://kejariwalayush.medium.com/monolith-vs-microservices-a-developers-journey-through-architectural-chaos-and-clarity-982614edc2a9?source=rss-b93dfb0e077c------2</link>
            <guid isPermaLink="false">https://medium.com/p/982614edc2a9</guid>
            <category><![CDATA[experience]]></category>
            <category><![CDATA[monolithic-architecture]]></category>
            <category><![CDATA[monolithic]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <dc:creator><![CDATA[Ayush Kejariwal]]></dc:creator>
            <pubDate>Tue, 09 Dec 2025 11:04:15 GMT</pubDate>
            <atom:updated>2025-12-09T11:04:15.973Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Deploying Python Apps with Kubernetes & Docker: Secrets and Service Accounts Made Fun! ]]></title>
            <link>https://kejariwalayush.medium.com/deploying-python-apps-with-kubernetes-docker-secrets-and-service-accounts-made-fun-5a19c2afa1ed?source=rss-b93dfb0e077c------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a19c2afa1ed</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Ayush Kejariwal]]></dc:creator>
            <pubDate>Fri, 30 May 2025 06:20:27 GMT</pubDate>
            <atom:updated>2025-05-30T06:20:27.906Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ycKvBjsywhJRIPGx3l02w.png" /></figure><p>Hey Pythonistas! 🐍 Ready to level up your deployment game? Forget dry manuals — let’s turn Kubernetes secrets and service accounts into an adventure. Imagine your app as a spaceship, Docker as its engine, and Kubernetes as mission control. Buckle up! 🌌</p><h3>Kubernetes: Your Cluster’s Command Center</h3><p><strong>The ultimate puppet master for containers!</strong></p><h4>Pods: Your App’s Cozy Spaceship Cabins</h4><ul><li><strong>Lifecycle</strong>: Pods are like temporary space stations — born, serve their purpose, and vanish. <strong>Poof!</strong> ✨</li><li><strong>Communication</strong>: Containers in a pod chat via `localhost` — like crewmates passing notes in zero gravity!</li></ul><h4>Nodes: The Hardworking Robots 🤖</h4><ul><li><strong><em>Types</em></strong>: <br> — <strong>Master</strong>: The bossy brain (think Elon Musk). <br> — <strong>Worker</strong>: The muscle (like Popoye lifting containers).</li><li><strong><em>Roles</em></strong>: Assign tasks like “handle networking” or “manage storage” — your robots’ job descriptions!</li></ul><h4>Services: Universal Translators</h4><p><strong><em>Types</em></strong>: <br> — <strong>ClusterIP</strong>: Internal team chat. <br> — <strong>NodePort</strong>: Open a window to the outside world. <br> — <strong>LoadBalancer</strong>: Roll out the red carpet for users!</p><blockquote>Choose wisely — it’s like picking a comms channel for your spaceship!</blockquote><h3>Docker: Your App’s Launchpad</h3><h4>Images: Blueprints for Spaceships</h4><ul><li><strong><em>Creation:</em></strong></li></ul><pre># Dockerfile: Your spaceship blueprint!<br> FROM python:3.9-slim<br> COPY . /app<br> RUN pip install -r requirements.txt<br> CMD [&quot;python&quot;, &quot;app.py&quot;]</pre><ul><li><strong><em>Build &amp; Launch:</em></strong></li></ul><pre>docker build -t my-python-app . # Construction time!<br> docker run my-python-app # Blast off! 🚀</pre><ul><li><strong><em>Pitfalls</em></strong>: <br> — <strong>Missing dependencies?</strong> 😱 → Always test locally! <br> — <strong>Image too heavy?</strong> → Slim down with `alpine` images.</li></ul><h4>Containers: Your Running Spaceships</h4><ul><li><strong>Lifecycle</strong>: Born (`docker run`), work, retire (`docker stop`).</li><li><strong>Interaction</strong>: Containers gossip via ports — like intercoms between spaceships! 📡</li></ul><h3>Python App Deployment: Mission Checklist</h3><h4>Phase 1: Dockerize Your App</h4><p>1. <strong>Write a `Dockerfile`</strong> (your spaceship blueprint). <br>2. <strong>Build</strong>: `docker build -t python-rocket .` <br>3. <strong>Test</strong>: `docker run — name test-flight python-rocket`</p><h4>Phase 2: Kubernetes Launch Sequence</h4><p><strong>1. Deployment Config </strong>(`deployment.yaml`):</p><pre>apiVersion: apps/v1<br> kind: Deployment<br> metadata:<br> name: python-app<br> spec:<br> replicas: 3 # Three backup spaceships!<br> template:<br> spec:<br> containers:<br> - name: python-pod<br> image: python-rocket:latest</pre><p>2. <strong>Launch</strong>: `kubectl apply -f deployment.yaml` <br><strong>3.</strong> <strong>Expose</strong>: Add a `Service` to let Earthlings (users) access your app!</p><blockquote>Pro Tip: Use `kubectl get pods` to watch your pods like mission control tracking spaceships! 📟</blockquote><h3>Service Accounts: Your Pod’s ID Badge</h3><h4>Why Bother?</h4><p>- <strong>Benefits</strong>: Restrict pod access (<strong><em>“You shall not pass!”</em></strong> — Gandalf style). <br>- <strong>Danger Zone</strong>: Misconfigured = 🚨 <strong><em>Security breach!</em></strong></p><h4>Setup in 3 Commands:</h4><p>1. Create badge: `kubectl create serviceaccount pod-bouncer` <br>2. Assign permissions (Role):</p><pre>rules:<br> - apiGroups: [&quot;&quot;]<br> resources: [&quot;pods&quot;]<br> verbs: [&quot;get&quot;, &quot;watch&quot;] # Can watch pods, not delete!</pre><p>3. Bind badge to role: `kubectl create rolebinding bouncer-binding — role=pod-watcher — serviceaccount=default:pod-bouncer`</p><h3>Secrets: Your App’s Vault 🔐</h3><h4>Create Secrets Like a Spy</h4><pre>kubectl create secret generic launch-codes - from-literal=api-key=&quot;42-answer-to-everything&quot;</pre><h4>Access Secrets in Python</h4><pre>import os<br>api_key = os.environ.get(&quot;API_KEY&quot;)<br>if not api_key:<br> print(&quot;🚨 RED ALERT: Missing launch codes!&quot;) # Drama!<br>else:<br> launch_rocket(api_key) # Proceed! 🚀</pre><h4>Decode Secrets in Terminal:</h4><pre>kubectl get secret launch-codes -o jsonpath=&quot;{.data.api-key}&quot; | base64 - decode<br></pre><p><em>Output</em>: `42-answer-to-everything` — <strong><em>shhh</em></strong>! 🤫</p><h3>Conclusion: You’re a Deployment Hero!</h3><p>You’ve navigated Docker’s seas 🌊, commanded Kubernetes robots 🤖, guarded secrets 🔐, and issued security badges 🪪. Pat yourself on the back — your Python app is now orbiting smoothly!</p><blockquote><strong>Remember</strong> <br>- Rotate secrets like toothbrushes! 🪥 <br>- Service accounts = VIP bouncers for your pods. <br>- When in doubt, `kubectl get events` is your debug radar! 📡</blockquote><h3>FAQs: Quick Fire Round 🔥</h3><p>1. <strong>How often should I rotate secrets?</strong><br> → <em>As often as you change your Netflix password!</em> (At least quarterly.)</p><p>2. <strong>Can a pod have multiple service accounts?</strong><br><em> → Nope! One badge per pod — no imposters! 🕵️</em></p><p>3. <strong>How to roll back a borked deployment?</strong> <br> <em>→ `kubectl rollout undo deployment/python-app` — Time machine activated! </em>⏳</p><p>4. <strong>Private Docker registry?</strong> <br><em> → Tell Kubernetes the secret handshake:</em></p><pre>imagePullSecrets:<br> - name: registry-key # Shhh… it&#39;s a secret!y</pre><p>5. <strong>Monitor app health?</strong><br><em> → Use </em><strong><em>readiness/liveness probes</em></strong><em>— Kubernetes’ stethoscope! 🩺</em></p><p>Ready for liftoff? Your Python app just got a <strong>Kubernetes-powered turbo boost</strong>! 🎉 <br><em>Share your war stories below! 👇</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a19c2afa1ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Master Git Branch Management: The Ultimate Guide for Solo Developers & Teams of Any Size]]></title>
            <link>https://kejariwalayush.medium.com/master-git-branch-management-the-ultimate-guide-for-solo-developers-teams-of-any-size-a9114fb9e9dd?source=rss-b93dfb0e077c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9114fb9e9dd</guid>
            <category><![CDATA[git-branching-strategy]]></category>
            <category><![CDATA[git-best-practices]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[team-collaboration]]></category>
            <category><![CDATA[versioncontroltips]]></category>
            <dc:creator><![CDATA[Ayush Kejariwal]]></dc:creator>
            <pubDate>Fri, 16 May 2025 07:49:30 GMT</pubDate>
            <atom:updated>2025-05-16T07:49:30.320Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s collaborative development world, proper Git branch management is the difference between smooth sailing and endless merge conflicts (looking at you, Gary). This guide will help you choose and implement the right branching strategy for your specific needs — whether you’re flying solo or steering a massive enterprise ship.</p><blockquote><strong>Fair warning:</strong> Throughout this guide, expect some lighthearted sitcom references sprinkled in to keep things fun. Because if managing Git can’t make you smile, well… you’re probably stuck in a merge conflict.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t-4uq_rZPqx59G_VYPknHA.png" /></figure><h3><strong>The Fundamentals of Branch Management</strong></h3><p>Think of branch management like traffic control for your code. Each branch is its own lane where features and fixes race forward without causing a pileup on the main highway. If you don’t manage it right, you’ll end up with merge conflicts that feel like a Pied Piper server crash right before launch.</p><p>Before we go full Richard Hendricks on this, here’s the lingo:</p><ul><li><strong>Feature branch</strong>: Your isolated workspace for developing specific features</li><li><strong>Main/master branch</strong>: The source of truth containing production-ready code</li><li><strong>Pull Request (PR)</strong>: Your request to integrate changes back into the main flow</li><li><strong>Merge conflict</strong>: What happens when Git can’t automatically resolve differences</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*uRpZEUBfOv0Kk7GJB4b3iQ.png" /></figure><h3><strong>Three Key Strategies: When to Use Each One</strong></h3><p>Not all merge strategies are created equal. Your choice shapes not just how your Git history looks, but how smoothly your team actually works together (or fights over the keyboard). Let’s break down the three main approaches so you can pick the one that fits your team’s vibe:</p><pre>| Strategy | History Style | Best For | Team Experience Level |<br>| - - - - - | - - - - - - - | - - - - - | - - - - - - - - - - - - |<br>| Squash &amp; Merge | Clean, feature-focused | Small-medium teams, feature-based work | Beginner to Intermediate |<br>| Create a Merge Commit | Complete, detailed | Complex features, debugging-heavy work | Intermediate |<br>| Rebase | Linear, clean | Experienced teams, continuous integration | Advanced |</pre><p>Think of it like picking your startup’s funding strategy: some want fast and lean, some want full transparency, and others are playing the long game with the perfect pitch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*GpzuAhMixoMReQFKBcDrtg.png" /></figure><h3><strong>Squash and Merge: Keeping History Clean</strong></h3><p>Squash and merge is like Richard’s “one true algorithm” — it takes all the messy commits and compresses them into one sleek, clean commit on main. Because nobody wants their Git history looking like a Pied Piper tech demo gone wrong.</p><p><strong><em>Perfect For:</em></strong></p><ul><li>Solo developers who want a clean history</li><li>Small to medium teams focused on features rather than implementation details</li><li>Projects where the end result matters more than the journey</li></ul><p><strong><em>Real-World Implementation:</em></strong></p><pre># On your main branch<br>git checkout main<br>git pull origin main<br>git merge - squash feature/awesome-feature<br>git commit -m &quot;Feature: Add awesome feature with all components&quot;<br>git push origin main</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FbUh1dPSz1SsB1B0XBmovw.png" /><figcaption>“Before &amp; After Squash Merge” — Visual showing multiple commits in a feature branch being consolidated into one clean commit on main.</figcaption></figure><h3><strong>Create a Merge Commit: Preserving Complete History</strong></h3><p>Standard merging is like saving the whole <em>Office</em> documentary instead of just the highlights — every awkward moment, every Jim prank, all preserved in one neat merge commit. Perfect if you want the full behind-the-scenes story of your code.</p><p><strong><em>Perfect For:</em></strong></p><ul><li>Teams where tracking implementation details matters</li><li>Complex features developed over long periods</li><li>Situations where you might need to debug “how we got here”</li><li>Continuing work on feature branches after initial merges</li></ul><p><strong><em>Real-World Implementation:</em></strong></p><pre># On your main branch<br>git checkout main<br>git pull origin main<br>git merge feature/awesome-feature - no-ff<br>git push origin main</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xjFsSIHqxH2eoR7qvyqsOg.png" /><figcaption>“Merge Commit Visualization” — Show how a merge commit preserves branch structure and history with a before/after diagram.</figcaption></figure><h3><strong>Rebasing: Creating Linear History</strong></h3><p>Rebasing is like rewriting history so it looks like you always <em>meant</em> to build your feature on top of the latest main — kind of like how Barney Stinson <em>always</em> has a perfect story. It makes your Git history look slick, but yeah, you gotta know your stuff to pull it off without disaster.</p><p><strong><em>Perfect For:</em></strong></p><ul><li>Experienced developers comfortable with Git</li><li>Teams with strict code review processes</li><li>Projects where a clean, linear history is valued highly</li></ul><p><strong><em>Real-World Implementation:</em></strong></p><pre># While on your feature branch<br>git checkout feature/awesome-feature<br>git fetch origin<br>git rebase origin/main<br># Resolve conflicts if needed<br>git push origin feature/awesome-feature - force-with-lease</pre><blockquote>⚠️ <strong>CAUTION</strong>: Never rebase branches that others are working on!</blockquote><h3><strong>Branch Cleanup: Best Practices</strong></h3><p>You wouldn’t leave scaffolding hanging around after the building’s done — don’t leave old branches cluttering your repo. Clean ’em up before your Git history looks like Michael Scott’s whiteboard.</p><p><strong><em>When to Delete Branches:</em></strong></p><ul><li>Immediately after squash and merge operations</li><li>After standard merges where work is truly complete</li><li>When branches have become stale or abandoned</li></ul><p><strong><em>When to Keep Branches:</em></strong></p><ul><li>When feature development will continue after initial merge</li><li>For release branches that might need future hotfixes</li><li>For reference branches that document major architectural decisions</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*Ht3lG-bcMtxiJvGW8LcXcw.png" /></figure><h3><strong>Size Matters 😜: Finding Your Perfect Strategy for Your Team</strong></h3><p>Like Joey with pizza slices, your branching strategy depends on how many people are sharing the pie. Here’s what usually works best, whether you’re a tiny startup squad or a whole DevOps battalion.</p><p><strong><em>Solo Developers</em></strong></p><ul><li><strong>Recommended Strategy</strong>: Squash and merge</li><li><strong>Why</strong>: Keeps history clean without worrying about team coordination</li><li><strong>Setup Tip</strong>: Configure GitHub to default to squash merges for personal projects</li></ul><p><strong><em>Small Teams (2–5 developers)</em></strong></p><ul><li><strong>Recommended Strategy</strong>: Squash and merge for most features, standard merge for complex ones</li><li><strong>Why</strong>: Balances clean history with needed detail on complex features</li><li><strong>Setup Tip</strong>: Use branch protection to require pull requests</li></ul><p><strong><em>Medium Teams (6–15 developers)</em></strong></p><ul><li><strong>Recommended Strategy</strong>: Mixed approach with clearly defined rules</li><li><strong>Why</strong>: Different features have different needs as team size grows</li><li><strong>Setup Tip</strong>: Document your branching strategy in your repo’s README.md</li></ul><p><strong><em>Large Teams (15+ developers)</em></strong></p><ul><li><strong>Recommended Strategy</strong>: Standard merge or rebase with detailed guidelines</li><li><strong>Why</strong>: Preserves important context when many people contribute</li><li><strong>Setup Tip</strong>: Use GitHub branch protection rules to enforce review requirements</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*LLkF20CV4VFjCRN2e9P-IA.png" /></figure><h3><strong>Automation Tips: Configure Once, Benefit Forever</strong></h3><p>Set it and forget it — like Ron Swanson with a steak timer. GitHub’s repo settings can enforce your branching strategy so no one (looking at you, Gary) accidentally pushes to main again.</p><p><strong><em>Setting Up Auto-Delete for Merged Branches:</em></strong></p><ol><li>Go to your repository on GitHub</li><li>Click on “Settings” in the top navigation</li><li>Select “Options” from the left sidebar</li><li>Scroll down to “Merge button”</li><li>Check “Automatically delete head branches”</li></ol><p><strong><em>Configuring Default Merge Type:</em></strong></p><ol><li>In the same “Merge button” section</li><li>Uncheck “Allow merge commits” if you never want standard merges</li><li>Uncheck “Allow squash merging” if you never want squash merges</li><li>Uncheck “Allow rebase merging” if you never want rebase merges</li><li>Select only the option you want as the default</li></ol><p><strong><em>Setting Up Branch Protection:</em></strong></p><ol><li>Go to “Settings” &gt; “Branches”</li><li>Click “Add rule” under “Branch protection rules”</li><li>Enter your main branch name (e.g., “main” or “master”)</li><li>Configure required reviews, status checks, etc.</li><li>Consider enabling “Require linear history” for a rebase-based workflow</li></ol><h3><strong>Visual Tools That Make Life Easier</strong></h3><p>Not everyone dreams in terminal green. For the devs who prefer clicks over `git log — oneline — graph`, these visual tools can help your team stick to good branching practices — without needing a command-line decoder ring.</p><p><strong><em>GitHub Desktop</em></strong></p><ul><li>Perfect for: Beginners and visual thinkers</li><li>Key features: Visual diffs, simplified branch management</li><li>Pro tip: Use the “Update from default branch” option frequently to avoid merge conflicts</li></ul><p><strong><em>VS Code Git Integration</em></strong></p><ul><li>Perfect for: Developers who live in their editor</li><li>Key features: Inline blame, integrated terminal, merge conflict resolution</li><li>Pro tip: Install the GitLens extension for even more powerful history exploration</li></ul><p><strong><em>GitKraken</em></strong></p><ul><li>Perfect for: Teams that need a comprehensive visual Git client</li><li>Key features: Visual commit graph, drag-and-drop merging, team collaboration</li><li>Pro tip: Use the built-in Gitflow functionality for structured workflows</li></ul><h3><strong>Ready to standardize your team’s branching strategy?</strong></h3><p>Before everyone ends up with branches named fix-broken-final-final-no-really-this-time, copy these templates into your team docs and save future-you from Git-induced chaos.</p><p><strong><em>For Teams Adopting Squash and Merge:</em></strong></p><pre><br># Our Branching Strategy<br>We use squash and merge to keep our history clean and focused on features rather than implementation details.<br>## Creating a New Feature<br>1. Create a branch from main: `git checkout -b feature/descriptive-name`<br>2. Make your changes with descriptive commit messages<br>3. Open a pull request against main<br>4. After review, squash and merge your PR<br>5. The branch will be automatically deleted<br>## Why We Use This Strategy<br>- Keeps our main branch history clean and focused on features<br>- Makes it easier to understand what changed and why<br>- Simplifies reverting features if needed</pre><p><strong><em>For Teams Adopting Standard Merge:</em></strong></p><pre># Our Branching Strategy<br>We use standard merge to preserve the complete history of how features were developed.<br>## Creating a New Feature<br>1. Create a branch from main: `git checkout -b feature/descriptive-name`<br>2. Make meaningful, atomic commits with clear messages<br>3. Open a pull request against main<br>4. After review, merge your PR with a merge commit<br>5. Keep or delete the branch based on whether development will continue<br>## Why We Use This Strategy<br>- Preserves the complete development history<br>- Makes debugging easier with detailed commit history<br>- Supports continued development on feature branches</pre><p><strong>Choosing a Git branching strategy?</strong> Oh boy.</p><p>It’s like picking a roommate in <em>Friends</em> — you <em>think</em> you want the structured one (<em>Git Flow</em>), but six sprints in, you’re wondering if trunk-based is more your “Monica clean, Joey chill” vibe.</p><p>Truth is, the <strong>best</strong> branching strategy is the one your team can actually follow — <em>without</em> starting every retro with:</p><p><em>“So… who force-pushed to main again?”</em> 🙃</p><p>(I’ve been there. Once. We now have a release branch, and only a few brave souls are allowed to touch main. Gary is <strong>not</strong> one of them. 😅)</p><p>Yes, a clean commit history is a thing of beauty.</p><p>But if your team spends more time rebasing than building, it’s time to pause and ask:</p><p><em>“Are we developers or Git historians?”</em></p><p>Spoiler: you’re shipping pizza-ordering microservices, not writing the next Shakespeare.</p><p>And don’t even get me started on automation — merge queues, pre-push hooks, CI/CD pipelines… basically anything that keeps Gary from deleting the release branch <em>again</em>.</p><p><strong>“Could this BE any more broken?”</strong></p><p>So let’s hear it:</p><p>🛠 What Git branching strategy does your team <em>actually</em> use (not just what’s in the docs)?<br>🤖 Got any tools that make things smoother than Ross yelling <em>“PIVOT!”</em> during a deploy?</p><p>Drop your tips, horror stories, or commit memes in the comments.</p><p>We’re all just trying to avoid shipping bugs and broken dreams to production on a Friday. 🚀</p><p>Happy Coding!!!🤞</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9114fb9e9dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Java to Proto: A Developer’s Guide to Painless Object Conversion]]></title>
            <link>https://kejariwalayush.medium.com/from-java-to-proto-a-developers-guide-to-painless-object-conversion-397144eed2a9?source=rss-b93dfb0e077c------2</link>
            <guid isPermaLink="false">https://medium.com/p/397144eed2a9</guid>
            <category><![CDATA[object-serialization]]></category>
            <category><![CDATA[java-development]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[protobuf]]></category>
            <category><![CDATA[refelection]]></category>
            <dc:creator><![CDATA[Ayush Kejariwal]]></dc:creator>
            <pubDate>Fri, 16 Aug 2024 10:58:10 GMT</pubDate>
            <atom:updated>2024-08-16T10:58:10.502Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey there, fellow devs! 👋 Let’s chat about something that’s probably given you a headache at least once in your coding career: converting Java objects to Protocol Buffers (Proto). If you’ve ever found yourself drowning in a sea of setter methods and null checks, you’re not alone. But what if I told you there’s a way to make this process a whole lot easier? Grab a coffee, and let’s dive in!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n4cegPlcWAGlfxvZOZVMPw.png" /></figure><h3>The Problem: Manual Conversion Blues</h3><p>Picture this: you’ve got a Java class that looks something like this:</p><pre>public class Customer {<br>    private String name;<br>    private int age;<br>    private List&lt;String&gt; orders;<br>    private CustomerType type;<br>    // ... getters and setters<br>}<br><br>public enum CustomerType {<br>    REGULAR, VIP, BUSINESS<br>}</pre><p>And now you need to convert it to a Proto message:</p><pre>message CustomerProto {<br>    string name = 1;<br>    int32 age = 2;<br>    repeated string orders = 3;<br>    CustomerTypeProto type = 4;<br>}<br><br>enum CustomerTypeProto {<br>    REGULAR = 0;<br>    VIP = 1;<br>    BUSINESS = 2;<br>}</pre><p>If you’re like me, your first instinct might be to start writing a conversion method that looks like a novel:</p><pre>public CustomerProto convertToProto(Customer customer) {<br>    CustomerProto.Builder builder = CustomerProto.newBuilder();<br>    if (customer.getName() != null) {<br>        builder.setName(customer.getName());<br>    }<br>    builder.setAge(customer.getAge());<br>    if (customer.getOrders() != null) {<br>        builder.addAllOrders(customer.getOrders());<br>    }<br>    if (customer.getType() != null) {<br>        builder.setType(CustomerTypeProto.valueOf(customer.getType().name()));<br>    }<br>    return builder.build();<br>}</pre><p>Ugh, right? Now imagine doing this for dozens of classes. It’s enough to make you want to bang your head against the keyboard. But fear not! There’s a better way.</p><h3>The Solution: Reflection to the Rescue!</h3><p>What if we could write a method that could convert *any* Java object to its Proto counterpart? Sounds like magic, doesn’t it? Well, with the power of reflection, we can make this magic happen!</p><p>Here’s the basic idea:</p><p>1. Use reflection to get all the fields of the Java object.<br>2. For each field, find the corresponding setter in the Proto builder.<br>3. Convert the value and set it in the Proto builder.</p><p>Let’s break it down with some code:</p><pre>public static void convertToProto(Object javaObject, Message.Builder protoBuilder) {<br> for (Field field : javaObject.getClass().getDeclaredFields()) {<br>   field.setAccessible(true);<br>   String fieldName = field.getName();<br>   <br>   try {<br>     Object value = field.get(javaObject);<br>     if (value == null) continue; // Skip null values<br>     String setterName = &quot;set&quot; + fieldName;<br>     Method setter = findSetter(protoBuilder.getClass(), setterName);<br>     if (setter != null) {<br>       convertField(protoBuilder, setter, value);<br>     }<br>   } catch (Exception e) {<br>   // Handle or log the exception<br>   }<br> }<br>}</pre><p>Now, I know what you’re thinking: “But what about different types? Enums? Lists?” Don’t worry, I’ve got you covered!</p><h4>Handling Different Types Like a Pro</h4><p>Let’s look at how we can handle different types in our `convertField` method:</p><pre>private static void convertField(Message.Builder protoBuilder, Method setter, Object value) throws Exception {<br> Class&lt;?&gt; paramType = setter.getParameterTypes()[0];<br>   if (isSimpleType(paramType)) {<br>     // For strings, numbers, booleans, etc.<br>     setter.invoke(protoBuilder, value);<br>   } else if (paramType.isEnum()) {<br>     // For enums<br>     Object protoEnum = paramType.getMethod(&quot;valueOf&quot;, String.class)<br>     .invoke(null, ((Enum&lt;?&gt;) value).name());<br>     setter.invoke(protoBuilder, protoEnum);<br>   } else if (value instanceof List) {<br>     // For lists<br>     String addMethod = &quot;add&quot; + setter.getName();<br>     Method adder = protoBuilder.getClass().getMethod(addMethod, paramType.getComponentType());<br>     for (Object item : (List&lt;?&gt;) value) {<br>       adder.invoke(protoBuilder, item);<br>     }<br>   } else {<br>     // For nested objects<br>     Message.Builder nestedBuilder = (Message.Builder) protoBuilder.getClass()<br>     .getMethod(getter(setter.getName()) + &quot;Builder&quot;)<br>     .invoke(protoBuilder);<br>     convertToProto(value, nestedBuilder);<br>   }<br>}</pre><h3>Putting It All Together</h3><p>Now, converting your Java objects to Proto is as easy as:</p><pre>Customer customer = new Customer(&quot;Alice&quot;, 30, Arrays.asList(&quot;Order1&quot;, &quot;Order2&quot;), CustomerType.VIP);<br>CustomerProto.Builder builder = CustomerProto.newBuilder();<br>convertToProto(customer, builder);<br>CustomerProto protoCustomer = builder.build();</pre><p>Boom! Just like that, you’ve got your Proto object, no manual conversion required.</p><h3>Wrapping Up</h3><p>Is this method perfect? Nope. Reflection can be a bit slower than manual conversion, so it might not be ideal for performance-critical parts of your app. But for most use cases, especially during development and testing, it’s a massive time-saver.</p><blockquote>Remember, the goal here isn’t just to write less code — it’s to write code that’s easier to maintain and less prone to errors. With this approach, you don’t have to update your conversion code every time you add a field to your Java class or Proto message. It just works.</blockquote><p><strong>Note:</strong> This is not a copy paste code, this is a way or roadmap actual code depends on your use cases, like you need to set you enums and check if it matches with class and then send for conversion.</p><p>So, next time you’re faced with the daunting task of converting Java objects to Proto, give this method a try. Your future self (and your teammates) will thank you!</p><p>Happy coding, and may your builds always be green! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=397144eed2a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[REST API vs GraphQL: A Comprehensive Insight into Preferences among Leading Companies]]></title>
            <link>https://kejariwalayush.medium.com/rest-api-vs-graphql-a-comprehensive-insight-into-preferences-among-leading-companies-810f77fc7d6b?source=rss-b93dfb0e077c------2</link>
            <guid isPermaLink="false">https://medium.com/p/810f77fc7d6b</guid>
            <category><![CDATA[comparison]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[rest-api]]></category>
            <dc:creator><![CDATA[Ayush Kejariwal]]></dc:creator>
            <pubDate>Thu, 26 Oct 2023 02:32:24 GMT</pubDate>
            <atom:updated>2023-10-26T02:32:24.737Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s tech-savvy world, efficient data handling is imperative for fostering robust web applications. Among the most utilised technologies for this purpose are REST (Representational State Transfer) API and GraphQL. Through this article, we delve into an insightful comparison between these two, shedding light on why and which predominant companies opt for either.</p><p>APIs have revolutionized how software applications communicate. With the introduction of REST and GraphQL, the debate over the best approach for data interaction has intensified. This article delves deep into the intricacies of both, offering insights based on firsthand experiences and shedding light on why certain companies prefer one over the other.</p><h3><strong>The Rise of APIs</strong></h3><p>APIs, or Application Programming Interfaces, act as intermediaries allowing different software applications to communicate with one another. They’ve undergone a significant evolution, responding to the demands of modern applications.</p><ul><li><strong>Evolution of APIs:</strong> Historically, SOAP was the dominant protocol for web services. However, its complexity led to the rise of REST, which offered simplicity and scalability. Later on, GraphQL emerged, addressing the limitations of REST, adding another layer to the debate.</li><li><strong>The need for modern data interaction:</strong> With the explosion of mobile apps and single-page applications, the demand for efficient data retrieval grew. Both REST and GraphQL aim to address this need, albeit in distinct manners.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*VYk7sYp8BrjQCFwm" /></figure><h3>Understanding the Core: REST API and GraphQL</h3><p>REST API, an architectural style for networked applications, has been a reliable choice since its inception in 2000. It employs standard HTTP methods and status codes, rendering it simple and straightforward for developers. On the flip side, GraphQL, introduced by Facebook in 2015, provides a more flexible approach, enabling precise data retrieval with a single query.</p><h4><strong>Basics of REST API</strong></h4><p>Representational State Transfer (REST) is an architectural style that revolves around stateless communication and the use of standard HTTP methods.</p><ul><li><strong>Principles of REST: </strong>REST operates on a set of principles, including statelessness, client-server architecture, and a uniform interface. These principles make REST a favourite among developers, especially for public APIs.</li><li><strong>Pros and cons of REST API:</strong> REST’s simplicity and scalability are its primary strengths. However, it’s not without its drawbacks, such as over-fetching and under-fetching of data, which can lead to inefficiencies.</li></ul><h4>Basics of GraphQL</h4><p>GraphQL, a query language developed by Facebook, provides a more flexible approach to data interaction.</p><ul><li><strong>Introduction to GraphQL:</strong> GraphQL allows clients to request only the data they need, potentially reducing the amount of data transferred over the network. It also offers a type system, ensuring data consistency.</li><li><strong>Pros and cons of GraphQL:</strong> GraphQL’s flexibility and efficiency are commendable. However, its learning curve and potential complexities in caching can pose challenges.</li></ul><h3>Detailed Comparison</h3><p>While both REST and GraphQL serve the same purpose, their methodologies differ, leading to various strengths and weaknesses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*CBiHA-ZZL-KukuXd" /></figure><ul><li><strong>Performance Efficiency: A Noteworthy Distinction:</strong> One of the glaring differences lies in the performance efficiency. GraphQL minimizes over-fetching or under-fetching of data, thanks to its single-query structure. REST API, however, may require multiple requests to retrieve all necessary information, which can hamper the application’s performance.</li><li><strong>Data retrieval: </strong>GraphQL’s ability to retrieve only required data contrasts with REST, where a specific endpoint fetches a predefined set of data.</li><li><strong>Ease of Versioning: </strong>With REST API, versioning is a common practice to accommodate changes, which can sometimes lead to complications. Conversely, GraphQL’s schema-centric design obviates the need for versioning, making the adaptation of changes smoother.</li><li><strong>Flexibility and Specificity:</strong> GraphQL offers unparalleled flexibility, letting clients dictate the shape of the response. On the other hand, REST endpoints have a fixed data structure.</li><li><strong>Authorization and Error Handling: </strong>Both technologies offer distinctive methods for authorization and error handling. While REST API has a more established set of conventions, GraphQL allows for a more fine-grained control, potentially simplifying error resolution.</li></ul><h4>Comparison between REST API and GraphQL and why and which companies prefer it</h4><p>Leading enterprises have shown a predilection for one over the other based on their unique requirements. Facebook, obviously, along with Shopify and Twitter have embraced GraphQL for its data efficiency and precise querying. On the other hand, companies like Google and Microsoft lean towards REST API due to its simplicity and well-defined standards. Companies have their reasons for choosing one approach over the other, often based on specific requirements.</p><ul><li><strong>Major companies using REST API:</strong> Companies like Twitter and Reddit initially adopted REST due to its simplicity and widespread adoption.</li><li><strong>Major companies using GraphQL</strong> Facebook, the creator of GraphQL, along with giants like Shopify and GitHub, have embraced GraphQL for its flexibility.</li><li><strong>Reasons for adoption</strong> While some companies prioritize flexibility and efficiency, leading them to GraphQL, others might stick to REST because of its maturity and vast ecosystem.</li></ul><h3>Business Perspectives</h3><p>From a business standpoint, the choice between REST and GraphQL isn’t black and white.</p><ul><li><strong>Cost implications:</strong> Transitioning from REST to GraphQL might entail initial costs, but the long-term efficiency gains can offset them.</li><li><strong>Scalability concerns:</strong> GraphQL’s flexibility can sometimes lead to complex queries, potentially impacting performance. REST, being more structured, can offer predictable scalability.</li><li><strong>Integration challenges:</strong> Migrating from REST to GraphQL can pose integration challenges, especially if the existing infrastructure is deeply rooted in REST.</li></ul><h3>Adoption Strategies</h3><p>For businesses looking to make the switch or integrate both, there are strategies to consider.</p><ul><li><strong>Transitioning from REST to GraphQL:</strong> Gradual migration, by introducing GraphQL for new features while maintaining REST for legacy ones, is a balanced approach.</li><li><strong>Integrating both REST and GraphQL:</strong> It’s feasible to have both co-exist, playing to each of their strengths. For instance, public APIs can remain RESTful, while internal services adopt GraphQL.</li></ul><h3>Future Trends</h3><p>The API landscape is ever-evolving, with innovations around the corner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*FKsIqI2mPk4BJy58" /></figure><ul><li><strong>Predictions for API technologies:</strong> While REST and GraphQL are dominant now, newer paradigms might emerge, driven by evolving technological demands.</li><li><strong>Emerging technologies and paradigms:</strong> Technologies like <strong><em>gRPC</em></strong> and <strong><em>Falcor</em></strong> are already making waves, potentially shaping the future of APIs.</li></ul><h3>Real-world Case Studies</h3><p>Real-world implementations provide insights into the practical advantages and challenges of both REST and GraphQL.</p><ul><li><strong>Success stories with REST API:</strong> Twitter’s transition to a more modular architecture using REST is a testament to its scalability.</li><li><strong>Success stories with GraphQL:</strong> Airbnb’s adoption of GraphQL has streamlined its data fetching, enhancing user experience.</li></ul><h3>Conclusion:</h3><p>The choice between REST API and GraphQL boils down to the specific needs of a project and the long-term vision of the company. While REST API stands strong with its simplicity and established conventions, GraphQL is carving a niche with its flexibility and efficiency, with both having a significant footprint in the corporate arena.</p><h3>FAQs</h3><p><strong>What is the primary difference between REST API and GraphQL? <br></strong>The primary difference lies in their approach to data retrieval. While REST uses predefined endpoints, GraphQL allows clients to specify their data needs.</p><p><strong>Why are companies shifting towards GraphQL? <br></strong>Companies value GraphQL’s flexibility, efficiency, and ability to fetch precise data without over-fetching.</p><p><strong>Are there scenarios where REST is more suitable than GraphQL? <br></strong>Yes, for applications that require a simple, structured, and easily cacheable API, REST might be more appropriate.</p><p><strong>How do REST and GraphQL handle security? <br></strong>Both have their security mechanisms. While REST relies on standard HTTP security practices, GraphQL requires more granular, field-level security.</p><p><strong>Can both REST and GraphQL co-exist in a system?<br></strong>Absolutely! Many companies adopt a hybrid approach, leveraging the strengths of both.</p><p><strong>Which one should a new project adopt: REST or GraphQL?<br></strong>It depends on the project’s needs. If flexibility and precise data retrieval are paramount, GraphQL might be the choice. However, for more structured, cacheable, and straightforward needs, REST might be preferable.</p><h3>Connect with me</h3><p>Here is my <a href="https://github.com/KejariwalAyush/">GitHub</a> and <a href="https://www.linkedin.com/in/kejariwalayush/">LinkedIn</a> profile<br>Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=810f77fc7d6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Embarking on a Coding Odyssey: Unveiling The Heart of Open Source Through Hacktoberfest and Beyond]]></title>
            <link>https://kejariwalayush.medium.com/embarking-on-a-coding-odyssey-unveiling-the-heart-of-open-source-through-hacktoberfest-and-beyond-762c78c462e7?source=rss-b93dfb0e077c------2</link>
            <guid isPermaLink="false">https://medium.com/p/762c78c462e7</guid>
            <category><![CDATA[gsoc]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[hacktoberfest]]></category>
            <category><![CDATA[kwoc]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Ayush Kejariwal]]></dc:creator>
            <pubDate>Sat, 21 Oct 2023 03:32:34 GMT</pubDate>
            <atom:updated>2023-10-21T03:32:34.196Z</atom:updated>
            <content:encoded><![CDATA[<p>Once upon a time, as October&#39;s chill began weaving through the air, tech enthusiasts from across the globe embarked on a thrilling voyage known as Hacktoberfest. This month-long festival of code opened the gates to a realm where creativity met code, where the heartbeats of open source thumped louder as each day passed. It wasn’t just about the cool swag, nor the badges that sparkled on your profile; it was about diving into the oceans of code, exploring the unknown, and emerging with a treasure trove of knowledge and experience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1_eD7XPgU3OsgSp_" /></figure><p>As young coders, many set sail towards Hacktoberfest lured by the promise of a stylish t-shirt. Among them was a budding programmer, who, like many, was initially enticed by the swag. However, as they delved into the code, they discovered a world where every line they wrote etched a lasting impact. They realized it wasn’t just a fest; it was a realm where the code spoke, errors taught, and success was shared.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dgOg1WLXRgae9Ve-" /></figure><p>As the winds of October faded, our coder&#39;s journey didn’t end. They were steered towards new horizons by events like KWoC (Kharagpur Winter of Code). Nestled in the heart of winter, KWoC was more than just a coding event; it was a warm community where learning blossomed, and code flourished despite the cold outside. With every pull request, the coder felt the warm embrace of collaborative learning, fueling their passion to contribute more, learn more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vh3oQ0_JKE15bqe9" /></figure><p>The coder&#39;s quest for knowledge didn&#39;t stop here; it soared towards the prestigious Google Summer of Code. This wasn&#39;t just a summer retreat; it was a rigorous coding marathon. It was here that they got a chance to contribute to repositories that resonated with their interests, working alongside seasoned mentors who guided them through every bug and feature. Each day was a narrative of codes, a story where challenges were faced, solutions were sought, and victories were celebrated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2xh7Q5Epkmm7Rspd" /></figure><p>With every event, our coder not only honed their skills but also realized the essence of open source - a selfless endeavor to contribute, to learn, and to collaborate. They began to see the beauty in how code transcended language boundaries, creating a universe where every coder, irrespective of their skill level, could contribute and learn.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rvdijRIxfTlRay6T" /></figure><p>As they sat through job interviews, they narrated tales of their coding adventures, of how they overcame the language barrier, understood different code architectures, and collaborated with coders worldwide. Their open-source journey wasn’t just a line in the resume; it was a testament to their growth, adaptability, and endless thirst for learning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FJt3zTtHevl1RnKs" /></figure><p>As our coder reminisces about their journey, they realize that Hacktoberfest was not just an event, but a prologue to the grand narrative of open source contribution. It was a rendezvous that introduced them to a community bound by a shared love for code, a realm where learning was the treasure, and sharing was the culture.</p><p>So, as the sails of Hacktoberfest billow once again this year, remember, it&#39;s not just about the swag, it&#39;s about the code, the community, and the endless journey of learning. Embark on this exciting voyage, for there are codes to be written, bugs to be fixed, and a whole open-source world to be explored!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qLnWc7qLEmxGYxTE" /></figure><p>As the gentle waves of code recede, our Captain bids adieu,</p><blockquote>“May your code run smoothly till our sails meet again at the next dawn of Hacktoberfest. Until then, keep your curiosity alight and your code ever-insightful!”</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=762c78c462e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Deep Dive into Argo CD]]></title>
            <link>https://kejariwalayush.medium.com/a-deep-dive-into-argo-cd-b031f0a1efc7?source=rss-b93dfb0e077c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b031f0a1efc7</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[gitops]]></category>
            <category><![CDATA[argo-cd]]></category>
            <category><![CDATA[rbac]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Ayush Kejariwal]]></dc:creator>
            <pubDate>Fri, 20 Oct 2023 03:32:34 GMT</pubDate>
            <atom:updated>2023-10-20T03:32:34.232Z</atom:updated>
            <content:encoded><![CDATA[<p>With great power comes great ‘complexity’.</p><p>Yet, Kubernetes has revolutionized the container orchestration world. Managing deployments, especially at scale, can become a daunting task.</p><blockquote>This is where <strong>Argo CD</strong> shines.</blockquote><p>A GitOps continuous delivery tool specifically designed for Kubernetes, Argo CD bridges the gap between code repositories and live deployments, ensuring that what you define in Git is precisely what gets deployed. Let’s unravel the nuances of Argo CD and explore why it’s becoming an essential tool for Kubernetes enthusiasts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/0*FF13sYkyh8FxFFbS.png" /></figure><h3>What Exactly is Argo CD?</h3><p>In the realm of continuous delivery tools, Argo CD stands out with its GitOps philosophy. It’s an open-source platform that streamlines the deployment and management of applications on Kubernetes clusters. The central premise is simple: Use Git repositories as the source of truth for defining the desired application state. Whenever there’s a change in the repository, it automatically triggers deployments, keeping the application’s live state in sync with the repository.</p><h3>Delving into Argo CD’s Rich Feature Set</h3><p>Argo CD is not just about syncing Git repositories with Kubernetes deployments; it’s packed with features that make application management a breeze:</p><p><strong>1.</strong> <strong>Declarative Sync &amp; Self-Healing</strong>: It ensures the deployed application matches the Git configuration. Any deviation is automatically corrected, making the system resilient and self-sufficient.<br> <br><strong>2. Visual Interface:</strong> Argo CD’s UI provides a clear visual representation of application statuses. This real-time view offers insights into health, synchronisation, and other essential metrics of the deployed applications.</p><p><strong>3. Integration with Multiple SCM Tools:</strong> Whether you use GitHub, GitLab, or Bitbucket, Argo CD has you covered. Its compatibility with popular source code management tools ensures a broad application base.</p><p><strong>4. Role-Based Access Control (RBAC):</strong> Security is paramount, and Argo CD’s RBAC ensures that access is granted judiciously. Only authorized users can access specific functionalities, bolstering the deployment process’s security.</p><p><strong>5. Extensibility:</strong> Argo CD is designed to be extensible, allowing users to integrate custom tools and scripts, enhancing its functionality and adaptability.</p><h3>The Competitive Edge: Why Kubernetes Users are Gravitating Towards Argo CD</h3><p>Kubernetes is powerful, but its complexity necessitates tools like Argo CD. Here’s what makes Argo CD indispensable:</p><p><strong>Consistency</strong>: No more manual deployment discrepancies. With Git as the single source of truth, deployments are uniform and consistent.</p><p><strong>Auditability</strong>: Track every deployment change back to a specific Git commit. This transparency provides a clear audit trail and accountability.</p><p><strong>Simplified Rollbacks</strong>: Mistakes happen. With Argo CD, reverting to a previous stable state is as simple as selecting a previous Git commit.</p><p><strong>Collaboration Boost</strong>: The clear demarcation between what’s in the code and what’s in the deployment allows for better collaboration between developers and operations teams.</p><h3><strong>Embarking on Your Argo CD Journey</strong></h3><p>Convinced about Argo CD’s prowess? Here’s a primer to get you started:</p><p>1. <strong>Installation</strong>: Begin by installing Argo CD on your Kubernetes cluster. The official Argo CD documentation is an excellent resource to guide you step-by-step.<br> <br>2. <strong>Your First Application</strong>: Define your application’s desired state in a Git repository. Sync this repository with your Kubernetes cluster using Argo CD’s user-friendly interface.</p><p>3. <strong>Monitoring and Oversight</strong>: Post-deployment, use Argo CD’s dashboard to glean insights into your applications. From health metrics to synchronization statuses, everything’s at your fingertips.</p><p>4. <strong>Continuous Learning</strong>: The key to mastering any tool is continuous engagement. Delve deeper into Argo CD’s documentation, interact with the active community, and most importantly, experiment hands-on.</p><blockquote><strong><em>For Creating GitOps style deployment, refer this document: </em></strong><a href="https://kejariwalayush.medium.com/creating-gitops-style-automation-with-gcp-and-argocd-1d56f7575683"><strong><em>https://kejariwalayush.medium.com/creating-gitops-style-automation-with-gcp-and-argocd-1d56f7575683</em></strong></a><strong><em><br>It will help you give a kick start towards your automation journey.</em></strong></blockquote><p>For more detailed installation guide you can read further here an article: https://spacelift.io/blog/argocd</p><h3>Wrapping up</h3><p>As Kubernetes gains traction, tools that alleviate its inherent complexities are paramount. Argo CD, with its GitOps-centric approach, doesn’t just simplify deployments — it ensures they are consistent, auditable, and easy to manage. Whether you’re knee-deep in Kubernetes or just wetting your feet, Argo CD promises to be a valuable ally in your container orchestration journey.</p><h3>Connect with me</h3><p>Here is my <a href="https://github.com/KejariwalAyush/">GitHub</a> and <a href="https://www.linkedin.com/in/kejariwalayush/">LinkedIn</a> profile<br>Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b031f0a1efc7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Kubernetes, Docker, and ArgoCD]]></title>
            <link>https://kejariwalayush.medium.com/introduction-to-kubernetes-docker-and-argocd-cd6d25eb8ddb?source=rss-b93dfb0e077c------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd6d25eb8ddb</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[gitops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[argo-cd]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Ayush Kejariwal]]></dc:creator>
            <pubDate>Sun, 15 Oct 2023 17:00:33 GMT</pubDate>
            <atom:updated>2023-10-15T17:00:33.278Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever felt overwhelmed with the buzzwords like Kubernetes, Docker, and ArgoCD?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*C5RH0TvLY-X_6h5M" /></figure><p>Well, you’re not alone. In this roller-coaster of an article, we’ll break down these terms and help you understand how they all fit together in the world of container orchestration and deployment.</p><p>Welcome to the world of container orchestration and deployment! In this guide, we’ll unravel the intricacies of Kubernetes, Docker, and ArgoCD, shedding light on how they intertwine to revolutionise application deployment.</p><h3>Kubernetes: A Detailed Overview</h3><h4>Understanding Kubernetes</h4><p>Kubernetes, often abbreviated as K8s, acts as the maestro in the orchestra of container management. Designed to automate the deployment, scaling, and management of application containers, it ensures efficient resource utilisation and fault tolerance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*M9HGZHmHHqftwFto" /></figure><h4>Key Components and Architecture</h4><p>Kubernetes boasts a modular architecture. Key components include:</p><ul><li><strong>Nodes</strong>: These are worker machines, VMs, or physical computers.</li><li><strong>Pods</strong>: The smallest deployable units that can be created and managed.</li><li><strong>Services</strong>: Abstractions representing a set of pods and the policy to access them.</li></ul><h3>Dive into Docker</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z8zJp1AmT7KSh2j3" /></figure><h4>The Need for Docker</h4><p>Docker revolutionised the way developers think about application packaging. By bundling an application and its dependencies into a container, Docker ensures consistency across multiple environments, from development to production.</p><h4>Docker’s Unique Workflow</h4><p>Central to Docker is its client-server architecture. The Docker client communicates with the Docker daemon, responsible for building, running, and managing containers.</p><h3>ArgoCD: Streamlining Deployments</h3><h4>Embracing ArgoCD</h4><p>ArgoCD, a GitOps continuous delivery tool tailored for Kubernetes, ensures that the live environment mirrors the desired state specified in a Git repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*P0EhjQDa5WN40JvT.jpeg" /></figure><h4>How ArgoCD Complements DevOps</h4><p>Incorporating ArgoCD into the DevOps lifecycle streamlines deployments, making them repeatable and predictable. It provides a visual representation of application status, making monitoring a breeze.</p><h3>Synergy: Kubernetes, Docker, and ArgoCD</h3><h4>Setting the Stage</h4><p>The first step is setting up Docker containers with the application and its dependencies. Kubernetes then steps in, managing the containers and ensuring optimal performance. Finally, ArgoCD automates the deployment, bridging the gap between development and operations.</p><h4>Seamless Deployments</h4><p>With this powerful trio, deployments become fluid. Applications are scalable, resilient, and consistent across environments.</p><h3>Conclusion</h3><p>Kubernetes, Docker, and ArgoCD form a formidable combination, transforming the landscape of application deployment. By understanding and leveraging these tools, teams can achieve faster, more reliable deployments, setting the stage for innovation and growth.</p><p>And there you have it! A whirlwind tour of Kubernetes, Docker, and ArgoCD. With these tools in your arsenal, you’re ready to conquer the world of container orchestration and deployment. So, why wait? Start your journey today!</p><h3>FAQs</h3><p>Here are few QnAs to give you a little more clarity</p><p><strong>1. What’s the fundamental difference between Docker and Kubernetes?<br></strong> — Docker is primarily a platform for containerization, while Kubernetes is an orchestration tool for managing these containers.</p><p><strong>2. How does ArgoCD integrate with Kubernetes?<br></strong> — ArgoCD automates application deployment to Kubernetes, ensuring the live environment mirrors the desired state defined in a Git repository.</p><p><strong>3. Is Docker necessary for Kubernetes?<br></strong> — While Docker is a popular choice, Kubernetes supports other container runtimes like <a href="https://podman.io/">Podman</a> &amp; <a href="https://azure.microsoft.com/en-us/free/kubernetes-service/search/?&amp;ef_id=CjwKCAjwgISIBhBfEiwALE19SbAmeZRHMpY_ugOPHe7q0EE01ZYvMMe8AHedzCJ6isp-BhVZqatOlBoCVagQAvD_BwE:G:s&amp;OCID=AID2200227_SEM_CjwKCAjwgISIBhBfEiwALE19SbAmeZRHMpY_ugOPHe7q0EE01ZYvMMe8AHedzCJ6isp">Microsoft Azure Container Registry</a>.</p><p><strong>4. Can I use ArgoCD without Kubernetes?<br></strong> — ArgoCD is specifically designed for continuous delivery to Kubernetes. While it’s tailored for K8s, its principles can be understood outside of this context.</p><p><strong>5. How do I scale applications with Kubernetes?<br></strong> — Kubernetes provides features like Horizontal Pod Autoscaling, which automatically scales the number of pods based on metrics like CPU utilization.</p><p><strong>6. Why is GitOps important in the context of ArgoCD?<br></strong> — GitOps emphasizes the use of Git as the single source of truth for declarative infrastructure and applications. ArgoCD leverages this principle to ensure consistent and auditable changes to environments.</p><p><strong>7. Is Kubernetes suitable for small-scale applications?<br></strong> — While Kubernetes excels in managing large-scale applications, its features can benefit small-scale applications in terms of scalability and resilience.</p><p><strong>8. How do I ensure data persistence in containers managed by Kubernetes?<br></strong> — Kubernetes offers Persistent Volumes (PVs) and Persistent Volume Claims (PVCs) to manage storage resources and ensure data persistence across container restarts.</p><p><strong>9. What security measures should I consider when using Docker, Kubernetes, and ArgoCD?</strong><br> — Best practices include using signed images, restricting container privileges, network segmentation, role-based access control, and regularly scanning for vulnerabilities.</p><p><strong>10. How do I monitor the health and performance of applications managed by this trio?<br></strong> — Tools like Prometheus, integrated with Grafana for visualization, can be used to monitor metrics from Docker, Kubernetes, and ArgoCD, providing insights into application health and performance.</p><p>I hope these FAQs provide clarity on the topic!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd6d25eb8ddb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating GitOps-Style Automation with GCP and ArgoCD]]></title>
            <link>https://kejariwalayush.medium.com/creating-gitops-style-automation-with-gcp-and-argocd-1d56f7575683?source=rss-b93dfb0e077c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d56f7575683</guid>
            <category><![CDATA[argo-cd]]></category>
            <category><![CDATA[cloud-build]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[gitops]]></category>
            <category><![CDATA[gcp]]></category>
            <dc:creator><![CDATA[Ayush Kejariwal]]></dc:creator>
            <pubDate>Thu, 15 Jun 2023 06:30:11 GMT</pubDate>
            <atom:updated>2023-06-18T04:27:25.109Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tn8IiP9aAHqwpKWg" /><figcaption>Photo by <a href="https://unsplash.com/de/@possessedphotography?utm_source=medium&amp;utm_medium=referral">Possessed Photography</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In modern software development, automation plays a crucial role in improving efficiency and reducing human errors. GitOps, a methodology that uses Git as a single source of truth for managing infrastructure and applications, has gained significant popularity. In this article, we will explore how to set up a GitOps-style automation pipeline using Google Container Registry (GCR), Cloud Build, and ArgoCD. We will focus on a Spring Boot project, leveraging Maven Jib to build and push container images, and ArgoCD for automated deployment.</p><blockquote>Note: In place of Google Container Registry you can also use Docker Hub and similarly in place of Cloud Build you can workout with GitHub actions. And in addition you can also setup to test your application before deploying.</blockquote><p>What are we planning to do is to automate everything till deployment once a commit is pushed or PR is merged on a particular branch, you can also make multiple pipelines for different uses.</p><p>Once user updates the app and the <strong>update the version tag</strong> we will have a Cloud Build Trigger to build and push the container image to Container Registry and then with the latest image commit a change in deployment config repository(different from the development one i.e, GitOps Style) and push then ArgoCD pulls the changes and updates the deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZtJZ3ZrsS4dTNo9XEF5KWQ.png" /><figcaption>Flow diagram that we will be going with.</figcaption></figure><h3>Prerequisites</h3><ul><li>Basics of GCP</li><li>Good knowledge of git</li><li>Knowledge of basic commands of Unix/Linux.</li></ul><h3><strong>1. Setting up Google Cloud Platform (GCP)</strong></h3><p>To begin, you need to set up a Google Cloud Platform (GCP) project and enable the necessary APIs for your project. Follow these steps:</p><p>1. Create a new project in the Google Cloud Console.<br>2. Enable the required APIs: Cloud Build, Container Registry, and Kubernetes.<br>3. Set up billing for your project.<br>4. Configure authentication by creating a service account and generating a key file.</p><h3><strong>2. Configuring the Spring Boot Project</strong></h3><p>Now, let’s configure your Spring Boot project:</p><p>1. Create a new Spring Boot project or use an existing one.<br>2. Set up your project’s dependencies and configurations.</p><p>Maven Jib simplifies the process of containerization your Spring Boot application. Follow these steps:</p><p>1. Add the Jib plugin to your Maven project’s `pom.xml` file.<br>2. Configure the Jib plugin to specify the container registry URLs for both Google Container Registry (GCR).<br>3. Build your project using Maven to generate a container image.<br>4. Jib will automatically push the image to the specified container registry.</p><h3><strong>3. Setting up Google Container Registry (GCR)</strong></h3><p>Now, let’s set up the repositories to host your container images:</p><p>1. Create a Google Container Registry (GCR) repository to store your images. You can use the Cloud Console or command-line tools to create a repository.<br>2. Obtain the necessary authentication credentials to access GCR.</p><h3><strong>4. Automating the Build and Push Process with Cloud Build</strong></h3><p>Cloud Build provides a serverless CI/CD platform for building and pushing container images. Here’s how to automate the process:</p><p>1. Create a `cloudbuild.yaml` file in the root directory of your project.<br>2. Define the build steps in the `cloudbuild.yaml` file, including Maven build and Jib containerization.</p><pre>steps:<br>  # Step 1: Build the container image &amp; push using Jib<br>  - name: &#39;gcr.io/cloud-builders/mvn&#39;<br>    args: [&#39;clean&#39;, &#39;compile&#39;, &#39;com.google.cloud.tools:jib-maven-plugin:3.1.4:build&#39;, &#39;-Dimage=gcr.io/gcpprojectname/project:${_VERSION}&#39;]<br><br><br>...<br><br><br>substitutions:<br>  _VERSION: &#39;v1.2&#39;</pre><p>3. Configure Cloud Build triggers to automatically execute the build process whenever changes are pushed to your repository.<br>4. Cloud Build will build your project, containerize it, and push the resulting image to GCR.</p><p>This above code snippet is the beginning we will add more in further steps.</p><p>For now we will be using _VERSION as global variable we will need it later.</p><h3>5. Maintaining Repository Configuration with Deployment and Service YAML Files</h3><p>To maintain the deployment configuration for your Spring Boot project, create a separate Git repository dedicated to storing the deployment and service YAML files for Kubernetes. Here’s how:</p><p>1. Create a <strong>new Git repository</strong> to store your deployment configuration files.<br>2. Place your <strong>deployment.yaml</strong> and <strong>service.yaml</strong> files in the repository.<br>3. Configure appropriate access controls and secrets management for the repository.<br>4. This repository will serve as the single source of truth for your infrastructure configuration.<br>5. Also create a Personal Access Token(PAT) for this repository with read access.</p><blockquote>Profile → Settings → Developer Settings → Personal access Tokens</blockquote><p>Then click on “Generate new token” then <strong>“Generate new token (classic)”<br></strong>Give a note/name for the token and set expiration date according to your use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1jXH1r1uF255Vsnm2Qk9WQ.png" /></figure><p>Now select all inside <strong>“repo” </strong>and then click on <strong>“Generate Token”</strong>.<br>You will see a token copy and save it somewhere, we will need it further.</p><h3><strong>6. Automated Deployment using ArgoCD</strong></h3><p>ArgoCD is a powerful GitOps continuous delivery tool that automates the deployment process. Here’s how to set it up:</p><p>1. Install ArgoCD in your Kubernetes cluster. You can use the ArgoCD CLI or apply the necessary Kubernetes manifests.<br>2. Configure ArgoCD to monitor your deployment configuration repository as a Git source.<br>3. Define an application in ArgoCD that corresponds to your Spring Boot project.<br>4. Configure the application with the necessary deployment parameters, such as the repository URL, path, and target namespace.<br>5. ArgoCD will automatically synchronize with the repository and deploy your application whenever changes are detected.</p><p>Use this official docs to setup ArgoCD: <a href="https://argo-cd.readthedocs.io/en/stable/getting_started/">https://argo-cd.readthedocs.io/en/stable/getting_started/</a><br>Now follow all these steps in detail.</p><blockquote>Also enable auto sync to auto deploy your build.</blockquote><h3>7. Updating the cloudbuild.yaml with the Latest Image Tag and changes</h3><p>To ensure the deployment of the latest image tag, you can leverage cloudbuild.yaml.</p><p>We will use make changes to the deployment repository from cloudbuild<br>Here’s what we will do.<br>- Clone the repo<br>- Make changes to the deployment.yaml file i.e., we will change the image tag to the latest one<br>- Commit and push the changes to the repository.<br>- ArgoCD will automatically detect the changes and deploy the updated application using the new image tag.</p><blockquote>Make sure you have configured namespaces and permissions for ArgoCD.</blockquote><p>Now we will create the trigger in cloud build. <br>Link: <a href="https://console.cloud.google.com/cloud-build/triggers;region=global/add?cloudshell=false&amp;project=sparksandbox">https://console.cloud.google.com/cloud-build/triggers</a></p><p><strong>Create new trigger</strong></p><ul><li>Add name</li><li>Link Source(Repo &amp; branch)</li><li>Configuration(Cloud build config file)</li><li>Location(“/cloudbuild.yaml”)</li><li>Substitution variables<br>_PAT = {Put your PAT key you generated in github}</li><li>Create Trigger</li></ul><p>Here is the final code of cloudbuild.yaml.</p><pre>steps:<br>  # Step 1: Build the container image &amp; push using Jib<br>  - name: &#39;gcr.io/cloud-builders/mvn&#39;<br>    args: [&#39;clean&#39;, &#39;compile&#39;, &#39;com.google.cloud.tools:jib-maven-plugin:3.1.4:build&#39;, &#39;-Dimage=gcr.io/gcpproject/project:${_VERSION}&#39;]<br><br>  # Step 2: Make changes to deployment.yaml<br>  - name: &#39;gcr.io/cloud-builders/git&#39;<br>    entrypoint: &#39;bash&#39;<br>    args:<br>      - &#39;-c&#39;<br>      - |<br>        git config --global user.email &quot;kejayush29@gmail.com&quot;<br>        git config --global user.name &quot;Ayush Kejariwal&quot;<br>        git clone https://$_PAT@github.com/KejariwalAyush/project.git<br>#        git checkout deployment_update<br>#        git branch<br><br>  # Step 3: Replace the version in deployment.yaml<br>  - name: &#39;ubuntu&#39;<br>    entrypoint: &#39;bash&#39;<br>    args:<br>      - &#39;-c&#39;<br>      - |<br>        sed -i &quot;s|image: &#39;gcr.io/gcpproject/project:${_OLD_VERSION}&#39;|image: &#39;gcr.io/gcpproject/project:${_VERSION}&#39;|&quot; project/deployment.yaml<br>  - name: &#39;ubuntu&#39;<br>    entrypoint: &#39;bash&#39;<br>    args:<br>      - &#39;-c&#39;<br>      - |<br>        cat project/deployment.yaml<br><br>  # Step 4: Commit and push the changes<br>  - name: &#39;gcr.io/cloud-builders/git&#39;<br>    entrypoint: &#39;bash&#39;<br>    args:<br>      - &#39;-c&#39;<br>      - |<br>        cd project<br>        git add .<br>        git commit -m &#39;Update deployment.yaml to new version:${_VERSION}&#39;<br>        git push<br><br>substitutions:<br>  _VERSION: &#39;v1.2&#39;<br>  _OLD_VERSION: &#39;v1.1&#39;</pre><p>Here is the deployment.yaml file form the deployment repo</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: project-argocd<br><br>spec:<br>  replicas: 1<br>  template:<br>    metadata:<br>      labels:<br>        app: project<br>    spec:<br>      containers:<br>        - name: starter<br>          image: &#39;gcr.io/gcpproject/project:v1.1&#39;<br>          ports:<br>            - containerPort: 8080<br>  selector:<br>    matchLabels:<br>      app: project</pre><p>Here is the service.yaml file from the deployment repo</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: project-argocd<br>spec:<br>  ports:<br>    - port: 8080<br>      targetPort: 8080<br>      protocol: TCP<br>  selector:<br>    app: project<br>  type: LoadBalancer</pre><blockquote>You did it! <br>Lets take an overview of the process</blockquote><blockquote>1. You will make changes to the app and update the version in cloudbuild.yaml file whenever you want to deploy the file and commit the code.</blockquote><blockquote>2. Now cloudbuild will get triggered on your commit and make an image and then deploy it with the new version tag that you mentioned</blockquote><blockquote>3. Then in further steps cloudbuild will clone your config repo and update the newest tag and commit and push the code.</blockquote><blockquote>4. Then ArgoCD will detect the changes and pull it and auto deploy the latest build to kubernetes.</blockquote><h3>Conclusion</h3><p>By following these steps, you can create a robust GitOps-style automation pipeline using Google Container Registry, Cloud Build, and ArgoCD.</p><p>This pipeline enables you to efficiently build, containerize, and deploy your Spring Boot applications while maintaining a centralized configuration repository. Automation ensures that your deployments are reliable, consistent, and up to date with the latest image tags.</p><p>Remember to follow security best practices, such as encrypting secrets, restricting access permissions, and implementing proper monitoring and logging. Regularly test and validate your automation pipeline to ensure its effectiveness.</p><p>With GitOps and the right set of tools, you can streamline your development and deployment processes, leading to faster iterations, improved stability, and enhanced collaboration within your development team.</p><blockquote>Happy automating!</blockquote><p><strong>Get in touch with me</strong><br><strong>Medium</strong>: <a href="https://kejariwalayush.medium.com/">https://kejariwalayush.medium.com</a>/<br><strong>Github</strong>: <a href="https://github.com/KejariwalAyush">https://github.com/KejariwalAyush</a><br><strong>LinkedIn</strong>: <a href="https://www.linkedin.com/in/kejariwalayush/">https://www.linkedin.com/in/kejariwalayush/</a><br><strong>Website</strong>: <a href="https://kejariwalayush.github.io/">https://kejariwalayush.github.io/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d56f7575683" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>