<?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 Sanjana Rampur Kottur on Medium]]></title>
        <description><![CDATA[Stories by Sanjana Rampur Kottur on Medium]]></description>
        <link>https://medium.com/@sanjanarampurkottur01?source=rss-b7665924993d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*v5mF-oeVf3JsAOt_nujzRw.jpeg</url>
            <title>Stories by Sanjana Rampur Kottur on Medium</title>
            <link>https://medium.com/@sanjanarampurkottur01?source=rss-b7665924993d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 10:08:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sanjanarampurkottur01/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[A Simple Pizza Story]]></title>
            <link>https://medium.com/@sanjanarampurkottur01/a-simple-pizzastory-adb9b8a6b8f4?source=rss-b7665924993d------2</link>
            <guid isPermaLink="false">https://medium.com/p/adb9b8a6b8f4</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[site-reliability-engineer]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Sanjana Rampur Kottur]]></dc:creator>
            <pubDate>Tue, 22 Jul 2025 00:31:11 GMT</pubDate>
            <atom:updated>2025-07-22T00:31:51.822Z</atom:updated>
            <content:encoded><![CDATA[<h3>What Happens When You Run kubectl apply -f deployment.yaml?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qOggR9C0rR8qIVfaI_-h6g.jpeg" /></figure><p>Imagine you’re the manager of a pizza chain 🍕</p><p>You write down a note for your team:<br>“<em>Please open 3 pizza shops. Each shop should serve the same menu, stay open all the time, and run smoothly”.</em></p><p>This note is your deployment.yaml file — it describes <strong>what you want</strong>, not how to do it.<br>Then, you hand this note directly to your team by running:</p><pre>kubectl apply -f deployment.yaml</pre><h3>Here’s what happens next:</h3><h4><strong>1. The Team Reads the Plan </strong>🧾</h4><p>Your team (Kubernetes) reads your instructions and takes it to the <strong>head office</strong> — the Kubernetes <strong>API server</strong> to register and approve the request.<br>You can even specify <strong>where</strong> the pizza shops go — using <strong>namespaces</strong>, like cities.<br>That way, shops for different regions (like toronto, vancouver, or test-environment) are kept organized and separate.</p><pre>kubectl apply -f deployment.yaml -n toronto</pre><p>This tells Kubernetes: “Please open these shops <strong>in the city called toronto </strong>(namespace)”</p><h4>2. The Head Office Stores the Plan 🏢</h4><p>The API server checks if everything is valid and stores the plan safely in the system (called <strong>etcd</strong>, like a digital notebook of all instructions).<br>Example command to see what’s stored:</p><pre>kubectl get deployments</pre><p>Or for a specific namespace:</p><pre>kubectl get deployments -n toronto</pre><h4>3. The Work Begins 🛠️</h4><p>The <strong>Deployment Controller</strong> (your project manager) sees your plan and says:<br><strong><em>Alright team, you know the drill, let’s spin up those pizza shops!<br></em></strong>They assign tasks to workers (ReplicaSets), who then open 3 pizza shops (Pods) using your kitchen setup (container image like nginx:latest).</p><p>🍽️ Example snippet from deployment.yaml:</p><pre>spec:<br> replicas: 3<br> template:<br>   spec:<br>     containers:<br>     — name: pizza-shop<br>       image: nginx:latest</pre><p>👀 You can check if the shops are up and running:</p><pre>kubectl get pods</pre><p>Or get more detailed info:</p><pre>kubectl describe deployment pizza-shop</pre><h4>4. The Team Keeps Everything Running 🏃‍♀️</h4><p>If a shop shuts down unexpectedly?<br>No worries — Kubernetes sees that it’s missing and opens a new one automatically.<br>If you want to change the recipe or decor, just update your YAML and re-apply it:</p><pre>kubectl apply -f deployment.yaml</pre><p>Kubernetes updates the shops <strong>one at a time</strong> without downtime (that’s a rolling update).<br><strong>Rolling Update?</strong> Kubernetes doesn’t shut down all shops at once it updates them <strong>one by one</strong>, so customers aren’t affected. It’s like renovating while keeping the business running.</p><p>Want to see the update rollout in progress?</p><pre>kubectl rollout status deployment pizza-shop</pre><p>Need to undo a bad update?</p><pre>kubectl rollout undo deployment pizza-shop</pre><p>What If the Note Has a Mistake? <br>❗If your note (deployment.yaml) has <strong>mistakes</strong> — like a missing field or an invalid format — Kubernetes will <strong>flag it immediately</strong>.<br>It won’t pass the plan to the team until the errors are fixed, so nothing breaks later.</p><p>⚠️ Try this to validate your YAML file before applying:</p><pre>kubectl apply — dry-run=client -f deployment.yaml</pre><p>Think of it as a <strong>safety check</strong> to make sure you don’t send the team out with the wrong ingredients or incomplete instructions.</p><p>🧼 Clean Up the Pizza Shops<br>Want to close the shops and clean up your deployment?</p><pre>kubectl delete -f deployment.yaml</pre><p>Or delete by name:</p><pre>kubectl delete deployment pizza-shop</pre><h3>In Simple Words:</h3><p>Running kubectl apply -f deployment.yaml is like setting your plans in motion.</p><p>🔹 You <strong>define what you want</strong> — your desired state<br> 🔹 Kubernetes <strong>builds it for you</strong> — setting up deployments, pods, and more<br> 🔹 And it <strong>keeps everything running</strong> — automatically fixing issues and staying aligned with your instructions.</p><p>kubectl apply is used in Kubernetes to create or update resources based on configuration files (usually in YAML or JSON format). It&#39;s a <strong>declarative approach</strong>, meaning you define the desired state of your resources, and kubectl figures out how to make the current state match it. If a resource doesn’t exist, it will be created. If it does exist, it will be updated.</p><p>🎉 <strong>Yay, we’ve arrived at the end of our Kubernetes pizza story!<br></strong>By now, you’ve set up your pizza shops (Pods), grouped them into a Deployment, and rolled out updates without closing shop — smooth, right?</p><p>But wait — you might still be wondering:<br><strong>What is that mysterious </strong><strong>-f in </strong><strong>kubectl apply -f deployment.yaml?</strong> 🤔</p><p>Let’s break it down:<br><strong>-f stands for &quot;file&quot;</strong> — it tells kubectl to apply the configuration <strong>from a file</strong>.<br> So when you run:</p><pre>kubectl apply -f deployment.yaml</pre><p>You’re saying:<br><em>“Hey Kubernetes, here’s my full order (in this case, a YAML recipe) — go ahead and make it happen!”</em></p><p>You can even use multiple files:</p><pre><br>kubectl apply -f deployment.yaml -f service.yaml</pre><p>Or apply everything in a folder:</p><pre>kubectl apply -f ./k8s/</pre><p>It’s automation, reliability, and self-healing — all from a single command. 💡<br><em>So the next time you run </em><em>kubectl apply, just picture your well-baked pizza chain springing into action one YAML plan at a time. 🍕</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=adb9b8a6b8f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Infrastructure as Code: A Hands-On Guide to Terraform and AWS]]></title>
            <link>https://medium.com/@sanjanarampurkottur01/mastering-infrastructure-as-code-a-hands-on-guide-to-terraform-and-aws-ba65103dc5ae?source=rss-b7665924993d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba65103dc5ae</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[iac]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Sanjana Rampur Kottur]]></dc:creator>
            <pubDate>Sat, 20 Jul 2024 13:12:41 GMT</pubDate>
            <atom:updated>2024-07-20T13:12:41.951Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Infrastructure as Code (IaC)</strong></h3><p>Imagine you have a toy train set with tracks, stations, and bridges. Every time you want to play, you have to set up all the tracks and pieces by hand. This can take a lot of time. Now, imagine you have a guide with instructions that shows you exactly how to set up your train set. You just follow the map, and your train set is ready to play with in no time!</p><p>Infrastructure as Code (IaC) is like that guide map for computers and the internet. Instead of assembling a toy train set, we are setting up things like websites, applications, and online games. And instead of using physical train tracks and pieces, we use computer resources like servers, databases, and networking components.</p><p>There’s a tool called Terraform that helps us write these instructions. It’s like having a brilliant master who can read our guide map and flawlessly assemble the ideal train set for us on the internet.</p><h3><strong>Importance of IaC in modern cloud infrastructure management</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n67AsRG7-KWFxUVUWYUHbQ.png" /><figcaption>Figure 1: Benefits of Infrastructure as Code (IaC) | Created by author Sanjana Rampur Kottur using Photopea</figcaption></figure><h3>Why Is Terraform a Popular Choice for IaC?</h3><h4>Enhancing Infrastructure with Version Control, Peer Review, and Automation</h4><ul><li>By treating infrastructure as code, Terraform enables version control, peer review, and automated testing of infrastructure changes. This improves collaboration, reduces errors, and increases the reliability of infrastructure deployments.</li></ul><h4><strong>State Management</strong></h4><ul><li>Terraform maintains a state file to track the current state of the infrastructure. This allows it to plan and apply changes incrementally, ensuring that only necessary updates are made, and providing a clear and predictable execution plan.</li></ul><h4><strong>Multi-Cloud Support</strong></h4><ul><li>Terraform’s provider ecosystem allows it to manage infrastructure across multiple cloud platforms and services. This multi-cloud capability is a key reason for its popularity, enabling organizations to adopt a cloud-agnostic approach.</li></ul><h4><strong>Declarative Configuration</strong></h4><ul><li>Terraform uses a declarative language (HCL — HashiCorp Configuration Language) to define the desired state of infrastructure. Users specify <em>what</em> they want, and Terraform handles <em>how</em> to achieve that state, making it easier to manage and understand infrastructure changes.</li></ul><h4><strong>Community and Ecosystem</strong></h4><ul><li>Terraform has a large and active community, which contributes to a rich ecosystem of modules, providers, and tools. This extensive support network accelerates development and troubleshooting, by providing a wealth of resources for learning and best practices.</li></ul><h3>Fundamentals of Terraform: Key Concepts Explained</h3><h4><strong>Providers</strong></h4><ul><li>Providers are plugins in Terraform that interact with APIs of various cloud services and platforms. They tell Terraform how to manage and create resources on these platforms.</li></ul><h4><strong>Resources</strong></h4><ul><li>Resources are the most important part of the Terraform configuration. They represent the infrastructure objects, like virtual machines, databases, or networks, that you want to create and manage.</li></ul><h4><strong>Variables</strong></h4><ul><li>Variables allow you to make your Terraform configurations flexible and reusable. They let you define values that can change, such as usernames or machine sizes, without hardcoding them.</li></ul><h4><strong>Output Values</strong></h4><ul><li>Output values are the results that Terraform provides after running. They can show useful information, like IP addresses of created servers or database connection strings, which you might need for further operations.</li></ul><h4><strong>State Files</strong></h4><ul><li>State files keep track of the current state of your infrastructure. Terraform uses these files to know what resources exist and to plan updates accurately.</li></ul><h3>Setting Up Terraform on AWS EC2: A Step-by-Step Installation Guide</h3><h4>1. Launch an EC2 Instance</h4><p>Log in to the AWS Management Console</p><p>Navigate to the EC2 Dashboard</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iBcag92HnQyrWV-E" /><figcaption>Figure 2: Navigate to the EC2 Dashboard</figcaption></figure><p>Click “Launch Instance”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rsfmk8w9JyEmNQMnUSnsbQ.png" /><figcaption>Figure 3: Launching the EC2 instance</figcaption></figure><p>Choose an Amazon Machine Image (AMI), such as Amazon Linux 2 AMI (HVM)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*crvOsQO9vqYqVHEHTVtxqg.png" /><figcaption>Figure 4: Choosing a specific AMI</figcaption></figure><p>Select an instance type (e.g., t2.micro)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rSrnIUIABV-l50NmT7mnHA.png" /><figcaption>Figure 5: Choosing instance type</figcaption></figure><p>Configure the instance details, add storage, and configure security groups to allow SSH access (port 22)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sDszLjZbPm6lR19LV5EXcQ.png" /><figcaption>Figure 6: Configure network</figcaption></figure><p>Review and launch the instance</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5L_gTZuG8mWdn4nVMtlCbw.png" /><figcaption>Figure 7: Review and launch instance</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RXHDqZ8hGUdTkj2Vtq0Dtg.png" /><figcaption>Figure 8: Creating a key pair</figcaption></figure><h4><strong>2. Connect to Your EC2 Instance</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nBYCzkEVX1tol9pR" /><figcaption>Figure 9: Instance launched successfully</figcaption></figure><p>Once the instance is running, connect to it using SSH. You can find the instance’s public IP in the EC2 Dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cPr4HOVfck5ZxqJa" /><figcaption>Figure 10: EC2 Dashboard with available instances</figcaption></figure><h4><strong>3. Connect Using SSH</strong></h4><ul><li>Open a terminal on your local machine.</li><li>Use the ssh command with the -i flag to specify the path to your key pair file.</li><li>Use the ec2-user username for Amazon Linux instances. The command format is</li></ul><pre># SSH into an EC2 instance using a specified key pair<br><br># General syntax<br>ssh -i /path/to/your-key.pem ec2-user@your-instance-public-ip <br><br># Specific example<br>ssh -i ~/Downloads/key-sample.pem ec2-user@ec2–44–206–238–93.compute-1.amazonaws.com<br><br># Explanation:<br># ssh: Secure Shell command to securely connect to a remote server<br># -i ~/Downloads/key-sample.pem: Specifies the private key file for authentication (located in the Downloads directory)<br># ec2-user: Default username for Amazon Linux instances<br># @ec2-44-206-238-93.compute-1.amazonaws.com: Public DNS name of the EC2 instance to connect to</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tzrb2STHp4PKWUJb" /><figcaption>Figure 11: Establish a connection using SSH</figcaption></figure><h4>4. Update the Package Repository</h4><ul><li>Ensure your package repository is up to date.</li></ul><pre>sudo yum update -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dpB4dU9uPYCu2o2m" /><figcaption>Figure 12: Update the package repository</figcaption></figure><h4>5. Install Terraform</h4><ul><li>Download the latest Terraform binary.</li></ul><pre>wget https://releases.hashicorp.com/terraform/1.5.0/terraform_1.5.0_linux_amd64.zip</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7GxjI6qYhOzt6y-v" /><figcaption>Figure 13: Terraform installation</figcaption></figure><ul><li>Install unzip to extract the downloaded file.</li></ul><pre>sudo yum install unzip -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1W23Nl3mH5QxNglz" /><figcaption>Figure 14: Installing unzip to extract the downloaded file</figcaption></figure><ul><li>Unzip the Terraform binary</li></ul><pre>unzip terraform_1.5.0_linux_amd64.zip</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fhkxmaikXYgFE9jJ" /><figcaption>Figure 15: Unzip Terraform</figcaption></figure><ul><li>Move the Terraform binary to /usr/local/bin so it’s available system-wide.</li></ul><pre>sudo mv terraform /usr/local/bin/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/0*VjAghS1z5zeHa7c0" /><figcaption>Figure 16: Ensure the Terraform binary is accessible system-wide</figcaption></figure><h4>6. Verify the Installation</h4><ul><li>Check if Terraform is installed correctly by running:</li></ul><pre>terraform -v</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z2n22JoTFSwy1eC4" /><figcaption>Figure 17: Verify the Terraform installation</figcaption></figure><h4>7. Setting Up AWS CLI (if not already set up)</h4><p>If you haven’t set up the AWS CLI on your EC2 instance, you might want to do so for managing AWS resources easily.</p><h4>8. Install AWS CLI</h4><ul><li>Use the following command to install the AWS CLI</li></ul><pre>sudo yum install aws-cli -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Hifc97fNx4QY2BDJ" /><figcaption>Figure 18: Install AWS CLI</figcaption></figure><h4>9. Configure AWS CLI</h4><ul><li>Configure the AWS CLI with your credentials.</li></ul><pre>aws configure</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7g224pDOSJNHglam" /><figcaption>Figure 19: Configure AWS CLI</figcaption></figure><p>You’ll be prompted to enter your AWS Access Key ID, Secret Access Key, region, and output format.</p><h3>Conclusion</h3><p>You’ve successfully installed Terraform on your AWS EC2 instance. You can now start using Terraform to manage your AWS infrastructure.</p><h3>Image Credits</h3><h3>Icon Sources</h3><p><strong>Timeline Icon</strong></p><p>Source: <a href="https://www.flaticon.com/free-icon/timeline_4394554?term=timeline&amp;page=1&amp;position=1&amp;origin=search&amp;related_id=4394554">Flaticon</a></p><p>Author: Freepik</p><p><strong>Gears Icon</strong></p><p>Source: <a href="https://www.flaticon.com/free-icon/gears_2668009?term=gears&amp;page=1&amp;position=62&amp;origin=search&amp;related_id=2668009">Flaticon</a></p><p>Author: Uniconlabs</p><p><strong>Strength Icon</strong></p><p>Source: <a href="https://www.flaticon.com/free-icon/strength_9571322?term=strength&amp;page=1&amp;position=5&amp;origin=search&amp;related_id=9571322">Flaticon</a></p><p>Author: juicy_fish</p><p><strong>Shield Icon</strong></p><p>Source: <a href="https://www.flaticon.com/free-icon/security_1332646?term=reliability&amp;page=1&amp;position=52&amp;origin=search&amp;related_id=1332646">Flaticon</a></p><p>Author: Icongeek26</p><p><strong>Trend Icon</strong></p><p>Source: <a href="https://www.flaticon.com/free-icon/growth-graph_6947168?term=trend&amp;page=1&amp;position=31&amp;origin=search&amp;related_id=6947168">Flaticon</a></p><p>Author: Mayor Icons</p><p><strong>Puzzle Icon</strong></p><p>Source: <a href="https://www.flaticon.com/free-icon/jigsaw_993760?term=puzzle&amp;page=1&amp;position=19&amp;origin=search&amp;related_id=993760">Flaticon</a></p><p>Author: monkik</p><p><strong>Rocket Icon</strong></p><p>Source: <a href="https://www.flaticon.com/free-icon/rocket_697485?term=rocket&amp;page=1&amp;position=26&amp;origin=search&amp;related_id=697485">Flaticon</a></p><p>Author: Dreamstale</p><p><strong>Teamwork Icon</strong></p><p>Source: <a href="https://www.flaticon.com/free-icon/group_6896421?term=teamwork&amp;page=1&amp;position=28&amp;origin=search&amp;related_id=6896421">Flaticon</a></p><p>Author: Kalashnyk</p><p><strong>Background</strong></p><p>Source: <a href="https://visme.co/blog/simple-backgrounds/">Visme Backgrounds</a></p><p><strong><em>Empower Your Infrastructure with Terraform: Build, Deploy, and Scale with Confidence!<br>Thank you for embarking on this journey!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba65103dc5ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Modern Infrastructure]]></title>
            <link>https://medium.com/@sanjanarampurkottur01/modern-infrastructure-1755cabb4043?source=rss-b7665924993d------2</link>
            <guid isPermaLink="false">https://medium.com/p/1755cabb4043</guid>
            <category><![CDATA[scalability]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[hybrid-cloud]]></category>
            <category><![CDATA[migration]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Sanjana Rampur Kottur]]></dc:creator>
            <pubDate>Wed, 10 Jul 2024 21:40:48 GMT</pubDate>
            <atom:updated>2024-07-10T21:40:48.892Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*e4Z9NR3A4gvE-108GAHoig.png" /><figcaption>Image by author Sanjana Rampur Kottur (created via draw.io)</figcaption></figure><p>Imagine an excellent university campus that has all the amenities:</p><p>1. <strong>Advanced Buildings:</strong> Each classroom and building is equipped with the latest technology — smartboards, digital textbooks, and interactive learning tools. These are like the modular building blocks of modern infrastructure.</p><p>2. <strong>Automated Systems:</strong> Everywhere you look, robots and automated systems ensure everything runs smoothly. They handle tasks like scheduling classes, managing resources, and even assisting professors and students with their daily activities. This represents the automation in modern infrastructure.</p><p>3. <strong>Hybrid Learning Environments:</strong> Students can learn in different settings. Some prefer quiet private study rooms (private cloud), while others enjoy collaborative projects in open spaces (public cloud). Even outdoor classes use technology seamlessly (edge computing). This reflects the hybrid-ready approach of modern infrastructure.</p><p>4. <strong>Reliability and Speed:</strong> Whether it’s accessing online resources, submitting assignments, or communicating with professors, everything is fast and reliable. The infrastructure ensures smooth operations without interruptions, providing a seamless path from learning (development) to showcasing projects (production).</p><p>In essence, just as a futuristic university campus utilizes advanced technology, automation, and adaptable learning environments to support various teaching styles and ensure smooth operations, modern IT infrastructure does the same for businesses. It integrates diverse technologies, including cloud environments, supports automation, and provides reliable, fast solutions for development and production needs.</p><h3>Why Modern Infrastructure?</h3><p>Modern infrastructure is crucial for several reasons:</p><ol><li><strong>Efficiency:</strong> Automation and next-generation technologies streamline processes, making IT environments more efficient.</li><li><strong>Scalability:</strong> Modular building blocks allow for rapid growth and advancements, enabling businesses to adapt quickly to changing needs.</li><li><strong>Hybrid-Ready:</strong> Integration of public, private, and edge cloud environments supports various operational needs and preferences.</li><li><strong>Reliability:</strong> Ensures continuous and reliable performance, minimizing downtime and disruptions.</li><li><strong>Speed:</strong> Provides faster pathways from development to production, accelerating time-to-market for new applications and services.</li></ol><h3>Key Features of Modern Infrastructure</h3><ul><li><strong>Combination of Automation and Next-Generation Technologies:</strong> Improves rapid growth and advancements.</li><li><strong>Efficient IT Environments:</strong> Utilizes services and strategies to develop efficient IT setups.</li><li><strong>Hybrid-Ready Approach:</strong> Integrates various cloud environments — public, private, and edge.</li><li><strong>Reliability:</strong> Ensures continuous, reliable performance.</li><li><strong>Well-Devised Approach from Development to Production:</strong> Provides a seamless transition and faster pathways for deployment.</li></ul><h4>Case Studies</h4><p>The below case studies assist us in grasping the necessity of modern infrastructure.</p><h4>Case study 1</h4><p>Company X, a medium-sized tech firm, recognized the necessity of transitioning its tightly coupled legacy systems from on-premise infrastructure. Despite the challenge of compatibility with public cloud infrastructure, they understood the importance of this migration. This led them to consider a hybrid cloud model, which offers greater flexibility, enhanced security, and improved overall performance.</p><p>Hybrid cloud technology emerged from the need to integrate computing, storage, and services across different environments, combining public cloud, private cloud, and on-premises infrastructure into a unified solution. This approach provides portability for applications and workloads, enabling seamless operation across varied computing environments.</p><p>The migration process involved thorough business impact assessments, ensuring platform compatibility, meticulous data migration, adherence to compliance requirements, scalability planning, resource allocation, and continuous improvements. Despite the complexities involved, Company X realized the strategic benefits of adopting a hybrid cloud model to meet their evolving business needs.</p><h4>Case Study 2</h4><p>XYZ Inc. is a global e-commerce platform that serves millions of customers worldwide. Due to rapid growth and evolving customer demands, XYZ Inc. decided to adopt a hybrid multicloud strategy to optimize performance, ensure scalability, and enhance resilience across their digital infrastructure.</p><p>XYZ implemented a hybrid multicloud approach by combining multiple public cloud services and a private cloud environment. For instance, XYZ Inc. decided to utilize AWS for storage capabilities while leveraging Azure for AI and ML tools. Specifically, to handle sensitive data, a private cloud infrastructure was hosted in data centers. To implement automatic scaling and deployment, Kubernetes was implemented.</p><h3><strong>Conclusion</strong></h3><p>By adopting a hybrid multi-cloud approach, XYZ Inc. modernized their infrastructure and achieved greater benefits such as scalability and agility. This strategic migration helped XYZ Inc. stay competitive in the market and handle global customers to meet business challenges.</p><p>Modern infrastructure is vital for organizations to thrive in today’s fast-paced and dynamic technological environment. By incorporating advanced technologies, automation, and hybrid-ready solutions, businesses can achieve greater efficiency, scalability, and reliability.</p><p><strong><em>Empower Your Future with Modern Infrastructure: Streamline, Scale, Succeed. Thank you for reading. Now, it’s your turn to delve deeper into the world of modern infrastructure!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1755cabb4043" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enhancing Cloud Security: Best Practices for EC2, EKS, and Secrets Management]]></title>
            <link>https://medium.com/@sanjanarampurkottur01/enhancing-cloud-security-best-practices-for-ec2-eks-and-secrets-management-1d2cd9a56906?source=rss-b7665924993d------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d2cd9a56906</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[cloud-security]]></category>
            <dc:creator><![CDATA[Sanjana Rampur Kottur]]></dc:creator>
            <pubDate>Mon, 01 Jul 2024 17:21:40 GMT</pubDate>
            <atom:updated>2024-07-01T17:25:23.243Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sQZ4lZ2PgbpORAvLz2PsZA.png" /><figcaption>Image by author Sanjana Rampur Kottur (created via Photopea)</figcaption></figure><p>With the increasing adoption of cloud services, ensuring robust security practices for EC2 instances, EKS clusters, and secrets management is essential. This blog post will guide you through best practices and hands-on implementations for enhancing security in your AWS environment.</p><h3><strong>EC2 Security Best Practices</strong></h3><h4><strong>IAM Roles for EC2</strong></h4><p>IAM roles provide secure access control to your AWS resources without the need to share long-term credentials. By attaching IAM roles to your EC2 instances, you can manage permissions dynamically and securely.</p><p><strong>Creating and Attaching IAM Roles to EC2 Instances</strong></p><p><strong>Create an IAM Role:</strong></p><ul><li>Go to the AWS Management Console and navigate to IAM.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*quORY5BI7tHzHxAG" /><figcaption>Figure 1: AWS Management Console</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NcUeKicmrUFkjhHL" /><figcaption>Figure 2: IAM Dashboard</figcaption></figure><ul><li>Click on “Roles” and then “Create role.”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*djaz1KLkdDbDSL54" /><figcaption>Figure 3: Roles to be asisgned within IAM</figcaption></figure><ul><li>Select “AWS service” and choose “EC2” as the service that will use this role.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C5WSWpzonPrL-2IT_8mQ2A.png" /><figcaption>Figure 4: Use case set to EC2 for working with IAM Roles.</figcaption></figure><ul><li>Attach the necessary policies (e.g., AmazonS3ReadOnlyAccess).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KigUdV6ra-q8VpDTkC8WBQ.png" /><figcaption>Figure 5: Adding the AmazonS3ReadOnlyAccess policy to a new IAM role in the AWS Management Console.</figcaption></figure><ul><li>Name the role and create it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3T8z-s_k1TOxiUImj_HUyg.png" /><figcaption>Figure 6: Creating an IAM Role with Amazon S3 Read-Only Access in AWS.</figcaption></figure><p><strong>Attach IAM Role to EC2 Instance:</strong></p><ul><li>Navigate to the EC2 dashboard and select your instance.</li><li>Click on “Actions,” then “Security,” and select “Modify IAM Role.”</li><li>Choose the IAM role you created and apply it.</li></ul><h4><strong>Security Groups</strong></h4><p>Security groups function like digital firewalls for EC2 instances, regulating both incoming and outgoing network traffic. By configuring security groups with precise rules, you can effectively safeguard your instances against unauthorized access, enhancing overall security measures.</p><p><strong>Configuring Security Groups with Specific Rules</strong></p><p><strong>1. Create a Security Group:</strong></p><ul><li>Go to the EC2 dashboard and click on “Security Groups.”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HFAU0QVooB1mVsNXaYO_HQ.png" /><figcaption>Figure 7: Summary of EC2 Instance created</figcaption></figure><ul><li>Click “Create Security Group” and provide a name and description.</li><li>Add inbound rules (e.g., allow SSH from a specific IP address).</li><li>Add outbound rules as needed.</li><li>Save the security group.</li></ul><p><strong>2. Assign Security Group to EC2 Instance:</strong></p><ul><li>Select your EC2 instance and click on “Actions,” then “Networking,” and select “Change Security Groups.”</li><li>Attach the newly created security group to your instance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z02SDKcjBosInajx2IQG7Q.png" /><figcaption>Figure 8: Representation of Inbound and Outbound rules for Security Groups</figcaption></figure><h4><strong>SSH Key Management</strong></h4><p>SSH key management is crucial for securing remote access to your EC2 instances. Proper generation, distribution, and management of SSH keys ensure secure and controlled access.</p><p><strong>Securely Generating, Distributing, and Managing SSH Keys</strong></p><p><strong>1. Launch EC2 Instance:</strong></p><ul><li>Navigate to the AWS Management Console and launch a new EC2 instance.</li><li>During the instance launch process, under “Step 3: Configure Instance Details” or “Step 6: Configure Security Group,” select or create a new key pair in the “Key pair” section. Choose “Create a new key pair” if you don’t have one already.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Ni7zl-Blekr-GlrelkC9A.png" /><figcaption>Figure 9: Creating a key pair named “test-key” in the AWS Management Console with RSA encryption and .pem format.</figcaption></figure><p><strong>2. Download the Private Key File:</strong></p><ul><li>After selecting “Create a new key pair,” AWS will generate a new SSH key pair for you.</li><li>Click on “Download Key Pair” to save the private key file (your-key-pair-name.pem) to your local machine.</li><li>Store this private key securely. It should not be shared or exposed unnecessarily.</li></ul><p><strong>3. Set Permissions for the Private Key File:</strong></p><ul><li>Ensure that the permissions on the private key file (your-key-pair-name.pem) are set to be readable only by you:</li></ul><p>Syntax:</p><p>chmod 400 your-key-pair-name.pem</p><p>Example:</p><p>chmod 400 test-key.pem</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lkbZgIOZZFeoYdCpWhHwhQ.png" /><figcaption>Figure 10: Changing file permissions for test-key.pem to read-only</figcaption></figure><p><strong>4. Access Your EC2 Instance:</strong></p><ul><li>Use SSH to connect to your EC2 instance using the downloaded private key:</li></ul><p>Syntax:</p><p>ssh -i path/to/your-key-pair-name.pem ec2-user@your-ec2-instance-ip</p><ul><li>Replace path/to/your-key-pair-name.pem with the actual path to your private key file.</li><li>Replace ec2-user with the appropriate username for your instance&#39;s operating system (e.g., ubuntu, centos, admin, etc.).</li><li>Replace your-ec2-instance-ip with the public IP address or DNS name of your EC2 instance.</li></ul><p>Example:</p><p>ssh -i Downloads/test-key.pem ec2-user@ec2-50-17-66-121.compute-1.amazonaws.com</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qhnVZNFHFajDJ2pX9lWcJQ.png" /><figcaption>Figure 11: SSH connection to an Amazon EC2 instance using the “test-key.pem” private key, successfully establishing access to an Amazon Linux 2023 environment.</figcaption></figure><p><strong>5. Further Management:</strong></p><ul><li>If you need to add or remove SSH access, you can manage the security group associated with your EC2 instance to allow or restrict SSH traffic (port 22) as needed.</li></ul><h3><strong>EKS Security Best Practices</strong></h3><h4><strong>IAM Roles for EKS</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*quORY5BI7tHzHxAG" /><figcaption>Figure 12: AWS Management Console</figcaption></figure><p>The AWS Management Console displays services such as IAM (Identity and Access Management), IAM Identity Center, Resource Access Manager, and AWS App Mesh, along with related features like Groups, Users, Roles, Policies, and Access Analyzer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NcUeKicmrUFkjhHL" /><figcaption>Figure 13: IAM Dashboard</figcaption></figure><p>The IAM dashboard in AWS is like a security control center for your resources. It shows you who can access your stuff (users &amp; groups) and how (roles &amp; policies). Think of users as individual keys, groups as keychains, roles as temporary guest passes, and policies as the building’s access rules. This dashboard helps you keep everything organized and secure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*djaz1KLkdDbDSL54" /><figcaption>Figure 14: Roles to be asisgned within IAM</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8TMiHrPdi48suUbg" /><figcaption>Figure 15: Trusted entity types</figcaption></figure><p>Users can choose from several trusted entity types, including AWS service, AWS account, web identity, SAML 2.0 federation, and custom trust policy. The specific use case shown is for allowing an AWS service like EC2 or Lambda to perform actions, with “EKS” selected as the service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eqCNty0UzEQR7rUg" /><figcaption>Figure 16: Choosing appropriate use case</figcaption></figure><p>This image shows the AWS IAM console, where you manage access permissions for your AWS resources. Here, you’re likely selecting a predefined use case for a new IAM role. These use cases come with pre-configured permissions that grant specific access levels to AWS services. By choosing a use case, you give your role a focused purpose.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L8QXtQ1UE_pZIvJe" /><figcaption>Figure 17: Adding permissions for the role created.</figcaption></figure><p>The image shows adding permissions to an IAM role in AWS. It lets you choose which service can assume the role, like Amazon EKS, and what permissions it has. Here, Amazon EKS is being granted the AWSServiceRoleForAmazonEKS role which allows it to manage your Amazon Elastic Container Service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NSJqlXoORIRXxdju" /><figcaption>Figure 18: Setting IAM role name and description</figcaption></figure><p>The image shows creating an IAM role. Imagine it like naming and setting up a special key for your AWS services. First, give the role a clear name that reflects its purpose, like “webapp-access-role”. Next, choose exactly what AWS resources this key can access and what actions it can take. Finally, once you’re happy with the settings, click a button (likely “Create role”) to bring your new key to life. This will grant the named service the permissions you defined.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7vvrc-0e_JNVVtuZ" /><figcaption>Figure 19: Successfully creation of IAM Role</figcaption></figure><p>Amazon EKS has been set up properly. EKS needed a special key, called an IAM role, to access resources on your behalf. This IAM role, named “AWSServiceRoleForAmazonEKS”, has been created successfully. Because it’s a service-linked role, it means Amazon created it automatically for EKS to use. Now, EKS has the necessary permissions to manage your Amazon Elastic Container Service.</p><h4><strong>Network Policies</strong></h4><p>Network policies in Kubernetes control traffic between pods, enhancing security by allowing only authorized communications within the EKS cluster.</p><p><strong>Implementing Network Policies to Control Traffic</strong></p><p>1. Define a policy YAML file (e.g., network-policy.yaml)</p><pre>apiVersion: networking.k8s.io/v1<br>kind: NetworkPolicy<br>metadata:<br>  name: allow-specific-pods<br>  namespace: default<br>spec:<br>  podSelector:<br>    matchLabels:<br>      role: frontend<br>  policyTypes:<br>  - Ingress<br>  ingress:<br>  - from:<br>    - podSelector:<br>        matchLabels:<br>          role: backend</pre><p>2. Apply the Network Policy:</p><p>Use kubectl to apply the policy as shown below</p><pre>kubectl apply -f network-policy.yaml</pre><h4><strong>Kubernetes RBAC (Role-Based Access Control)</strong></h4><p>Kubernetes RBAC (Role-Based Access Control) enhances cluster security and manageability through several key features. First, it provides fine-grained access control by defining roles and role bindings, ensuring users have only the permissions they need. Secondly, it supports namespace isolation, allowing teams or applications to operate in isolated environments and reducing cross-namespace interference. Thirdly, RBAC integrates with identity providers and supports dynamic policy updates, making managing and scaling access control easier. These features make Kubernetes RBAC a robust tool for securing and managing access in complex environments.</p><p><strong>Setting Up and Managing RBAC</strong></p><p><strong>1. Create a Role:</strong></p><ul><li>Define a role YAML file (e.g., role.yaml)</li></ul><pre>apiVersion: rbac.authorization.k8s.io/v1<br>kind: Role<br>metadata:<br>  namespace: default<br>  name: admin-role<br>rules:<br>- apiGroups: [&quot;&quot;]<br>  resources: [&quot;pods&quot;]<br>  verbs: [&quot;create&quot;, &quot;delete&quot;, &quot;update&quot;, &quot;patch&quot;]<br>- apiGroups: [&quot;&quot;]<br>  resources: [&quot;services&quot;]<br>  verbs: [&quot;create&quot;, &quot;delete&quot;, &quot;update&quot;, &quot;patch&quot;]<br>- apiGroups: [&quot;apps&quot;]<br>  resources: [&quot;deployments&quot;]<br>  verbs: [&quot;create&quot;, &quot;delete&quot;, &quot;update&quot;, &quot;patch&quot;]<br>- apiGroups: [&quot;batch&quot;]<br>  resources: [&quot;jobs&quot;]<br>  verbs: [&quot;create&quot;, &quot;delete&quot;, &quot;update&quot;, &quot;patch&quot;]</pre><pre>apiVersion: rbac.authorization.k8s.io/v1<br>kind: RoleBinding<br>metadata:<br>  name: admin-rolebinding<br>  namespace: default<br>subjects:<br>- kind: User<br>  name: <br>  apiGroup: rbac.authorization.k8s.io<br>roleRef:<br>  kind: Role<br>  name: admin-role<br>  apiGroup: rbac.authorization.k8s.io</pre><p>In this example, the admin-role is bound to a user named sanjana. You can change the kind and name fields in the subjects section to bind the role to a group or service account as needed. Here’s how you can modify it for a service account:</p><pre>apiVersion: rbac.authorization.k8s.io/v1<br>kind: RoleBinding<br>metadata:<br>  name: admin-rolebinding<br>  namespace: default<br>subjects:<br>- kind: ServiceAccount<br>  name: my-service-account<br>  namespace: default<br>roleRef:<br>  kind: Role<br>  name: admin-role<br>  apiGroup: rbac.authorization.k8s.io</pre><p>This binds the admin-role to a service account named my-service-account in the default namespace.</p><p>3. Apply the Role and RoleBinding:</p><ul><li>Use kubectl to apply the role and role binding</li></ul><pre>kubectl apply -f role.yaml<br>kubectl apply -f rolebinding.yaml</pre><h3><strong>Secrets Management</strong></h3><h4><strong>AWS Secrets Manager</strong></h4><p>AWS Secrets Manager allows you to store, retrieve, and manage sensitive information securely, reducing the risk of exposing secrets.</p><p><strong>Storing and Retrieving Secrets Securely Using AWS Secrets Manager</strong></p><p><strong>1. Store a Secret:</strong></p><ul><li>Go to AWS Secrets Manager in the AWS Management Console.</li><li>Click “Store a new secret,” choose “Other type of secrets,” and enter the secret data.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YCzpqLaxCQTMyu2h" /><figcaption>Figure 20: Configuring a Secret in AWS Secrets Manager with Key/Value Pairs.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ss2oE6EdPNAxuA4E" /><figcaption>Figure 21: Configuring Secret Name and Description in AWS Secrets Manager.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FNUupeNf6pt_zrNN" /><figcaption>Figure 22: Configuring rotation for Secret (optional)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TyHJ4lQmDebG3aqb" /><figcaption>Figure 23: Successful creation of secret</figcaption></figure><ul><li>Follow the prompts to configure the secret and save it.</li></ul><p><strong>2. Retrieve the Secret:</strong></p><ul><li>Use the AWS SDK or CLI to retrieve the secret</li></ul><pre>aws secretsmanager get-secret-value --secret-id my-secret</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pL9exsMUtt9YcBi6" /><figcaption>Figure 24: Secret Retrieval</figcaption></figure><h4><strong>AWS Parameter Store</strong></h4><p>AWS Parameter Store, a part of AWS Systems Manager, helps manage configuration data and secrets efficiently.</p><p><strong>Managing Configuration Data and Secrets Using AWS Parameter Store</strong></p><ol><li><strong>Store a Parameter:</strong></li></ol><ul><li>Use the AWS CLI to store a parameter</li></ul><pre>aws ssm put-parameter --name my-parameter --value &quot;my-value&quot; --type String</pre><p><strong>Retrieve the Parameter:</strong></p><ul><li>Use the AWS CLI to retrieve the parameter</li></ul><pre>aws ssm get-parameter --name my-parameter</pre><h4><strong>Other Secrets Management Solutions: Overview and Use Cases</strong></h4><p><strong>AWS Secrets Manager:</strong></p><ul><li><strong>Best for:</strong> AWS-native environments with tight integration.</li><li><strong>Features:</strong> Automated secrets rotation, fine-grained access control, and AWS service integration.</li><li><strong>Use Cases:</strong> Applications hosted on AWS needing seamless integration with other AWS services.</li></ul><p><strong>AWS Parameter Store:</strong></p><ul><li><strong>Best for:</strong> Simpler use cases or where AWS Systems Manager is already in use.</li><li><strong>Features:</strong> Secure, hierarchical storage for configuration data and secrets management, integrated with AWS Systems Manager.</li><li><strong>Use Cases:</strong> Storing configuration data, secrets, and passwords for applications already utilizing AWS Systems Manager.</li></ul><p><strong>HashiCorp Vault:</strong></p><ul><li><strong>Best for:</strong> Multi-cloud or on-premises environments with advanced secret management needs.</li><li><strong>Features:</strong> Dynamic secrets, encryption as a service, leasing and renewal, and detailed audit logs.</li><li><strong>Use Cases:</strong> Complex infrastructure setups requiring secure secrets management across different environments and platforms.</li></ul><h3><strong>Image Credits</strong></h3><p><strong>EC2 Logo</strong>:</p><ul><li>Source: <a href="https://aws.amazon.com/architecture/icons/">AWS Architecture Icons</a></li><li>Author: AWS</li><li>Description: AWS EC2 Logo</li></ul><p><strong>EKS Logo:</strong></p><ul><li>Source: <a href="https://aws.amazon.com/architecture/icons/">AWS Architecture Icons</a></li><li>Author: AWS</li><li>Description: AWS EKS Logo</li></ul><p><strong>Secrets Manager Logo:</strong></p><ul><li>Source: <a href="https://aws.amazon.com/architecture/icons/">AWS Architecture Icons</a></li><li>Author: AWS</li><li>Description: AWS Secrets Manager Logo</li></ul><p><strong>Background Image</strong>:</p><ul><li>Source:: <a href="https://www.expresscomputer.in/guest-blogs/importance-of-zero-trust-cloud-security-in-the-age-of-data-breaches/100851/">Express Computer</a></li><li>Author: Express Computer</li><li>Description: Importance of Zero Trust Cloud Security in the Age of Data Breaches</li></ul><h3><strong>Conclusion</strong></h3><p>Securing your cloud infrastructure requires a combination of best practices, hands-on implementations, continuous monitoring, and proactive threat mitigation. By following these guidelines for EC2, EKS, and secrets management, you can enhance the security of your AWS environment. Regularly updating your security policies and staying informed about the latest threats and vulnerabilities are crucial. Implement these practices today to safeguard your cloud resources effectively and maintain a robust security posture.</p><p><strong><em>Stay proactive, stay secure, and keep your cloud environment resilient against potential threats.</em></strong></p><p><strong><em>Thank you for reading!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d2cd9a56906" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Docker: Dockerfile, Image Repositories, and Comprehensive CI/CD Automation Guide]]></title>
            <link>https://blog.devops.dev/mastering-docker-dockerfile-image-repositories-and-comprehensive-ci-cd-automation-guide-a8c4ef16bcc5?source=rss-b7665924993d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8c4ef16bcc5</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[cicd]]></category>
            <dc:creator><![CDATA[Sanjana Rampur Kottur]]></dc:creator>
            <pubDate>Sat, 29 Jun 2024 20:10:23 GMT</pubDate>
            <atom:updated>2024-07-11T15:26:03.971Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NlZdTyJ4VNhhh7_SCJkf6w.png" /><figcaption>Empowering Containerization with Docker by Docker, Inc.</figcaption></figure><h3>Introduction: Understanding Docker through a Gardening Analogy</h3><p>Imagine having a gardening kit with all the tools and supplies you need: seeds, a small shovel, gloves, and a watering can. Whenever you want to garden, you open your kit and everything is right there. Whether you go to the backyard, a community garden, or a friend’s house, you’re always prepared to plant flowers or vegetables because your gardening kit has all the same tools and supplies.</p><p>Similarly, Docker operates like this gardening kit for computer programs:</p><ul><li><strong>Ready to Use:</strong> Docker gathers everything a program needs — like code and settings — into one container. This container is ready to run the program right away, just like your gardening kit is always ready for you to start gardening.</li><li><strong>Portable:</strong> You can take a Docker container and use it on any computer. It works the same everywhere you go, much like how you can take your gardening kit to different places and still have all your gardening tools at hand.</li><li><strong>Consistent:</strong> Wherever you run a Docker container, it ensures the program operates in the same way because it maintains a uniform setup. This reliability is akin to your gardening kit consistently having the same tools and supplies, ensuring successful gardening every time.</li></ul><p>In summary, Docker packages everything a program needs — such as code, libraries, and settings — into one container, making it straightforward to move and run programs on any computer. This versatility resembles how a gardening kit allows you to garden anywhere with all your tools readily available.</p><h3>What is Docker?</h3><p>Docker is a platform designed to help developers build, share, and run container applications.</p><h3>Creating a Dockerfile: Preparing Your Gardening Kit</h3><p>It’s a bright, sunny day — oh, do we plant tulips or daisies? First, let’s delve into understanding Dockerfile. A Dockerfile is essentially a list of instructions that tells Docker how to build an application’s environment inside a container. It focuses on specifying which tools, such as libraries, software, and configurations, should be included and how they should be set up. This process is akin to organizing tools in a specific order for easy access in our gardening kit. Just as a gardening kit’s tools are arranged methodically, a Dockerfile outlines a sequence of steps to prepare the application’s environment.</p><h3>Building Docker Images: Building Your Gardening Kit</h3><p>Building your gardening kit involves assembling all the necessary tools and supplies exactly as specified. Similarly, in Docker, when you build a Dockerfile, Docker follows a set of instructions to create what’s called a Docker image. This image serves as a snapshot of your application’s environment at a specific moment in time, encompassing all the components and configurations outlined in the Dockerfile. Think of it like organizing your gardening tools and supplies in a particular order to ensure you have everything ready for gardening.</p><h3>Running Docker Containers: Using Your Gardening Kit</h3><p>Once your gardening kit is prepared, you can use it to garden wherever you need, whether in your backyard or elsewhere. Likewise, after you’ve built a Docker image, you can use it to run Docker containers. A Docker container functions like a virtual instance of your application running independently, utilizing the environment established by the Docker image. This setup ensures your application operates consistently and reliably across different computing environments, much like how your well-prepared gardening kit ensures you have the same tools and supplies available every time you start gardening.</p><h3>Pushing Docker Images to Hub or Repository: Sharing Your Gardening Kit</h3><p>Once you’ve built your gardening kit (created a Docker image), you might want to share it or use it on different computers. This is where pushing Docker images to a hub or repository comes into play.</p><p>Think of a hub or repository as a storage place where you can keep your gardening kit safe and accessible from anywhere. In Docker terms, a hub (like Docker Hub) or a private repository (like AWS ECR or GitHub Container Registry) serves as a centralized location to store and manage Docker images.</p><h3>Demo: Creating a Simple Login Page with ReactJS</h3><p>For the purpose of this demo, we will create a simple login page using ReactJS and then create a Docker image from it.</p><h3>Step-by-Step Guide: Creating a Docker Image for Your ReactJS Application</h3><h4>Step 1: Create a Dockerfile</h4><p>Use the below Dockerfile to create a Docker image.</p><pre># Select base image<br>FROM node:20.15.0-alpine3.20<br><br># Set working directory<br>WORKDIR /app<br><br># Add `/app/node_modules/.bin` to $PATH<br>ENV PATH /app/node_modules/.bin:$PATH<br><br># Install app dependencies<br>COPY package.json ./<br>COPY package-lock.json ./<br>RUN npm install<br><br># Add app<br>COPY . ./<br><br># Start app<br>CMD [&quot;npm&quot;, &quot;start&quot;]</pre><h4>Step 2: Build the Docker Image</h4><p>Open the terminal, navigate to the directory containing your Dockerfile, and run the below command.</p><p>Syntax:</p><pre>docker build .</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vc3oitaeylMhHQiJ" /><figcaption>Figure 1: Docker image build process showing the steps followed to create the image from the Dockerfile.</figcaption></figure><p>This will create the Docker image.</p><h4>Step 3: Tagging Your Docker Image</h4><p>Before pushing, you typically tag your Docker image with a name that includes the repository where it will be stored and any version information.</p><p>Syntax:</p><pre>docker tag your_image_name username/repository_name:tag<br>docker tag myapp username/myapp:v1.0</pre><p>For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZxbbdKXWaiOWfoUp" /><figcaption>Figure 2: Tagging the Docker image with the repository name ‘sanjanarampur/docker-test’ and displaying the Docker images list.</figcaption></figure><h4>Step 4: Pushing the Docker Image</h4><p>Once tagged, you use the docker push command to upload your Docker image to the specified repository.</p><p>Syntax:</p><pre>docker push username/repository_name:tag<br>docker push username/myapp:v1.0</pre><p>For example:</p><pre>docker push sanjanarampur/docker-test</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e5m8uJNBeM41FeuE" /><figcaption>Figure 3: Pushing the tagged Docker image ‘sanjanarampur/docker-test’ to Docker Hub, showing the layers being pushed and the final digest.</figcaption></figure><h3>Access and Use Anywhere</h3><p>Once pushed to the hub or repository, your Docker image can be pulled and used on any Docker-enabled machine. It ensures that others can easily access and deploy your application in their environments.</p><p>Pushing Docker images to a hub or repository allows for efficient collaboration, distribution, and deployment of Dockerized applications across teams and environments, much like sharing your well-prepared gardening kit with others who need to use the same tools and supplies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*im-v6DA6Gq3Q0mqj" /><figcaption>Figure 4: Docker image successfully pushed to Docker Hub</figcaption></figure><h3>Automating Docker builds using CI/CD (Continuous Integration/Continuous Deployment) pipelines</h3><h3>Steps to Automate Docker Builds Using CI/CD</h3><h4>Step 1: Set Up Your CI/CD Pipeline</h4><ul><li><strong>Choose a CI/CD Platform</strong>: Options include Jenkins, GitLab CI/CD, CircleCI, or GitHub Actions.</li><li><strong>Configuration</strong>: Set up your repository to trigger builds automatically when changes are pushed to a specific branch (e.g., main, develop).</li><li><strong>GitLab CI/CD</strong>: Here, we’ll use GitLab CI/CD.</li></ul><h4>Step 2: Create the Pipeline YAML File</h4><pre>stages:          <br>  - publish<br>  - deploy<br><br>publish:<br>  image: docker:latest<br>  stage: publish<br>  tags: <br>    - docker-test<br>  variables:<br>    DOCKER_TLS_CERTDIR: &quot;&quot;<br>    DOCKER_HOST: &quot;tcp://docker:2375&quot;<br>  services:<br>    - docker:dind<br>  script:<br>    - pwd <br>    - echo $SERVER_IP<br>    - docker --version<br>    - docker login -u sanjanarampur -p &lt;your-password&gt; docker.io<br>    - docker build -t sanjanarampur/docker-test .<br>    - docker push sanjanarampur/docker-test<br>  only:<br>    - main</pre><ul><li><strong>Purpose</strong>: This file defines stages to create a Docker image from the Dockerfile.</li></ul><h4>Step 3: Set Up Docker in Docker (dind)</h4><ul><li><strong>Explanation</strong>: dind allows running Docker inside a Docker container, which is useful for CI/CD pipelines.</li><li><strong>Benefits</strong>: Enables the use of Docker commands within the pipeline without needing Docker installed on the host system.</li></ul><h4>Step 4: Create a GitLab Runner on an EC2 Instance</h4><p>On GitLab:</p><ul><li><strong>Navigate to</strong>: Repository settings &gt; CI / CD &gt; Runners.</li><li><strong>Create a Runner</strong>: Note the generated token and the Git URL.</li></ul><p>On AWS:</p><ol><li><strong>Create an EC2 Instance</strong>:</li></ol><ul><li><strong>OS</strong>: Use Amazon Linux or an AMI of your choice.</li><li><strong>Key Pair</strong>: Generate a key pair for SSH access.</li><li><strong>Instance: </strong>Keep the instance as a t2.micro instance.</li></ul><p><strong>2. Connect to EC2 Instance</strong>:</p><ul><li>Command: ssh -i &quot;&lt;generated key file name&gt;&quot; ec2-user@&lt;public ipv4 dns of ec2&gt;</li></ul><p><strong>3. Install Docker</strong>:</p><pre>sudo yum update<br>sudo yum install docker<br>sudo service docker start</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1-6nulEToPi5RM7D" /><figcaption>Figure 5: Installing Docker on EC2 Instance</figcaption></figure><p><strong>4. Install GitLab Runner:</strong></p><pre>sudo curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64<br>sudo chmod +x /usr/local/bin/gitlab-runner<br>sudo useradd --comment &#39;GitLab Runner&#39; --create-home gitlab-runner --shell /bin/bash<br>sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner<br>sudo gitlab-runner start</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/0*7L6XlYrg26OfUPu9" /><figcaption>Figure 6: Starting Docker Service and Adding Users to Docker Group</figcaption></figure><p><strong>5. Register GitLab Runner</strong>:</p><pre>sudo gitlab-runner register -n --url &lt;url&gt; --registration-token &lt;token&gt; --executor docker --description &quot;Deployment Runner&quot; --docker-image &quot;docker:stable&quot; --docker-privileged</pre><p><strong>6. Configure SSH Access</strong></p><pre>ssh-keygen -b 4096<br>cat ~/.ssh/id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys<br>cat ~/.ssh/id_rsa</pre><p><strong>7. Add SSH Key to GitLab:</strong></p><ul><li>Go to: Settings &gt; CI / CD &gt; Variables.</li><li>Add a file variable called ID_RSA with the key contents.</li><li>Add the public IP of the EC2 instance as SERVER_IP.</li><li>Add the username (default: ec2-user) as SERVER_USER.</li></ul><h4>Step 5: Configure CI/CD Pipeline Steps</h4><ul><li><strong>Clone Repository</strong>: The pipeline starts by cloning your repository to the CI/CD server.</li><li><strong>Build Docker Image</strong>: Use Docker commands in the pipeline script to build your Docker image based on the Dockerfile in your project.</li><li><strong>Push Image to Container Registry: </strong>Once the image has been built, push the same to Dockerhub or a container registry of your choice.</li><li>For my example, I have only kept a build stage that builds an image.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Iw8BlWEbxyl3ZHMxjJvMiQ.png" /><figcaption>Figure 7: GitLab CI/CD Pipeline Execution</figcaption></figure><h4>Step 6: Automate Testing (Optional)</h4><ul><li><strong>Testing</strong>: Include automated tests in your CI/CD pipeline to ensure your application behaves correctly within the Docker container.</li><li><strong>Types of Tests</strong>: Unit tests, integration tests, etc.</li></ul><pre>test:<br>  stage: test<br>  script:<br>    - npm install<br>    - npm test<br>  only:<br>    - main</pre><h4>Step 7: Deploy (Optional)</h4><ul><li><strong>Deployment</strong>: Automatically deploy the newly built Docker image to your staging or production environment using tools like Kubernetes or directly to cloud services.</li></ul><h4>Step 8: Monitor and Review</h4><ul><li><strong>Monitoring</strong>: Set up monitoring and logging to track the performance of your CI/CD pipeline and Docker deployments.</li><li><strong>Issue Management</strong>: Ensure that any failures or issues are promptly identified and addressed.</li></ul><h4>Step 9: Iterate and Improve</h4><ul><li><strong>Continuous Improvement</strong>: Refine your CI/CD pipeline based on feedback and changes in your application.</li><li><strong>Optimization</strong>: Optimize build times, enhance test coverage, and improve deployment reliability.</li></ul><p>By automating Docker builds using CI/CD pipelines, teams can achieve faster and more reliable software delivery, maintain consistency across environments, and streamline the development workflow from code changes to production deployment.</p><p><strong>Image Credits</strong></p><p><strong>Image Source:</strong> <a href="https://www.docker.com/">Docker</a></p><p><strong>Author:</strong> Docker, Inc.</p><p><strong>Usage License:</strong> Used with permission from Docker, Inc.</p><p><strong><em>Mastering Docker empowers developers by streamlining the setup of development environments and ensuring consistency across deployments. Like a versatile gardening kit, Docker’s portability and comprehensive packaging make application management efficient and reliable. Integrating Docker with CI/CD pipelines, such as GitLab CI/CD or Jenkins, accelerates the development lifecycle and enhances collaboration. This guide’s step-by-step approach to Dockerfile creation, image management, and CI/CD automation ensures a seamless and efficient workflow. Embrace Docker and CI/CD to cultivate robust and consistent software projects, and enjoy the journey of streamlined development.</em></strong></p><p><strong><em>Thank you for reading!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8c4ef16bcc5" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/mastering-docker-dockerfile-image-repositories-and-comprehensive-ci-cd-automation-guide-a8c4ef16bcc5">Mastering Docker: Dockerfile, Image Repositories, and Comprehensive CI/CD Automation Guide</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[Deploy Jenkins CI/CD Server on AWS]]></title>
            <link>https://medium.com/@sanjanarampurkottur01/deploy-jenkins-ci-cd-server-on-aws-6bf02145bc09?source=rss-b7665924993d------2</link>
            <guid isPermaLink="false">https://medium.com/p/6bf02145bc09</guid>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[jenkins]]></category>
            <dc:creator><![CDATA[Sanjana Rampur Kottur]]></dc:creator>
            <pubDate>Thu, 27 Jun 2024 20:49:41 GMT</pubDate>
            <atom:updated>2024-06-27T20:49:41.839Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sPNa9B2krf4Nn7n6ytC6CQ.png" /><figcaption>Image by author Sanjana Rampur Kottur (created via Photopea)</figcaption></figure><h3><strong>Deploying Jenkins CI/CD on AWS and its benefits</strong></h3><p>By leveraging AWS’s features, Jenkins CI/CD processes are enhanced with scalability, high availability, cost-effectiveness, flexibility, security, and global reach, resulting in a robust, efficient, and secure CI/CD environment.</p><p><strong>Automated Builds and Testing</strong>:</p><ul><li><strong>Scalability</strong>: AWS’s scalable infrastructure allows you to handle increasing build and test loads effortlessly, ensuring that automated processes remain efficient as your team grows.</li><li><strong>Cost-Effective</strong>: By using AWS’s pay-as-you-go model, you can manage costs effectively, only paying for the resources required for your build and testing workloads.</li></ul><p><strong>Code-Based Pipeline Management</strong>:</p><ul><li><strong>Security</strong>: AWS provides robust access control mechanisms and data encryption, ensuring that your pipeline definitions and CI/CD workflows are secure.</li><li><strong>Flexibility</strong>: AWS’s extensive services, such as IAM for identity management and RDS for database services, allow you to create a flexible, code-based pipeline management system that is easy to version control and manage.</li><li><strong>Global Infrastructure</strong>: Deploy Jenkins in multiple AWS regions to meet regional compliance requirements and ensure low-latency access to your CI/CD pipelines.</li></ul><p><strong>Continuous Integration</strong>:</p><ul><li><strong>High Availability</strong>: AWS’s high availability services ensure that your Jenkins environment is always accessible, allowing for continuous integration and early issue detection without downtime.</li><li><strong>Global Infrastructure</strong>: With AWS’s global network, you can set up Jenkins instances in various regions, ensuring low latency and better collaboration across geographically dispersed teams.</li></ul><p><strong>Continuous Delivery and Deployment</strong>:</p><ul><li><strong>Flexibility</strong>: AWS’s wide range of services, such as EC2 for compute power and S3 for storage, integrates seamlessly with Jenkins, enabling frequent and reliable releases.</li><li><strong>Security</strong>: AWS’s advanced security features protect your deployment pipelines, ensuring that new features and bug fixes are delivered securely to users.</li></ul><p><strong>Setting Up a Jenkins Server on AWS</strong></p><ol><li><strong>Launch an EC2 Instance</strong>:</li></ol><ul><li>Sign in to the AWS Management Console.</li><li>Navigate to the EC2 dashboard and click “Launch Instance.”</li><li>Follow the prompts to configure and launch your instance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wqjWbSptw3WkvjfT" /><figcaption>Figure 1: Launch an EC2 instance</figcaption></figure><p><strong>2. Sign in to the AWS Management Console</strong>:</p><ul><li>Go to the AWS website and log in with your credentials.</li><li>Access the EC2 service from the console to begin setting up your Jenkins server.</li></ul><p><strong>3. Configure the Instance AMI</strong>:</p><ul><li>Choose an appropriate Amazon Machine Image (AMI) for your instance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ToH6FL4KMcDSAwcd" /><figcaption>Figure 2: Choosing an appropriate Amazon Machine Image (AMI) for your instance</figcaption></figure><ul><li>Select the instance type that suits your requirements (for testing purposes, I have kept it as t2.micro).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*F73PdchakXLGA4yY" /><figcaption>Figure 3: Selecting the instance type that meets your requirements</figcaption></figure><ul><li>Configure the instance details, add storage, and set up security groups (Optional).</li></ul><p>This step involves setting additional configurations such as network settings, user data scripts, and IAM roles to tailor the instance setup to specific requirements.</p><p><strong>4. Add Storage:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Vtk_cTojV4R0oTst" /><figcaption>Figure 4: Configuring the amount and type of storage needed for your EC2 instance.</figcaption></figure><p><strong>5. Add Tags (Optional):</strong><br>Tags are metadata labels that you can attach to AWS resources, including EC2 instances running Jenkins. They consist of key-value pairs and can be used for organizational purposes, cost allocation, or automation. When setting up Jenkins on AWS, adding tags helps in easily identifying and categorizing instances based on their purpose.</p><p><strong>6. Configuring Security Groups in AWS EC2:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9vjiPYspnreVJ4r3" /><figcaption>Figure 5: Configuring security groups for controlling inbound and outbound traffic to your instance</figcaption></figure><ul><li>Review your settings and launch the instance.</li></ul><p>Click “Launch Instance” again to finalize the setup. AWS will provision your EC2 instance based on the selected configuration.</p><p><strong>7. Configure Keys to Connect to EC2 Instance:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Xs1adzDG2HbLookb" /><figcaption>Figure 6: Establishing a connection to an EC2 instance</figcaption></figure><ul><li>EC2 Instance created</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*14TQJZHbH8CvRfB2" /><figcaption>Figure 7: Successfully created an EC2 instance on AWS</figcaption></figure><p>The above steps outline the creation of an EC2 instance successfully.</p><p><strong>Connect to Your EC2 Instance</strong>:</p><p>Using the key we generated earlier, we can connect to the EC2 instance using a shell on your device. The following steps outline how to connect to the EC2 instance and proceed with the installation of Jenkins.</p><p><strong>1. SSH into Your Instance:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BiJ7ZgyzmXW3EuOv" /><figcaption>Figure 8: Connecting to EC2 instance using ssh</figcaption></figure><p><strong>2. Install Jenkins on EC2 Instance</strong>:</p><ul><li>Update Packages</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ULZgmtSLw_Ypjtfu" /><figcaption>Figure 9: Updating all existing packages using yum</figcaption></figure><ul><li>Install Java</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tdoWZjtMnH12R667" /><figcaption>Figure 10: Installing java using yum</figcaption></figure><ul><li>Add Jenkins Repository and Install Jenkins</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nTPRtygphSpZK1kj" /><figcaption>Figure 11: Add Jenkins repository URL to download and install Jenkins</figcaption></figure><p>Some common errors encountered during this process include:</p><ul><li>Jenkins server not starting after running `<strong>systemctl start jenkins</strong>`.</li></ul><p>To fix this error:<br> — Debug using `<strong>journalctl -u jenkins.service</strong>`.<br> — One issue I faced was Jenkins using Java version 22. I resolved this by downgrading to version 17, as the currently supported versions are 11 and 17.</p><p><strong>3. Start Jenkins Service:</strong></p><ul><li>Ensure Jenkins starts correctly (systemctl start jenkins).</li><li>Debug issues using journalctl -u jenkins.service.</li><li>Manage Java version compatibility (e.g., downgrade if necessary).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iFahh-lzaxTriVpW" /><figcaption>Figure 12: Starting Jenkins successfully</figcaption></figure><p><strong>4. Configure Firewall:</strong></p><ul><li>Set inbound rules for port 8080 in the security group.</li><li>Modify security group settings to allow access to Jenkins web interface.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wxiAJwhCPxTWDuoq" /><figcaption>Figure 13: Setting up inbound rules on the EC2 server to allow Jenkins access using a web browser</figcaption></figure><p><strong>5. Access Jenkins Web Interface:</strong></p><ul><li>Open Jenkins in a web browser using <a href="http://public-ipv4-dns-address:8080.">http://&lt;public-ipv4-dns-address&gt;:8080.</a></li></ul><p><strong>6. Complete Jenkins Setup:</strong></p><ul><li>Create an admin user for Jenkins.</li><li>Configure Jenkins settings, including URL configuration.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*luF4SYwf62qPjyaq" /><figcaption>Figure 14: Setting up Jenkins using the URL of the EC2 server</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WWDlwwb679Hgvtei" /><figcaption>Figure 15: Setting up an admin user in Jenkins</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1RyDdrQId1nzFsye" /><figcaption>Figure 16: Setting up a cloud environment for AWS</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8TiEtf3n6J-8JAfF" /><figcaption>Figure 17: Adding AWS cloud details (Key ID, Secret etc.)</figcaption></figure><p><strong>7. Install Additional Plugins (Optional):</strong></p><ul><li>Customize Jenkins functionality by installing necessary plugins.</li></ul><p><strong>8. Secure Jenkins:</strong></p><ul><li>Set up security measures such as configuring access controls and managing credentials.</li><li>Ensure HTTPS is configured for secure communication.</li></ul><p><strong>9. Set Up Backups (Optional):</strong></p><ul><li>Implement backup strategies to protect Jenkins data and configurations.</li></ul><p><strong>10. Integrate with Version Control (Optional):</strong></p><ul><li>Install SCM plugins to integrate Jenkins with version control systems like Git.</li></ul><p><strong>11. Additional Configuration and Optimization:</strong></p><ul><li>Optimize Jenkins performance by adjusting JVM settings, plugin configurations, and resource allocation.</li></ul><p><strong>Start Using Jenkins:</strong></p><ul><li>Create jobs to automate build, test, and deployment workflows.</li><li>Set up pipelines and automate tasks within Jenkins.</li></ul><p>After the above setup, you can start setting up your own pipeline builds on the EC2 server leveraging the power and scalability of AWS EC2.</p><h4>Image Credits</h4><p><strong>Background Image</strong>:</p><ul><li>Source: <a href="https://pngtree.com/freebackground/rainbow-curves-abstract-colorful-background_2379642.html">PNGTree</a></li><li>Author: Provided by PNGTree</li><li>Description: Rainbow Curves Abstract Colorful Background</li></ul><p><strong>Jenkins Logo</strong>:</p><ul><li>Source: <a href="https://iconscout.com/free-icon/jenkins">Iconscout</a></li><li>Author: Iconscout</li><li>Description: Jenkins CI/CD Logo</li></ul><p><strong>EC2 Logo</strong>:</p><ul><li>Source: <a href="https://aws.amazon.com/architecture/icons/">AWS Architecture Icons</a></li><li>Author: AWS</li><li>Description: AWS EC2 Logo</li></ul><p><strong><em>Delve into setting up Jenkins CI/CD on AWS — it’s an excellent opportunity to learn and enjoy the process! Thank you for embarking on this journey!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bf02145bc09" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>