<?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 Rishikesh Sonawane on Medium]]></title>
        <description><![CDATA[Stories by Rishikesh Sonawane on Medium]]></description>
        <link>https://medium.com/@rishikesh.s7711?source=rss-edac684cb70f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0xtlWAr0ZZRgAWvdzMv-vQ.jpeg</url>
            <title>Stories by Rishikesh Sonawane on Medium</title>
            <link>https://medium.com/@rishikesh.s7711?source=rss-edac684cb70f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 08:40:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rishikesh.s7711/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[Golf Courses Use More Water Than AI Data Centers. So Why Is Nobody Talking About That?]]></title>
            <link>https://medium.com/@rishikesh.s7711/golf-courses-use-more-water-than-ai-data-centers-so-why-is-nobody-talking-about-that-b2d8c73ec6f3?source=rss-edac684cb70f------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2d8c73ec6f3</guid>
            <category><![CDATA[tech-myths]]></category>
            <category><![CDATA[artificialintelligenceai]]></category>
            <category><![CDATA[ai-and-environment]]></category>
            <category><![CDATA[water-usage]]></category>
            <category><![CDATA[data-center]]></category>
            <dc:creator><![CDATA[Rishikesh Sonawane]]></dc:creator>
            <pubDate>Fri, 18 Sep 2026 04:30:27 GMT</pubDate>
            <atom:updated>2026-09-18T04:30:27.373Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3npLo4chCKXPX9wrP4lTmA.jpeg" /><figcaption>Illustration Future of AI Datacenters</figcaption></figure><p><strong>The AI Water Conversation Is Misplaced. Here’s What the Numbers Actually Show</strong></p><p>There’s a narrative circulating that AI data centers are rapidly becoming one of the most water-intensive industries in the United States. And while there’s a kernel of truth to the concern, these facilities do consume significant amounts of water. The broader picture is far more nuanced than the headlines suggest. If you dig into the actual data, you’ll find that AI’s water footprint is a rounding error compared to some of the industries we’ve accepted without blinking for decades.</p><p>The irony is that golf courses use roughly two and a half times more water than all US data centers combined. That’s not a typo. It’s the current reality.</p><p><strong>Setting the Record Straight: The Numbers</strong></p><p>When people hear “AI data centers,” they tend to picture sprawling server farms consuming oceans of water. But the aggregate numbers tell a different story. According to multiple sources, all US data centers, including those powering streaming services, cloud storage, cryptocurrency mining, and AI workloads — consume an estimated 228 billion gallons of water annually when you factor in both direct cooling and the water used to generate the electricity they run on.</p><p>Now, compare that to golf course maintenance, which guzzles somewhere between 530 and 550 billion gallons per year. That means America’s 14,000-plus golf courses use roughly 2.4 times more water than every data center in the country put together.</p><p>And here’s the part that really puts things in perspective: AI workloads specifically account for an estimated share of around 52 billion gallons annually. That means golf courses alone use somewhere between eight and ten times more water than AI does. The gap is enormous, and yet you rarely hear anyone organizing a boycott of Pebble Beach.</p><pre>Category                                  | Annual US Consumption          | Comparison<br>------------------------------------------|--------------------------------|------------------------------------------<br>Golf Course Maintenance                   | 530–550 Billion Gallons        | ~2.4x more than all data centers<br>All US Data Centers (Direct + Power)      | ~228 Billion Gallons           | Includes streaming, cloud, crypto, AI<br>AI Workloads Only (Estimated Share)       | ~52 Billion Gallons            | Golf uses ~8x–10x more than AI</pre><p><strong>The Real Heavyweights Nobody Talks About</strong></p><p>If you really want to understand where US water consumption goes, you have to look past the tech industry entirely. The sectors that dominate water usage are so massive that data centers even with their breakneck growth barely register on the radar.</p><p><strong>Agriculture and Irrigation</strong> is the undisputed champion. Crop irrigation accounts for roughly 80% of the nation’s total consumptive water use. We’re talking trillions of gallons annually, driven by everything from cattle ranching to water-thirsty crops like alfalfa. This single sector dwarfs every other consumer by a margin that makes the data center conversation almost trivial.</p><p><strong>Thermoelectric Power Generation</strong> is the runner-up. Nuclear, coal, and natural gas power plants collectively draw nearly 39% to 41% of all US freshwater withdrawals, almost entirely for cooling purposes. The irony here is thick: the very energy infrastructure that powers data centers is itself one of the largest water consumers in the country.</p><p><strong>Residential and Public Supply</strong> also eclipses data center usage significantly. Everyday household activities lawn watering, toilet flushing, vehicle washing add up to a national total that towers over what all those server racks consume.</p><p>The point isn’t that data center water usage should be ignored. It’s that the conversation has been laser-focused on a relatively small player while the real giants continue to operate with comparatively little public scrutiny.</p><p><strong>So Why Is Everyone Talking About AI?</strong></p><p>If the numbers are so modest, why does AI water usage dominate the discourse? Two factors explain the disparity.</p><p><strong>First, the problem is local, not national.</strong> Golf courses are spread across more than 14,000 facilities scattered throughout the country. The water burden is distributed. Data centers, on the other hand, cluster in specific geographic hotspots Northern Virginia, parts of Texas, and a growing number of other regions. When a handful of massive AI server hubs open in a single watershed, they can place enormous, concentrated strain on that community’s local water supply. A town in Virginia or Arizona might see its municipal water reserves pressured by a facility that, on a national scale, represents a tiny fraction of total usage. For the people living there, though, the impact is very real and very immediate.</p><p><strong>Second, the growth trajectories point in opposite directions.</strong> Golf course water consumption has been flat or slightly declining, thanks to industry-wide adoption of recycled water systems and drought-resistant turf varieties. The trend line is gently pointing downward. AI data center construction, meanwhile, is expanding exponentially. Every year brings new hyperscale facilities, each one adding to the cumulative water footprint. Analysts who track this space note that while the comparison still heavily favors golf courses today, the gap is narrowing not because golf is using more, but because tech is racing upward at a pace that’s hard to comprehend.</p><p>This is the crux of the concern. It’s not about what AI is consuming today. It’s about what it will consume if current growth projections hold true over the next decade.</p><p><strong>What Comes Next?</strong></p><p>The data center industry isn’t standing still either. Some operators are already transitioning to closed-loop cooling systems that recirculate water rather than consuming it, and others are locating facilities near bodies of water or in cooler climates to reduce cooling demands. Whether these innovations can keep pace with the exponential buildout remains an open question.</p><p>What’s clear from the data is that framing AI as the primary water villain in the United States is misleading. The real challenges are systemic agriculture, energy generation, and municipal supply and they’ve been the dominant water consumers long before a single GPU was ever powered up.</p><p>That said, ignoring AI’s growing footprint would be equally shortsighted. The responsibility lies in understanding the full picture: acknowledging that today’s numbers are modest while taking seriously the trajectory they’re on.</p><p>The conversation shouldn’t be about choosing between AI and golf courses. It should be about how we manage water resources across every sector that depends on them because all of them are drawing from the same finite supply.</p><blockquote>About the Author</blockquote><blockquote><strong>This article was researched and written by </strong><a href="https://rishidigitalco.com/"><strong>Rishi Digital Co</strong></a><strong>. — a Pune-based digital studio specializing in custom web design, web development, SEO, paid ads, analytics, cloud infrastructure, and IT setup for small businesses. We build things that actually work, not recycled templates. If your business needs a digital presence that converts, that’s what we do.</strong></blockquote><p>— -</p><p><strong><em>Sources: </em></strong><a href="https://buttondown.com/napkinquest/archive/golf-uses-more-water-than-data-centers-by-2x-or/"><em>ButtonDown/napkinquest</em></a><em>, </em><a href="https://www.cbsnews.com/projects/2026/how-much-water-ai-uses/"><em>CBS News</em></a><em>, </em><a href="https://www.linkedin.com/pulse/edition-2-golf-courses-use-30-times-more-water-than-us-peter-nabhan-dk8rc"><em>LinkedIn/Peter Nabhan</em></a><em>, </em><a href="https://www.facebook.com/StCharlesMissouriScannerTraffic/posts/-golf-courses-vs-data-centers-who-uses-more-water-weve-seen-a-lot-of-discussion-l/1475356267962288/"><em>Facebook/St. Charles Scanner</em></a><em>, </em><a href="https://www.akcp.com/2026/08/17/truth-about-data-water-footprint-of-data-centers/"><em>AKCP</em></a><em>, </em><a href="https://melissaniwater.com/blogs/news/average-water-usage-in-the-united-states"><em>Melissaani Water</em></a><em>, </em><a href="https://orennia.com/insights/which-industries-use-the-most-water-in-america"><em>Orennia</em></a><em>, </em><a href="https://www.reddit.com/r/aiwars/comments/1tdb4m5/the_ai_water_problem_explained_before_someone/"><em>Reddit r/aiwars</em></a><em>, </em><a href="https://thenextweb.com/news/oleary-data-centers-water-golf-courses-comparison"><em>The Next Web</em></a><em>, </em><a href="https://labs.waterdata.usgs.gov/visualizations/water-use-15/index.html"><em>USGS Water Data</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2d8c73ec6f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Let Your AI Coding Agents Hallucinate]]></title>
            <link>https://medium.com/@rishikesh.s7711/stop-let-your-ai-coding-agents-hallucinate-7b20d24101e9?source=rss-edac684cb70f------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b20d24101e9</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Rishikesh Sonawane]]></dc:creator>
            <pubDate>Mon, 08 Jun 2026 17:00:16 GMT</pubDate>
            <atom:updated>2026-06-08T17:38:28.586Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Reusable Autonomous Engineering Lifecycle Framework: How AI Coding Agents Can Avoid Catastrophic Failures</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zT3P0hXTuSA3LLm6vB0oFQ.png" /></figure><p>Advanced AI coding agents are transforming software development, but they’re plagued by recurring failures: premature coding before understanding the problem, silent error swallowing that masks bugs, hallucinated file structures that break builds, and context drift that causes agents to forget their original goals.</p><p>I’ve developed a solution: <strong>The Reusable Autonomous Engineering Lifecycle Framework</strong>. This rigorously structured, multi-turn, self-correcting development pipeline locks development behind strict architectural gates and physical repository checkpoint files, completely mitigating these common LLM engineering failures.<br>Let me show you how it works.</p><h3>Why Current AI Coding Agents Fail (And How This Framework Fixes It)</h3><p>Before diving into the framework, it’s crucial to understand the problems we’re solving:</p><h4><strong>Common Major Failures</strong></h4><p><strong>Premature Coding:</strong> Agent writes code before fully understanding the architecture.<br><strong>Silent Error Swallowing:</strong> Errors get hidden, causing cascading failures later down the line.<br><strong>Hallucinated File Structures:</strong> Agent creates files or paths that don’t exist in the actual codebase.<br><strong>Context Drift:</strong> Agent forgets architectural assumptions during long, high-token sessions.</p><p>The framework works by treating the AI agent as an autonomous <strong>Principal Full-Stack Engineer and Software Architect</strong> with four specialized sub-skills it invokes dynamically:</p><ul><li>[Staff Enterprise Architect] – for diagnosis and design</li><li>[Senior Staff Developer] – for execution</li><li>[Principal Reviewer] – for self-audit</li><li>[Principal SDET] – for testing and verification</li></ul><h3>The Repository Structure: Your AI’s External Memory Bank</h3><p>When initializing this framework, create a dedicated revamp/ directory inside your application&#39;s root. This serves as the AI&#39;s external memory bank, preventing context window exhaustion:</p><pre>your-project-repository/<br>└── revamp/<br>    ├── system_instructions.md   # Framework Sections 1 &amp; 2<br>    ├── blueprint.md             # Active technical spec &amp; architecture<br>    └── restore_manifest.json    # State tracking (milestone, completed files)</pre><p>These physical files are your disaster recovery mechanism. When the agent experiences context drift (which it will, eventually), you can force a hard reset by pointing it back to these documents.</p><h3>Phase 1: Application Ingestion, Feature Mapping, &amp; Pain Point Diagnosis</h3><p><strong>Active Skill</strong>: [Staff Enterprise Architect] (Diagnostic Mode)<br><strong>Goal</strong>: Build a flawless mental model of the application without writing any code.</p><p>Many AI agents jump straight to coding. This phase forces them to slow down and understand what they’re actually fixing.</p><h3>What Happens in Phase 1</h3><ol><li><strong>Feature &amp; State Analysis</strong>: Trace how data flows through core features. Identify state management, database interactions, authentication boundaries, and third-party dependencies.</li><li><strong>Pain Point Mapping</strong>: Correlate the user’s reported problems directly to code bottlenecks, architectural flaws, or logical bugs.</li><li><strong>Diagnostics Output</strong>: Present a clear summary of the app’s behavior, a map of affected features, and a hypothesis explaining why the pain points occur.</li></ol><h3>The Gatekeeper Check</h3><p>Before proceeding, the agent must ask:</p><blockquote>“Does this accurately map out the application’s behavior and the pain points you want solved? Please confirm to proceed to Architectural Planning.”</blockquote><p><strong>Checkpoint Sync</strong>: Write the finalized structural breakdown to revamp/system_instructions.md and initialize revamp/restore_manifest.json.</p><h3>Phase 2: 100% Resilient Architectural Planning &amp; Algorithmic Strategy</h3><p><strong>Active Skill</strong>: [Staff Enterprise Architect] (Design Mode)<br><strong>Goal</strong>: Design a bulletproof solution guaranteed to fix issues without introducing regressions.</p><p>This is where most AI agents fail — they design solutions that handle the obvious case but miss edge cases, scaling limits, or downstream impacts. Phase 2 forces multi-angle thinking.</p><h3>What Happens in Phase 2</h3><ol><li><strong>Multi-Angle Solution Design</strong>: Blueprint a solution handling all edge cases, scaling limits, data flow modifications, and potential failure states.</li><li><strong>Algorithmic Accuracy Evaluation</strong>: Critically evaluate data processing and core business logic. Redesign input parsing, algorithmic processing, or query expansion to prevent data dilution. Ensure no high-signal outputs are prematurely dropped by heuristic layers.</li><li><strong>Blast Radius Analysis</strong>: Verify that changes to target components won’t break upstream or downstream services.</li></ol><h3>The Gatekeeper Check</h3><p>The agent must ask:</p><blockquote>“This blueprint is structurally locked to solve the pain points and optimize accuracy. Shall I begin the Senior Developer implementation phase?”</blockquote><p><strong>Checkpoint Sync</strong>: Append the complete technical architectural specification and Architecture Decision Records (ADRs) into revamp/blueprint.md.</p><h3>Phase 3: Defensive &amp; Expert Development</h3><p><strong>Active Skill</strong>: [Senior Staff Developer]<br><strong>Goal</strong>: Execute clean, highly robust code modifications based entirely on the locked Phase 2 blueprint.</p><p>Now we write code — but with strict guardrails.</p><h3>What Happens in Phase 3</h3><ol><li><strong>File-by-File Implementation</strong>: Write complete, highly typed, production-grade code blocks. No shortcuts, no truncated code, no // TODO: implement later tags.</li><li><strong>In-Flight Code Review</strong>: Interleave the [Principal Reviewer] skill to self-audit every block before presenting it. Ensure no race conditions, security holes, unhandled exceptions, or memory leaks.</li><li><strong>Drift Watch</strong>: Monitor execution logic against the Phase 2 blueprint. If an unexpected blocker causes drift, activate the <strong>Drift Detection Protocol</strong> instantly:</li></ol><ul><li>Immediately freeze execution</li><li>Explain the technical drift to the user</li><li>Present alternative solutions</li><li>Await confirmation before changing a single line</li></ul><p><strong>Checkpoint Sync</strong>: On every file successfully modified, update the feature status in revamp/restore_manifest.json and note implementation nuances in revamp/blueprint.md.</p><h3>Phase 4: Verification and Automated Testing</h3><p><strong>Active Skill</strong>: [Principal SDET]<br><strong>Goal</strong>: Secure the newly implemented codebase against future regressions. Code isn’t complete until it’s tested. Phase 4 ensures reliability.</p><h3>What Happens in Phase 4</h3><ol><li><strong>Test Suite Generation</strong>: Write Unit and Integration tests capturing the exact edge cases and failure modes mapped in Phases 1 and 2.</li><li><strong>Deterministic Execution</strong>: Avoid arbitrary sleep/wait times. Use event-driven or async polling test blocks to guarantee zero test flakiness.</li><li><strong>Handoff Documentation</strong>: Provide exact integration instructions, environment variable setup, and precise validation commands to run the updated application flawlessly.</li></ol><p><strong>Final Checkpoint Sync</strong>: Run a final update across all files in revamp/, signing off on the completed lifecycle state.</p><h3>Disaster Recovery: When Context Drift Hits (It Will)</h3><p>LLM context windows eventually exhaust or compact during long engineering sessions. When the agent starts outputting placeholders, truncated code, or skips planning phases, use this override command:</p><pre>[HARD RESET] You are experiencing context drift. Trigger Restore Point: ALPHA-ARCH-99. Immediately halt your current task. Open revamp/system_instructions.md and revamp/blueprint.md, re-ingest the architecture and lifecycle phase state completely, and confirm when you are ready to resume standard operations under our original constraints.</pre><p>This forces the agent to re-read its physical documentation and re-align with the original constraints.</p><h3>The Four Operational Guardrails That Make This Work</h3><p>These rules are non-negotiable:</p><ol><li><strong>Zero Speculation</strong>: If you don’t have the code for a component required to comprehend a feature, you MUST ask for it. Never guess.</li><li><strong>The Phase-Lock Gate</strong>: Forbidden from writing production code until Phases 1 and 2 are 100% complete and explicitly approved.</li><li><strong>Continuous Documentation Sync</strong>: Physically write to and update revamp/ files at the end of every phase. Never proceed without documenting the previous one.</li><li><strong>Drift Detection Protocol</strong>: If an architectural assumption was wrong or an edge case breaks the plan, immediately freeze, explain, and await confirmation.</li></ol><h3>Why This Framework Matters</h3><p>The Reusable Autonomous Engineering Lifecycle Framework isn’t just another set of instructions for AI agents. It’s a <strong>structural solution</strong> to systemic failures in LLM-based engineering.</p><p>By locking development behind architectural gates, maintaining physical checkpoint files, and enforcing sequential phase execution, this framework transforms AI coding agents from unreliable experimenters into disciplined principal engineers.</p><p>The result? Production-ready code that actually works, architectural decisions that withstand edge cases, and development sessions that don’t collapse from context drift.</p><h3>Ready to Implement This Framework?</h3><p>This framework is fully generalized and stripped of any codebase-specific branding. You can drop it directly into your repository as a markdown file or use it as the blueprint for your own AI coding agent’s system instructions.</p><p>The revamp/ directory structure, the four-phase lifecycle, and the ALPHA-ARCH-99 disaster recovery trigger are ready to use on any engineering project.</p><p>Your AI agent will thank you. Your codebase will thank you. And your future self (when you’re debugging at 2 AM) will thank you even more.</p><p><em>What’s your experience with AI coding agents? Have you encountered context drift or premature coding failures? Share your thoughts in the comments below.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b20d24101e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Free AI Tools That Are Revolutionizing Video Creation & Productivity in 2025]]></title>
            <link>https://medium.com/@rishikesh.s7711/free-ai-tools-that-are-revolutionizing-video-creation-productivity-in-2025-63c029441fce?source=rss-edac684cb70f------2</link>
            <guid isPermaLink="false">https://medium.com/p/63c029441fce</guid>
            <category><![CDATA[ai̇]]></category>
            <category><![CDATA[faceless-youtube]]></category>
            <category><![CDATA[videocreation]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Rishikesh Sonawane]]></dc:creator>
            <pubDate>Thu, 26 Jun 2025 08:21:11 GMT</pubDate>
            <atom:updated>2025-06-26T08:21:11.852Z</atom:updated>
            <content:encoded><![CDATA[<p>🚀 Free AI Tools That Are Revolutionizing Video Creation &amp; Productivity in 2025</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6DFhvk1zrCPX0z13jmRy2Q.png" /><figcaption>AIBoom</figcaption></figure><p>In an age where attention spans are shrinking and video is the dominant medium, the ability to create high-quality content quickly and affordably has become a superpower.</p><p>As a tech-savvy creator and researcher deeply passionate about productivity and automation, I’ve spent weeks exploring the best <strong>free AI tools</strong> that empower anyone — from indie creators to startup founders — to <strong>generate videos</strong>, streamline research, and optimize digital workflows.</p><p>Here’s a curated list of <strong>free and freemium AI tools</strong> that are game-changers in 2025:</p><h3>🎥 AI Tools for Video Creation</h3><h3>1. <a href="https://hailuoai.video/">Hailuo AI Video</a></h3><p>Turn text into avatar-based videos with realistic AI narrators. Perfect for explainer, educational, or news-style content.</p><ul><li>✅ Supports subtitles, multilingual voices</li><li>🚫 Watermark on free plan</li><li>🔁 Ideal for short reels, updates, and faceless content</li></ul><h3>2. <a href="https://faceless.video/">Faceless.Video</a></h3><p>A dream tool for YouTubers and short-form creators who want to automate content without showing their face.</p><ul><li>🎙️ AI voiceovers + scenes from a script</li><li>🎞️ Templates optimized for TikTok, YouTube Shorts</li><li>💡 Great for content automation workflows</li></ul><h3>3. <a href="https://app.ltx.studio/">LTX Studio</a></h3><p>A cinematic storytelling engine using AI. Think of it as your personal Pixar, still in beta but promising incredible power.</p><ul><li>🎬 Scene generation from text</li><li>🧠 Great for storyboarding, trailers, and visual stories</li><li>✨ Ideal for creatives &amp; indie filmmakers</li></ul><h3>4. <a href="https://yuewen.cn/videos">Yuewen.cn/videos</a></h3><p>Popular in Asia, this platform specializes in avatar and voice-based AI content. It is perfect for regional or localized content strategies.</p><ul><li>🌏 Requires translation if outside China</li><li>🤖 Good for faceless explainers and news recaps</li></ul><h3>🧠 AI Research &amp; Chat Assistants</h3><h3>5. <a href="https://chat.deepseek.com/">DeepSeek Chat</a></h3><p>An excellent ChatGPT alternative for deep code, data, and multilingual research.</p><ul><li>🌐 Chinese + English support</li><li>📚 Ideal for script generation, topic research, and productivity tasks</li></ul><h3>6. <a href="https://glbgpt.com/chatGpt/deep-research">GLB GPT Deep Research</a></h3><p>A focused research assistant that can summarize web content, articles, and trends — useful for script writing and idea validation.</p><h3>7. <a href="https://chat.qwen.ai/">Qwen AI Chat</a></h3><p>Alibaba’s AI assistant, powerful in multilingual and technical tasks. Worth trying for idea generation across languages and domains.</p><h3>📚 AI Tools for Learning &amp; Productivity</h3><h3>8. <a href="https://notebooklm.google/">NotebookLM (by Google)</a></h3><p>An AI-powered notebook that understands your uploaded documents, PDFs, or notes and answers questions from them.</p><ul><li>📄 Great for condensing research</li><li>✍️ Useful for preparing scripts, blogs, or presentation notes</li></ul><h3>9. <a href="https://app.youlearn.ai/">YouLearn.ai</a></h3><p>Transform YouTube videos into digestible insights. Super useful for creators who learn fast and want to script faster.</p><h3>10. <a href="https://www.aixploria.com/en/">AIxploria</a></h3><p>A massive directory of freemium AI tools across categories like writing, video, code, productivity, and more.</p><ul><li>🔎 Ideal for discovering hidden gems</li><li>🧰 A go-to resource hub for creators and solopreneurs</li></ul><h3>🧰 Bonus: Developer/Automation Utilities</h3><h3>11. <a href="https://www.augmentcode.com/">AugmentCode</a></h3><p>A new-age code assistant that helps you build smarter, faster. If you automate workflows (like I do), this can enhance your pipeline scripts or tool integrations.</p><h3>12. <a href="https://www.google.com/search?q=trae+code+editor">Trae Code Editor</a></h3><p>Still evolving, this AI-enhanced code editor could be promising for collaborative or AI pair programming setups.</p><h3>🔄 How I Use Them Together (A Workflow Preview)</h3><p>Here’s a simplified <strong>workflow</strong> I’m experimenting with to generate 3 short-form videos a day:</p><p>Step Tool(s) Used Idea Generation ChatGPT / DeepSeek / Qwen Research + Script NotebookLM / GLB GPT / YouLearn Voice &amp; Narration Hailuo AI / Faceless / Yuewen Video Assembly LTX Studio / Faceless Visuals + Assets Stockimg.ai / Canva (free) Manual Final Touch CapCut / Clipchamp</p><h3>🧩 Final Thoughts</h3><p>The AI landscape is evolving rapidly, and <strong>you don’t need to spend a dime</strong> to start leveraging its power. With the right mix of creativity and curiosity, anyone can build powerful content workflows, boost productivity, and even start a side hustle using these free tools.</p><p>🔗 <strong>Let me know if you’ve tried any of these — or if you’ve discovered others worth exploring. I’m always open to learning from fellow creators!</strong></p><p>Feel free to connect, share this list, or follow for more updates on my AI + productivity experiments.</p><p>#ai #tools #video #automation #creatorstack #contentcreation #freeai #no-code #productivity</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63c029441fce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fundamentals Of Kubernetes Part 5]]></title>
            <link>https://medium.com/@rishikesh.s7711/fundamentals-of-kubernetes-part-5-fd9fc97f5b4?source=rss-edac684cb70f------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd9fc97f5b4</guid>
            <category><![CDATA[k8s-series]]></category>
            <category><![CDATA[kubernetes-networking]]></category>
            <category><![CDATA[services]]></category>
            <category><![CDATA[kubernetes-service]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Rishikesh Sonawane]]></dc:creator>
            <pubDate>Sun, 21 Apr 2024 09:33:45 GMT</pubDate>
            <atom:updated>2024-04-21T09:33:45.751Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>In this article,</strong> we delve into the basics of Kubernetes networking, focusing on the concept of <strong>Services </strong>— a fundamental building block that allows for efficient communication within and outside of your Kubernetes cluster.</p><p>We’ll start with networking in a single-node Kubernetes cluster and then expand our understanding to multi-node clusters, highlighting the challenges and solutions provided by Kubernetes networking. Understanding Services is key to enabling loose coupling between microservices in your application, so let’s explore how they facilitate connectivity and load balancing across different components of your application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dEKpDVaBEslRnpeM.jpeg" /><figcaption>Source: Google</figcaption></figure><p>Grab your notebook for some key takeaways, as we dive deeper into the world of Kubernetes!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mXWm5elL_oeXyUR-hMTUNQ.png" /><figcaption>Source: Google</figcaption></figure><p>We begin our journey into Kubernetes networking with an exploration of a single-node Kubernetes cluster. Imagine this node is assigned the IP address `192.168.1.2`, which we utilize for tasks such as accessing the node and establishing SSH connections.</p><p>Within this single-node cluster, we’ve spun up a single Pod. Unlike container, which is directly assigned an IP address, Kubernetes assigns the IP address to the Pod itself. For example, our Pod may be allocated an IP address like `10.244.0.2`, which falls within the internally created Kubernetes network range, typically starting at `10.244.0.0`. So, how does the Pod receive this internal IP address? When Kubernetes is set up, it crafts a private network exclusively for Pods, ensuring each Pod receives a unique IP address within this network. Pods can communicate with one another using these internal addresses, but relying on these addresses for inter-Pod communication can be problematic. These IPs are volatile and subject to change if Pods are terminated and recreated. Shortly, we’ll explore more robust and reliable methods for enabling communication between Pods, transcending the limitations of transient internal IP addresses.</p><p><strong># Cluster Networking</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*VDi783a34ZmI2GP-t5Stcw.png" /><figcaption>Source: Google</figcaption></figure><p>So it’s all easy and simple to understand when it comes to networking on a single node. But how does it work when you have multiple nodes in a cluster? In this case we have two nodes running kubernetes and they have IP addresses `192.168.1.2` and `192.168.1.3` assigned to them. Note that they are not part of the same cluster yet. Each of them has a single POD deployed. As discussed in the previous slide these pods are attached to an internal network and they have their own IP addresses assigned. However, if you look at the network addresses, you can see that they are the same. The two networks have an address `10.244.0.0` and the PODs deployed have the same address too. This is NOT going to work well when the nodes are part of the same cluster. The PODs have the same IP addresses assigned to them and that will lead to IP conflicts in the network. Now that’s one problem. When a kubernetes cluster is setup, kubernetes does NOT automatically setup any kind of networking to handle these issues. As a matter of fact, kubernetes expects us to setup networking to meet certain fundamental requirements. Some of these are that all the containers or pods in a kubernetes cluster must be able to communicate with one another without having to configure <a href="https://www.geeksforgeeks.org/network-address-translation-nat/">NAT</a>. All nodes must be able to communicate with containers and all containers must be able to communicate with the nodes in the cluster. Kubernetes expects us to setup a networking solution that meets these criteria.</p><p>Fortunately, we don’t have to set it up all on our own as there are multiple pre-built solutions available. Some of them are the cisco ACI networks, Cilium, Big Cloud Fabric, Flannel, Vmware NSX-t and Calico. Depending on the platform you are deploying your Kubernetes cluster on you may use any of these solutions. For now we will use Calico. Depending on your environment and after evaluating the Pros and Cons of each of these, you may chose the right networking solution.</p><p>So back to our cluster, with the Calico networking setup, it now manages the networks and Ips in the nodes and assigns a different network address for each network in the nodes. This creates a virtual network of all PODs and nodes were they are all assigned a unique IP Address. And by using simple routing techniques the cluster networking enables communication between the different pods or Nodes to meet the networking requirements of Kubernetes. Thus all Pods can now communicate to each other using the assigned IP addresses.</p><p><strong># Services</strong></p><p>Kubernetes Services enable communication between various components within and outside of the application. Kubernetes Services helps us connect applications together with other applications or users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V6xrCXrP6VsEZMvMexA8Uw.png" /><figcaption>Source: Google</figcaption></figure><p><strong>For example</strong>, our application has groups of pods running various sections, such as a group for serving front-end load to users, another group running back-end processes, and a third group connecting to an external data source. It is Services that enable connectivity between these groups of PODs. Services enable the front-end application to be made available to users, it helps communication between back-end and front-end PODs, and helps in establishing connectivity to an external data source. Thus services enable loose coupling between microservices in our application.</p><p>Let’s take a look at one use case of Services. So far we talked about how pods communicate with each other through internal networking. Let’s look at some other aspects of networking in this lecture. Let’s start with external communication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*MEH5N6ck2Em7mR9W_0s-wg.png" /><figcaption>Source: Google</figcaption></figure><p>So we deployed our pod having a web application running on it. How do we as an external user access the web page? First of all, lets look at the existing setup. The Kubernetes Node has an IP address and that is `192.168.1.2`. The laptop is on the same network as well, so it has an IP address `192.168.1.10`. The internal POD network is in the range `10.244.0.0` and the POD has an IP `10.244.0.2`. Clearly, I cannot ping or access the POD at address `10.244.0.2` as its in a separate network. So what are the options to see the webpage? First, if we were to SSH into the kubernetes node at `192.168.1.2`, from the node, we would be able to access the Pod’s webpage by doing a curl or if the node has a GUI, we could fire up a browser and see the webpage in a browser following the address `http://10.244.0.2`. But this is from inside the Kubernetes Node and that’s not what we really want. I want to be able to access the web server from my own laptop without having to SSH into the node and simply by accessing the IP of the Kubernetes node. So we need something in the middle to help us map requests to the node from our laptop through the node to the pod running the web container.</p><p>That is where the kubernetes service comes into play. The kubernetes service is an object just like PODs, Replicaset or Deployments that we worked with before. One of its use case is to listen to a port on the Node and forward requests on that port to a port on the POD running the web application. This type of service is known as a <strong>NodePort</strong> service because the service listens to a port on the Node and forwards requests to pods. There are other kinds of services available which we will now discuss.</p><p>The first one is what we discussed already — <strong>NodePort</strong> where the service makes an internal POD accessible on a Port on the Node. The second is <strong>ClusterIP</strong> — and in this case the service creates a virtual IP inside the cluster to enable communication between different services such as a set of front-end servers to a set of backend servers. The third type is a <strong>LoadBalancer</strong>, where it provisions a load balancer for our service in supported cloud providers. A good example of that would be to distribute load across different web servers. We will now look at Each of these in a bit more detail.</p><p><strong># NodePort</strong></p><p>Getting back to NodePort, as we discussed about external access to the application. We said that a Service can help us by mapping a port on the Node to a port on the POD.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*7gLgt4Dppbyn9d6-d_dM6w.png" /><figcaption>Source: Google</figcaption></figure><p>Let’s take a closer look at the Service. If you look at it, there are 3 ports involved. The port on the pod where the actual web server is running is `port 80`. And it is referred to as the “targetPort”, because that is where the service forwards the requests to. The second port is the port on the service itself. It is simply referred to as the “port”. Remember, these terms are from the viewpoint of the service. The service is in fact like a virtual server inside the node. Inside the cluster it has its own IP address. And that IP address is called the “Cluster-IP of the service”. And finally we have the port on the Node itself which we use to access the web server externally. And that is known as the “NodePort”. As you can see it is `30008`. That is because NodePorts can only be in a valid range which is from <strong>“30000 to 32767”</strong>.</p><p>Let us now look at how to create the service. Just like how we created a Deployment, ReplicaSet or Pod, we will use a definition file to create a service. The high level structure of the file remains the same. As before we have apiVersion, kind, metadata and spec sections. The apiVersion is going to be <strong>v1</strong>. The kind is ofcourse <strong>service</strong>. The metadata will have a <strong>name</strong> and that will be the name of the service. It can have <strong>labels</strong>, which is optional. Next we have <strong>spec</strong> and as always this is the most crucial part of the file as this is were we will be defining the actual services and this is the part of a definition file that differs between different objects. In the spec section of a service we have <strong>type</strong> and <strong>ports</strong>. The type refers to the type of service we are creating. As discussed before it could be <strong>ClusterIP</strong>, <strong>NodePort</strong>, or <strong>LoadBalancer</strong>. In this case since we are creating a NodePort we will set it as “NodePort”. The next part of spec is <strong>ports</strong>. This is where we input information regarding what we discussed. The first type of port is the <strong>targetPort</strong>, which we will set to “80”. The next one is simply <strong>port</strong>, which is the port on the service object and we will set that to “80” as well. The third is <strong>NodePort</strong> which we will set to “30008” or any number in the valid range. <strong><em>Remember that out of these, the only mandatory field is port</em> </strong>. <strong><em>If you don’t provide a targetPort it is assumed to be the same as port and if you don’t provide a nodePort a free port in the valid range between 30000 and 32767 is automatically allocated. Also note that ports is an array.</em></strong></p><p>→ <strong>Service definition file —</strong></p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: myapp-service<br>spec:<br> type: NodePort<br>  ports:<br>    - targetPort: 80<br>      port: 80<br>      nodePort: 30008<br>  selector:<br>    labels:<br>       app: myapp<br>       type: front-end</pre><p>So note the dash under the ports section that indicate the first element in the array. You can have multiple such port mappings within a single service. So we have all the information in, but something here is really missing. There is nothing here in the definition file that connects the service to the POD. We have simply specified the targetPort but we didn’t mention the targetPort on which POD. There could be 100s of other PODs with web services running on port 80. So how do we do that? As we did with the replicasets previously and a technique that you will see very often in kubernetes, we will use labels and selectors to link these together. We know that the POD was created with a label. We need to bring that label into this service definition file.</p><p>So we have a new property in the spec section and that is <strong>selector</strong>. Under the selector provide a list of labels to identify the POD. For this refer to the poddefinition file used to create the POD. Pull the labels from the pod-definition file and place it under the selector section. This links the service to the pod. Once done create the service using the `kubectl create command` and input the “<strong>service-definition file”</strong> and there you have the service created. To see the created service, run the `kubectl get services` command that lists the services, their cluster-ip and the mapped ports. The type is <strong>NodePort</strong> as we created and the port on the node automatically assigned is <strong>‘32432’.</strong> We can now use this port to access the web service using curl or a web browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TfIvh1fPemHGZ6XzIiyhAg.png" /><figcaption>Source: Google</figcaption></figure><p>So far we talked about a service mapped to a single POD. But that’s not the case all the time, what do you do when you have multiple PODs? In a production environment you have multiple instances of your web application running for highavailability and load balancing purposes. In this case we have multiple similar PODs running our web application. They all have the same labels with a key app set to value myapp. The same label is used as a selector during the creation of the service. So when the service is created, it looks for matching PODs with the labels and finds 3 of them. The service then automatically selects all the 3 PODs as endpoints to forward the external requests coming from the user. You don’t have to do any additional configuration to make this happen. And if you are wondering what algorithm it uses to balance load, it uses a random algorithm. Thus the service acts as a built-in load balancer to distribute load across different PODs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*dxV04s3DDQDc_qsW-AEIAw.png" /><figcaption>Source: Google</figcaption></figure><p>And finally, lets look at what happens when the PODs are distributed across multiple nodes. In this case we have the web application on PODs on separate nodes in the cluster. When we create a service , without us having to do any kind of additional configuration, kubernetes creates a service that spans across all the nodes in the cluster and maps the target port to the same NodePort on all the nodes in the cluster. This way you can access your application using the IP of any node in the cluster and using the same port number which in this case is `30008`. To summarize — in any case weather it be a single pod in a single node, multiple pods on a single node, multiple pods on multiple nodes, the service is created exactly the same without you having to do any additional steps during the service creation. When pods are removed or added the service is automatically updated making it highly flexible and adaptive. Once created you won’t typically have to make any additional configuration changes.</p><p><strong># ClusterIP</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*g7DHNySIsp6fnaKOB4TtMg.png" /><figcaption>Source: Google</figcaption></figure><p>A full stack web application typically has different kinds of pods hosting different parts of an application. You may have a number of pods running a front-end web server, another set of pods running a backend server, a set of pods running a keyvalue store like Redis, anotherset of pods running a persistent database like MySQL etc. The web front-end servers need to connect to the backend-workers and the backend-workers need to connect to database as well as the redis services. So what is the right way to establish connectivity between these pods? The pods all have an IP address assigned to them as we can see on the screen. But these Ips as we know are not static, these PODs can go down anytime and new PODs are created all the time — and so you cannot rely on these IP addresses for internal communication within the application. Also what if the first front-end pod at `10.244.0.3` need to connect to a backend service? Which of the 3 would it go to and who makes that decision? <br>A kubernetes service can help us group these PODs together and provide a single interface to access the PODs in a group. For example a service created for the backend PODs will help group all the backend PODs together and provide a single interface for other PODs to access this service. The requests are forwarded to one of the PODs under the service randomly. Similarly, create additional services for Redis and allow the backend PODs to access the redis system through this service. This enables us to easily and effectively deploy a microservices based application on kubernetes cluster. Each layer can now scale or move as required without impacting communication between the various services. Each service gets an IP and name assigned to it inside the cluster and that is the name that should be used by other PODs to access the service. This type of service is known as <strong>ClusterIP</strong>.</p><p>To create such a service, as always, use a definition file. In the service definition file , first use the default template which has apiVersion, kind, metadata and spec. The apiVersion is “v1”, kind is “Service” and we will give a name to our service we will call it “back-end”. Under Specification we have type and ports. The type is “ClusterIP”. <em>In fact, ClusterIP is the default type, so even if you didn’t specify it, it will automatically assume it to be ClusterIP.</em> Under ports we have a targetPort and port. The target port is the port were the back-end is exposed, which in this case is `80`. And the port is were the service is exposed. Which is `80` as well. To link the service to a set of pods, we use “selector”. We will refer to the “pod-definition file” and copy the labels from it and move it under selector. And that should be it. We can now create the service using the kubectl create command and then check its status using the kubectl get services command. The service can be accessed by other pods using the ClusterIP or the service name.</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: back-end<br>spec:<br> type: ClusterIP<br>  ports:<br>    - targetPort: 80<br>      port: 80<br>  selector:<br>    labels:<br>       app: myapp<br>       type: back-end</pre><p><strong># Loadbalancer</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bAbWG78X8kgrTjQDv-69sA.png" /><figcaption>Source: Google</figcaption></figure><p>We will quickly recap what we learned about the two service types, so that we can work our way to the LoadBalancer type. We have a 3 node cluster with Ips `192.168.1.2,3 and 4`. Our application is two tier, there is a <strong>“database service”</strong> and a <strong>“front-end web service”</strong> for users to access the application. The default service type known as “ClusterIP” makes a service, such as a redis or database service available internally within the Kubernetes cluster for other applications to consume. The next tier in this application happens to be a <strong>“python based web front-end”</strong>. This application connects to the backend using Service created for the <strong>redis service</strong>. To expose the application to the end users, we create another service of type <strong>NodePort</strong>. Creating a service of type NodePort exposes the application on a high end port of the Node and the users can access the application at any IP of nodes with the port `30008`. Now, what IP do you give your end users to access your application? You cannot give them all three and let them choose one of their own. What end users really want is a single URL to access the application. For this, you will be required to setup a separate Load Balancer VM in your environment. In this case we can deploy a new VM for load balancer purposes and configure it to forward requests that come to it to any of the Ips of the Kubernetes nodes. We can then configure the DNS to point to this load balancer when a user hosts <strong>`http://myapp.com`</strong>. Now setting up that load balancer by yourself is a tedious task, and you might have to do that in a local or on prem environment. However, if it happens to be on a supported CloudPlatform, like Google Cloud Platform, you can leverage the native load balancing functionalities of the cloud platform to set this up. Again you don’t have to set that up manually, Kubernetes sets it up for you. Kubernetes has built-in integration with supported cloud platforms.</p><p>→ <strong>Service definition file —</strong></p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: front-end<br>spec:<br> type: LoadBalancer<br>  ports:<br>    - targetPort: 80<br>      port: 80<br>  selector:<br>    labels:<br>       app: myapp<br>       type: front-end</pre><p><strong># Conclusion</strong></p><p>In conclusion, Kubernetes networking is a critical component of cluster management, ensuring seamless communication between Pods, Nodes, and external networks. By leveraging Services, Kubernetes provides a powerful abstraction that allows for loose coupling between microservices within an application. Services like NodePort, ClusterIP, and LoadBalancer facilitate different types of connectivity and load balancing, addressing both internal and external communication needs. With the ability to link Services to Pods using labels and selectors, Kubernetes simplifies the process of exposing applications and managing traffic flow, making the system both robust and adaptable to changes. Whether operating on-premises or in the cloud, Kubernetes networking solutions, integrated with various pre-built network plugins, ensure that applications remain accessible, scalable, and maintainable.</p><blockquote><em>Here we reached the end of the article — </em><strong><em>“Fundamentals Of Kubernetes PART 5”</em></strong><em>. which is also the final installment in this series. If you’ve missed the earlier parts, do check out Part 4 and the other preceding articles to complete your understanding. <br>If you’ve any queries regarding this, it will be my pleasure to help you, just ping me on </em><a href="https://in.linkedin.com/in/rishikeshsonawane88ba3a14b"><strong><em>LinkedIn</em></strong></a><em>.</em></blockquote><blockquote><em>More on such topics/technologies in the upcoming blogs. So, stay tuned! ;)</em></blockquote><p><strong>HAPPY LEARNING! :)</strong></p><p><strong>Thank you,</strong><br><strong>Rishikesh Sonawane.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd9fc97f5b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fundamentals Of Kubernetes Part 4]]></title>
            <link>https://medium.com/@rishikesh.s7711/fundamentals-of-kubernetes-part-4-e1006cb72614?source=rss-edac684cb70f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1006cb72614</guid>
            <category><![CDATA[scaling]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[k8s-series]]></category>
            <category><![CDATA[kubernetes-replicaset]]></category>
            <category><![CDATA[k8s-deployment]]></category>
            <dc:creator><![CDATA[Rishikesh Sonawane]]></dc:creator>
            <pubDate>Wed, 10 Apr 2024 13:41:32 GMT</pubDate>
            <atom:updated>2024-04-21T09:27:12.478Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Hi again!<br></strong>Welcome to the <strong>PART 4 </strong>of this series on <strong>“Fundamentals Of Kubernetes”.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dEKpDVaBEslRnpeM.jpeg" /></figure><p><strong>In this installment</strong>, we’re zooming in on how to effectively scale your applications and manage deployments within Kubernetes. We’ll tackle scaling <strong>ReplicaSets, the nuances of rolling updates, rollbacks, and the significance of Labels and Selectors</strong>. Get ready to learn the essentials that will keep your applications robust and scalable.</p><p>Grab your notebook for some key takeaways, as we dive deeper into the world of Kubernetes!</p><p><strong># SCALING — </strong><br>Let’s look at how we scale the replicaset. <br>Say we started with 3 replicas, and in the future we decide to scale to 6. How do we update our replicaset to scale to 6 replicas. <br>Well, there are multiple ways to do it. <br>The <strong>first</strong>, is to update the number of replicas in the definition file to 6. Then run the `kubectl replace` command specifying the same file using the `–f` parameter and that will update the replicaset to have 6 replicas.</p><pre>kubectl replace -f rc_definition.yml</pre><p>The <strong>second</strong> <strong>way</strong> to do it is to run the `kubectl scale` command.</p><pre>kubectl scale - replicas=6 replicaset myapp-rc</pre><p>Use the `replicas` parameter to provide the new number of replicas and specify the same file as input. <br>— You may either input the definition file or provide the replicaset name in the type Name format.</p><p>However, remember that using the file name as input will not result in the number of replicas being updated automatically in the file. In otherwords, the number of replicas in the replicaset-definition file will still be 3 even though you scaled your replicaset to have 6 replicas using the kubectl scale command and the file as input.<br>There are also options available for automatically scaling the replicaset based on load.</p><blockquote><strong>IMP Commands: -<br></strong># The `kubectl create`command, as we know, is used to create a replca set. <br>You must provide the input file using the `–f `parameter.<br># Use the `kubectl get` command to see list of replicasets created. <br># Use the `kubectl delete replicaset` command followed by the name of the replica set to delete the replicaset.<br># And then we have the `kubectl replace` command to replace or update replicaset and the `kubectl scale` command to scale the replicas simply from the command line without having to modify the file.</blockquote><p><strong># Deployments —</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EDDTqHuamLAjumipgbKgCw.png" /><figcaption>Source: Google</figcaption></figure><p>For a minute, let us forget about PODs and Replicasets and other Kubernetes concepts and talk about how you might want to deploy your application in a production environment.<br><strong>Say for example,</strong> you have a web server that needs to be deployed in a production environment. You need not one, but many such instances of the web server running for obvious reasons.<br>Now, let’s say there are newer versions of the web server available in the Docker registry. You want to seamlessly upgrade your web server instances to the latest version without causing any downtime or disruption to your users.<br>But theres the catch you don’t want to upgrade all the instances at once because that could impact users accessing your applications. Instead, you want to upgrade them one by one in a controlled manner. This type of upgrade is called a <strong>Rolling Update</strong>.<br> → Rolling Updates allow you to upgrade your application instances in a sequential fashion. You start by upgrading one instance while the others continue serving user requests. Once the upgraded instance is successfully running and serving traffic, you move on to upgrade the next instance. This way, you can ensure a smooth and gradual transition to the new version without affecting all users at once.<br><strong>However</strong>, let’s say one of the upgrades didn’t go as planned, and an unexpected error occurs. In that case, you want to be able to quickly undo or revert the changes and roll back to the previous working version. <br>This rollback capability allows you to revert to a stable state and address any issues that may have occurred during the update process.<br>So, in summary, deploying applications in a production environment involves running multiple instances of the application, upgrading them in a controlled manner using Rolling Updates, and having the ability to roll back to a previous version if needed. These practices help ensure smooth and reliable operations of your application while minimizing disruptions and maintaining high availability.<br>All of these capabilities are available with the kubernetes Deployments.</p><blockquote><strong># The hierarchy — </strong><br> So far we discussed about PODs, which deploy single instances of our application such as the web application. A container is encapsulated in PODs. <br>Multiple such PODs are deployed using Replication Controllers or Replica Sets. And then comes Deployment which is a Kubernetes object that comes higher in the hierarchy. The deployment provides us with capabilities to upgrade the underlying instances seamlessly using rolling updates, undo changes, and pause and resume changes to deployments.</blockquote><p>So <strong>how do we create a deployment</strong>. As with the previous components, we first create a deployment definition file. The contents of the deployment-definition file are exactly similar to the replicaset definition file, except for the kind, which is now going to be `Deployment`. <br>If we walk through the contents of the file it has an <strong>apiVersion</strong> which is `apps/v1`, <strong>metadata</strong> which has <strong>name</strong> and <strong>labels</strong> and a <strong>spec</strong> that has template, replicas and selector. The <strong>template</strong> has a POD definition inside it. Once the file is ready run the `<strong>kubectl create`</strong> command and specify deployment definition file. Then run the `<strong>kubectl get deployments`</strong> command to see the newly created deployment. The deployment automatically creates a replica set. So if you run the kubectl get replcaset command you will be able to see a new replicaset in the name of the deployment. <br>The replicasets ultimately create pods, so if you run the `kubectl get pods` command you will be able to see the pods with the name of the deployment and the replicaset. <br>So far there hasn’t been much of a difference between replicaset and deployments, except for the fact that deployments created a new Kubernetes object called deployments.<br> <br> → <strong>deployment definition file —</strong></p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: new-deployment<br>  labels:<br>    type: front-end<br>spec:<br>  replicas: 3<br>  selector:<br>    matchLabels:<br>      tier: front-end<br>  template:<br>    metadata:<br>      name: new-pod<br>      labels:<br>        tier: front-end<br>    spec:<br>      containers:<br>      - name: nginx-cont<br>        image: nginx</pre><p># To create the Deployment:</p><pre>kubectl create -f deployment-definition.yml</pre><p># To view the Deployment:</p><pre>kubectl get deployments</pre><p>This command will show you a list of Deployments in your cluster. You should see the newly created “new-deployment” Deployment.</p><p># To view the Pods managed by the Deployment:</p><pre>kubectl get pods</pre><p>This command will display a list of Pods in your cluster. You should see three Pods with names similar to “new-pod-&lt;random-string&gt;”.</p><p># To describe the Deployment:</p><pre>kubectl describe deployments new-deployment</pre><p>This command provides detailed information about the Deployment, including its labels, replica count, and current status.</p><p># To scale the Deployment:</p><pre>kubectl scale deployments new-deployment --replicas=5</pre><p>This command scales the Deployment named “new-deployment” to have five replicas. Kubernetes will automatically create or delete Pods to meet the desired replica count.</p><p># To update the image used by the Deployment:</p><pre>kubectl set image deployment/new-deployment nginx-cont=nginx:1.19.2</pre><p>This command updates the image of the container named `nginx-cont` in the `new-deployment` Deployment to use the `nginx:1.19.2` image.</p><p>#<strong> To verify the image update:</strong></p><pre>kubectl describe deployments new-deployment</pre><p># <strong>Rollout and Versioning: -</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ukWPzJ9bxgAFcPzWg0vkaQ.png" /><figcaption>Source: Google</figcaption></figure><p>Whenever you create a new deployment or upgrade the images in an existing deployment it triggers a Rollout. <br>A rollout is the process of gradually deploying or upgrading your application containers. When you first create a deployment, it triggers a rollout. A new rollout creates a new Deployment revision. Let’s call it revision 1. <br>In the future when the application is upgraded — meaning when the container version is updated to a new one — a new rollout is triggered, and a new deployment revision is created named Revision 2. This helps us keep track of the changes made to our deployment and enables us to rollback to a previous version of deployment if necessary.<br>You can see the status of your rollout by running the command <strong>`kubectl rollout status`</strong> followed by the name of the deployment. To see the revisions and history of rollout run the command <strong>`kubectl rollout history`</strong> followed by the deployment name and this will show you the revisions.</p><p># To edit the `new-deployment` deployment, you can use the following command:</p><pre>kubectl edit deployment new-deployment</pre><p>This command will open the deployment file in your default text editor, allowing you to make changes to the deployment’s configuration. Save and exit the editor to apply the changes.</p><p># To check the rollout status of the deployment, you can use the following command:</p><pre>kubectl rollout status deployment new-deployment</pre><p>This command will display the status of the ongoing rollout for the `new-deployment` deployment. It will show information such as the number of updated replicas, the desired and available replicas, and the deployment’s overall status.</p><p><strong>→ Deployment Strategy: -<br></strong>There are two types of <strong>Deployment Strategies:</strong><br> <strong>1. Recreate<br> 2. Rolling Update</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i3Tlu72bLQ66qcRbbK6QXQ.png" /><figcaption>Source: Google</figcaption></figure><p>Say <strong>for example, </strong>you have 5 replicas of your web application instance deployed. <strong>One</strong> <strong>way</strong> to upgrade these to a newer version is to destroy all of these and then create newer versions of application instances. Meaning first, destroy the 5 running instances and then deploy 5 new instances of the new application version. <br>The problem with this as you can imagine, is that during the period after the older versions are down and before any newer version is up, the application is down and inaccessible to users. This strategy is known as the Recreate strategy, and thankfully this is NOT the default deployment strategy. <br>The <strong>second strategy</strong> is where we do not destroy all of them at once. Instead, we take down the older version and bring up a newer version one by one. This way the application never goes down and the upgrade is seamless. <br>Remember, if you do not specify a strategy while creating the deployment, it will assume it to be Rolling Update. In other words, RollingUpdate is the default Deployment Strategy. So we talked about upgrades but — <strong>how exactly do you update your deployment? </strong>When I say update it could be different things such as updating your application version by updating the version of docker containers used, updating their labels or updating the number of replicas etc. Since we already have a deployment definition file it is easy for us to modify this file. Once we make the necessary changes, we run the `kubectl apply` command to apply the changes. A new rollout is triggered and a new revision of the deployment is created.<br>But there is another way to do the same thing. You could use the `kubectl set image` command to update the image of your application. But remember, doing it this way will result in the deployment-definition file having a different configuration. So, you must be careful when using the same definition file to make changes in the future.<br>The difference between the recreate and rolling update strategies can also be seen when you view the deployments in detail. Run the kubectl describe deployment command to see detailed information regarding the deployments. You will notice when the Recreate strategy was used the events indicate that the old replicaset was scaled down to 0 first and the new replica set scaled up to 5. However, when the RollingUpdate strategy was used the old replica set was scaled down one at a time simultaneously scaling up the new replica set one at a time.<br> <br> → <strong>UPGRADES —</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pj2qItYOvIuk3h6KE1CzIQ.png" /><figcaption>Source: Google</figcaption></figure><p>Let’s look at how a deployment performs an upgrade under the hoods. When a new deployment is created, say to deploy 5 replicas, it first creates a Replicaset automatically, which in turn creates the number of PODs required to meet the number of replicas. When you upgrade your application as we saw before, <strong>the kubernetes deployment object creates a new replicaset under the hoods and starts deploying the containers there.</strong> At the same time taking down the PODs in the old replica-set following a RollingUpdate strategy. This can be seen when you try to list the replicasets using the `kubectl get replicasets` command.<br> <br> → <strong>ROLLBACK —</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ynYwLCc7ZVPYvM3vAf4ekQ.png" /><figcaption>Source: Google</figcaption></figure><p>Say for instance once you upgrade your application, you realise something isn’t very right. Something’s wrong with the new version of build you used to upgrade. So you would like to rollback your update. <br>Kubernetes deployments allow you to rollback to a previous revision. <br>To undo a change run the command `kubectl rollout undo` followed by the name of the deployment.</p><pre>kubectl get all<br>kubectl rollout undo deployment new-deployment<br>kubectl get all</pre><p>The deployment will then destroy the PODs in the new replicaset and bring the older ones up in the old replicaset. And your application is back to its older format. When you compare the output of the kubectl get replicasets command, before and after the rollback, you will be able to notice this difference. Before the rollback the first replicaset had 0 PODs and the new replicaset had 5 PODs and this is reversed after the rollback is finished. In conclusion, Kubernetes Controllers are essential for managing and maintaining the desired state of Kubernetes objects. They ensure fault tolerance, scalability, and high availability of applications. By using Replication Controllers, Replica Sets, and Deployments, you can easily manage and scale your application instances while ensuring continuous availability and seamless updates. Labels and selectors allow for efficient grouping and organization of pods, making it easier for controllers to monitor and manage specific sets of resources. Overall, Kubernetes Controllers are vital tools for effectively managing and orchestrating applications in Kubernetes clusters.</p><p><strong># Summary<br></strong>Fundamentals Of Kubernetes Part 4 provides an in-depth look at scaling applications using ReplicaSets, the process of rolling updates, and the importance of labels and selectors in Kubernetes. It explains how to scale up or down the number of replicas, and introduces Deployments as a means to manage application releases without downtime. The article covers the creation and management of Deployments, including updating images and scaling, and details the strategies for updating applications with zero downtime: Recreate and Rolling Update. It also touches on the concept of rollouts and versions, showing how to view rollout history and perform rollbacks to previous versions if updates fail. The piece concludes by emphasizing the critical role of Kubernetes Controllers in ensuring application resilience and availability.</p><blockquote><em>Here we reached the end of the article — </em><strong><em>“Fundamentals Of Kubernetes PART 4”</em></strong><em>. Please also check the Part 5 of this series.</em></blockquote><blockquote><em>If you’ve any queries regarding this, it will be my pleasure to help you, just ping me on </em><a href="https://in.linkedin.com/in/rishikeshsonawane88ba3a14b"><strong><em>LinkedIn</em></strong></a><em>.</em></blockquote><blockquote><em>More on such topics in the upcoming blogs. So, stay tuned! ;)</em></blockquote><p><strong>HAPPY LEARNING! :)</strong></p><p><strong>Thank you,</strong><br><strong>Rishikesh Sonawane.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1006cb72614" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fundamentals Of Kubernetes Part 3]]></title>
            <link>https://medium.com/@rishikesh.s7711/fundamentals-of-kubernetes-part-3-e8ee8b005cc?source=rss-edac684cb70f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8ee8b005cc</guid>
            <category><![CDATA[k8s-series]]></category>
            <category><![CDATA[replicaset]]></category>
            <category><![CDATA[replication-controller]]></category>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Rishikesh Sonawane]]></dc:creator>
            <pubDate>Mon, 08 Apr 2024 04:21:14 GMT</pubDate>
            <atom:updated>2024-04-21T09:26:42.830Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Hi again!</strong><br>Welcome to the <strong>PART 3</strong> of this series on <strong>“Fundamentals Of Kubernetes”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9cQltfPWWdUoP1h28kLSNw.jpeg" /></figure><p>This article is the third installment in a series on the Fundamentals of Kubernetes, focusing on Replication Controllers and Replica Sets, as well as Labels and Selectors. These concepts are essential for understanding high availability, load balancing, scaling, and deployments in Kubernetes.</p><p>We will go in depth with these topics.<br>Get a Note Book and note what all you feel is important! :)</p><p>Let’s start from one controller in particular and that is —</p><p>→ <strong>REPLICATION CONTROLLER —</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/241/0*z1EIDNdFB4VKpZaA.jpg" /><figcaption>Source: Google</figcaption></figure><p><strong># High Availability:<br></strong>So what is a <strong>Replica</strong> and why do we need a <strong>Replication Controller</strong>?<br><strong>To answer this </strong>— Let’s go back to our the scenario where we had a single POD running our application. <br>What if for some reason, our application crashes and the POD fails?— Users will no longer be able to access our application. To prevent users from losing access to our application, we would like to have more than one instance or POD running at the same time. <br>That way if one fails, we still have our application running on the other one. The replication controller helps us run multiple instances of a single POD in the Kubernetes cluster thus providing <strong>High Availability</strong>.<br>So does that mean you can’t use a replication controller if you plan to have a single POD? <br><strong>No! </strong>Even if you have a single POD, the replication controller can help by automatically bringing up a new POD when the existing one fails. <br>Thus, the replication controller ensures that the specified number of PODs are always running. Even if it’s just 1 or 100.<br>It is possible that a Node is out of resources while creating new pods with Replication controllers or replica sets, in such case it will automatically create new pods on another available cluster node.</p><p><strong># Load Balancing &amp; Scaling: -</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/0*dPUrxhs7Nw1uAAGA.jpg" /><figcaption>Source: Google</figcaption></figure><p>Another reason we need replication controller is to create multiple PODs to share the load across them.<strong><br>For example</strong>, in this simple scenario we have a single POD serving a set of users. When the number of users increase we deploy additional POD to balance the load across the two pods. If the demand further increases and if we were to run out of resources on the first node, we could deploy additional PODs across other nodes in the cluster. <br>As you can see, the replication controller spans across multiple nodes in the cluster. It helps us balance the load across multiple pods on different nodes as well as scale our application when the demand increases.<br><strong>*</strong>It’s important to note that there are two similar terms — <strong>Replication Controller and Replica Set</strong>. <br>Both have the same purpose but they are not the same.<br>Replication Controller<strong> </strong>is the older technology that is being replaced by Replica Set. Replica set is the new recommended way to setup replication. <br>However, whatever we discussed remain applicable to both these technologies. Also there are some minor differences in the way each works.</p><p><strong># How to create REPLICATION CONTROLLER: -</strong><br>To create a ReplicationController in Kubernetes, you need to define a YAML file that specifies its configuration. Let’s create a file named <em>“rc_definition.yml”</em> and add the following content:</p><pre>apiVersion: v1<br>kind: ReplicationController<br>metadata:<br>  name: myapp-rc<br>  labels:<br>    app: myapp<br>    type: front-end<br>spec:<br>  template:<br>    metadata:<br>      name: myapp-pod<br>      labels:<br>        tier: front-end<br>    spec:<br>      containers:<br>      - name: nginx-container<br>        image: nginx<br>  replicas: 3</pre><p>In this YAML file, we have four sections: <strong>apiVersion, </strong><strong>kind, </strong><strong>metadata, and </strong><strong>spec.</strong></p><p>The <strong>apiVersion </strong>field specifies the version of the Kubernetes API we are using, which is v1 for ReplicationControllers.</p><p>The <strong>kind</strong> field indicates that we are defining a ReplicationController.</p><p>Under the <strong>metadata </strong>section, we provide a name for the ReplicationController, which is set as ‘<em>myapp-rc’.</em> We also assign labels to it using the <strong>labels</strong> field. In this case, we set the &quot;app&quot; label to <em>‘myapp’</em> and the &quot;type&quot; label to <em>‘front-end’</em>. These labels can be used for selecting and grouping resources.</p><p>The most crucial part is the <strong>spec</strong> section. Within the <strong>spec</strong>, <strong>we define a template for the Pods that the ReplicationController will create.</strong> The template includes a <strong>metadata</strong> section specifying the name and labels for the Pods, and a <strong>spec</strong> section defining the desired state of the Pods.</p><p>Inside the <strong>metadata</strong> section of the template, we set the name of the Pod as <em>‘myapp-pod’</em> and assign a label &quot;tier&quot; with the value <em>‘front-end’</em> to it. These labels are used for identifying and organizing the Pods.</p><p>The <strong>spec</strong> section within the template defines the desired state of the Pod. In this example, we have a single container named &quot;nginx-container&quot; with the image &quot;nginx&quot;. You can add more containers or specify different images based on your application requirements.</p><p>We also specify the number of replicas we want by adding the <strong>replicas</strong> field under the main <strong>spec</strong> section. In this example, we set <strong>replicas: 3,</strong> indicating that we want three replicas of the Pod to be running at all times.</p><p>Once the <em>“rc_definition.yml”</em> file is ready, you can create the ReplicationController by running the following command:</p><pre>kubectl create -f rc_definition.yml</pre><p>This command instructs Kubernetes to create the ReplicationController and its associated Pods based on the configuration defined in the YAML file.</p><p>To verify that the ReplicationController has been created, you can use the following command:</p><pre>kubectl get replicationcontroller</pre><p>This will display a list of ReplicationControllers in your cluster, including the newly created <em>“myapp-rc”</em> ReplicationController.</p><p>If you want to see the Pods created by the ReplicationController, you can run:</p><pre>kubectl get pods</pre><p>This command will show you a list of Pods, including the three Pods that were created by the ReplicationController based on the specified template.</p><p><strong>That’s it!</strong> You have now successfully created a ReplicationController in Kubernetes and verified the creation of Pods managed by the ReplicationController.</p><p><strong># How to create Replicaset — </strong><br>What we just saw was <strong>ReplicationController</strong>. Let us now look at <strong>ReplicaSet</strong>. It is very similar to replication controller. Just as before, first we have apiVersion, kind, metadata and spec. <br>The <strong>`apiVersion</strong>` though is a bit different. It is <strong>apps/v1</strong> which is different from what we had before for replication controller. For replication controller it was simply <strong>v1</strong>.<br>The <strong>`kind`</strong> would be ReplicaSet and we add name and labels in ‘<strong>metadata’</strong>.<br>The `<strong>spec’</strong> section looks very similar to replication controller.<br>It has a template section were we provide pod-definition as before.<br>And we have number of replicas set to 3. <br>However, there is <strong>one major difference </strong>between replication controller and replica set. Replica set requires a selector definition. The selector section helps the replicaset identify what pods fall under it. But why would you have to specify what PODs fall under it, if you have provided the contents of the pod-definition file itself in the template? <br>It’s because, replica set can also manage pods that were not created as part of the replicaset creation.</p><p><strong>Say for example</strong>, there were pods created before the creation of the ReplicaSet that match the labels specified in the selector, the replica set will also take those pods into consideration when creating the replicas.<br>Selector is one of the major differences between replication controller and replica set. The selector is not a required field in case of a replication controller, but it is still available.<br>In case of replica set a user input is required for this property. And it has to be written in the form of matchLabels.<br>The matchLabels selector simply matches the labels specified under it to the labels on the PODs. The replicaset selector also provides many other options for matching labels that were not available in a replication controller. To create a ReplicaSet run the kubectl create command providing the definition file as input and to see the created replicasets run the kubectl get replicaset command. To get list of pods, simply run the kubectl get pods command.</p><p><strong># Labels and Selectors: -</strong><br>So what is the deal with Labels and Selectors? <br>Why do we label our PODs and objects in kubernetes? <br>Let us look at a simple scenario. Say we deployed 3 instances of our frontend web application as 3 PODs. We would like to create a replication controller or replica set to ensure that we have 3 active PODs at anytime. <br>And yes that is one of the use cases of replica sets. You can use it to monitor existing pods, if you have them already created. In case they were not created, the replica set will create them for you. The role of the replicaset is to monitor the pods and if any of them were to fail, deploy new ones. The replica set is in fact a process that monitors the pods. <strong>Now</strong>, how does the replica set know what pods to monitor. There could be 100s of other PODs in the cluster running different application. <br><strong>This is where labelling our PODs during creation comes in handy</strong>. <br>We could now provide these labels as a filter for replicaset. Under the selector section we use the matchLabels filter and provide the same label that we used while creating the pods. This way the replicaset knows which pods to monitor. In the replicaset <strong>“spec”</strong> section we learned that there are 3 sections: <br><strong>Template, replicas and the selector.</strong><br>Say for instance we have the same scenario where we have 3 existing PODs that were created already and we need to create a replica set to monitor the PODs to ensure there are a minimum of 3 running at all times. <br>When the replica set is created, it is not going to deploy a new instance of POD as 3 of them with matching labels are already created. <br>In that case, do we really need to provide a template section in the replica-set spec section, since we are not expecting the replicaset to create a new POD on deployment? <br><strong>Yes we do!</strong> because incase one of the PODs were to fail in the future, the replicaset needs to create a new one to maintain the desired number of PODs. <br> And for the replica set to create a new POD, the template definition section is required.<br> <br> → <strong>ReplicaSet Definition file —</strong></p><pre>apiVersion: apps/v1<br>kind: ReplicaSet<br>metadata:<br>  name: myapp-rc<br>  labels:<br>    app: myapp<br>    type: front-end<br>spec:<br>  selector:<br>    matchLabels:<br>      tier: front-end<br>  template:<br>    metadata:<br>      name: myapp-pod<br>      labels:<br>        tier: front-end<br>    spec:<br>      containers:<br>      - name: nginx-container<br>        image: nginx<br>  replicas: 3</pre><p>— After creating the ReplicaSet using the provided YAML file, here are some commands you can try to interact with the ReplicaSet and its associated Pods:<br># To create the ReplicaSet:</p><pre>kubectl create -f replicaset-definition.yml</pre><p># To view the ReplicaSet:</p><pre>kubectl get replicasets</pre><p>This command will show you a list of ReplicaSets in your cluster. You should see the newly created “myapp-rc” ReplicaSet.</p><p># To view the Pods managed by the ReplicaSet:</p><pre>kubectl get pods</pre><p>This command will display a list of Pods in your cluster. You should see three Pods with names similar to “myapp-pod-{random-string}”.</p><p># To describe the ReplicaSet:</p><pre>kubectl describe replicasets myapp-rc</pre><p>This command provides detailed information about the ReplicaSet, including its labels, selector, and current status.</p><p># To scale the ReplicaSet:</p><pre>kubectl scale replicasets myapp-rc --replicas=5</pre><p>This command scales the ReplicaSet named “myapp-rc” to have five replicas. Kubernetes will automatically create or delete Pods to meet the desired replica count.</p><p># To verify the updated replica count:</p><pre>kubectl get replicasets myapp-rc</pre><p>This command will show you the updated ReplicaSet information, including the new replica count of five.</p><p># To delete the ReplicaSet:</p><pre>kubectl delete replicasets myapp-rc</pre><p>This command removes the ReplicaSet and its associated Pods from the cluster.</p><p>Please note that the above commands assume you have kubectl configured to connect to your Kubernetes cluster.</p><h4><strong># Summary</strong></h4><p>In Part 3 of the <strong>“Fundamentals of Kubernetes”</strong> series, the focus is on Replication Controllers and Replica Sets, which ensure high availability by maintaining a specified number of pod replicas. Replication Controllers are an older technology being replaced by Replica Sets, which require a selector to manage pods. Labels and Selectors are also discussed as they are crucial for identifying and organizing Kubernetes objects. The article includes examples of YAML configuration for both Replication Controllers and Replica Sets and provides commands for managing them within a Kubernetes cluster.</p><blockquote><em>Here we reached the end of the article — </em><strong><em>“Fundamentals Of Kubernetes PART 3”</em></strong><em>. Please also check the Part 4 of this series.</em></blockquote><blockquote><em>If you’ve any queries regarding this, it will be my pleasure to help you, just ping me on </em><a href="https://in.linkedin.com/in/rishikeshsonawane88ba3a14b"><strong><em>LinkedIn</em></strong></a><em>.</em></blockquote><blockquote><em>More on such topics in the upcoming blogs. So, stay tuned! ;)</em></blockquote><p><strong>HAPPY LEARNING! :)</strong></p><p><strong>Thank you,</strong><br><strong>Rishikesh Sonawane.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8ee8b005cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fundamentals Of Kubernetes: Part 2]]></title>
            <link>https://medium.com/@rishikesh.s7711/fundamentals-of-kubernetes-part-2-7253d83414f2?source=rss-edac684cb70f------2</link>
            <guid isPermaLink="false">https://medium.com/p/7253d83414f2</guid>
            <dc:creator><![CDATA[Rishikesh Sonawane]]></dc:creator>
            <pubDate>Wed, 28 Jun 2023 05:11:35 GMT</pubDate>
            <atom:updated>2024-04-21T09:25:48.651Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4Q24FcySxpa-xcId" /><figcaption>Source: <a href="https://www.tech2bit.com/what-is-kubernetes/">What is Kubernetes? (tech2bit.com)</a></figcaption></figure><p><strong>In the second part of this article, </strong>we will dive deeper into the key concepts and components of Kubernetes. <br>The basic architecture, what are nodes, what are clusters, the role of nodes and clusters, the master node, the concept of pods, the control plane, and the components of the control plane. <br>We will also discuss the relationship between master and worker nodes, multi-container pods, and the usage of the Kubernetes command-line tool (kubectl). Additionally, we will learn about YAML files and how they are used to define Kubernetes objects.</p><p><strong>By the end of this article series,</strong> you will have a comprehensive understanding of Kubernetes and its various components. You will be equipped with the knowledge and tools to deploy, scale, and manage your applications effectively on Kubernetes.<br>So, let’s dive into the exciting world of Kubernetes and unleash the full potential of container orchestration and application management!</p><p>Let’s begin with the <strong>Basic Architecture </strong>of Kubernetes<strong>: -</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/0*91NQJqbgv4lzkJvi" /></figure><p><strong>→ NODE — <br></strong>A <strong>node</strong> is a machine — physical or virtual — on which Kubernetes is installed. A node is a worker machine, and this is where containers (which we learned in the earlier part of this series) will be launched by Kubernetes. Also known as “Minions” in the past. <br>So, you might here these terms used interchangeably.<br>But what if the node on which our application is running fails? <br>Our application goes down. So, you need to have more than one node.<br> <br> → <strong>Cluster — </strong><br>When there is more than one node, it is called a <strong>cluster</strong>. A cluster is a set of nodes grouped together. This way even if one node fails you have your application still accessible from the other nodes. <br>Moreover, having multiple nodes helps in sharing load as well.<br>Yay! So now we have a cluster, but <br>- who is responsible for managing the cluster? <br>- Where is the information about the members of the cluster stored? <br>- How are the nodes monitored? <br>- When a node fails how do you move the workload of the failed node to another worker node?<br>We’ll answer these questions here-on-<br> <br> → <strong>Master — </strong><br> That’s where the Master comes in. The master is another node with Kubernetes installed in it and is configured as a <strong>Master</strong>. The master watches over the nodes in the cluster and is responsible for the actual orchestration of containers on the worker nodes.<br> <br> → <strong>Pod’s — <br>- </strong>With Kubernetes our ultimate aim is to deploy our application in the form of containers on a set of machines that are configured as worker nodes in a cluster.<br> -However, Kubernetes does not deploy containers directly on the worker nodes. The containers are encapsulated into a Kubernetes object known as PODs.<br> -A POD is a single instance of an application. A POD is the smallest object, that you can create in Kubernetes.<br> <br> → <strong>Control Plane — </strong><br>- The way Kubernetes manages all the pods is with the help of something called <strong>Control Plane</strong>. <br>- Basically, this control plane is responsible for handling all the details by exposing an API. <br>This is where K8s can deploy, define, and manage the lifecycle of a pod.</p><blockquote><em>Note: Kubernetes is also known as </em><a href="https://cloud.google.com/learn/what-is-kubernetes#:~:text=Kubernetes%20(sometimes%20shortened%20to%20K8s,and%20manage%20containerized%20applications%20anywhere."><em>K8s</em></a></blockquote><p>→ <strong>Components of the CONTROL PLANE —</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rFTDFEhZL8ujAKuH.png" /><figcaption>Source: FOSSTechNix.com</figcaption></figure><p>When you install Kubernetes on a System, you are actually installing the following components:<br> An <strong>API Server</strong>, An <strong>ETCD service</strong>, A <strong>kubelet service,</strong> A <strong>Container Runtime</strong>, <strong>Controllers and Schedulers</strong>.<br>Lets dive into all these components: -</p><ol><li>The <strong>API server</strong> acts as the front-end for Kubernetes. The users, management devices, Command line interfaces all talk to the API server to interact with the Kubernetes cluster.</li><li>Next is the <strong>ETCD</strong> key store. ETCD is a distributed reliable key-value store used by Kubernetes to store all data used to manage the cluster. Think of it this way, when you have multiple nodes and multiple masters in your cluster, etcd stores all that information on all the nodes in the cluster in a distributed manner. ETCD is responsible for implementing locks within the cluster to ensure there are no conflicts between the Masters.</li><li>The <strong>scheduler</strong> is responsible for distributing work or containers across multiple nodes. It looks for newly created containers and assigns them to Nodes.</li><li>The <strong>controllers</strong> are the brain behind orchestration. They are responsible for noticing and responding when nodes, containers or endpoints goes down. The controllers make decisions to bring up new containers in such cases.</li><li>The <strong>container runtime</strong> is the underlying software that is used to run containers. In most of the cases it happens to be Docker.</li><li>And finally, <strong>kubelet</strong> is the agent that runs on each node in the cluster. The agent is responsible for making sure that the containers are running on the nodes as expected.</li></ol><p><strong>→ Let’s go back to Nodes and know a lil more about it-<br>Master vs Worker Nodes —</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*096jvDGw8iOzwGtxIpTfWA.jpeg" /><figcaption>Source: Google</figcaption></figure><p>So far, we saw two types of nodes — Master and Worker and a set of components of the control plane that makes up Kubernetes. <br>But how are these components distributed across different types of servers? <br>In other words, how does one server become a master and the other slave?— The worker node is where the containers are hosted. <br><strong>For example</strong>, Docker containers, and to run docker containers on a system, we need a container runtime installed. And that’s where the container runtime falls. In this case it happens to be Docker. This doesn’t HAVE to be docker, there are other container runtime alternatives available such as <strong>Rocket</strong> or <strong>CRIO</strong>.<br> — The master server has the <strong>kube-apiserver </strong>and that is what makes it a master.<br> — Similarly the worker nodes have the <strong>kubelet agent</strong> that is responsible for interacting with the master to provide health information of the worker node and carry out actions requested by the master on the worker nodes.<strong><br> — </strong>All the information gathered are stored in a <strong>key-value store</strong> on the Master. The key value store is based on the popular etcd framework which we just discussed.<strong><br> </strong>— The master also has the <strong>controller manager</strong> and the <strong>scheduler</strong>.</p><p><strong>→ Let’s dive deep into PODs —</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*1pcTPWIebEgQNlcVhcAXeQ.png" /><figcaption>Source: Google</figcaption></figure><p><strong>- </strong>Let’s consider a case where you have a single node Kubernetes cluster with a single instance of your application running in a single docker container encapsulated in a POD.<strong><br> -</strong>What if the number of users accessing your application increase and you need to scale your application?<br> The answer is, you need to add additional instances of your web application to share the load. Right? <br>-Now, where would you spin up additional instances? <br>Do we bring up a new container instance within the same POD?<br>The answer is NO! We create a new POD altogether with a new instance of the same application. As you can see we now have two instances of our web application running on two separate PODs on the same Kubernetes system or node.<br>-What if the user base further increases and your current node has no sufficient capacity?<br>Well THEN you can always deploy additional PODs on a new node in the cluster. You will have a new node added to the cluster to expand the cluster’s physical capacity. <br><strong>So</strong>, what I am trying to illustrate is that, PODs usually have a one-to-one relationship with containers running your application. To scale-up you create new PODs and to scale down you delete PODs. You do not add additional containers to an existing POD to scale your application.</p><p><strong>→ MULTI-CONTAINER PODs — <br></strong>Now we just said that PODs usually have a one-to-one relationship with the containers, but, are we restricted to having a single container in a single POD?<br>The answer is NO! A single POD CAN have multiple containers, except for the fact that they are usually not multiple containers of the same kind.<br>- If our intention was to scale our application, then we would need to create additional PODs. But sometimes you might have a scenario where you have a helper container, that might be doing some kind of supporting task for our web application such as processing a user entered data, processing a file uploaded by the user etc, and you want these helper containers to live along side your application container. In that case, you can have both of these containers as a part of the same POD, so that when a new application container is created, the helper is also created and when it dies the helper also dies since they are part of the same POD. The two containers can also communicate with each other directly by referring to each other as ‘localhost’ since they share the same network namespace. Plus they can easily share the same storage space as well.<br>- We just need to define what all containers a POD consists of and the containers in a POD by default will have access to the same storage, the same network namespace, and same fate as in they will be created together and destroyed together. <br>- Even if our application didn’t happen to be so complex and we could live with a single container, Kubernetes still requires you to create PODs. But this is good in the long run as your application is now equipped for architectural changes and scale in the future.<br> However, multi-pod containers are a rare use-case.</p><p><strong>→ Now Let’s get to CLI (COMAND LINE TOOL) — <br></strong>We also need to know a little bit about ONE of the command line utilities known as the kube command line tool or <strong>kubectl</strong> or <strong>kube control</strong> as it is also called.<br><strong>Function — </strong>The kube control tool is used to deploy and manage applications on a kubernetes cluster, to get cluster information, get the status of nodes in the cluster and many other things.</p><blockquote><strong>Some examples of the use of kubectl command:-</strong><br># The <strong>kubectl run </strong>command is used to deploy an application on the cluster.<br># The <strong>kubectl cluster-info </strong>command is used to view information about the cluster.<br># The <strong>kubectl get pod </strong>command is used to list all the nodes part of the cluster.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*cdrG_RxjEbeT1M5FUe0Kfw.jpeg" /><figcaption>Source: Google</figcaption></figure><p>Let us now look at how to <strong>deploy PODs</strong>. <br>The kubectl run command. What this command really does is it deploys a docker container by creating a POD. <br>So it first creates a POD automatically and deploys an instance of the docker image(for eg: nginx). But where does it get the application image from?</p><pre>- name: nginx-container<br>    image: nginx</pre><p><strong>2. </strong>Next is the <strong>kind</strong>. The kind refers to the type of object we are trying to create, which in our case is a POD. So we will set it as Pod. Some other possible values here could be ReplicaSet or Deployment or Service, which is what you see in the kind field .</p><pre>kind: Pod</pre><p><strong>3.</strong> The next is <strong>metadata</strong>. The metadata is data about the object like its name, labels etc. As you can see unlike the first two where you specified a string value, this, is in the form of a dictionary. So everything under metadata is intended to the right a little bit and so names and labels are children of metadata.<br> -Under metadata, the name is a string value — so you can name your POD <em>myapp-pod</em> — and the labels is a dictionary. So labels is a dictionary within the metadata dictionary. And it can have any key and value pairs as you wish. For now can add a label app with the value myapp.</p><pre>metadata:<br>  name: myapp-pod<br>  labels:<br>    tier: front-end</pre><p>Similarly you could add other labels as you see fit which will help you identify these objects at a later point in time. <strong>Say for example</strong> there are 100s of PODs running a front-end application, and 100’s of them running a backend application or a database, it will be DIFFICULT for you to group these PODs once they are deployed. <br>If you label them now as front-end, back-end or database, you will be able to filter the PODs based on this label at a later point in time. <br>- So far we have only mentioned the type and name of the object we need to create which is a POD with the name myapp-pod, but we haven’t really specified the container or image we need in the pod.</p><p><strong>4.</strong> The last section in the configuration file is the specification which is written as <strong>spec</strong>. Depending on the object we are going to create, this is where we provide additional information to Kubernetes pertaining to that object. This is going to be different for different objects, so its important to understand or refer to the <a href="https://kubernetes.io/docs/home/">documentation section</a> to get the right format for each. Since we are only creating a pod with a single container in it, it is easy. Spec is a dictionary so add a property under it called containers, which is a list or an array. <br>The reason this property is a list is because the PODs can have multiple containers within them as we learned in the section earlier. In this case though, we will only add a single item in the list, since we plan to have only a single container in the POD. The item in the list is a dictionary, so add a name and image property. The value for image is <strong>nginx</strong>.</p><pre>spec:<br>  containers:<br>  - name: nginx-container<br>    image: nginx</pre><p><strong># </strong>Once the file is created, run the command <strong>kubectl create -f &lt;</strong>followed by the file name&gt; (for e.g: pod-definition.yml) and kubernetes creates the pod.<br># Once a file is created, use the kubectl get pods command to see a list of pods available.<br> # To see detailed information about the pod run the kubectl describe pod command.<br># This will tell you information about the POD, when it was created, what labels are assigned to it, what docker containers are part of it and the events associated with that POD.</p><blockquote><strong>→ Try the below commands: </strong><br><strong># kubectl get pods:</strong> Checks the running pods on the system. <br>So you will see that there are no pods running if you didn’t create any .<br>Also to checks the status and the ready state.<br><strong># kubectl get all:</strong> To check all the resources running. So you’ll see that there is a service named Kubernetes is running with the type of <strong>ClusterIP</strong><br><strong># kubectl run nginx-container — image=nginx: </strong>To create a POD without a POD definition file.</blockquote><p>→ <strong>POD DEFINATION FILE—</strong></p><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: myapp-pod<br>  labels:<br>    tier: front-end<br>spec:<br>  containers:<br>  - name: nginx-container<br>    image: nginx</pre><blockquote><strong>→ Try these commands after the above</strong> <br># kubectl run &lt;above file name&gt;<br># kubectl get pods <br># kubectl describe pod myapp-pod<br># kubectl delete pod myapp-pod<br># kubectl get pos<br><strong>And Check the output</strong></blockquote><p><strong>→ Summary — </strong><br>This article delves into the fundamental concepts and elements of Kubernetes. It provides an in-depth exploration of Kubernetes’ architecture, including nodes, clusters, and the master node. The concept of pods, the control plane, and its components are discussed, along with the relationship between master and worker nodes. Furthermore, the article touches on multi-container pods, the usage of the Kubernetes command-line tool (kubectl), and the importance of YAML files for defining Kubernetes objects.</p><p>Join us as we unravel the intricacies of Kubernetes in this concise and informative read.</p><blockquote><em>Here we reached the end of the article — </em><strong><em>“Fundamentals Of Kubernetes PART 2”</em></strong><em>. Please also check the Part 3 of this series.</em></blockquote><blockquote><em>If you’ve any queries regarding this, it will be my pleasure to help you, just ping me on </em><a href="https://in.linkedin.com/in/rishikeshsonawane88ba3a14b"><strong><em>LinkedIn</em></strong></a><em>.</em></blockquote><blockquote><em>More on such topics in the upcoming blogs. </em><strong><em>So, stay tuned! ;)</em></strong></blockquote><p><strong>HAPPY LEARNING! :)</strong></p><p><strong>Thank you,</strong><br><strong>Rishikesh Sonawane.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7253d83414f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fundamentals Of Kubernetes: Part 1]]></title>
            <link>https://medium.com/@rishikesh.s7711/fundamentals-of-kubernetes-part-1-8054dbb7a624?source=rss-edac684cb70f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8054dbb7a624</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[container-orchestration]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <dc:creator><![CDATA[Rishikesh Sonawane]]></dc:creator>
            <pubDate>Mon, 29 May 2023 05:49:25 GMT</pubDate>
            <atom:updated>2024-04-21T09:26:18.519Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are a developer or a system administrator who works with applications, you might have heard of Kubernetes. But what exactly is it and how can it help you manage your containers more efficiently?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9cQltfPWWdUoP1h28kLSNw.jpeg" /><figcaption>Source: Google</figcaption></figure><p><strong><em>In this article,</em></strong> we will explain the basics of Kubernetes, its benefits, and how it works. we will also compare it with other solutions such as virtual machines and Docker. By the end of this article, you will have a clear understanding of what Kubernetes is and why you might want to use it for your next project.</p><p><strong>What is Kubernetes?</strong><br>It is a portable, extensible open-source platform for managing containerized workloads and services. It facilitates declarative configuration and automation, letting you run distributed systems resiliently with scaling and failover for your application.</p><p><strong><em>In layman’s terms</em></strong><em>,</em> it is a container orchestrator that helps ensure each container is where it is supposed to be and the container can work together. It ensures the services work smoothly in the way an app developer wants.</p><p><strong>Why Kubernetes?</strong><br>To answer this question we need to trace back to the type of applications called monoliths and microservices. Let us dive into this.<br>There are a lot of applications that we call monoliths, which means they put all the functionalities, like the transactions, and third-party interactions into a single deployable artifact and they are a common way to build an application. But this (monolith) type of application has its own downfalls.<br><strong><em>For eg:-</em></strong> Deployments can take a long time since everything has to roll out altogether and if different parts of the monolith are managed by different <br>teams, there could be a lot of additional complexity when prepping for a rollout, and scaling will have the same problem. Teams have to work on the whole application even if the bottleneck is only on a single area.<br>So people came up with microservices. In which each piece of functionality is split apart into smaller artifacts. If there’s an update only the exact service has to be replaced. The microservice model has its scaling benefits too.<br>An individual service can be scaled to match its traffic, so it&#39;s easier to avoid bottlenecks without over-provisioning. This is all great but having one machine for each service would require a lot of resources and a whole bunch of machines.<br>That’s why <strong><em>containers are a perfect choice.</em></strong> With containers, teams can package up their services neatly. All the applications, their dependencies, and any necessary configuration get delivered together. This also means that they can be sure their services will run the same way no matter where they run.</p><p><strong><em>What are Containers?</em><br></strong>So Kubernetes is a container orchestrator and containers are packaged up services. Containers were built to deploy smaller services with consistency and isolation. Containers are built from some underlying concepts of Linux kernel — <strong><em>Namespaces and Cgroups</em></strong>. Namespaces make sure that individual processes can see the details of other processes. And Cgroups control how much resources a process can use like CPU memory.<br>These two are all about giving process isolation, protecting it from interfering with other processes as well as protecting itself from others.</p><p><strong>Virtual Machine VS Containers</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R7sL4Md1JIou93aXEWMszQ.jpeg" /><figcaption>Source: <a href="https://www.google.com/">Google</a></figcaption></figure><p>Virtual machines can give us a similar type of isolation but only by packing the whole os with it. For plenty of applications, the os isn’t necessary and it certainly takes up a lot of resources. Containers on the other hand focus on the application and its dependencies making them more lightweight.</p><p><strong>Container Runtime:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tjTUpEi8h53-DMkweX2TDQ.png" /><figcaption>Source: <a href="https://www.google.com/">Google</a></figcaption></figure><p>One of the well-known container runtimes is the docker.<br>Docker is a built-in API that helps app developers to build containers and a platform to run them the same way regardless of which machine they run on.</p><p><strong>DockerFile — </strong><br>Let us look at a docker file to make a container for a Flask app —</p><pre>$cat Dockerfile<br>From ubuntu:16.04<br>RUN apt update &amp;&amp; apt install python -y<br>apt install python-pip -y<br>RUN pip install flask<br>COPY app.py /opt/app.py<br>ENTRYPOINT FLASK_APP=/opt/app.py flask run --host=0.0.0.0 \</pre><p>The $cat Dockerfile command is used to display the contents of the file named Dockerfile in the terminal. The $ sign indicates that the command is executed as a regular user, not as a root or superuser. <br><a href="https://www.educba.com/cat-command-in-linux/">The </a><a href="https://www.educba.com/cat-command-in-linux/">cat command is short for <strong>concatenate</strong>,</a> and it can also be used to create, append, or combine files. For example, you can use <br>cat &gt; filename1 to create a new file, <br>cat file1 file2 &gt; file3 to combine two files into one, or <br>cat &gt;&gt; filename4 to append text to an existing file.</p><p>The FROM instruction is the first instruction in a Dockerfile. <a href="https://docs.docker.com/engine/reference/builder/">It specifies the <strong>parent image</strong> from which you are building your own image</a>.<br>The parent image is usually an existing image from a registry, such as Docker Hub, or another image that you have built before. <a href="https://docs.docker.com/engine/reference/builder/">The </a><a href="https://docs.docker.com/engine/reference/builder/">FROM instruction also sets the working directory for the rest of the Dockerfile</a>.</p><p>The ubuntu:16.04 part is the <strong>image name</strong> and <strong>tag</strong> of the parent image. The image name is ubuntu, which is a popular Linux distribution. The tag is 16.04, which indicates the specific version of Ubuntu that you want to use. <a href="https://docs.docker.com/engine/reference/builder/">Tags are optional, but they help you choose the right image for your needs</a>.<br>So, the line FROM ubuntu:16.04 means that you are creating a new image based on the Ubuntu 16.04 image from Docker Hub.</p><p><a href="https://learn.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/manage-windows-dockerfile">The </a><a href="https://learn.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/manage-windows-dockerfile">RUN instruction is used to execute any commands on top of the current image and commit the results</a>. <a href="https://docs.docker.com/engine/reference/builder/">The commands are executed in a new layer, which means that they can modify the existing files or create new ones</a>. The RUN instruction can have two forms: the <strong>exec form</strong> and the <strong>shell form</strong>. The exec form is <br>RUN [&quot;&lt;executable&gt;&quot;, &quot;&lt;param 1&gt;&quot;, &quot;&lt;param 2&gt;&quot;]. It uses a JSON array to specify the executable and its parameters. The exec form does not invoke a command shell, which means that you cannot use shell features such as variable expansion or wildcard characters. <br>The shell form is RUN &lt;command&gt;. It invokes a command shell to run the command. The default shell depends on the base image, but it is usually /bin/sh -c for Linux and cmd /S /C for Windows2. The shell form allows you to use shell features, but it also adds an extra layer to the image. In your case, you are using the shell form of the RUN instruction. The first line RUN apt update &amp;&amp; apt install python -y updates the package index and installs Python on the Ubuntu image. The second line apt install python-pip -y installs pip, which is a tool for managing Python packages. The third line RUN pip install flask installs Flask, which is a web framework for Python.</p><p><strong>COPY app.py /opt/app.py</strong>: This copies the file app.py from your current directory to the /opt/app.py location inside the container.</p><p><strong>ENTRYPOINT FLASK_APP=/opt/app.py flask run — host=0.0.0.0</strong>: This specifies what command to run within the container when it is started. In this case, it sets the FLASK_APP environment variable to `/opt/app.py` and runs the flask application on port 5000, accessible from any IP address.</p><p><strong>GREAT! </strong>We have a container now.<br>But there are still more problems that remain unsolved — <br><strong>How do these containers know how to talk to each other?</strong><br><strong>How can an app developer debug issues and observe what&#39;s happening?</strong><br><strong>And how can updates be done without downtime?</strong><br>With only a container, you would still have to manually deploy the container, manage it and handle situations like if the container goes down or if you want to roll out an update to your app code.<br><strong>Here comes Kubernetes into the picture</strong>. It takes care of managing your container, no matter if you have 1 or 1000.</p><p>Kubernetes is all about managing these containers on VMs or nodes. The Nodes are grouped together as a cluster and each container has endpoints, DNS, Storage, and scalability everything that modern applications need without the manual effort of doing it yourself. Kubernetes automates most of the repetition and inefficiencies of doing everything by hand. The app developer tells Kubernetes what it wants the cluster to look like and Kubernetes makes it happen.</p><p><strong>Summary:-<br></strong>Kubernetes is a powerful platform for managing containerized workloads and services. It offers many advantages over traditional methods such as virtual machines and Docker, such as scalability, resilience, automation, and portability. Kubernetes also provides a rich set of features and tools to help you deploy, monitor, troubleshoot, and update your applications. Whether you are building a simple web app or a complex distributed system, Kubernetes can help you achieve your goals faster and easier. If you want to learn more about Kubernetes, you can check out the official documentation or some of the online courses and tutorials available. You can also try it out yourself by installing it on your local machine or using a cloud service provider. <br>Kubernetes is an open-source project that welcomes contributions from anyone who wants to improve it. You can join the community and get involved in various ways, such as reporting issues, submitting code, writing documentation, or participating in events. Kubernetes is not only a technology but also a culture of collaboration and innovation. <br>I hope this article has given you a good introduction to Kubernetes and inspired you to explore it further.</p><blockquote><em>Here we reached the end of the article —</em><strong><em> “Fundamentals Of Kubernetes PART 1”</em></strong><em>. Please also check the part 2 of this series.<br>If you’ve any queries regarding this, it will be my pleasure to help you, just ping me on </em><a href="https://in.linkedin.com/in/rishikeshsonawane88ba3a14b"><strong><em>LinkedIn</em></strong></a><em>.</em></blockquote><blockquote><em>More on such topics in the upcoming blogs. So, stay tuned! ;)</em></blockquote><p><strong>HAPPY LEARNING! :)</strong></p><p>Thank you,<br><strong>Rishikesh Sonawane.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8054dbb7a624" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flask Vs Django]]></title>
            <link>https://medium.com/@rishikesh.s7711/flask-vs-django-e925a76ca0b3?source=rss-edac684cb70f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e925a76ca0b3</guid>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[python-web-framework]]></category>
            <category><![CDATA[django]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Rishikesh Sonawane]]></dc:creator>
            <pubDate>Tue, 02 May 2023 07:20:44 GMT</pubDate>
            <atom:updated>2023-05-03T04:24:59.785Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*YCWYgY6pb92kRG8h-jp55w.jpeg" /><figcaption>Source: www.google.com</figcaption></figure><p><a href="https://flask.palletsprojects.com/en/2.3.x/"><strong>Flask</strong></a> and <a href="https://docs.djangoproject.com/en/4.2/"><strong>Django</strong></a> are popular web frameworks used to build web applications in Python. <strong>Django vs Flask</strong>, which of these two Python frameworks is better for web development? <br>Many Python-based web frameworks make it easy for developers to create scalable apps quickly. These frameworks can handle everything from simple to complicated websites.<br>Django vs Flask is a popular debate topic because both languages are similar in many ways. While they have some similarities, there are also key differences that set them apart.</p><blockquote><strong>In this article</strong>, we will explore the differences and similarities between Flask and Django.<br><strong>So Let’s dive in!<br>First let us see what exactly these both frameworks are.</strong></blockquote><h3>|| What is Django?</h3><p>Django is a <a href="https://www.turing.com/blog/five-popular-web-frameworks-for-2022/">web framework for rapidly developing</a> applications. Django promotes component reusability and pluggability, less code, low coupling, rapid development, and the idea of “Don’t Repeat Yourself” (DRY).</p><p><strong>+ When should you use Django?</strong><br>Django allows users to construct web applications quickly. As a result, users can speed up complicated <a href="https://www.turing.com/blog/best-web-development-trends-2022/">web development</a> using Django. Django was even named one of the top 10 frameworks for web app development in the Stack Overflow 2020 Developer Survey.</p><p><strong>+</strong> Django allows developers to create user interfaces and work on back-end processes such as server-side scripting, database querying, and API development.</p><h3>|| Which companies use Django?</h3><p>Here’s a list of a few companies that prefer Django over Flask:</p><ol><li><strong>Instagram<br></strong>Django was one of the only technologies to boost Instagram’s efficiency when the app wanted to scale exponentially.</li><li><strong>National Geographic<br></strong>With its custom-built CMS, NG uses Django to handle its website. The CMS manages the website’s pictures, ads, modules, and other elements.</li><li><strong>Pinterest<br></strong>Django empowers Pinterest to run at a high degree of performance while also scaling as needed.</li></ol><h3>|| What Is Flask?</h3><p>Flask is a Python-based microweb framework. It is called a microframework because it does not necessitate using any specific tools or libraries. For example, it doesn’t have a database abstraction layer or other components that rely on third-party libraries to finish tasks.</p><p><strong>+</strong> <strong>When should you use Flask?</strong><br>Flask is a back-end web development framework used to create server-side apps. Flask’s most compelling feature is its ability to build apps from the ground up. In addition, Flask provides reduced development time and faster run times.</p><h3>|| Which companies use Flask?</h3><p>Here’s a list of a few companies that prefer Flask over Django:</p><ol><li><strong>Netflix<br></strong>Netflix is a video-on-demand service that relies on Flask APIs for a lot of its analytical and infrastructure work.</li><li><strong>Reddit<br></strong>Reddit hosts thousands of communities allowing online strangers to connect and converse. Reddit uses Flask extensively to manage its micro pages.</li><li><strong>Lyft<br></strong>Lyft uses Flask to implement its microservices architecture. Lyft’s microservices architecture consists of small services working together to produce a more complicated app.</li></ol><h3>|| Django vs Flask: Head-to-head comparison</h3><blockquote>While Django is a full-featured framework that takes care of a lot of the heavy lifting for its users, Flask gives complete control on a smaller scale.</blockquote><blockquote><strong>Django vs. Flask:</strong> <br>Here’s a quick rundown of the significant differences and similarities between the two.</blockquote><h3><strong>| Differences:</strong></h3><ul><li><strong>Structure</strong>: Flask and Django have different structures. Django follows the Model-View-Template (MVT) pattern, while Flask follows the Model-View-Controller (MVC) pattern. In MVC, the Model handles data storage and retrieval, the View handles presentation logic, and the Controller handles user input and updates the Model and View. In MVT, the Model still handles data storage, but the Template handles presentation logic and the View handles user input and updates the Model and Template.</li><li><strong>Scalability</strong>: Django is more scalable than Flask due to its built-in components for handling authentication, routing, caching, and more. These components make it easier to build large-scale web applications. Flask, on the other hand, is a micro-framework, which makes it more suitable for smaller projects.</li><li><strong>Flexibility</strong>: Flask is known for its flexibility, allowing developers to choose the tools and libraries they want to use. Django, on the other hand, is more opinionated and has a more rigid structure, making it less flexible but easier to maintain and scale.</li><li><strong>Database Support</strong>: Django has built-in support for Object-Relational Mapping (ORM), which makes it easier to interact with databases. Flask does not have built-in ORM support but offers extensions for interacting with databases, such as Flask-SQLAlchemy.</li><li><strong>Template Engine:</strong> Flask and Django use different template engines to render HTML templates. Flask uses Jinja2, which is known for its flexibility and ease of use, while Django uses its own template engine, which is more feature-rich and powerful.</li><li><strong>URL Routing:</strong> Django has built-in URL routing capabilities, which makes it easier to manage URLs and requests. Conversely, Flask uses Werkzeug, a WSGI (Web Server Gateway Interface) toolkit, for routing. This gives developers more control over URL routing but requires more manual configuration.</li><li><strong>Community and Documentation: </strong>Django has a larger community and more comprehensive documentation due to its popularity and widespread use. Flask, on the other hand, has a smaller community, but the documentation is still comprehensive and easy to follow.</li></ul><h3>| Similarities:</h3><ul><li>Both Flask and Django are open-source web frameworks written in Python.</li><li>Both frameworks provide a range of tools and libraries for building web applications, including support for HTTP requests, sessions, cookies, and more.</li><li>Both frameworks have active communities and extensive documentation to support developers.</li><li>Both frameworks support the use of third-party libraries and extensions.</li><li>Both frameworks offer support for testing and debugging web applications.</li><li>Both frameworks support the use of templates to render HTML pages.</li><li>Both frameworks support managing static files, such as CSS and JavaScript.</li><li>Both frameworks are compatible with a variety of web servers and deployment platforms.<br>— These similarities highlight the shared goals of Flask and Django in providing developers with powerful tools and resources for building web applications in Python.</li></ul><p><strong>In summary</strong>, Flask and Django have several key differences and similarities. Flask is more flexible and better suited for smaller projects, while Django is more opinionated and better suited for larger projects. Both frameworks provide developers with powerful tools and resources for building high-quality web applications in Python.<br>Although Django and Flask share many similarities, selecting the correct framework depends on whether you want to work on something simple or complex. But in general, Django outperforms Flask in several areas.</p><blockquote>Here we reached the end of the article - “Django Vs Flask”. <br>If you’ve any queries regarding this, it will be my pleasure to help you, just ping me on <a href="https://in.linkedin.com/in/rishikeshsonawane88ba3a14b"><strong>LinkedIn</strong></a>.</blockquote><blockquote>More on such topics in the upcoming blogs. So, stay tuned! ;)</blockquote><blockquote>Join our Cloud and DevOps community for Cloud and DevOps Learnings:- <a href="https://www.linkedin.com/company/guys-in-the-cloud/"><strong>Guys in the Cloud</strong></a> and <a href="https://www.youtube.com/@guysinthecloud"><strong>Guys in the Cloud YouTube channel</strong></a>.</blockquote><p><strong>HAPPY LEARNING! :)</strong></p><p>Thank you,<br><strong>Rishikesh Sonawane.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e925a76ca0b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Maximizing IT Efficiency with Ansible Tower: A Comprehensive Overview]]></title>
            <link>https://medium.com/@rishikesh.s7711/maximizing-it-efficiency-with-ansible-tower-a-comprehensive-overview-e560fec8e03f?source=rss-edac684cb70f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e560fec8e03f</guid>
            <category><![CDATA[overview]]></category>
            <category><![CDATA[configuration-management]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ansible-tower]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Rishikesh Sonawane]]></dc:creator>
            <pubDate>Fri, 03 Feb 2023 04:53:25 GMT</pubDate>
            <atom:updated>2023-02-03T04:53:25.976Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6nB80HsKS9B9GrzI.png" /></figure><p>Ansible Tower is a popular open-source automation platform developed by Red Hat. It is used for managing and automating IT infrastructure, application deployment, and workflows. With Ansible Tower, organizations can streamline their automation processes and manage complex multi-tier deployments with ease.</p><p><strong>In this article,</strong> we will take a deep dive into Ansible Tower, its various components, features, and much more.</p><h3>Prerequisites:</h3><ul><li>Good knowledge of Ansible and familiarity with Ansible Playbooks, Templates, Roles, Handlers, etc.</li><li>RHCSA in RHEL or equivalent Linux system administration skills recommended.</li></ul><h3>Introduction To Ansible Tower:</h3><p>Ansible Tower is Ansible at a more enterprise level. It is a web-based solution for managing your organization with a simple User Interface that provides a dashboard with all of the state summaries of all the hosts, allows quick deployments, and monitors all configurations. Ansible Tower is providing you with a web user interface that would be very easy to deploy any playbook.</p><p>It is a web-based management and automation platform that provides a centralized control point for IT operations. It is designed to make it easy for IT teams to manage and automate complex multi-tier deployments. With Ansible Tower, organizations can automate the deployment of applications and services, manage workflows, and monitor and control the entire infrastructure from a single interface.</p><p>Ansible Tower provides a secure and scalable solution for IT automation and is used by organizations of all sizes, from small startups to large enterprises. <br>Next, we will see some differences and commonalities between Ansible and Ansible Tower.</p><h3>Ansible VS Ansible Tower:</h3><p>Ansible and Ansible Tower are both IT automation tools developed by Red Hat. However, they have different purposes and functions.</p><p>Ansible is an open-source automation engine that provides a simple way to automate a variety of IT tasks, including configuration management, application deployment, and cloud provisioning. Ansible uses a declarative language approach to describe the desired state of a system and automates the steps required to reach that state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*wgtFgOAtfhZbvwBvVxEysg.png" /><figcaption><a href="https://medium.com/@rishikesh.s7711/getting-started-with-ansible-4145c2b57d75"><strong>A Typical Ansible Architecture</strong></a></figcaption></figure><blockquote>For more detail on Ansible check out my first blog “<a href="https://medium.com/@rishikesh.s7711/getting-started-with-ansible-4145c2b57d75">Getting started with Ansibl</a>e”</blockquote><p>On the other hand, Ansible Tower is a commercial product that provides a W<strong>eb-Based User Interface</strong>, <strong>Role-Based Access Control (RBAC)</strong>, <strong>Centralized Logging</strong>, and <strong>Reporting</strong> on top of the Ansible engine. Ansible Tower is designed to provide a “Centralized Management Solution” for Ansible and helps to scale automation to the enterprise level.</p><p>If we talk about Ansible whenever we need to run a playbook, we can only execute from the command line. But with Ansible Tower we have a beautiful graphical view. <br>For that, we can simply log into the Ansible Tower and from there we can choose the respective playbook and execute it for the desired service.</p><p>Second, Ansible Tower allows you to share the SSH credentials without exposing them, which is not possible with Ansible alone. <br>This diminishes a big security breach which was existing in Ansible and gives a major advantage to Ansible Tower.</p><p>Third, is that it logs all the jobs, manages inventories graphically, and assigns them to a wide variety of cloud providers. The tower can keep a history of the times that job has been executed, the successes, failures, logs, whatever servers you have run it against, and the status of all those servers. Because it stores all this information it makes auditing a snap.</p><p><strong>Here is a comparison of Ansible and Ansible Tower:</strong></p><ol><li><strong>Complexity:</strong> Ansible is a simple automation engine that is designed for ease of use and has a low learning curve. Ansible Tower, on the other hand, provides a centralized management solution for Ansible and can be more complex to set up and use compared to Ansible.</li><li><strong>Features:</strong> Ansible provides the basic automation functionality required for IT tasks, while Ansible Tower provides additional features such as a web-based user interface, role-based access control, centralized logging, and reporting.</li><li><strong>Scalability:</strong> Ansible is designed to be simple and easy to use, and is well-suited for small to medium-sized organizations. Ansible Tower, on the other hand, is designed to provide a centralized management solution for large-scale Ansible deployments and is well-suited for large enterprises.</li><li><strong>Cost:</strong> Ansible is open-source software and is free to use, while Ansible Tower is a commercial product and requires a license.</li><li><strong>Support:</strong> Ansible is an open-source project and has a large community of contributors and users who provide support. Ansible Tower, on the other hand, is a commercial product and provides support from Red Hat.</li><li><strong>Customization:</strong> Ansible provides a flexible automation engine that can be customized to meet specific requirements, while Ansible Tower provides a more limited set of customization options.</li></ol><p><strong>In conclusion</strong>, the choice between Ansible and Ansible Tower depends on the specific needs and requirements of an organization. Small organizations that need a simple automation solution may only need Ansible, while large enterprises may require the centralized management and additional features of Ansible Tower. <br>Ansible is a powerful automation engine that is designed for simplicity and ease of use, while Ansible Tower is designed to provide a centralized management solution for large-scale Ansible deployments.</p><h3>Critical Components of Ansible Tower:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*rWDyC0yLzMcxAKXvNXY6qA.png" /><figcaption><a href="https://docs.ansible.com/ansible-tower/latest/html/quickstart/examine_dashboard.html"><strong>Ansible Tower Dashboard</strong></a></figcaption></figure><h3><strong>- Inventories:</strong></h3><p>Ansible Tower inventories are used to manage the list of hosts and groups of hosts that you want to target with your automation tasks. Inventories can be either static or dynamic. Static inventories are defined manually, while dynamic inventories are created using a script or an external source that automatically discovers and updates the list of hosts.</p><ul><li><strong>Static Inventory: </strong>In Ansible Tower, a static inventory is a pre-defined list of hosts and their associated information, such as IP addresses, hostnames, and variables. Static inventories are created and managed within the Tower interface and can be used to target specific hosts or groups of hosts when launching jobs or running playbooks.</li><li><strong>Dynamic Inventory: </strong>A dynamic inventory is a way of automatically discovering and managing a constantly changing set of hosts. Instead of manually defining a static list of hosts, a dynamic inventory uses a script or an external source to automatically discover and update the list of hosts. <br>Dynamic inventories are particularly useful for managing cloud infrastructure, where hosts are frequently added and removed. Assume you have the service from suppose a cloud environment, as a result, your inventory kept on updating, a few servers are adding, and a few servers are deleting. So, if you want to maintain such type of inventories, which keeps on updating, then you have to go with Dynamic Inventory and which is possible with Ansible Tower. However it is possible with Ansible as well, but it was quite messy and complex.</li></ul><h3>- Jobs:</h3><p>Jobs in Ansible Tower are used to run playbooks, which are collections of automation tasks. Jobs can be launched manually or automatically based on a schedule. Jobs can be launched against specific hosts or groups of hosts, and the results of the job can be monitored in real-time.</p><h3>- Playbooks:</h3><p>Playbooks in Ansible Tower are collections of automation tasks that can be run against a set of hosts. Playbooks are written in YAML and are used to automate tasks such as deploying software, configuring systems, and managing services.</p><h3>- Credentials:</h3><p>Credentials in Ansible Tower are used to store and manage authentication information for various types of resources, such as servers, cloud infrastructure, and source control systems. Credentials are used to authenticate when launching jobs, running playbooks, and interacting with external resources.</p><h3>- Templates:</h3><p>Templates in Ansible Tower are used to define a job or workflow that can be launched multiple times with different parameters. Templates make it easy to reuse common automation tasks and workflows and can be used to automate repetitive tasks.</p><h3>- Workflows:</h3><p>Workflows in Ansible Tower are used to automate complex multi-step processes that involve multiple playbooks, jobs, and systems. Workflows can be used to automate tasks such as deploying a complete application stack or migrating data between systems.</p><h3>- Reports:</h3><p>Ansible Tower provides real-time reports that can be used to monitor the status of automation tasks, track the progress of workflows, and view the results of completed jobs. Reports can be used to quickly identify and resolve issues and to track the success of automation tasks.</p><h3>Ansible Tower features:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*YV9CNshdPBpsGTdWKZz7wQ.png" /></figure><ol><li><strong>Ansible Dashboard:</strong> <br>The Ansible Tower dashboard displays everything going on in your Ansible environment like the hosts, Inventory Status, recent job activity, and so on.</li><li><strong>Real-time Job Status Updates:</strong> <br>As Ansible can automate the complete infrastructure, you can see real-time job updates, like plays and tasks broken down by each machine either being successful or a failure. So, with this, you can see the status of your automation, and know what’s next in the queue.</li><li><strong>Multi-Playbook Workflows: <br></strong>This feature allows you to chain any number of playbooks, regardless of the usage of different inventories, utilize various credentials, or run different users.</li><li><strong>Who executed — What job — When:</strong> As the name suggests, you can easily know who ran what job and when as all the automation activity is securely logged in Ansible Tower.</li><li><strong>Scale Capacity with Clusters:</strong> We can connect multiple Ansible Tower nodes with Ansible Tower clusters as cluster redundancy and capacity which allow you to scale Ansible automation across the enterprise.</li><li><strong>Integrated Notifications:</strong> This feature lets you notify a person or team when a job succeeds or fails across the entire organization at once or customize on a per-job basis.</li><li><strong>Schedule Ansible Jobs:</strong> Different kinds of jobs such as playbook run, cloud inventory updates, and source control updates: Different kinds of jobs such as playbook run, cloud inventory updates, and source control updates can be scheduled inside ansible tower to run according to the need.</li><li><strong>Manage and Track entire Inventory:</strong> Ansible Tower helps you manage your entire infrastructure by letting you easily pull inventory from public cloud providers such as AWS, GCP, and ms azure.</li><li><strong>Self-Service:</strong> This feature from Ansible lets you launch playbooks with just a single click. It can also let you choose from available secure credentials or prompt you for variables and monitor the resulting deployments.</li><li><strong>Rest API &amp; Tower CLI Tool:</strong> Every feature present in ansible tower is available via ansible towers rest API, which provides the ideal API for a systems management infrastructure. The ansible towers CLI tool is available for launching jobs from CI systems such as Jenkins or when you need to integrate with other CLI tools.</li><li><strong>Remote Command Execution:</strong> You can run simple tasks such as adding users, restarting any malfunctioning service, and resetting passwords on any hosts in the inventory with Ansible Tower’s remote command execution.</li></ol><h3>User Types and User Access in Ansible Tower:</h3><p>Ansible Tower has several types of users that serve different purposes:</p><ol><li><strong>Admin User:</strong> An admin user is a user with full administrative access to Ansible Tower. They can create and manage users, manage licenses, and configure the platform to meet the needs of their organization.</li><li><strong>Normal User:</strong> A user is a person who can log into Ansible Tower and access the resources they are authorized to use, such as projects, inventory, and job templates. They can also run ad hoc commands and playbooks, and view job results.</li><li><strong>Read-Only User:</strong> A read-only user is a user who has read-only access to Ansible Tower, meaning they can view the resources in the platform but cannot make changes or run jobs.</li><li><strong>System Auditor:</strong> A system auditor is a user who has access to the system audit logs in Ansible Tower, which records all changes and actions taken in the platform. This user type is typically used to monitor changes to the system and track compliance with security and regulatory requirements.</li><li><strong>Team Member:</strong> A team member is a user who belongs to a specific team in Ansible Tower, which is a group of users who work together on a common set of projects and resources. Team members can be assigned different levels of access within the team, depending on their roles and responsibilities.</li></ol><p>These user types allow organizations to control and manage access to Ansible Tower, ensuring that users have the appropriate level of access to perform their jobs effectively.</p><h3>Organization and Organization roles in Ansible Tower</h3><p>In Ansible Tower, an organization is a container for projects, inventories, and users. Organizations allow administrators to group related resources and manage access control for those resources.</p><p>Organizational roles in Ansible Tower determine the level of access and permissions that users have within an organization. There are several built-in organizational roles in Ansible Tower, including:</p><ol><li><strong>Admin:</strong> Administrators have full access to all resources within an organization, including the ability to add and manage users, projects, and inventories.</li><li><strong>Auditor:</strong> Auditors have read-only access to all resources within an organization, including the ability to view jobs, job templates, and playbooks.</li><li><strong>Member:</strong> Members have access to run jobs, launch job templates, and access reports. However, they cannot modify organizational resources.</li><li><strong>Read Only:</strong> Read-only users have read-only access to all resources within an organization, but cannot run jobs or launch job templates.</li></ol><p>Organizational roles can be customized to meet specific requirements, and additional roles can be added if necessary. Organizations and organizational roles in Ansible Tower provide a flexible way to manage access control for resources and ensure that sensitive information is only accessible by authorized users.</p><h3><strong>Credentials and Access Control in Ansible Tower:</strong></h3><p>Another feature is that the tower allows you to share secrets/credentials without exposing them. What does it mean? Let me try to explain you. Let us first see what the credentials are.</p><p><strong>Credentials</strong> are Ansible Tower objects that are used to authenticate to remote systems for various purposes. They may provide secrets such as passwords, SSH keys, or other supporting information needed to successfully access or use a remote resource.</p><p>Credentials passwords and keys are encrypted before they are saved to the tower database and cannot be retrieved in clear text from the tower user interface.</p><p>Ansible Tower has different types of credentials that it can manage.</p><ul><li><strong>Machine credentials </strong>— used to authenticate playbook logins and privilege escalation for inventory hosts.</li><li><strong>Network credentials </strong>— are used when ansible network modules are used to manage the network configurations.</li><li><strong>Source Control (or SCM) credentials —</strong> are used by projects to clone and update ansible project materials from a remote version control system such as GIT, Subversion, or mercurial.</li><li><strong>Inventory credentials —</strong> are used to update dynamic inventory information from one ansible tower’s built-in dynamic inventory sources.</li></ul><p>Users and Teams can be assigned privileges to use credentials but the secrets are not exposed to them. Whenever we execute a playbook in Ansible Tower with users 1 2 or 3, we use a common credential of the Ansible tower admin user.</p><blockquote><strong>Note: </strong>By default, an Admin User account is created by the tower installer which has full control of the tower installation. Here “admin user” refers to this guy.</blockquote><p>This credential is shared among all the users (who have been assigned the privileges to use the credentials) without exposing them. These credentials or keys are encrypted and cannot be retrieved in clear text from the tower user interface. This was one of the advantages of Ansible Tower over Ansible that it gives the ability of playbook execution to other users without exposing the credentials.</p><p>Now Suppose we have users [user 1, 2, and 3] and 6 playbooks - {Playbook one, two, three, four, five, and six}. We first logged into Ansible Tower with [user 1] and wanted that whenever [user 1] would log into Ansible tower, they only have access to {Playbook 1} and {Playbook 2}. When logged in with [user 2], we get access to {Playbook 3} and {Playbook 4}. Likewise, when logged in with [user 3], we get access to {Playbook 3} and {Playbook 4}. So, this is possible with our Role Based Access Control.</p><p>Now let us see what exactly RBAC or <strong>Role-Based Access Control </strong>is,<br>RBAC is a feature in Ansible Tower that allows administrators to control access to resources and operations within the Tower interface. With RBAC, you can create roles that have specific permissions and then assign those roles to users or teams.</p><p>Different people using Ansible Tower need to have a different levels of access. Some may simply need to run existing job templates against a preconfigured inventory of machines. Others need to be able to modify particular inventories, job templates, and playbooks. Still, others may need access to change anything in the tower installation. Users are assigned roles that grant permission which defines precisely who can see, change, and delete, an object in Tower.</p><p>RBAC in Ansible Tower is based on the following three components:</p><ol><li><strong>Users:</strong> Users are the individual accounts that have access to the Tower interface. Each user must have a unique username and password.</li><li><strong>Teams:</strong> Teams are groups of users. You can assign roles to teams, and all the users in that team will have the permissions associated with that role.</li><li><strong>Roles:</strong> Roles are sets of permissions that dictate what a user or team can do within the Tower interface. For example, you can create a role that allows a user to view jobs, but not launch them.</li></ol><p>When a user logs into Ansible Tower, their access is determined by the roles and permissions assigned to their team or individual user. This allows for granular control over who can perform certain actions, such as launching jobs, managing resources, or modifying settings.</p><p>RBAC is an important security feature in Ansible Tower, as it helps to ensure that only authorized users have access to sensitive information and operations.</p><h3>Conclusion:</h3><p>Ansible Tower provides a centralized control point and Improves collaboration by providing a centralized platform for IT operations, making it easy for IT teams to manage and automate complex multi-tier deployments as well as to share automation tasks, playbooks, and workflows. With Ansible Tower, IT teams can manage and automate their entire infrastructure from a single interface and can work together more efficiently, improving their ability to deliver automation.</p><p>Here we reached the end of the basic theory part for Ansible Tower Overview. If you’ve any queries regarding this, it will be my pleasure to help you, just ping me on <a href="https://in.linkedin.com/in/rishikeshsonawane88ba3a14b"><strong>LinkedIn</strong></a>.</p><p>More on Ansible in upcoming blogs. So, stay tuned! ;)</p><p>Join our Cloud and DevOps community for more Cloud and DevOps Learnings here-<strong> </strong><a href="https://www.linkedin.com/company/guys-in-the-cloud/"><strong>Guys in the Cloud</strong></a> and <a href="https://www.youtube.com/@guysinthecloud"><strong>Guys in the Cloud YouTube channel</strong></a>.</p><p>Here are some additional resources related to Ansible:<br><strong> — </strong><a href="https://medium.com/@rishikesh.s7711/getting-started-with-ansible-4145c2b57d75"><strong>Getting Started with Ansible</strong></a><br> <strong>— </strong><a href="https://medium.com/@rishikesh.s7711/ansible-on-ubuntu-20-04-b67ac664a0c0"><strong>Ansible on Ubuntu 20.04</strong></a></p><p><strong>HAPPY LEARNING! :)</strong></p><p>Thank you,<br>Rishikesh Sonawane.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e560fec8e03f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>