<?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 Sai Charan on Medium]]></title>
        <description><![CDATA[Stories by Sai Charan on Medium]]></description>
        <link>https://medium.com/@ssaicharanclan?source=rss-f97274d24f35------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3ZzPBqVPsY1ldbsSQhLA6A.jpeg</url>
            <title>Stories by Sai Charan on Medium</title>
            <link>https://medium.com/@ssaicharanclan?source=rss-f97274d24f35------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 19:32:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ssaicharanclan/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[Linux Shell Fundamentals: Terminal, Shell, Kernel, Shebang, Permissions & Conditions]]></title>
            <link>https://blog.devops.dev/linux-shell-fundamentals-terminal-shell-kernel-shebang-permissions-conditions-b700414c233d?source=rss-f97274d24f35------2</link>
            <guid isPermaLink="false">https://medium.com/p/b700414c233d</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[operating-systems]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Sai Charan]]></dc:creator>
            <pubDate>Sun, 23 Aug 2026 10:27:30 GMT</pubDate>
            <atom:updated>2026-08-25T12:10:40.777Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bc9xXHO8QdtEXewGfXrW5A.png" /></figure><p>When I started learning Linux and shell scripting, I had several questions:</p><ul><li>What exactly is a terminal?</li><li>Is the terminal the same as the shell?</li><li>What does the kernel do?</li><li>What is a shebang?</li><li>How does the kernel understand #! if it cannot understand shell commands?</li><li>What is the difference between ./script.sh and bash script.sh?</li><li>What does chmod +x actually do?</li><li>How do conditions work in shell scripting?</li></ul><p>This article brings all of these concepts together in a simple way.</p><h3>1. Terminal, Shell, and Kernel</h3><p>The basic flow can be understood as:</p><pre>User<br>  ↓<br>Terminal<br>  ↓<br>Shell<br>  ↓<br>Kernel<br>  ↓<br>System Resources</pre><h3>Terminal</h3><p>A <strong>terminal</strong> is a text-based interface where we type commands and see the output.</p><p>For example:</p><pre>ls<br>pwd<br>mkdir test</pre><p>The terminal itself does <strong>not interpret these commands</strong>.</p><p>It provides the interface through which we interact with the shell.</p><h3>Shell</h3><p>The <strong>shell is a command interpreter</strong>.</p><p>Common shells include:</p><pre>bash<br>sh<br>zsh<br>fish<br>csh</pre><p>The shell understands shell commands and determines how they should be executed.</p><p>For example:</p><pre>ls</pre><p>Bash interprets the command and executes the appropriate program.</p><h3>Kernel</h3><p>The <strong>kernel is the core part of the operating system</strong>.</p><p>It manages system resources such as:</p><ul><li>CPU</li><li>Memory</li><li>Disk</li><li>Processes</li><li>Devices</li><li>Input/Output</li></ul><p>A simplified flow is:</p><pre>User<br> ↓<br>Terminal<br> ↓<br>Bash<br> ↓<br>Kernel<br> ↓<br>CPU / Memory / Disk / Devices</pre><h3>2. Major Responsibilities of the Kernel</h3><p>The kernel is responsible for several important areas.</p><h3>Process Management</h3><p>Process management means managing running programs.</p><p>Useful commands include:</p><pre>ps<br>top<br>kill</pre><p>For example:</p><pre>ps</pre><p>shows processes.</p><pre>kill PID</pre><p>sends a signal to a process.</p><p>The commands help us <strong>observe or control processes</strong>, while the actual process management is handled by the OS/kernel.</p><h3>Memory Management</h3><p>Memory management means managing RAM and virtual memory.</p><p>Commands such as:</p><pre>free<br>top</pre><p>help us view memory usage.</p><p>The kernel:</p><ul><li>Allocates memory to processes</li><li>Frees memory</li><li>Manages virtual memory</li><li>Protects processes from accessing each other’s memory</li></ul><h3>File System Management</h3><p>The OS manages files and directories.</p><p>For example:</p><pre>touch file.txt<br>mkdir test<br>rm file.txt</pre><p>These operations ultimately involve the filesystem and kernel.</p><p>Linux filesystems include:</p><pre>ext4<br>xfs</pre><h3>Device Management</h3><p>The kernel manages hardware devices such as:</p><pre>Keyboard<br>Mouse<br>Disk<br>Network Card<br>USB Device<br>Printer</pre><p>The kernel commonly communicates with hardware through <strong>device drivers</strong>.</p><pre>Application<br>     ↓<br>Kernel<br>     ↓<br>Device Driver<br>     ↓<br>Hardware</pre><h3>Input/Output Management</h3><p>I/O means <strong>Input/Output</strong>.</p><p>It is broader than just:</p><blockquote><em>User gives input → User gets output.</em></blockquote><p>The OS manages data transfer between applications and devices.</p><p>Examples:</p><pre>Keyboard → Computer     = Input<br>Computer → Monitor      = Output</pre><pre>Disk → Computer         = Input<br>Computer → Disk         = Output</pre><pre>Network → Computer      = Input<br>Computer → Network      = Output</pre><h3>3. Terminal vs Console</h3><p>These terms can be confusing.</p><h3>Console</h3><p>A <strong>console</strong> traditionally refers to a system-level interface for interacting with the operating system.</p><p>It can be a physical or virtual interface.</p><h3>Terminal</h3><p>A <strong>terminal</strong> is an interface/application that provides a text-based session where we can interact with a shell.</p><p>For example:</p><pre>GUI Desktop<br>     ↓<br>Terminal Application<br>     ↓<br>Bash<br>     ↓<br>Kernel</pre><p>So remember:</p><blockquote><strong><em>Console = system-level access/interface</em></strong><em><br></em><strong><em>Terminal = text-based interface/application</em></strong><em><br></em><strong><em>Shell = command interpreter</em></strong></blockquote><h3>4. What Is a Graphical Terminal?</h3><p>On Linux, you can have a graphical desktop such as:</p><pre>GNOME<br>KDE Plasma<br>XFCE<br>Cinnamon</pre><p>You can open a terminal application from that graphical desktop.</p><p>For example:</p><pre>Ubuntu GUI<br>     ↓<br>GNOME Terminal<br>     ↓<br>Bash<br>     ↓<br>Linux Kernel</pre><p>The terminal application is graphical because it appears as a window, but the interface <strong>inside the terminal is still CLI-based</strong>.</p><p>So there isn’t normally a separate concept called a “graphical CLI.”</p><h3>5. Windows CMD and Linux Bash</h3><p>On Windows, cmd.exe is a <strong>command interpreter</strong>.</p><p>It is similar to a shell in Linux.</p><p>For example:</p><pre>Windows:<br>Terminal → cmd.exe → Windows OS</pre><pre>Linux:<br>Terminal → Bash → Linux Kernel</pre><p>Windows CMD commands include:</p><pre>dir<br>cd<br>mkdir<br>del<br>copy</pre><p>Linux Bash commands include:</p><pre>ls<br>cd<br>mkdir<br>rm<br>cp</pre><p>cmd.exe interprets commands belonging to the Windows Command Prompt environment.</p><p>Bash interprets shell commands on Linux/Unix systems.</p><h3>6. What Is a Shell Script?</h3><p>A shell script is basically a <strong>text file containing commands that a shell can interpret and execute</strong>.</p><p>For example:</p><pre>#!/bin/bash</pre><pre>echo &quot;Hello&quot;</pre><pre>mkdir test</pre><pre>echo &quot;Done&quot;</pre><p>Instead of manually entering each command, we can place them in a script and execute them sequentially.</p><p>This is similar to a Windows batch file.</p><h3>Batch file vs Shell script</h3><pre>Windows → .bat → Command Prompt<br>Linux   → .sh  → Shell such as Bash</pre><h3>7. What Is an Interpreter?</h3><p>An <strong>interpreter</strong> is a program that reads and executes instructions written in a particular language.</p><p>Examples:</p><pre>Python → Python interpreter<br>Bash   → Bash interpreter<br>Perl   → Perl interpreter</pre><p>A <strong>shell is one type of interpreter</strong>.</p><p>For example:</p><pre>Interpreter<br>│<br>├── Bash<br>├── Zsh<br>├── Python<br>└── Perl</pre><p>Bash is both:</p><ul><li>A shell</li><li>An interpreter for shell scripts</li></ul><p>Python is an interpreter, but it is not a shell.</p><p>So:</p><blockquote><strong><em>Every shell can act as an interpreter for shell scripts, but not every interpreter is a shell.</em></strong></blockquote><h3>8. Shebang</h3><p>The first line of a shell script is often:</p><pre>#!/bin/bash</pre><p>The #! is called the <strong>shebang</strong> or <strong>hashbang</strong>.</p><p>It tells the operating system which interpreter should be used to execute the script.</p><p>For example:</p><pre>#!/bin/bash</pre><p>means:</p><pre>#!        → interpreter directive<br>/bin/bash → interpreter executable</pre><h3>9. What Does bin Mean?</h3><p>In:</p><pre>/bin/bash</pre><p>bin traditionally means <strong>binary</strong>.</p><p>/bin is a directory used for executable programs.</p><p>So:</p><pre>/       → root directory<br>bin     → directory containing executable programs<br>bash    → Bash executable</pre><p>Therefore:</p><pre>#!/bin/bash</pre><p>means:</p><blockquote><em>Use the Bash executable located at </em><em>/bin/bash to interpret this script.</em></blockquote><h3>10. Is /bin/bash a Binary File?</h3><p>Yes.</p><p>The script itself:</p><pre>script.sh</pre><p>is normally a <strong>text file</strong>.</p><p>But:</p><pre>/bin/bash</pre><p>is an <strong>executable binary program</strong>.</p><p>The relationship is:</p><pre>script.sh<br>   ↓<br>Text containing shell commands<br>   ↓<br>#!/bin/bash<br>   ↓<br>Kernel starts /bin/bash<br>   ↓<br>Bash interprets script.sh</pre><h3>11. How Can the Kernel Understand #!?</h3><p>This was one of the most confusing concepts for me.</p><p>The kernel cannot understand shell commands such as:</p><pre>echo<br>if<br>for<br>while</pre><p>So how can it understand:</p><pre>#!</pre><p>The answer is that the kernel does <strong>not interpret the entire shell script</strong>.</p><p>When we execute:</p><pre>./script.sh</pre><p>the kernel first examines the beginning of the file.</p><p>If it sees:</p><pre>#!</pre><p>it recognizes the special interpreter mechanism.</p><p>For example:</p><pre>#!/bin/bash<br>echo &quot;Hello&quot;</pre><p>The flow is approximately:</p><pre>./script.sh<br>     ↓<br>Kernel receives request to execute file<br>     ↓<br>Kernel sees #!<br>     ↓<br>Kernel finds /bin/bash<br>     ↓<br>Kernel starts Bash<br>     ↓<br>Bash reads the script<br>     ↓<br>Bash interprets shell commands</pre><p>The kernel doesn’t need to understand:</p><pre>echo &quot;Hello&quot;</pre><p>Bash understands that.</p><h3>12. What Happens If the Shebang Specifies csh?</h3><p>Suppose:</p><pre>#!/bin/csh</pre><p>and Bash is also installed on the system.</p><p>If you run:</p><pre>./script.sh</pre><p>Bash does <strong>not</strong> interpret the script contents.</p><p>The flow is:</p><pre>Interactive Bash<br>      ↓<br>./script.sh<br>      ↓<br>Kernel<br>      ↓<br>#!/bin/csh<br>      ↓<br>Kernel starts csh<br>      ↓<br>csh interprets the script<br>      ↓<br>Programs / system calls<br>      ↓<br>Kernel</pre><p>The important point is:</p><blockquote><strong><em>The Bash you are using interactively and the Bash that might be specified in a shebang are two different roles.</em></strong></blockquote><p>Your interactive Bash receives:</p><pre>./script.sh</pre><p>and requests execution from the kernel.</p><p>The kernel then follows the shebang and starts the appropriate interpreter.</p><h3>13. What Does the Interpreter Do With Commands?</h3><p>Suppose the script contains:</p><pre>mkdir test</pre><p>The interpreter understands the command and determines what needs to happen.</p><p>It may execute an external program such as mkdir, which then makes system calls.</p><p>A simplified flow is:</p><pre>Shell Interpreter<br>       ↓<br>Program / System Call<br>       ↓<br>Kernel<br>       ↓<br>Filesystem / Disk</pre><p>So it is better to say:</p><blockquote><strong><em>The shell interprets the command and executes programs or makes system calls that request operations from the kernel.</em></strong></blockquote><p>It doesn’t simply send the original human-readable command directly to the kernel.</p><h3>14. ./script.sh vs bash script.sh</h3><p>These two commands are very important.</p><h3>./script.sh</h3><pre>./script.sh</pre><p>You are asking the OS to execute the script directly.</p><p>If the script contains:</p><pre>#!/bin/bash</pre><p>the shebang selects Bash.</p><pre>./script.sh<br>     ↓<br>Kernel<br>     ↓<br>Shebang<br>     ↓<br>Bash<br>     ↓<br>Script execution</pre><h3>bash script.sh</h3><pre>bash script.sh</pre><p>Here you explicitly tell Bash:</p><blockquote><em>Bash, interpret this file.</em></blockquote><p>The shebang is not used to choose the interpreter.</p><pre>bash script.sh<br>     ↓<br>Bash<br>     ↓<br>Interprets script</pre><p>For example, if the script says:</p><pre>#!/bin/csh</pre><p>then:</p><pre>./script.sh</pre><p>tries to use csh.</p><p>But:</p><pre>bash script.sh</pre><p>explicitly uses Bash.</p><h3>Easy rule</h3><pre>./script.sh      → shebang decides interpreter<br>bash script.sh   → you explicitly chose Bash</pre><h3>15. Which One Requires Execute Permission?</h3><p>This is another important difference.</p><h3>Direct execution</h3><pre>./script.sh</pre><p>requires the script to have execute permission.</p><p>You can add it with:</p><pre>chmod +x script.sh</pre><p>Then:</p><pre>./script.sh</pre><p>can execute it.</p><h3>Explicit Bash execution</h3><pre>bash script.sh</pre><p>does <strong>not require the script itself to have execute permission</strong>.</p><p>Why?</p><p>Because you are executing Bash, and Bash is reading the script as input.</p><pre>./script.sh<br>   ↓<br>Execute script directly<br>   ↓<br>Needs +x</pre><p>Whereas:</p><pre>bash script.sh<br>   ↓<br>Execute Bash<br>   ↓<br>Bash reads script<br>   ↓<br>Script itself doesn&#39;t need +x</pre><h3>16. Understanding chmod +x</h3><p>The command:</p><pre>chmod +x script.sh</pre><p>adds execute permission.</p><p>Permissions are:</p><pre>r → read<br>w → write<br>x → execute</pre><p>You can also explicitly specify all users:</p><pre>chmod a+x script.sh</pre><p>Here:</p><pre>a → all<br>+ → add<br>x → execute</pre><p>So:</p><pre>chmod a+x script.sh</pre><p>means:</p><blockquote><em>Add execute permission for the owner, group, and others.</em></blockquote><p>Similarly:</p><pre>chmod +r file</pre><p>adds read permission.</p><pre>chmod +w file</pre><p>adds write permission.</p><pre>chmod +rwx file</pre><p>adds read, write, and execute permissions.</p><h3>17. A Shebang Mistake I Encountered</h3><p>I initially wrote:</p><pre>#!bin/bash</pre><p>instead of:</p><pre>#!/bin/bash</pre><p>The / after #! is important.</p><p>Correct:</p><pre>#!/bin/bash</pre><pre>echo &quot;Enter Your Name&quot;</pre><pre>read name</pre><pre>echo &quot;hi $name&quot;</pre><p>Incorrect:</p><pre>#!bin/bash</pre><p>The correct interpreter path is:</p><pre>/bin/bash</pre><p>not:</p><pre>bin/bash</pre><h3>18. The read Command</h3><p>The read command takes input from the user and stores it in a variable.</p><p>Example:</p><pre>echo &quot;Enter your name:&quot;<br>read name</pre><pre>echo &quot;Hi $name&quot;</pre><p>If the user enters:</p><pre>Sai</pre><p>then:</p><pre>name = Sai</pre><p>and:</p><pre>echo &quot;Hi $name&quot;</pre><p>produces:</p><pre>Hi Sai</pre><p>So the basic idea is:</p><pre>read<br> ↓<br>User input<br> ↓<br>Variable<br> ↓<br>Use variable later</pre><h3>19. Linux Commands Are Case-Sensitive</h3><p>Linux is generally <strong>case-sensitive</strong>.</p><p>For example:</p><pre>ls</pre><p>is different from:</p><pre>LS</pre><p>Likewise:</p><pre>file.txt<br>File.txt<br>FILE.txt</pre><p>are different names.</p><p>This applies to:</p><ul><li>Commands</li><li>File names</li><li>Directory names</li><li>Variables</li><li>Paths</li></ul><p>So always pay attention to uppercase and lowercase characters.</p><h3>20. Conditions in Shell Scripting</h3><p>Conditions allow a script to make decisions.</p><p>The basic structure is:</p><pre>if [ condition ]<br>then<br>    # commands<br>fi</pre><p>For example:</p><pre>if [ &quot;$age&quot; -ge 18 ]<br>then<br>    echo &quot;Adult&quot;<br>fi</pre><h3>21. Numeric Conditions</h3><p>When comparing numbers, use these operators:</p><p>OperatorMeaning-eqEqual-neNot equal-gtGreater than-geGreater than or equal-ltLess than-leLess than or equal</p><p>Examples:</p><pre>[ &quot;$a&quot; -eq &quot;$b&quot; ]</pre><p>Means:</p><blockquote><em>Is </em><em>a numerically equal to </em><em>b?</em></blockquote><pre>[ &quot;$a&quot; -gt &quot;$b&quot; ]</pre><p>Means:</p><blockquote><em>Is </em><em>a greater than </em><em>b?</em></blockquote><pre>[ &quot;$a&quot; -lt &quot;$b&quot; ]</pre><p>Means:</p><blockquote><em>Is </em><em>a less than </em><em>b?</em></blockquote><h3>22. String Conditions</h3><p>For strings, commonly used operators are:</p><p>OperatorMeaning=Equal!=Not equal-zEmpty string-nNon-empty string</p><p>Example:</p><pre>if [ &quot;$name&quot; = &quot;Sai&quot; ]<br>then<br>    echo &quot;Name matched&quot;<br>fi</pre><p>This is different from numeric comparison.</p><pre>[ &quot;$a&quot; -eq &quot;$b&quot; ]</pre><p>is for <strong>numbers</strong>.</p><pre>[ &quot;$a&quot; = &quot;$b&quot; ]</pre><p>is for <strong>strings</strong>.</p><p>This distinction is very important in shell scripting.</p><h3>23. File Conditions</h3><p>Shell scripts can also check files and directories.</p><p>Common operators include:</p><p>OperatorMeaning-eExists-fRegular file-dDirectory-rReadable-wWritable-xExecutable-sExists and is not empty-LSymbolic link</p><p>Example:</p><pre>if [ -f &quot;test.txt&quot; ]<br>then<br>    echo &quot;It is a file&quot;<br>fi</pre><p>Directory:</p><pre>if [ -d &quot;test&quot; ]<br>then<br>    echo &quot;It is a directory&quot;<br>fi</pre><p>Executable:</p><pre>if [ -x &quot;script.sh&quot; ]<br>then<br>    echo &quot;Script is executable&quot;<br>fi</pre><h3>24. Combining Conditions</h3><h3>AND</h3><p>Use &amp;&amp; when both conditions must be true.</p><pre>if [ &quot;$age&quot; -ge 18 ] &amp;&amp; [ &quot;$age&quot; -le 60 ]<br>then<br>    echo &quot;Eligible&quot;<br>fi</pre><h3>OR</h3><p>Use || when at least one condition must be true.</p><pre>if [ &quot;$age&quot; -lt 18 ] || [ &quot;$age&quot; -gt 60 ]<br>then<br>    echo &quot;Not in range&quot;<br>fi</pre><h3>NOT</h3><p>Use ! to reverse a condition.</p><pre>if [ ! -f &quot;test.txt&quot; ]<br>then<br>    echo &quot;File does not exist&quot;<br>fi</pre><h3>25. if, elif, and else</h3><p>We can check multiple conditions:</p><pre>if [ &quot;$marks&quot; -ge 90 ]<br>then<br>    echo &quot;A&quot;<br>elif [ &quot;$marks&quot; -ge 75 ]<br>then<br>    echo &quot;B&quot;<br>elif [ &quot;$marks&quot; -ge 50 ]<br>then<br>    echo &quot;C&quot;<br>else<br>    echo &quot;Fail&quot;<br>fi</pre><p>The script checks conditions from top to bottom.</p><h3>26. Quick Revision</h3><p>The complete picture looks like this:</p><pre>User<br>                       ↓<br>                  Terminal<br>                       ↓<br>             Interactive Shell<br>                  (Bash)<br>                       ↓<br>             Request execution<br>                       ↓<br>                    Kernel<br>                       ↓<br>          Reads shebang if needed<br>                       ↓<br>             Starts Interpreter<br>                       ↓<br>          Bash / csh / other shell<br>                       ↓<br>          Interprets script commands<br>                       ↓<br>        Programs / System Calls<br>                       ↓<br>                    Kernel<br>                       ↓<br>       CPU / Memory / Disk / Devices</pre><p>And the most important concepts are:</p><pre>Terminal      → Interface<br>Shell         → Command interpreter<br>Interpreter   → Executes instructions of a language<br>Kernel        → Manages system resources<br>Shebang       → Specifies the script interpreter<br>/bin          → Directory containing executable programs<br>read          → Gets user input into a variable<br>chmod +x      → Adds execute permission<br>./script.sh   → Direct execution; uses shebang<br>bash script   → Explicitly use Bash</pre><p>For shell scripting, the next important step is to practice <strong>variables → </strong><strong>read → conditions → loops → functions</strong>, before moving into more advanced SRE automation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b700414c233d" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/linux-shell-fundamentals-terminal-shell-kernel-shebang-permissions-conditions-b700414c233d">Linux Shell Fundamentals: Terminal, Shell, Kernel, Shebang, Permissions &amp; Conditions</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker Networking Fundamentals: From Container eth0 to docker0, veth Pairs, Bridges and NAT]]></title>
            <link>https://blog.devops.dev/docker-networking-fundamentals-from-container-eth0-to-docker0-veth-pairs-bridges-and-nat-1c42f6502d8e?source=rss-f97274d24f35------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c42f6502d8e</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Sai Charan]]></dc:creator>
            <pubDate>Sat, 22 Aug 2026 07:46:57 GMT</pubDate>
            <atom:updated>2026-08-25T12:10:37.203Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xIIOYze3D4KqITQz.png" /></figure><p>Docker containers are isolated from the host by default. But an isolated container still needs a way to communicate with other containers, the host, and external services such as the internet.</p><p>When I started learning Docker networking, terms like <strong>bridge, </strong><strong>docker0, veth pair, network namespace, NAT, host network, and user-defined bridge</strong> seemed like separate concepts.</p><p>The easiest way to understand them is to connect them together.</p><p>This article explains Docker networking from the fundamentals, starting with the simplest Docker bridge network and gradually building the complete picture.</p><h3>1. What is Docker Networking?</h3><p>Docker networking provides connectivity between:</p><ul><li>Container ↔ Container</li><li>Container ↔ Host</li><li>Container ↔ External services</li><li>Container ↔ Internet</li></ul><p>A simplified view is:</p><pre>Container<br>    ↓<br>Container network interface<br>    ↓<br>Docker network<br>    ↓<br>Host networking<br>    ↓<br>External network</pre><p>Docker supports different networking modes. The most important ones to understand first are:</p><pre>bridge<br>host<br>none</pre><h3>2. Docker’s Default Networks</h3><p>After installing Docker on a typical Linux system, you can check the available Docker networks using:</p><pre>docker network ls</pre><p>You will normally see something similar to:</p><pre>NETWORK ID     NAME      DRIVER    SCOPE<br>xxxxxx         bridge    bridge    local<br>xxxxxx         host      host      local<br>xxxxxx         none      null      local</pre><p>These three networks have different purposes.</p><h3>Bridge</h3><p>Used for normal container networking.</p><h3>Host</h3><p>The container uses the host’s network stack instead of having a separate isolated network stack.</p><h3>None</h3><p>The container has networking disabled except for its loopback interface.</p><h3>3. What is the Docker bridge Network?</h3><p>The default Docker bridge network is implemented using a Linux bridge called:</p><pre>docker0</pre><p>This is one of the most important things to understand.</p><pre>Docker default bridge network<br>            ↓<br>         docker0<br>            ↓<br>   Linux bridge interface</pre><p>So when we talk about Docker’s default bridge network, docker0 is the Linux bridge interface associated with it.</p><h3>4. Does docker0 Belong to the Container or the Host?</h3><p>This was one of the most important points for me to understand.</p><p><strong>docker0 belongs to the Linux host.</strong></p><p>It is not inside the container.</p><p>For example:</p><pre>Linux Host<br>┌──────────────────────────────────────┐<br>│                                      │<br>│             docker0                  │<br>│       Linux bridge interface         │<br>│                                      │<br>└──────────────────┬───────────────────┘<br>                   │<br>                 veth<br>                   │<br>            ┌──────┴──────┐<br>            │  Container  │<br>            │    eth0     │<br>            └─────────────┘</pre><p>The container has its own network interface, usually:</p><pre>eth0</pre><p>The host has:</p><pre>docker0</pre><p>They are <strong>not the same interface</strong>.</p><h3>5. Container eth0 vs docker0</h3><p>This distinction is extremely important.</p><h3>Container</h3><p>The container has:</p><pre>eth0</pre><p>For example:</p><pre>eth0<br>172.17.0.2</pre><p>This interface exists inside the container’s network namespace.</p><h3>Host</h3><p>The Linux host has:</p><pre>docker0</pre><p>For example:</p><pre>docker0<br>172.17.0.1</pre><p>docker0 is a Linux bridge interface.</p><p>So:</p><pre>Container                  Host</pre><pre>eth0                       docker0<br>172.17.0.2                 172.17.0.1<br>   │                          │<br>   │                          │<br>   └────── veth pair ─────────┘</pre><p>The container’s eth0 and the host&#39;s docker0 are different things.</p><h3>6. What is a veth Pair?</h3><p>This is where Docker networking becomes much easier to understand.</p><p><strong>veth</strong> stands for <strong>Virtual Ethernet</strong>.</p><p>A veth pair consists of two virtual Ethernet interfaces that are connected to each other.</p><p>Think of it as a <strong>virtual network cable</strong>.</p><pre>Interface A  =================  Interface B<br>                 virtual cable</pre><p>Anything sent through one end appears at the other end.</p><p>Docker uses this mechanism to connect a container’s network namespace to the host’s Linux bridge.</p><p>Conceptually:</p><pre>Container                         Host</pre><pre>eth0<br>  │<br>  │<br>veth end #1  =================  veth end #2<br>                                      │<br>                                      │<br>                                   docker0</pre><p>Therefore:</p><blockquote><em>A veth pair acts like a virtual Ethernet cable between the container and the host’s bridge.</em></blockquote><h3>7. Why Does Docker Need a veth Pair?</h3><p>A container has its own network namespace.</p><p>That means the container has its own:</p><ul><li>Network interfaces</li><li>IP addresses</li><li>Routing table</li><li>Network stack</li></ul><p>The host has its own network namespace as well.</p><p>Docker therefore needs a way to connect the container’s network namespace to the host network.</p><p>The veth pair provides that connection.</p><p>Think about a physical computer:</p><pre>Computer<br>   │<br>Network card<br>   │<br>Ethernet cable<br>   │<br>Network switch</pre><p>Docker creates a virtual equivalent:</p><pre>Container<br>   │<br>eth0<br>   │<br>veth pair<br>   │<br>docker0</pre><p>So the mental model is:</p><blockquote><strong><em>Container </em></strong><strong><em>eth0 → veth pair → Linux bridge</em></strong></blockquote><h3>8. docker0 Acts Like a Virtual Switch</h3><p>A Linux bridge behaves similarly to a Layer-2 network switch.</p><p>Imagine several containers:</p><pre>Container A<br>    │<br>   veth<br>    │<br>    │<br>Container B ── veth ── docker0<br>    │                  │<br>   veth                │<br>    │                  │<br>Container C ───────────┘</pre><p>A cleaner representation is:</p><pre>Container A ── veth ──┐<br>                       │<br>Container B ── veth ──┼── docker0<br>                       │<br>Container C ── veth ──┘</pre><p>The bridge connects the container interfaces.</p><p>That is why docker0 can be thought of as a <strong>virtual switch/bridge</strong>.</p><h3>9. Container-to-Container Communication</h3><p>Suppose we have:</p><pre>Container A<br>IP: 172.17.0.2</pre><pre>Container B<br>IP: 172.17.0.3</pre><p>Both containers are connected to the default Docker bridge.</p><p>The communication path is approximately:</p><pre>Container A<br>    ↓<br>   eth0<br>    ↓<br>veth pair<br>    ↓<br> docker0<br>    ↓<br>veth pair<br>    ↓<br>   eth0<br>    ↓<br>Container B</pre><p>Notice something important:</p><p><strong>The traffic does not need to go to the internet.</strong></p><p>Both containers are connected to the same bridge network.</p><p>So docker0 provides the local Layer-2 connectivity between them.</p><h3>10. Container-to-Host Communication</h3><p>Now suppose a container wants to communicate with something on the host.</p><p>The traffic can travel through the container’s interface and the bridge toward the host networking stack.</p><p>Conceptually:</p><pre>Container<br>    ↓<br>   eth0<br>    ↓<br>veth pair<br>    ↓<br> docker0<br>    ↓<br>Host network stack<br>    ↓<br>Host service</pre><p>The important point is:</p><blockquote><em>docker0 belongs to the host and provides the bridge between the container network and the host&#39;s networking environment.</em></blockquote><p>However, this does <strong>not</strong> mean the container automatically has all the same access as the host.</p><p>Firewall rules, routing, network policies, permissions, and other security controls can restrict connectivity.</p><h3>11. Container-to-Internet Communication</h3><p>Now let’s look at the most interesting flow.</p><p>Suppose the container has:</p><pre>Container IP: 172.17.0.2</pre><p>and it wants to access an external server:</p><pre>8.8.8.8</pre><p>The simplified flow is:</p><pre>Container<br>    ↓<br>eth0<br>    ↓<br>veth pair<br>    ↓<br>docker0<br>    ↓<br>Host network stack<br>    ↓<br>NAT<br>    ↓<br>Host physical NIC<br>    ↓<br>Internet<br>    ↓<br>External service</pre><p>This is the complete mental model.</p><h3>12. Why is NAT Needed?</h3><p>Container IP addresses such as:</p><pre>172.17.0.2</pre><p>are private addresses.</p><p>The external network doesn’t normally route directly back to that private Docker network.</p><p>Docker therefore uses network address translation (NAT) so that traffic leaving the container network can be translated to the host’s address as it exits toward the external network.</p><p>Conceptually:</p><pre>Before NAT:</pre><pre>172.17.0.2<br>     ↓<br>External network</pre><p>After translation:</p><pre>172.17.0.2<br>     ↓<br>   NAT<br>     ↓<br>Host IP<br>     ↓<br>External network</pre><p>So an external service can see the connection as coming from the host’s network address rather than directly from the private container address.</p><h3>13. What Does the Host’s Physical NIC Do?</h3><p>The Linux host might have a physical network interface such as:</p><pre>eth0</pre><p>or another interface name depending on the system.</p><p>So don’t confuse these:</p><pre>Container eth0</pre><p>with:</p><pre>Host eth0</pre><p>They are completely different interfaces.</p><p>The complete path can look like:</p><pre>Container eth0<br>      ↓<br>   veth pair<br>      ↓<br>   docker0<br>      ↓<br>Host network stack<br>      ↓<br>     NAT<br>      ↓<br>Host eth0<br>      ↓<br>Internet</pre><h3>14. Why Does the Container Have eth0?</h3><p>Because the container has its own network namespace.</p><p>Inside the container, if you run:</p><pre>ip addr</pre><p>you may see:</p><pre>eth0<br>172.17.0.2</pre><p>That is the container’s network interface.</p><p>On the host, you can inspect network interfaces using:</p><pre>ip addr</pre><p>and you may see:</p><pre>docker0</pre><p>You can therefore think of the architecture as:</p><pre>Container network namespace<br>        │<br>        │ eth0<br>        │<br>      veth<br>        │<br>        │<br>Linux host<br>        │<br>     docker0</pre><h3>15. Default Bridge vs User-Defined Bridge</h3><p>This is another important distinction.</p><p>Docker’s default bridge network uses:</p><pre>docker0</pre><p>But when you create a user-defined bridge network:</p><pre>docker network create mynetwork</pre><p>Docker normally creates a separate Linux bridge.</p><p>It may look like:</p><pre>br-a1b2c3d4</pre><p>So:</p><pre>Default bridge<br>      ↓<br>   docker0</pre><p>while:</p><pre>User-defined bridge<br>      ↓<br>   br-xxxxxx</pre><p>Both are Linux bridge interfaces.</p><h3>16. Does Every Docker Bridge Network Need a Linux Bridge?</h3><p>Yes.</p><p>This is the general rule:</p><blockquote><strong><em>A Docker bridge network uses a Linux bridge interface.</em></strong></blockquote><p>The difference is which bridge is used.</p><pre>Default Docker bridge<br>        ↓<br>     docker0</pre><pre>User-defined bridge<br>        ↓<br>     br-xxxxxx</pre><p>So docker0 is not the name for every Docker bridge.</p><p>It is the name of the bridge used by the default Docker bridge network.</p><h3>17. User-Defined Bridge Networking</h3><p>Suppose we create:</p><pre>docker network create mynetwork</pre><p>Then run two containers on it:</p><pre>docker run -d --name app1 --network mynetwork nginx<br>docker run -d --name app2 --network mynetwork nginx</pre><p>The conceptual architecture becomes:</p><pre>Container app1<br>      │<br>     eth0<br>      │<br>    veth<br>      │<br>      ├──────── br-xxxxxx<br>      │<br>    veth<br>      │<br>     eth0<br>Container app2</pre><p>The important thing is:</p><p><strong>docker0 is not involved in this user-defined bridge network.</strong></p><p>The br-xxxxxx bridge is used instead.</p><h3>18. Why Are User-Defined Bridge Networks Important?</h3><p>User-defined bridge networks provide better networking features than relying on the default bridge.</p><p>One major advantage is Docker’s built-in DNS-based service discovery.</p><p>For example, if:</p><pre>app<br>db</pre><p>are connected to the same user-defined network, the application can typically connect to:</p><pre>db</pre><p>rather than depending on the database container’s IP address.</p><p>This is much more convenient because container IP addresses can change.</p><h3>19. What About the Host Network?</h3><p>Docker also has a host network mode.</p><p>For example:</p><pre>docker run --network host nginx</pre><p>Here the container uses the host’s network stack rather than the normal isolated container networking model.</p><p>Conceptually:</p><pre>Container<br>     │<br>     ↓<br>Host network stack<br>     │<br>     ↓<br>Host NIC</pre><p>You don’t have the normal:</p><pre>Container<br>   ↓<br>veth<br>   ↓<br>docker0</pre><p>architecture for the container’s networking.</p><p>Host networking can be useful in specific scenarios, but it provides less network isolation.</p><h3>20. What About the none Network?</h3><p>The none network is used when you want the container to have essentially no normal network connectivity.</p><p>For example:</p><pre>docker run --network none nginx</pre><p>The container can still have its loopback interface:</p><pre>lo</pre><p>but it doesn’t have normal external networking.</p><p>Conceptually:</p><pre>Container<br>   │<br>   └── lo</pre><p>No normal:</p><pre>eth0<br>   ↓<br>veth<br>   ↓<br>docker0</pre><p>path.</p><h3>21. A Common Misunderstanding: Does docker0 Give Containers All Host Access?</h3><p>No.</p><p>The container can use the host’s networking path to reach external networks, but that does <strong>not</strong> mean:</p><blockquote><em>“The container has everything the host can access.”</em></blockquote><p>Security controls can restrict traffic.</p><p>For example:</p><pre>Container<br>    ↓<br>Docker networking<br>    ↓<br>Firewall / routing rules<br>    ↓<br>Destination</pre><p>The host may be able to reach a service while the container is blocked from reaching it, depending on routing and security configuration.</p><h3>22. Another Important Misunderstanding: Is docker0 the Same as Container eth0?</h3><p>No.</p><p>They belong to different network environments.</p><pre>Container<br>┌────────────────────┐<br>│ eth0               │<br>│ 172.17.0.2         │<br>└─────────┬──────────┘<br>          │<br>       veth pair<br>          │<br>┌─────────┴──────────┐<br>│ Linux Host         │<br>│                    │<br>│ docker0             │<br>│ 172.17.0.1          │<br>└────────────────────┘</pre><p>Remember:</p><pre>Container → eth0<br>Host      → docker0</pre><h3>23. The Complete Docker Bridge Networking Picture</h3><p>Now we can combine everything.</p><pre>LINUX HOST<br>┌──────────────────────────────────────────────────────┐<br>│                                                      │<br>│  Container A                     Container B         │<br>│ ┌──────────────┐               ┌──────────────┐     │<br>│ │ eth0         │               │ eth0         │     │<br>│ │ 172.17.0.2   │               │ 172.17.0.3   │     │<br>│ └──────┬───────┘               └──────┬───────┘     │<br>│        │                              │              │<br>│      veth                           veth             │<br>│        │                              │              │<br>│        └──────────┐      ┌────────────┘              │<br>│                   ↓      ↓                           │<br>│                 ┌────────────┐                      │<br>│                 │  docker0   │                      │<br>│                 │   Bridge   │                      │<br>│                 └─────┬──────┘                      │<br>│                       │                             │<br>│                Host network stack                   │<br>│                       │                             │<br>│                      NAT                            │<br>│                       │                             │<br>│                  Host eth0                          │<br>│                       │                             │<br>└───────────────────────┼─────────────────────────────┘<br>                        ↓<br>                     Internet</pre><p>This single diagram captures the fundamentals of Docker bridge networking.</p><h3>24. The Three Things to Remember</h3><p>If you’re just starting with Docker networking, remember these three things first.</p><h3>eth0</h3><p>The container’s network interface.</p><pre>Container → eth0</pre><h3>veth pair</h3><p>The virtual cable connecting the container’s network namespace to the host bridge.</p><pre>eth0 → veth pair</pre><h3>Linux bridge</h3><p>The virtual switch that connects containers.</p><pre>veth → docker0</pre><p>For the default bridge:</p><pre>eth0 → veth pair → docker0</pre><p>For a user-defined bridge:</p><pre>eth0 → veth pair → br-xxxxxx</pre><h3>25. The Most Important Mental Model</h3><p>Instead of memorizing individual Docker networking terms, remember this:</p><pre>Container<br>   │<br>   │ eth0<br>   ↓<br>veth pair<br>   │<br>   ↓<br>Linux bridge<br>   │<br>   ├──→ Another container<br>   │<br>   └──→ Host network stack<br>              │<br>              ↓<br>             NAT<br>              │<br>              ↓<br>          Host NIC<br>              │<br>              ↓<br>           Internet</pre><p>For the default Docker bridge:</p><pre>Linux bridge = docker0</pre><p>For a user-defined bridge:</p><pre>Linux bridge = br-xxxxxx</pre><h3>26. Useful Commands to Explore Docker Networking</h3><p>You don’t have to understand Docker networking only theoretically. You can inspect it directly.</p><h3>List Docker networks</h3><pre>docker network ls</pre><h3>Inspect the default bridge</h3><pre>docker network inspect bridge</pre><h3>Inspect a user-defined network</h3><pre>docker network inspect mynetwork</pre><h3>See Linux interfaces</h3><pre>ip addr</pre><h3>See Linux links</h3><pre>ip link</pre><h3>Inspect a container</h3><pre>docker inspect &lt;container-name&gt;</pre><p>You can use these commands together to connect what Docker shows you with what Linux is actually doing underneath.</p><h3>27. Docker Networking: Fundamental vs Advanced</h3><p>What we’ve covered so far is the <strong>fundamental layer</strong> of Docker networking.</p><h3>Fundamentals</h3><ul><li>Docker networks</li><li>Bridge network</li><li>docker0</li><li>User-defined bridge</li><li>Linux bridge</li><li>Container eth0</li><li>Network namespaces</li><li>veth pairs</li><li>Container-to-container communication</li><li>Container-to-host communication</li><li>NAT</li><li>Container-to-internet communication</li><li>Host networking</li><li>None networking</li></ul><h3>Next level</h3><p>Once these concepts are clear, you can move to:</p><ul><li>Docker DNS</li><li>Port publishing (-p)</li><li>Custom subnets</li><li>Custom gateways</li><li>Multiple Docker networks</li><li>Network isolation</li><li>iptables/nftables</li><li>Advanced routing</li></ul><h3>Advanced</h3><p>Later, you can learn:</p><ul><li>Overlay networks</li><li>Docker Swarm networking</li><li>VXLAN</li><li>Multi-host container networking</li><li>Advanced network security</li></ul><p>There’s no need to jump directly into overlay networking if the bridge/veth model isn’t clear yet.</p><h3>Conclusion</h3><p>Docker networking becomes much easier once we stop treating docker0, eth0, veth pairs, bridges, and NAT as unrelated concepts.</p><p>They are parts of one system.</p><p>The fundamental flow is:</p><pre>Container<br>   ↓<br>eth0<br>   ↓<br>veth pair<br>   ↓<br>Linux bridge<br>   ↓<br>Host network stack<br>   ↓<br>NAT<br>   ↓<br>Host physical NIC<br>   ↓<br>External network</pre><p>For Docker’s default bridge:</p><pre>Linux bridge = docker0</pre><p>For a user-defined bridge:</p><pre>Linux bridge = br-xxxxxx</pre><p>And the most important distinction is:</p><blockquote><strong><em>eth0 belongs to the container. The Linux bridge (</em></strong><strong><em>docker0 or </em></strong><strong><em>br-xxxxxx) belongs to the host. The veth pair connects them.</em></strong></blockquote><p>Once this mental model is clear, Docker networking stops looking like a collection of commands and starts making sense as a Linux networking system underneath Docker.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c42f6502d8e" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/docker-networking-fundamentals-from-container-eth0-to-docker0-veth-pairs-bridges-and-nat-1c42f6502d8e">Docker Networking Fundamentals: From Container eth0 to docker0, veth Pairs, Bridges and NAT</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Git Learning Journey: Understanding Git Branches, git switch, git push, and Pull Requests]]></title>
            <link>https://blog.devops.dev/my-git-learning-journey-understanding-git-branches-git-switch-git-push-and-pull-requests-6184ab0efba3?source=rss-f97274d24f35------2</link>
            <guid isPermaLink="false">https://medium.com/p/6184ab0efba3</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Sai Charan]]></dc:creator>
            <pubDate>Tue, 11 Aug 2026 18:48:15 GMT</pubDate>
            <atom:updated>2026-08-13T11:39:12.142Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*-UrOmmnNPVz0whtIjaEDgA.jpeg" /><figcaption><strong>Beginner friendly</strong></figcaption></figure><p>After learning the basics of Git such as git init, git add, git commit, git remote, and git push, I wanted to understand how Git is actually used when multiple people are working on the same project.</p><p>One concept that immediately came up was <strong>Git branches</strong>.</p><p>I had seen commands like git branch, git switch, and git checkout many times, but I didn&#39;t want to simply memorize them. I wanted to understand why branches are needed and how they are used in a real organization.</p><p>So I created a small dummy repository and started experimenting with branches.</p><h3>Why do we need Git branches?</h3><p>Imagine a team is working on a project.</p><p>There is a main branch:</p><pre>main</pre><p>This branch contains the stable version of the project.</p><p>Now I want to add a new login feature.</p><p>If I directly make changes to main, I could accidentally introduce a bug into the stable code.</p><p>Instead, I can create a separate branch:</p><pre>main<br>  |<br>  └── feature/login</pre><p>Now I can work on the login feature without affecting main.</p><p>This was the first important thing I understood about branches:</p><blockquote><strong><em>A branch gives me a separate line of development where I can safely make changes.</em></strong></blockquote><h3>Creating a branch</h3><p>I first checked which branch I was currently on:</p><pre>git branch</pre><p>The output looked something like:</p><pre>* main</pre><p>The * tells me which branch I am currently using.</p><p>I then created a new branch:</p><pre>git branch feature/login</pre><p>This creates the branch, but it does <strong>not</strong> automatically move me to that branch.</p><p>So I switched to it using:</p><pre>git switch feature/login</pre><p>Now:</p><pre>git branch</pre><p>shows:</p><pre>main<br>* feature/login</pre><p>The * tells me that I am now working on feature/login.</p><h3>Creating and switching to a branch in one command</h3><p>I also learned that I don’t have to use two commands.</p><p>I can create a new branch and switch to it at the same time:</p><pre>git switch -c feature/login</pre><p>Here:</p><pre>-c = create a new branch</pre><p>So:</p><pre>git switch -c feature/login</pre><p>means:</p><blockquote><em>Create </em><em>feature/login and switch to it.</em></blockquote><p>This is the command I find more convenient when starting a new task.</p><h3>Making changes on the feature branch</h3><p>Once I switched to:</p><pre>feature/login</pre><p>I made some changes to my project files.</p><p>For example, I created:</p><pre>login.html</pre><p>Then I checked the status:</p><pre>git status</pre><p>Git showed that login.html was a new file.</p><p>I then staged it:</p><pre>git add login.html</pre><p>and created a commit:</p><pre>git commit -m &quot;Added login page&quot;</pre><p>At this point, the commit existed in my <strong>local </strong><strong>feature/login branch</strong>.</p><p>It had not yet been uploaded to GitHub.</p><h3>Pushing the feature branch to GitHub</h3><p>This was another important part I wanted to understand.</p><p>I was currently on:</p><pre>feature/login</pre><p>So I pushed that branch to the remote repository:</p><pre>git push -u origin feature/login</pre><p>Here:</p><ul><li>origin → the name of my remote GitHub repository</li><li>feature/login → the branch I want to push</li><li>-u → sets the upstream/tracking relationship</li></ul><p>After the first push, Git remembers that my local:</p><pre>feature/login</pre><p>is connected to:</p><pre>origin/feature/login</pre><p>So the next time, while I’m on the same branch, I can simply use:</p><pre>git push</pre><p>I don’t have to specify the remote and branch again.</p><h3>What happens on GitHub?</h3><p>After pushing my feature branch, my GitHub repository now has:</p><pre>main<br>feature/login</pre><p>My changes are in:</p><pre>feature/login</pre><p>They are not automatically part of main.</p><p>This is exactly what I wanted.</p><p>I can now create a <strong>Pull Request</strong>.</p><p>The Pull Request will be:</p><pre>feature/login<br>       ↓<br>      main</pre><p>A Pull Request is basically a request saying:</p><blockquote><em>“I have completed my changes on this branch. Please review them and merge them into the main branch.”</em></blockquote><h3>How branches are normally used in organizations</h3><p>This is where Git branches became much more interesting to me.</p><p>In an organization, developers normally don’t directly make changes to main.</p><p>A common workflow looks like this:</p><pre>main<br>                  |<br>          Create feature branch<br>                  |<br>                  ↓<br>          feature/login<br>                  |<br>             Make changes<br>                  |<br>                commit<br>                  |<br>                push<br>                  |<br>                  ↓<br>           Pull Request<br>                  |<br>             Code Review<br>                  |<br>            CI/CD Checks<br>                  |<br>              Approval<br>                  |<br>                  ↓<br>                main</pre><p>For example, if I receive a Jira ticket:</p><pre>ABC-123: Add login functionality</pre><p>I might create:</p><pre>git switch main<br>git pull origin main<br>git switch -c feature/ABC-123-login</pre><p>Then I work on the ticket:</p><pre>git add .<br>git commit -m &quot;ABC-123 Added login functionality&quot;</pre><p>Then push:</p><pre>git push -u origin feature/ABC-123-login</pre><p>After that, I create a Pull Request:</p><pre>feature/ABC-123-login → main</pre><p>The team can review the changes before they become part of main.</p><h3>Why do we pull main before creating a branch?</h3><p>This was another concept I learned while practicing.</p><p>Suppose my local main is behind the remote main.</p><p>Remote:</p><pre>A → B → C → D</pre><p>My local:</p><pre>A → B → C</pre><p>If I create a feature branch now, it will start from the older version of main.</p><p>So I first update my local main:</p><pre>git switch main<br>git pull origin main</pre><p>Now:</p><pre>Local main<br>A → B → C → D</pre><p>Then I create my feature branch:</p><pre>git switch -c feature/login</pre><p>Now my feature branch starts from the latest main.</p><p>This made me understand why, in a real organization, developers commonly make sure their local main is up to date before starting new work.</p><h3>What happens if someone changes main while I&#39;m working?</h3><p>Suppose I created my branch:</p><pre>main<br>  |<br>  └── feature/login</pre><p>While I’m working, another developer’s Pull Request gets merged into main.</p><p>Now the remote main has newer changes.</p><p>My feature branch doesn’t automatically get those changes.</p><p>I may need to bring the latest main changes into my branch, depending on the team&#39;s workflow.</p><p>For example:</p><pre>git switch main<br>git pull origin main</pre><pre>git switch feature/login<br>git merge main</pre><p>Or a team may use:</p><pre>git rebase main</pre><p>I learned that merge and rebase are separate topics that I need to understand more deeply.</p><h3>Can we merge a branch locally?</h3><p>Yes.</p><p>Suppose I have:</p><pre>main<br>feature/login</pre><p>and I want to merge feature/login into main locally.</p><p>First I switch to main:</p><pre>git switch main</pre><p>Then:</p><pre>git merge feature/login</pre><p>This tells Git:</p><blockquote><em>Merge the changes from </em><em>feature/login into my current </em><em>main branch.</em></blockquote><p>After the merge, I can push the updated main:</p><pre>git push origin main</pre><p>However, this is different from the Pull Request workflow commonly used in organizations.</p><p>In many teams, the normal process is:</p><pre>feature branch<br>      ↓<br>     push<br>      ↓<br>Pull Request<br>      ↓<br>Code Review<br>      ↓<br>Approval<br>      ↓<br>Merge into main</pre><p>So I don’t normally need to directly merge into `main myself.</p><h3>Deleting a branch</h3><p>Once my feature is merged, I may no longer need the branch.</p><p>To delete the local branch:</p><pre>git switch main<br>git branch -d feature/login</pre><p>If the branch has already been pushed to GitHub, I can delete the remote branch using:</p><pre>git push origin --delete feature/login</pre><p>So there are two different branches to delete:</p><pre>git branch -d feature/login<br>        ↓<br>Delete LOCAL branch</pre><p>and:</p><pre>git push origin --delete feature/login<br>        ↓<br>Delete REMOTE branch</pre><h3>One thing that confused me: git checkout</h3><p>While learning branches, I also came across:</p><pre>git checkout feature/login</pre><p>This can also be used to switch branches.</p><p>For example:</p><pre>git checkout feature/login</pre><p>However, Git introduced git switch specifically for branch switching, which I find easier to understand as a beginner.</p><p>So I prefer:</p><pre>git switch feature/login</pre><p>and:</p><pre>git switch -c feature/login</pre><p>for creating and switching to a new branch.</p><h3>The complete workflow I practiced</h3><p>After experimenting with branches, I can now understand the complete workflow much better:</p><pre>Clone repository<br>      ↓<br>Check branches<br>      ↓<br>Switch to main<br>      ↓<br>Pull latest main<br>      ↓<br>Create feature branch<br>      ↓<br>Switch to feature branch<br>      ↓<br>Make changes<br>      ↓<br>git add<br>      ↓<br>git commit<br>      ↓<br>git push -u origin feature-branch<br>      ↓<br>Create Pull Request<br>      ↓<br>Code Review<br>      ↓<br>Approval<br>      ↓<br>Merge into main<br>      ↓<br>Delete feature branch</pre><p>The commands I practiced were:</p><pre>git clone &lt;repository-url&gt;</pre><pre>git branch</pre><pre>git switch main</pre><pre>git pull origin main</pre><pre>git switch -c feature/login</pre><pre>git status</pre><pre>git add .</pre><pre>git commit -m &quot;Added login feature&quot;</pre><pre>git push -u origin feature/login</pre><p>After the Pull Request is merged:</p><pre>git switch main<br>git pull origin main</pre><pre>git branch -d feature/login</pre><pre>git push origin --delete feature/login</pre><h3>The biggest lesson I learned</h3><p>Before learning branches, I thought Git was mainly about:</p><pre>git add<br>git commit<br>git push</pre><p>After practicing branches, I realized that Git is also about <strong>managing different lines of development safely</strong>.</p><p>Here is how I now think about the important commands:</p><ul><li>git branch → view or create branches</li><li>git switch → move between branches</li><li>git switch -c → create and switch to a new branch</li><li>git pull → get and integrate the latest remote changes into my current branch</li><li>git push → upload my commits to the remote branch</li><li>Pull Request → request that my branch be reviewed and merged into another branch</li><li>git merge → combine one branch into another</li><li>git branch -d → delete a local branch</li></ul><p>The biggest thing I learned is that <strong>I don’t need to work directly on </strong><strong>main</strong>.</p><p>I can create my own feature branch, make changes safely, push it to GitHub, create a Pull Request, get the changes reviewed, and then merge them into main.</p><p>That is how Git branches started making much more sense to me.</p><p>My next step is to practice <strong>merge conflicts, </strong><strong>git fetch, </strong><strong>git pull, </strong><strong>git merge, and </strong><strong>git rebase</strong>, because these are the areas where Git becomes more interesting in real-world projects.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6184ab0efba3" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/my-git-learning-journey-understanding-git-branches-git-switch-git-push-and-pull-requests-6184ab0efba3">My Git Learning Journey: Understanding Git Branches, git switch, git push, and Pull Requests</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Git Learning Journey: Understanding git init, git add, git commit, git remote, and git push]]></title>
            <link>https://blog.devops.dev/my-git-learning-journey-understanding-git-init-git-add-git-commit-git-remote-and-git-push-e40f11a87cdd?source=rss-f97274d24f35------2</link>
            <guid isPermaLink="false">https://medium.com/p/e40f11a87cdd</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Sai Charan]]></dc:creator>
            <pubDate>Thu, 06 Aug 2026 14:21:20 GMT</pubDate>
            <atom:updated>2026-08-07T11:25:27.653Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*Wh_g4OPgtZQquasGnyG_2A.webp" /><figcaption>Beginner friendly</figcaption></figure><p>When I started learning Git, I noticed that many tutorials explained <strong>what</strong> each command does, but not <strong>why</strong> we use it. I could memorize commands, but I didn’t really understand what was happening behind the scenes.</p><p>So I decided to experiment on my own. I created a small project, tried different Git commands, made mistakes, and gradually understood how Git actually works. This article is a summary of what I learned.</p><h3>The workflow I followed</h3><p>I started by creating a folder called gitpractise-folder and opened it in Visual Studio Code. Inside that folder, I created an index.html file and added some basic HTML code.</p><p>At this point, it was just a normal folder with a file inside it. Git had no idea that this folder even existed.</p><p>To bring Git into the picture, I ran:</p><pre>git init</pre><p>Initially, I thought this command would start tracking all my files automatically. But that’s not what it does.</p><p>What git init actually does is create a hidden .git folder inside the project. This .git folder is the heart of Git. It stores everything Git needs to manage the project, such as commits, branches, references, logs, configuration, Git objects, and the staging area.</p><p>One thing I found interesting is that even after running git init, my index.html file was still <strong>untracked</strong>. When I checked the status using:</p><pre>git status</pre><p>Git showed the file under <strong>Untracked files</strong>.</p><p>That made me realize that <strong>git init doesn&#39;t track files—it only prepares the project to use version control.</strong></p><h3>Why do we use git add?</h3><p>Next, I ran:</p><pre>git add index.html</pre><p>This command tells Git:</p><blockquote><em>“I want this file to be included in my next commit.”</em></blockquote><p>Since index.html was a new file, Git also started tracking it.</p><p>This helped me understand the difference between git init and git add.</p><ul><li>git init creates the Git repository.</li><li>git add starts tracking new files and stages them for the next commit.</li></ul><p>In simple words, git add moves the file from the <strong>Working Directory</strong> to the <strong>Staging Area</strong>.</p><h3>Creating my first commit</h3><p>After staging the file, I created my first commit:</p><pre>git commit -m &quot;Initial commit&quot;</pre><p>This command creates a snapshot of everything that is currently in the staging area.</p><p>That snapshot becomes part of the project’s history.</p><p>Every time we make another commit, Git creates another version of the project. That’s where the term <strong>Version Control</strong> comes from.</p><p>Instead of saving files like:</p><ul><li>Project_Final</li><li>Project_Final_New</li><li>Project_Final_Latest</li></ul><p>Git keeps every version in an organized history that you can revisit anytime.</p><h3>Connecting my local repository to GitHub</h3><p>At this point, everything was stored only on my computer.</p><p>To upload the project to GitHub, I first connected my local repository to a remote repository:</p><pre>git remote add origin &lt;GitHub Repository URL&gt;</pre><p>One thing I learned here is that this command <strong>doesn’t upload anything</strong>.</p><p>It simply tells Git:</p><blockquote><em>“Whenever I say </em><em>origin, this is the GitHub repository I&#39;m referring to.&quot;</em></blockquote><p>You usually run this command only once for a repository created using git init.</p><h3>Uploading the project</h3><p>Finally, I pushed my commits to GitHub using:</p><pre>git push -u origin master</pre><p>This uploads all the local commits to the remote repository.</p><p>The -u option was another concept that confused me initially.</p><p>I learned that -u means <strong>--set-upstream</strong>.</p><p>It creates a tracking relationship between my local branch and the remote branch.</p><p>Because of this, I don’t have to type:</p><pre>git push origin master</pre><p>every single time.</p><p>From the next push onward, I can simply use:</p><pre>git push</pre><p>Similarly, I can use:</p><pre>git pull</pre><p>without specifying the remote and branch name again.</p><h3>Version Control vs File Tracking</h3><p>This was probably the biggest confusion I had while learning Git.</p><p>I thought they meant the same thing, but they’re actually different.</p><p><strong>File tracking</strong> means Git is watching a file for changes.</p><p>For example, after running git add on a new file, Git knows about that file. If I modify it later, Git immediately tells me that the file has changed.</p><p><strong>Version control</strong>, on the other hand, is about maintaining the complete history of the project through commits.</p><p>Every commit becomes a checkpoint that I can compare, restore, or revisit later.</p><h3>The biggest lesson I learned</h3><p>Initially, I believed git init was responsible for tracking files.</p><p>After experimenting, I realized that’s not true.</p><p>Here’s how I now think about it:</p><ul><li>git init creates the Git repository.</li><li>git add starts tracking files and stages them.</li><li>git commit creates a permanent snapshot.</li><li>git remote add origin connects the local repository to GitHub.</li><li>git push uploads the commits to GitHub.</li></ul><p>Understanding <strong>why</strong> each command exists made Git much easier for me.</p><p>Once I stopped memorizing commands and started understanding their purpose, the entire Git workflow finally made sense.</p><p>I hope this explanation helps other beginners who have the same questions I had while learning Git.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e40f11a87cdd" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/my-git-learning-journey-understanding-git-init-git-add-git-commit-git-remote-and-git-push-e40f11a87cdd">My Git Learning Journey: Understanding git init, git add, git commit, git remote, and git push</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Operating System vs Kernel: What’s the Real Difference?]]></title>
            <link>https://blog.devops.dev/operating-system-vs-kernel-whats-the-real-difference-9cded6b48a25?source=rss-f97274d24f35------2</link>
            <guid isPermaLink="false">https://medium.com/p/9cded6b48a25</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[keras]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[operating-systems]]></category>
            <dc:creator><![CDATA[Sai Charan]]></dc:creator>
            <pubDate>Sat, 22 Nov 2025 05:48:57 GMT</pubDate>
            <atom:updated>2025-11-25T11:46:28.010Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*_b6FnAtSeUYr4jPe5XLi9w.jpeg" /></figure><p>Most people use computers every day without thinking about what’s happening behind the scenes. Two terms often come up in tech conversations — <strong>Operating System</strong> and <strong>Kernel</strong>. They sound similar, but they’re not the same. Here’s a simple, human-friendly explanation.</p><h3>What Is a Kernel?</h3><p>Think of the <strong>kernel</strong> as the <em>brain</em> of your computer.<br> It is the <strong>core component</strong> of any operating system. The kernel sits right between your hardware and your applications.</p><p>It handles things like:</p><ul><li>Managing memory</li><li>Communicating with hardware</li><li>Scheduling CPU tasks</li><li>Handling processes</li><li>Applying permissions and security</li></ul><p>The kernel works silently in the background and is essential for everything to function. Without a kernel, your system simply <strong>won’t boot</strong>.</p><p>Examples of kernels:</p><ul><li>Linux kernel</li><li>Windows NT kernel</li><li>XNU kernel (used in macOS)</li></ul><h3>What Is an Operating System?</h3><p>The <strong>Operating System (OS)</strong> is the complete software environment that you actually use.<br> It includes the kernel, <strong>plus</strong> all the tools, interfaces, and utilities needed to interact with the machine.</p><p>An OS provides:</p><ul><li>Graphical interface (UI)</li><li>File explorers</li><li>Command-line tools</li><li>System libraries</li><li>Device drivers</li><li>Networking tools</li><li>Security components</li></ul><p>In simple terms, the operating system is what you see and use every day.</p><p>Examples of operating systems:</p><ul><li>Windows 11</li><li>Ubuntu</li><li>macOS</li><li>Android</li></ul><h3>The Best Analogy: Car and Engine</h3><p>This is the easiest way to understand it:</p><ul><li><strong>Kernel = Engine of the car</strong></li><li><strong>Operating System = Entire car</strong></li></ul><p>The engine is the most critical part, but you can’t drive with an engine alone.<br> Similarly, the kernel is the core of the OS, but the operating system includes everything else that makes the computer usable.</p><h3>Differences Between Kernel and Operating System</h3><ul><li><strong>The kernel is the core component</strong>, while the <strong>operating system is the complete system</strong> that users interact with.</li><li><strong>The kernel manages hardware</strong>, but the <strong>operating system provides the full user experience</strong>, including tools, UI, and applications.</li><li><strong>The kernel works silently in the background</strong>, whereas the <strong>operating system interacts directly with users</strong>.</li><li><strong>A kernel cannot function alone</strong> — it needs supporting components.<br> The <strong>operating system is a complete, usable system</strong> on its own.</li><li><strong>Linux kernel</strong> is an example of a kernel, while <strong>Ubuntu OS</strong> is an example of a full operating system.</li></ul><h3>Final Thoughts</h3><p>The kernel is the low-level component that powers everything, while the operating system is the full package that lets you work, browse, code, and interact with your computer. Understanding this difference helps you appreciate how deeply interconnected your system really is.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9cded6b48a25" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/operating-system-vs-kernel-whats-the-real-difference-9cded6b48a25">Operating System vs Kernel: What’s the Real Difference?</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Provisioning a Google Compute Engine Instance Using Terraform]]></title>
            <link>https://blog.devops.dev/provisioning-a-google-compute-engine-instance-using-terraform-3bcd8cbb581e?source=rss-f97274d24f35------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bcd8cbb581e</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <dc:creator><![CDATA[Sai Charan]]></dc:creator>
            <pubDate>Fri, 16 May 2025 14:14:20 GMT</pubDate>
            <atom:updated>2025-05-17T10:21:23.778Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re working with Google Cloud Platform (GCP) and looking to automate infrastructure provisioning, Terraform is your best friend. In this post, I’ll show you how to set up a basic <strong>GCE (Google Compute Engine)</strong> instance using Terraform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Ymt2tXFdxcVRsumYvXjEw.png" /></figure><h3>Project Structure</h3><p>Let’s keep things modular and clean. Here’s the structure of the Terraform files used.</p><pre>.<br>├── provider.tf<br>├── terraform.tfvars<br>└── variables.tf</pre><h3>Step 1: Configure Your Provider (provider.tf)</h3><p>This file defines your provider (Google Cloud) and sets up the compute instance.</p><pre>provider &quot;google&quot; {<br>  region  = &quot;us-central1&quot;<br>  project = var.projectid<br>}<br><br>resource &quot;google_compute_instance&quot; &quot;default&quot; {<br>  name         = &quot;newb&quot;<br>  machine_type = var.machinetype<br>  zone         = &quot;us-central1-a&quot;<br><br>  tags = [&quot;foo&quot;, &quot;bar&quot;]<br><br>  boot_disk {<br>    initialize_params {<br>      image = var.img<br>    }<br>  }<br><br>  network_interface {<br>    network = &quot;default&quot;<br><br>    access_config {<br>      # Ephemeral public IP<br>    }<br>  }<br>}</pre><h3>Step 2: Declare Your Variables (variables.tf)</h3><p>Using variables makes your code reusable and clean. Here’s how you define them</p><pre>variable &quot;machinetype&quot; {<br>  type        = string<br>  description = &quot;Machine type for the compute instance&quot;<br>}<br><br>variable &quot;img&quot; {<br>  type        = string<br>  description = &quot;Image name for the boot disk&quot;<br>}<br><br>variable &quot;projectid&quot; {<br>  type        = string<br>  description = &quot;Google Cloud project ID&quot;<br>}</pre><h3>Step 3: Provide Your Inputs (terraform.tfvars)</h3><p>This is where you provide real values for your declared variables</p><pre>projectid    = &quot;your-gcp-project-id&quot;<br>machinetype  = &quot;your machinetype&quot;<br>img          = &quot;your img&quot;</pre><p>Replace &quot;your-gcp-project-id&quot; with your actual project ID from Google Cloud.</p><h3>Step 4: Initialize and Apply</h3><p>Open your terminal and run the following commands</p><pre>terraform init<br>terraform plan<br>terraform apply</pre><p>Confirm when prompted, and Terraform will provision your instance!</p><h3>Final Thoughts</h3><p>Terraform lets you manage infrastructure as code, which is essential for repeatability and automation. This setup is a great starting point. You can build on it by adding firewall rules, external IPs, startup scripts, and more.</p><p>Let me know in the comments if you’d like me to write a follow-up with advanced GCP Terraform use cases!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bcd8cbb581e" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/provisioning-a-google-compute-engine-instance-using-terraform-3bcd8cbb581e">Provisioning a Google Compute Engine Instance Using Terraform</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud and DevOps: More Than Just Tools — A Mindset Shift]]></title>
            <link>https://ssaicharanclan.medium.com/cloud-and-devops-more-than-just-tools-a-mindset-shift-77d781f8227f?source=rss-f97274d24f35------2</link>
            <guid isPermaLink="false">https://medium.com/p/77d781f8227f</guid>
            <category><![CDATA[mindset-shift]]></category>
            <category><![CDATA[engineering-culture]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[tech-reflections]]></category>
            <dc:creator><![CDATA[Sai Charan]]></dc:creator>
            <pubDate>Thu, 01 May 2025 15:08:55 GMT</pubDate>
            <atom:updated>2025-05-01T15:08:55.313Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Cloud and DevOps: More Than Just Tools — A Mindset Shift</strong></p><p>Lately, I’ve been reflecting on how Cloud and DevOps aren’t just technologies. They represent a shift in how we think, collaborate, and build.</p><p>Cloud gave us speed — the power to experiment, iterate, and scale without hesitation. DevOps reminded us that collaboration isn’t optional; it’s essential. Automation, monitoring, CI/CD pipelines — they all drive toward one outcome: breaking silos and delivering value faster.</p><p>But beyond the tools and frameworks lies something deeper — a new mindset</p><ul><li>Automate where you can.</li><li>Collaborate like you’re one team.</li><li>Focus on outcomes, not just outputs.</li></ul><p>The journey isn’t always easy. Each project brings new challenges. But that’s the beauty of Cloud and DevOps — <strong>continuous learning isn’t a bonus; it’s a core feature.</strong></p><p>Here’s to embracing change, building better systems, and staying endlessly curious.</p><p>The future belongs to the builders. 🚀</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*YQ-30tMP_Pcx7tGEcHoNOQ.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77d781f8227f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating Google Cloud Resources with Deployment Manager: A Step Towards Simplified Infrastructure…]]></title>
            <link>https://blog.devops.dev/automating-google-cloud-resources-with-deployment-manager-a-step-towards-simplified-infrastructure-ef577ca1af7a?source=rss-f97274d24f35------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef577ca1af7a</guid>
            <category><![CDATA[cloud-deployment-manager]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[gcp]]></category>
            <dc:creator><![CDATA[Sai Charan]]></dc:creator>
            <pubDate>Thu, 01 May 2025 15:02:47 GMT</pubDate>
            <atom:updated>2025-05-02T15:56:43.024Z</atom:updated>
            <content:encoded><![CDATA[<h3>Automating Google Cloud Resources with Deployment Manager: A Step Towards Simplified Infrastructure Management</h3><p>In this article, we’ll walk through deploying two essential Google Cloud resources: a virtual machine (VM) and a storage bucket using <strong>Google Cloud Deployment Manager</strong>. The power of Infrastructure as Code (IaC) lies in its ability to automate and manage cloud resources efficiently, which is exactly what we’ll accomplish here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I_AH5ufm0OU0mimqiS_F7A.png" /></figure><h3>Introduction</h3><p>Google Cloud Deployment Manager is a service that allows users to create, configure, and manage Google Cloud resources using templates. This approach reduces manual effort, increases consistency, and ensures that infrastructure is scalable and reproducible.</p><p>However, it’s important to note that <strong>Cloud Deployment Manager will reach end of support on December 31, 2025</strong>. If you are currently using Deployment Manager, it is recommended to migrate to <strong>Infrastructure Manager</strong> or another deployment technology to ensure your services continue without disruption.</p><h3>Resource 1: Virtual Machine (vm1)</h3><p>This section configures a basic virtual machine instance in the us-central1-a zone. The machine type is set to e2-micro, which is a cost-effective option for light workloads. Additionally, a persistent disk is attached, with Debian 11 set as the operating system image.</p><pre>resources:<br>- name: vm1<br>  type: compute.v1.instance<br>  properties:<br>    zone: us-central1-a<br>    machineType: zones/us-central1-a/machineTypes/e2-micro<br>    disks:<br>    - deviceName: boot<br>      type: PERSISTENT<br>      boot: true<br>      autoDelete: true<br>      initializeParams:<br>        sourceImage: projects/debian-cloud/global/images/family/debian-11<br>    networkInterfaces:<br>    - network: global/networks/default<br>      accessConfigs:<br>      - name: External NAT<br>        type: ONE_TO_ONE_NAT</pre><h3>Key Points</h3><ul><li><strong>Zone:</strong> us-central1-a</li><li><strong>Machine Type:</strong> e2-micro</li><li><strong>Disk Type:</strong> Persistent</li><li><strong>Operating System Image:</strong> Debian 11</li></ul><h3>Resource 2: Cloud Storage Bucket (my-storage-bucket)</h3><p>The second resource is a Cloud Storage bucket. This bucket is set up with a <strong>Standard storage class</strong> and <strong>public read access</strong> for all users, making it ideal for serving static content or sharing files publicly.</p><pre>resources:<br>- name: my-storage-bucket<br>  type: storage.v1.bucket<br>  properties:<br>    location: US<br>    storageClass: STANDARD<br>    accessControl:<br>      - role: READER<br>        entity: allUsers</pre><h3>Key Points:</h3><ul><li><strong>Location:</strong> US</li><li><strong>Storage Class:</strong> Standard</li><li><strong>Access Control:</strong> Public read access for all users</li></ul><h3>How It Works:</h3><p>The configuration above consists of two main parts:</p><ol><li><strong>Virtual Machine (</strong><strong>vm1)</strong>: This VM is configured with a persistent disk, Debian 11 image, and an external IP.</li><li><strong>Storage Bucket (</strong><strong>my-storage-bucket)</strong>: This is a basic Cloud Storage bucket that has public read access, making it suitable for publicly accessible files.</li></ol><h3>Usage Steps</h3><h3>1. Create a Project and Set Up Google Cloud SDK</h3><ul><li>First, create a new project in the Google Cloud Console</li></ul><ol><li>Open the Google Cloud Console.</li><li>Click on <strong>Select a Project</strong> at the top of the page and then <strong>Create Project</strong>.</li><li>Name the project and set up the billing account if required.</li></ol><ul><li>Set your project ID in the terminal</li></ul><pre>gcloud config set project YOUR_PROJECT_ID</pre><h3>2. Create the Configuration File</h3><ul><li>Open your terminal and create a new file to define your resources</li></ul><pre>nano deployment.yaml</pre><ul><li>Paste your YAML configuration for the VM and Storage Bucket into the file and save it.</li></ul><h3>3. Deploy the Resources</h3><ul><li>Use the following command to deploy the resources defined in your deployment.yaml file</li></ul><pre>gcloud deployment-manager deployments create my-deployment --config deployment.yaml</pre><h3>4. Deleting Resources</h3><ul><li>If you need to delete the deployment and its resources, use</li></ul><pre>gcloud deployment-manager deployments delete my-deployment</pre><h3>Conclusion:</h3><p>This approach to deploying Google Cloud resources using YAML templates with <strong>Google Cloud Deployment Manager</strong> simplifies cloud infrastructure management. It allows DevOps teams to automate deployments, saving time and reducing the chance of errors. However, with the upcoming deprecation of Deployment Manager, consider migrating to <strong>Infrastructure Manager</strong> or other modern deployment tools by <strong>December 31, 2025</strong>, to ensure continued support and seamless operation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef577ca1af7a" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/automating-google-cloud-resources-with-deployment-manager-a-step-towards-simplified-infrastructure-ef577ca1af7a">Automating Google Cloud Resources with Deployment Manager: A Step Towards Simplified Infrastructure…</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating Continuous Integration and Delivery for Java Applications in a Cloud-Native Environment]]></title>
            <link>https://blog.devops.dev/automating-continuous-integration-and-delivery-for-java-applications-in-a-cloud-native-environment-98f4d8179ceb?source=rss-f97274d24f35------2</link>
            <guid isPermaLink="false">https://medium.com/p/98f4d8179ceb</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[containerization]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[sonarqube]]></category>
            <category><![CDATA[argo-cd]]></category>
            <dc:creator><![CDATA[Sai Charan]]></dc:creator>
            <pubDate>Sun, 27 Apr 2025 16:04:21 GMT</pubDate>
            <atom:updated>2025-05-01T17:42:50.063Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Introduction</strong></h3><p>In today’s DevOps-driven world, automation is key to achieving fast and reliable software deployments. This project aims to automate the CI/CD process for a Java application using a combination of Jenkins, Maven, Trivy, SonarQube, Docker, Docker Hub, Kubernetes (EKS), and ArgoCD.</p><p>The goal of this CI/CD pipeline is to streamline the process of building, testing, and deploying applications. In this post, we’ll take a deep dive into how to set up an end-to-end Jenkins pipeline to achieve this automation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*H9UkDJDwk1nRukCjCUT8hg.png" /></figure><h3>1. Continuous Integration (CI)</h3><p>Automate the process of code integration, ensuring that new code changes are seamlessly merged with the existing codebase.<br>Perform automated code quality checks and static analysis using SonarQube.</p><h3>2. Continuous Deployment (CD)</h3><p>Automate the deployment of applications to a Kubernetes cluster.<br>Utilize Docker for creating and managing containerized applications, facilitating consistent deployment environments across different stages (development, testing,and production).<br>Implement a streamlined workflow for updating deployment configurations and pushing them to a Git repository for version control.</p><h3><strong>Objective</strong></h3><p>The primary objective of this project is to establish a robust CI/CD pipeline that automates the entire process of building, testing, and deploying a Java application. It integrates various DevOps tools including Jenkins, Maven, SonarQube, Docker, Docker Hub, ArgoCD, and Kubernetes (EKS).</p><h3><strong>Project Summary</strong></h3><p>This end-to-end Jenkins pipeline automates the CI/CD process, from code checkout to production deployment, using the following tools:</p><ul><li><strong>Git</strong> for version control.</li><li><strong>Jenkins</strong> for automation.</li><li><strong>Maven</strong> for building Java applications.</li><li><strong>SonarQube</strong> for code quality analysis.</li><li><strong>Docker</strong> for containerization.</li><li><strong>Trivy</strong> is a security scanner for Docker images, identifying vulnerabilities and misconfigurations.</li><li><strong>Docker Hub</strong> for image storage.</li><li><strong>ArgoCD</strong> for continuous delivery and deployment to Kubernetes.</li><li><strong>Kubernetes (EKS)</strong> for orchestrating the application deployment.</li></ul><h3><strong>Pre-requisites</strong></h3><p>Before diving into the setup, make sure you have the following</p><ol><li><strong>Java Application Code</strong> hosted on a GitHub repository.</li><li><strong>Server Requirements</strong>:</li></ol><ul><li>A Linux server for Jenkins, Docker, and SonarQube setup (recommended instance type: t2.large).</li><li>An EKS Cluster for container deployment.</li></ul><h3><strong>Software Requirements</strong></h3><ul><li><strong>Jenkins</strong></li><li><strong>Docker</strong></li><li><strong>Maven</strong></li><li><strong>SonarQube</strong></li><li><strong>Trivy</strong></li><li><strong>Kubernetes CLI (</strong><strong>kubectl)</strong> and <strong>eksctl</strong> for managing EKS clusters.</li><li><strong>EKS Kubernetes cluster</strong>.</li><li><strong>ArgoCD</strong> for deployment</li></ul><p><strong>Step-by-Step Setup</strong></p><h3>1. Installing and Configuring Jenkins</h3><ul><li>Set up Jenkins on your Linux server.</li></ul><pre># JAVA INSTALLATION<br>sudo apt update<br>sudo apt install default-jdk -y<br>java -version<br><br># JENKINS INSTALLATION<br><br>sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \<br>  https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key<br>echo &quot;deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]&quot; \<br>  https://pkg.jenkins.io/debian-stable binary/ | sudo tee \<br>  /etc/apt/sources.list.d/jenkins.list &gt; /dev/null<br>sudo apt-get update<br>sudo apt-get install jenkins</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E1wzjUvy0iyc6mixa7Xn6w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3k8wrEa3_t4P_T1sFb4xsQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wPeq57WUapy2o-WraIdhUQ.png" /></figure><ul><li>Install necessary plugins (Maven, Docker, SonarQube, etc.).<br><strong>1. Go to Jenkins Dashboard &gt; Manage Jenkins &gt; Manage Plugins &gt; Available.<br>2. Search for “Docker” and install the Docker plugin, Maven, SonarQube.</strong></li><li>Set up Jenkins credentials for Docker, GitHub, and other services.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xrknOkpRmRfycUfPzCWqyw.png" /></figure><h3>2. Setting Up Docker and Configuring Jenkins</h3><ul><li>Install Docker and configure Jenkins to use Docker.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cYQGS7aigfxMzaZ2sc34SA.png" /></figure><ul><li>Ensure Jenkins has the necessary permissions to run Docker commands.</li></ul><pre>sudo usermod -aG docker $USER<br>sudo systemctl restart docker</pre><h3>3. Configuring AWS CLI and Installing Kubernetes CLI</h3><ul><li>Install and configure <strong>AWS CLI</strong>.</li></ul><pre>sudo apt update<br>sudo apt install unzip<br>curl &quot;https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip&quot; -o &quot;awscliv2.zip&quot;<br>unzip awscliv2.zip<br>sudo ./aws/install</pre><ul><li>Install <strong>kubectl</strong> and <strong>eksctl</strong> for managing the EKS cluster.</li></ul><pre># Steps to Install kubectl on Ubuntu<br> curl -LO &quot;https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl&quot;<br> chmod +x ./kubectl<br> sudo mv ./kubectl /usr/local/bin/kubectl<br> kubectl version --client<br><br>#Steps to Install Eksctl on Ubuntu<br> curl --silent --location &quot;https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz&quot; | tar xz -C /tmp<br> sudo mv /tmp/eksctl /usr/local/bin<br> eksctl version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4QIRrDjvAkIvJU6-asbRnQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-cI6oLDmhL7v3sjgindDrA.png" /></figure><h3>4. Install Trivy for Scanning Docker Images</h3><p><strong>Trivy</strong> is a simple and easy-to-use vulnerability scanner for containers, which can scan Docker images for vulnerabilities. It’s a great tool for integrating into your CI/CD pipeline to ensure that the images you’re deploying to Kubernetes are secure.</p><h4>Install Trivy on the Jenkins Agent (or your server)</h4><p>To install <strong>Trivy</strong>, follow the steps based on your operating system.</p><p><strong>For Linux (Ubuntu/Debian)</strong></p><pre>sudo apt-get install wget apt-transport-https gnupg lsb-release<br>wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -<br>echo deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list.d/trivy.list<br>sudo apt-get update<br>sudo apt-get install trivy</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GN9FjUxLAt_smCoNpLB7Ow.png" /></figure><h3>5. Creating the EKS Cluster</h3><ul><li>Create an EKS cluster using <strong>eksctl</strong>.</li></ul><pre>eksctl create cluster --name newappcluster --nodegroup-name mcng --node-type t3.micro --nodes 8 --managed</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eS095bTR1MArH7dUXWaprw.png" /></figure><h3>6. Install and configure Sonarqube as a Docker container</h3><p><a href="https://awstip.com/how-to-install-sonarqube-on-aws-ec2-using-docker-7b9bbeb9d6be">How to Install SonarQube on AWS EC2 Using Docker</a></p><ol><li>Check if the SonarQube container is running:<br>docker ps</li><li>Access the SonarQube web interface:<br>Open a web browser and go to http://&lt;your-server-ip&gt;:9000<br>The default login credentials are<br><strong>Username: admin<br>Password: admin</strong></li><li>Log in to SonarQube using the default credentials.<br>Change the default password</li><li>Create Sonar token for Jenkins:<br>Sonar Dashboard -&gt; Administration -&gt; MyAccount -&gt; Security -&gt; Create token</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t5IPB2K6T2mu2n6Refee3Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wtg7szgMUzpm5b9yy6RyNw.png" /></figure><h3>7. Generate GitHub Token</h3><p><strong>Generate a GitHub token for Jenkins to access your GIT repositories</strong><br>1. Go to GitHub &gt; Settings &gt; Developer settings &gt; Personal access tokens.<br>2. Generate a new token with the necessary scopes (e.g., repo, admin:repo_hook).</p><h3>8. Create Jenkinsfile for CI/CD Pipeline</h3><p>Create a Jenkinsfile in your repository to define the CI/CD pipeline</p><pre>pipeline {<br>    agent any<br><br><br>       tools {<br>        maven &#39;maven3&#39;<br>    }<br><br>    stages {<br>      stage(&#39;checkout&#39;) {<br>            steps {<br>                echo &#39;Cloning GIT HUB Repo &#39;<br>    git branch: &#39;main&#39;, url: &#39;https://github.com/saicharan-clan/mindcircuit13.git&#39;<br>            }  <br>        }<br>  <br>  <br>  <br>  stage(&#39;sonar&#39;) {<br>            steps {<br>                echo &#39;scanning project&#39;<br>                sh &#39;ls -ltr&#39;<br>                <br>                sh &#39;&#39;&#39; mvn sonar:sonar \\<br>                      -Dsonar.host.url=http://34.234.85.235:9000 \\<br>                      -Dsonar.login=sqa_8ed53399afa6a217c640a514303f61ba762fc029&#39;&#39;&#39;<br>            }<br>     }<br>  <br>  <br>  <br>        stage(&#39;Build Artifact&#39;) {<br>            steps {<br>                echo &#39;Build Artifact&#39;<br>    sh &#39;mvn clean package&#39;<br>            }<br>        }<br>  <br>  <br>  <br>        stage(&#39;Docker Image&#39;) {<br>            steps {<br>                echo &#39;Docker Image building&#39;<br>    sh &#39;docker build -t saicharan09/batch13:${BUILD_NUMBER} .&#39;<br>            }<br>        }<br>        <br>        stage(&#39;Scanning Container Image&#39;) {<br>            steps {<br>                echo &quot;Scanning Docker image with Trivy&quot;<br>                sh &quot;trivy image --format table saicharan09/batch13:${BUILD_NUMBER}&quot;<br>            }<br>        }<br>  <br>  <br>       stage(&#39;Push to Dockerhub&#39;) {<br>            steps {<br>    script {<br>   withCredentials([string(credentialsId: &#39;dockerhub&#39;, variable: &#39;dockerhub&#39;)]) <br>   {<br>            sh &#39;docker login -u saicharan09 -p ${dockerhub}&#39;<br>   <br>    }<br>      sh &#39;docker push saicharan09/batch13:${BUILD_NUMBER}&#39;<br>      <br>           <br>    }<br>    <br>            }<br>        }<br>  <br>  <br>    stage(&#39;Update Deployment File&#39;) {<br>  <br>   environment {<br>            GIT_REPO_NAME = &quot;mindcircuit13&quot;<br>            GIT_USER_NAME = &quot;saicharan-clan&quot;<br>        }<br>  <br>            steps {<br>                echo &#39;Update Deployment File&#39;<br>    withCredentials([string(credentialsId: &#39;githubtoken&#39;, variable: &#39;githubtoken&#39;)]) <br>    {<br>                  sh &#39;&#39;&#39;<br>                    git config user.email &quot;ssaicharan612@gmail.com&quot;<br>                    git config user.name &quot;saicharan-clan&quot;<br>                    BUILD_NUMBER=${BUILD_NUMBER}<br>                    sed -i &quot;s/batch13:.*/batch13:${BUILD_NUMBER}/g&quot; deploymentfiles/deployment.yml<br>                    git add .<br>                    <br>                    git commit -m &quot;Update deployment image to version ${BUILD_NUMBER}&quot;<br><br>                    git push @github.com/${GIT_USER_NAME}/${GIT_REPO_NAME&quot;&gt;https://${githubtoken}@github.com/${GIT_USER_NAME}/${GIT_REPO_NAME} HEAD:main<br>                &#39;&#39;&#39;<br>      <br>                 }<br>    <br>            }<br>        }<br>  <br>  <br>   <br>    }<br><br>}</pre><p><strong>The output of the Trivy scan in the Jenkins pipeline will be displayed in the console log, showing the security vulnerabilities detected in the Docker image. You can also archive the results as a file for further analysis.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_KOsM1u-6jQQ4twP1Ee74w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9P5AQ7Uh5J6Vqfid8lnfRw.png" /></figure><p><strong>The output of the Jenkins pipeline will be displayed in the console log, which includes the results of each stage such as the build status, Trivy scan results, and any test or deployment logs.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p_OlvR9omiV_VCuNyJelfA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Aj7mbmxHrJFG6liuM6u42Q.png" /></figure><h3>9. Installation of argocd</h3><pre>kubectl create namespace argocd<br>kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-<br>cd/stable/manifests/install.yaml</pre><p><strong>Edit the Argo CD server service to type LoadBalancer</strong></p><pre>kubectl patch svc argocd-server -n argocd -p &#39;{&quot;spec&quot;: {&quot;type&quot;: &quot;LoadBalancer&quot;}}&#39;<br>kubectl get svc argocd-server -n argocd<br>kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath=&quot;{.data.password}&quot; |<br>base64 -d ; echo</pre><p><strong>At the end of this post, you can refer to the </strong><strong>deployment.yaml and </strong><strong>service.yaml files in my GitHub repository, where I have defined the Kubernetes resources for the application, including the deployment and service configurations.</strong></p><h3>10. ArgoCD Application Configuration</h3><p>1. Open the Argo CD UI<br>2. Access the Argo CD UI using the EXTERNAL-IP (for LoadBalancer)<br>3. Log in with the username admin and the password retrieved in the previous step.</p><h3><strong>Create and Sync an Application</strong></h3><ol><li>Once logged in, click the + New App button at the top of the Argo CD dashboard.</li><li>Fill out the application details in the “General” section:</li><li>Application Name: my-app (or your preferred name)<br>Project: default</li><li>Sync Policy: Leave as Manual for now (you can change it to Automatic later ifdesired)</li></ol><p><strong>Fill out the “Source” section</strong></p><p>1. Repository URL: Enter the URL of the Git repository containing your<br>application manifests. For example,<br><a href="https://github.com/saicharan-clan/mindcircuit13">https://github.com/saicharan-clan/mindcircuit13</a></p><p>2. Revision: Leave as HEAD or specify a branch/tag if needed.</p><p>3. Path: Enter the path within the repository where the Kubernetes manifests are located. For example, deploymentfiles.</p><p><strong>Fill out the “Destination” section</strong></p><ol><li>Cluster URL: Leave as <a href="https://kubernetes.default.svc/">https://kubernetes.default.svc</a> (this targets the current cluster).</li><li>Namespace: Specify the namespace where you want the application to be<br>deployed. For example, default.</li><li>Click the Create button at the bottom of the page.</li></ol><p><strong>Sync the Application</strong></p><ol><li>After the application is created, it will appear in the Argo CD dashboard with a status of OutOfSync.</li><li>To sync the application, click on the application name (my-app).</li><li>Click the Sync button at the top right of the application details page.</li><li>In the sync dialog, review the resources to be synchronized and click Synchronize to start the sync process.</li><li>The status will change to Healthy once the sync is complete and the application is successfully deployed.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FHhX1Yi34XMrxXXHZpG7wg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QDwPYg9ayC6vwAIFtDvsqg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YJuatGs3L3m5U1pSIhgSRQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oKCAk1SpzdatXrlC3WKmug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w3dSL2BlzQcQr-x0-hsB4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jVSTIfIWTS1EcAfH4_G1zQ.png" /></figure><p><strong>Click on </strong><strong>mc-app-service, copy the hostname URL, and prepend </strong><strong>http:// before the hostname. Paste the URL into your web browser to view the deployed application.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*49FogvJ7j7LjjiTGX0OjkA.png" /></figure><h3><strong>Conclusion</strong></h3><p>In this project, we set up an end-to-end CI/CD pipeline using Jenkins to automate the process of building, testing, and deploying a Java application. The tools integrated in this pipeline include Git, Jenkins, SonarQube, Maven, Docker, Docker Hub, Kubernetes (EKS), and ArgoCD.</p><p>This CI/CD pipeline not only speeds up the development process but also ensures that the application is continuously tested, built, and deployed to a Kubernetes cluster with minimal manual intervention.</p><h3>SOURCE CODE</h3><p><a href="https://github.com/saicharan-clan/mindcircuit13.git">GitHub - saicharan-clan/mindcircuit13: mindcircuit-batch13</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98f4d8179ceb" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/automating-continuous-integration-and-delivery-for-java-applications-in-a-cloud-native-environment-98f4d8179ceb">Automating Continuous Integration and Delivery for Java Applications in a Cloud-Native Environment</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[K8s Voting App Deployment on AWS EC2 Using Kind, Kubernetes & Argo CD]]></title>
            <link>https://blog.devops.dev/k8s-voting-app-deployment-on-aws-ec2-using-kind-kubernetes-argo-cd-8ebabfc11281?source=rss-f97274d24f35------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ebabfc11281</guid>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[gitops]]></category>
            <category><![CDATA[argo-cd]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[microservice-architecture]]></category>
            <dc:creator><![CDATA[Sai Charan]]></dc:creator>
            <pubDate>Sun, 20 Apr 2025 13:29:58 GMT</pubDate>
            <atom:updated>2025-04-22T15:32:45.321Z</atom:updated>
            <content:encoded><![CDATA[<p>A hands-on project I implemented from scratch by setting up a Kubernetes cluster on AWS EC2 using Kind, configuring Argo CD for GitOps, and deploying a full-stack Voting App with observability through Prometheus and Grafana.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t8qxQR9JqgA91kII-VSftQ.png" /></figure><p>The goal of this project was to build and manage a local Kubernetes environment using Kind (Kubernetes IN Docker) on an AWS EC2 instance. I deployed a microservices-based voting application, implemented GitOps practices using Argo CD for automated deployments, and integrated monitoring solutions to gain visibility into system performance.</p><h3>Key Outcomes</h3><ul><li>Created a <strong>multi-node Kubernetes cluster</strong> using Kind on an EC2 instance.</li><li>Installed <strong>Argo CD</strong> for GitOps-based Continuous Delivery.</li><li>Monitored cluster metrics using <strong>Prometheus</strong> and <strong>Grafana</strong>.</li><li>Deployed and managed a <strong>Voting App</strong> using Kubernetes YAML specs.</li><li>Installed and accessed the <strong>Kubernetes Dashboard</strong>.</li></ul><h3>Architecture</h3><p>The architecture includes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*U_GiO5L0qZOgNo4ybFoq1Q.png" /></figure><ul><li>A front-end web app (Python) for voting.</li><li>Redis for queuing votes.</li><li>A .NET worker for processing.</li><li>Postgres database for storage.</li><li>A results web app (Node.js)</li></ul><h3>Tech Stack</h3><ul><li><strong>AWS EC2</strong> — Host infrastructure (Ubuntu)</li><li><strong>Docker</strong> — Container runtime</li><li><strong>Kind</strong> — Kubernetes in Docker</li><li><strong>kubectl</strong> — K8s CLI</li><li><strong>Argo CD</strong> — GitOps-based deployment tool</li><li><strong>Prometheus + Grafana</strong> — Observability and monitoring</li><li><strong>Helm</strong> — Kubernetes package manager</li></ul><h3>Step-by-Step Implementation</h3><h3>1. Set Up EC2 &amp; Install Dependencies</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eJ2OCyPnyOmgJkRQ5VwMDA.png" /></figure><pre># Install Docker<br><br>sudo apt update &amp;&amp; sudo apt install docker.io -y<br>sudo usermod -aG docker $USER<br>newgrp docker</pre><h3><strong>2. </strong>Install Kind &amp; Kubectl</h3><p>We use <strong>Kind</strong> (Kubernetes IN Docker) to create a lightweight, local Kubernetes cluster ideal for testing and learning. <strong>kubectl</strong> is the command-line tool used to interact with Kubernetes clusters.</p><pre># Install Kind<br>curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64<br>chmod +x ./kind<br>sudo mv ./kind /usr/local/bin/kind<br><br># Install Kubectl<br>curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.19.6/2021-01-05/bin/linux/amd64/kubectl<br>chmod +x ./kubectl<br>sudo mv ./kubectl /usr/local/bin<br>kubectl version --short --client</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xATxYFjYdxJP6dae54ce8g.png" /></figure><p>Clone the Git Repository and Change Directories According to Specific Configurations and Installations</p><p><a href="https://github.com/LondheShubham153/k8s-kind-voting-app.git">GitHub - LondheShubham153/k8s-kind-voting-app: This is a distributed app composed of multiple containers for Docker, Compose, Swarm, and Kubernetes</a></p><h3><strong>3. </strong>Create a Kind Cluster</h3><p>Kind (Kubernetes in Docker) is a tool for running Kubernetes clusters locally using Docker containers as nodes. This step ensures that you can create and interact with a local Kubernetes cluster using kind.</p><pre># Create Kind Cluster<br>kind create cluster --config=config.yml<br>kubectl cluster-info --context kind-kind<br>kubectl get nodes</pre><h3>4. Managing Docker and Kubernetes Pods</h3><blockquote><em>This section helps verify the health and status of Docker containers and Kubernetes pods running in our cluster.</em></blockquote><pre>docker ps<br>kubectl get pods -A</pre><h3>5. Clone and Deploy the Voting App</h3><p>We use a microservices-based demo app to simulate a real-world use case. The app is cloned from GitHub and deployed to the Kubernetes cluster using predefined manifests.</p><pre>git clone https://github.com/dockersamples/example-voting-app.git<br>cd example-voting-app/<br>kubectl apply -f k8s-specifications/<br>kubectl get all</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ku3MEJeya8kriAAJSbhTKQ.png" /></figure><p><strong>To access the frontend and result dashboard locally, we use port forwarding</strong></p><pre>kubectl port-forward service/vote 5000:5000 --address=0.0.0.0 &amp;<br>kubectl port-forward service/result 5001:5001 --address=0.0.0.0 &amp;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZPVcyzpMiFMPlDz0NGOstA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o6w8weVGP7yF9TijbsN1kA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AnD-NoMiH7vmM0iFRHgSbA.png" /></figure><h3>6. Managing Files in the Example Voting App</h3><blockquote><em>Reviewing Dockerfiles and scripts helps understand the build process and how seed data is generated.</em></blockquote><pre>cd ..<br>cd seed-data/<br>ls<br>cat Dockerfile<br>cat generate-votes.sh</pre><h3>7. Installing Argo CD</h3><blockquote><em>Argo CD is used to implement </em><strong><em>GitOps</em></strong><em>, allowing us to automatically deploy Kubernetes manifests stored in a Git repository. These steps set up Argo CD and expose its web UI.</em></blockquote><pre>kubectl create namespace argocd<br>kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml<br><br># Expose Argo CD<br>kubectl patch svc argocd-server -n argocd -p &#39;{&quot;spec&quot;: {&quot;type&quot;: &quot;NodePort&quot;}}&#39;<br>kubectl port-forward -n argocd service/argocd-server 8443:443 &amp;</pre><p><strong>This step retrieves the auto-generated admin password for first-time Argo CD login.</strong></p><pre>kubectl get secret -n argocd argocd-initial-admin-secret -o jsonpath=&quot;{.data.password}&quot; | base64 -d &amp;&amp; echo</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5otuOKJfHtS-jlbBAJ_Jhw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UO7ZFOSZNcmFDA1ZUpVLlw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NyehKz7rwBKaP-AJpRgUiQ.png" /></figure><p><strong>Click on NEW APP option and Create it and name it as voting-app</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0eNkEHVq6oPj13k_PF1vuw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tDCNkSRop6i9gZJm3mF9xQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jRN4pA88JMdcMQ0kLoT5rQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GpB_664mvVeLHgf6T3aEzQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZQype2rXxOPUS4mvMxjZ4Q.png" /></figure><h3>8. Installing HELM</h3><blockquote><em>Helm is a package manager for Kubernetes that simplifies deploying complex applications like Prometheus and Grafana using pre-configured charts.</em></blockquote><pre>curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3<br>chmod 700 get_helm.sh<br>./get_helm.sh</pre><h3>9. Installing Kube Prometheus Stack</h3><blockquote><em>This Helm chart installs Prometheus, Grafana, and Alertmanager in one go. We expose their services using </em><em>NodePort to access dashboards locally.</em></blockquote><pre># Add Helm repos<br>helm repo add prometheus-community https://prometheus-community.github.io/helm-charts<br>helm repo update<br><br># Create namespace and install<br>kubectl create namespace monitoring<br>helm install kind-prometheus prometheus-community/kube-prometheus-stack \<br>  --namespace monitoring \<br>  --set prometheus.service.nodePort=30000 \<br>  --set prometheus.service.type=NodePort \<br>  --set grafana.service.nodePort=31000 \<br>  --set grafana.service.type=NodePort</pre><p><strong>To access Prometheus and Grafana dashboards locally</strong></p><pre>kubectl port-forward svc/kind-prometheus-kube-prome-prometheus -n monitoring 9090:9090 --address=0.0.0.0 &amp;<br>kubectl port-forward svc/kind-prometheus-grafana -n monitoring 31000:80 --address=0.0.0.0 &amp;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YLb6O3J_NP4SS9jwVmaxGw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*18ndNdFjrga_8jHj4Df7ig.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VyRtQ5fZvlYUjhtX6bxiLg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aQZfQipTSzG_s4s1xLcLAA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7fQNSIh2l-R4jZUsSYmdlw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kazf7uLq6XOt55tiVJ4KcA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*szgUYMoZeStkkErthrluvw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SVow4MUdQNJB3PfS6VMvzA.png" /></figure><h3>10. Running Prometheus Queries</h3><blockquote><em>These sample Prometheus queries help in analyzing CPU usage, memory consumption, and network traffic at the pod level.</em></blockquote><pre># CPU usage<br>sum (rate (container_cpu_usage_seconds_total{namespace=&quot;default&quot;}[1m])) / sum (machine_cpu_cores) * 100<br><br># Memory usage<br>sum (container_memory_usage_bytes{namespace=&quot;default&quot;}) by (pod)<br><br># Network I/O<br>sum(rate(container_network_receive_bytes_total{namespace=&quot;default&quot;}[5m])) by (pod)<br>sum(rate(container_network_transmit_bytes_total{namespace=&quot;default&quot;}[5m])) by (pod)</pre><h3>Conclusion</h3><p>In this project, we successfully set up a complete local Kubernetes environment using KIND (Kubernetes IN Docker), deployed a microservices-based application, and integrated GitOps and monitoring tools such as Argo CD, Prometheus, and Grafana.</p><p>Through this hands-on implementation, we achieved the following outcomes</p><ul><li>Built and managed a multi-node Kubernetes cluster locally using KIND</li><li>Deployed and exposed a production-style voting application using Kubernetes manifests</li><li>Implemented GitOps practices using Argo CD to manage and automate Kubernetes deployments</li><li>Set up monitoring and alerting using Helm charts for the Kube Prometheus Stack</li><li>Gained real-time visibility into cluster metrics and pod-level resource usage via Prometheus and Grafana dashboards</li></ul><p>This project not only provided practical exposure to container orchestration and microservices management but also demonstrated how modern DevOps tools can streamline application delivery, monitoring, and infrastructure-as-code practices in a Kubernetes ecosystem.</p><p><strong>SOURCE CODE :</strong></p><p><a href="https://github.com/LondheShubham153/k8s-kind-voting-app.git">GitHub - LondheShubham153/k8s-kind-voting-app: This is a distributed app composed of multiple containers for Docker, Compose, Swarm, and Kubernetes</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ebabfc11281" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/k8s-voting-app-deployment-on-aws-ec2-using-kind-kubernetes-argo-cd-8ebabfc11281">K8s Voting App Deployment on AWS EC2 Using Kind, Kubernetes &amp; Argo CD</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>