<?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 Vinod Varma on Medium]]></title>
        <description><![CDATA[Stories by Vinod Varma on Medium]]></description>
        <link>https://medium.com/@vv-devops?source=rss-a4f78f48f248------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3yV8xvi0QAf8IKuhBvvJzA.jpeg</url>
            <title>Stories by Vinod Varma on Medium</title>
            <link>https://medium.com/@vv-devops?source=rss-a4f78f48f248------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 18:47:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vv-devops/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[Safeguard Your Workflow: The Power of Referencing Specific Versions in GitHub Actions]]></title>
            <link>https://medium.com/@vv-devops/safeguard-your-workflow-the-power-of-referencing-specific-versions-in-github-actions-e083a03fef11?source=rss-a4f78f48f248------2</link>
            <guid isPermaLink="false">https://medium.com/p/e083a03fef11</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[workflow]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Vinod Varma]]></dc:creator>
            <pubDate>Tue, 30 Jan 2024 04:28:52 GMT</pubDate>
            <atom:updated>2024-01-30T04:29:20.706Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Github Action Logo" src="https://cdn-images-1.medium.com/max/875/1*Mjro6V5Ya2pEf2i2CVvXZQ.png" /></figure><h3>Introduction:</h3><p>In the dynamic landscape of software development, workflows are the backbone of efficiency. GitHub Actions, with its powerful automation capabilities, has become a go-to tool for developers. However, Referencing actions in your workflows without specifying a version can expose your workflow to unexpected changes. Imagine relying on a crucial action, only to have it disrupted by an unforeseen update that introduces breaking changes. To mitigate such risks, GitHub Actions provides mechanisms to reference specific versions of an action.</p><h4>The Art of Specific Version Referencing:</h4><p>Here are several ways you can reference a specific version of an action within your workflow.</p><p><strong>1. Reference a Specific Commit:</strong></p><pre>steps:    <br>  - uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e</pre><p>By referencing a commit SHA hash, you ensure that your workflow uses the exact version of the action as it existed at the time of that commit. This provides a precise and unchanging foundation for your workflow.</p><p><strong>2. Reference the Major Version of a Release:</strong></p><pre>- uses: actions/setup-node@v1</pre><p>Referencing a major version guarantees that your workflow will use the latest release within that major version. This can be useful when you want to benefit from new features or bug fixes while maintaining compatibility with the original major release.</p><p><strong>3. Reference a Minor Version of a Release:</strong></p><pre>- uses: actions/setup-node@v1.2</pre><p>Similar to referencing major versions, specifying a minor version allows you to incorporate updates within that minor release. This can be beneficial when you want to stay up-to-date with improvements while ensuring a level of consistency.</p><p><strong>4. Reference a Branch:</strong></p><pre>- uses: actions/setup-node@main</pre><p>While referencing a branch allows for the latest changes, it comes with a trade-off. The latest might not always mean the most stable, making it a riskier choice. If using a branch, consider carefully whether it aligns with the stability and security requirements of your workflow.</p><h4>Choosing Stability and Security:</h4><p>Some references are safer than others, and the level of specificity in your version referencing matters. For enhanced stability and security, the recommendation is to use the commit SHA of a released action within your workflows. This approach ensures that your workflow remains consistent and secure over time, unaffected by subsequent changes that might introduce instability.</p><h3>Conclusion:</h3><p>By adopting the practice of referencing specific versions of actions in GitHub Actions, you provide your workflows with a reliable foundation, reducing the risk of unexpected disruptions. Whether by specifying commit SHAs or version numbers, the choice of referencing method depends on your balance between staying up-to-date and ensuring the stability of your workflow.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e083a03fef11" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Maximizing Efficiency with GitHub Actions Workflow Templates in Your Enterprise]]></title>
            <link>https://medium.com/@vv-devops/maximizing-efficiency-with-github-actions-workflow-templates-in-your-enterprise-72a8fe36e46d?source=rss-a4f78f48f248------2</link>
            <guid isPermaLink="false">https://medium.com/p/72a8fe36e46d</guid>
            <dc:creator><![CDATA[Vinod Varma]]></dc:creator>
            <pubDate>Thu, 25 Jan 2024 05:37:45 GMT</pubDate>
            <atom:updated>2024-01-25T05:43:14.654Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Github Action Workflow Template" src="https://cdn-images-1.medium.com/max/1021/1*UozHoS-TCcvGP51g6i7ZxA.jpeg" /></figure><p>Workflow templates are a great way to ensure automation is reused and maintained in your enterprise. Both in Enterprise Cloud and Enterprise Server, users with write access to an organization’s .github repository can create workflow templates that will be available for use to the other organization&#39;s members with the same write access. Workflow templates can then be used to create new workflows in the public and private repositories of the organization.</p><p><strong>Step 1: Create a Public Repository:</strong></p><p>Create a Public Repository:</p><p>If you don’t have one, create a public repository on GitHub for your organization. You’ll need write access to this repository.</p><p><strong>Step 2: Create the YAML Workflow and JSON Metadata Files:</strong></p><ol><li>Create a yml workflow file.</li><li>Create a json metadata file that describes how the template should be presented to users when they are creating a workflow.</li></ol><pre>Note:-<br>The metadata file must have the same name as the workflow file. Instead of the .yml extension, it must be appended with .properties.json. For example, a file named abc.properties.json contains the metadata for the workflow file named abc.yml.</pre><p>Both files must be placed in a public .github repository and in a directory named workflow-templates. You might have to create these if they don&#39;t already exist in your organization.</p><p>The following is an example of a basic workflow file:</p><pre>name: ABC CI/CD<br><br>on:<br>  push:<br>    branches: [ $default-branch ]<br>  pull_request:<br>    branches: [ $default-branch ]<br><br>jobs:<br>  build:<br>    runs-on: ubuntu-latest<br><br>    steps:<br>      - uses: actions/checkout@v2<br><br>      - name: Run a one-line script<br>        run: echo &quot;Hello from Octo Organization&quot;</pre><p>Following is the metadata file you would create for the above workflow file:</p><pre>{<br>    &quot;name&quot;: &quot;abc Workflow&quot;,<br>    &quot;description&quot;: &quot;abc CI/CD workflow template.&quot;,<br>    &quot;iconName&quot;: &quot;example-icon&quot;,<br>    &quot;categories&quot;: [<br>        &quot;Go&quot;<br>    ],<br>    &quot;filePatterns&quot;: [<br>        &quot;package.json$&quot;,<br>        &quot;^Dockerfile&quot;,<br>        &quot;.*\\.md$&quot;<br>    ]<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kw_yVsGxP1FyeM9pOriiJQ.jpeg" /></figure><p>Once a workflow template is created, users in your organization can find it under <strong>Actions</strong> <strong>&gt;</strong> <strong>New workflow</strong> <strong>&gt;</strong> <strong>Workflows</strong> created by <strong>your_organization_name</strong>.</p><h4>Step 3: Verify Template Availability:</h4><ol><li><em>Create a Repository:</em></li></ol><pre>Create a public or private repository within your organization on GitHub.</pre><p>2. <em>Navigate to Actions:</em></p><pre>Go to the newly created repository and click on the &quot;Actions&quot; tab.</pre><p>3.<em> Create a New Workflow:</em></p><pre>Click on &quot;New workflow&quot; and select &quot;Workflows created by _your_organization_name.&quot;</pre><p>4.<em> Select Your Template:</em></p><pre>Find and select the &quot;Organization Workflow&quot; template.</pre><p>5. <em>Configure and Execute:</em></p><pre>Follow the workflow configuration steps and execute the workflow.</pre><h4>Step 4: Updating Workflow Files:</h4><ol><li><em>Update the Workflow:</em></li></ol><pre>If you need to make changes or updates to your workflow template, modify the YAML and/or JSON files in the .github/workflow-templates directory of your organization&#39;s repository.</pre><p>2. <em>Commit Changes:</em></p><pre>Commit the changes to the repository.</pre><p>3. <em>Automatic Reflection:</em></p><pre>GitHub Actions workflow templates are designed for reuse. So, any updates made to the template in the organization&#39;s .github repository will automatically reflect in all repositories that use this template.</pre><p>4. <em>Manual Addition (if required):</em></p><pre>If a particular repository requires the updated workflow template immediately,you may need to manually trigger the addition of the updated workflow templatein that specific repository. Navigate to the Actions tab of the repository, click on &quot;New workflow&quot; and select the updated template.</pre><h4>Conclusion</h4><p>In conclusion, GitHub Actions workflow templates provide a powerful mechanism for streamlining automation across your organization’s repositories. By following a straightforward two-step process to create YAML workflow files and accompanying JSON metadata files, you can ensure the seamless reuse and maintenance of automation solutions.</p><p>#githubaction #devops #cicd #automation #githubtips #github #techblog</p><p>#versioncontrol #actions</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72a8fe36e46d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GitHub’s Power Boost: Unleashing Double the Strength for Open Source Warriors.]]></title>
            <link>https://medium.com/@vv-devops/githubs-power-boost-unleashing-double-the-strength-for-open-source-warriors-f65eac17a022?source=rss-a4f78f48f248------2</link>
            <guid isPermaLink="false">https://medium.com/p/f65eac17a022</guid>
            <dc:creator><![CDATA[Vinod Varma]]></dc:creator>
            <pubDate>Fri, 19 Jan 2024 08:36:20 GMT</pubDate>
            <atom:updated>2024-01-19T08:36:20.916Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*XTEhcXJj0KOcxjmXFYxyYg.png" /><figcaption>GitHub Actions</figcaption></figure><p>Unleashing a GitHub Actions Upgrade That’s Changing the Game! 💻🚀</p><ul><li><strong>The Buzz: GitHub Actions Gets a Turbocharge! </strong>🌟<br>GitHub, the nucleus of open collaboration, has just turned up the heat on its hosted runners. Get ready for an upgrade that’s not just talk—it’s a game-changer for open-source developers like you!</li><li><strong>Double the CPU, Double the Fun!💪🏼</strong><br>Your Linux and Windows workflows in public repositories just got a massive boost with the introduction of 4-vCPU runners. Imagine up to 25% more power, and the best part? No configuration changes required!</li><li><strong>Lightning-Fast CI/CD: </strong>⚡🔧<br>No more twiddling your thumbs during builds. These upgraded machines aren’t just powerful; they’re performance beasts, ensuring quicker feedback loops and slashing build times.</li><li><strong>Memory &amp; Storage Makeover:</strong> 🚀📦<br>It’s not just about doubling the processors—brace yourself for 16 GiB of memory and a whopping 150GiB storage. Perfect for those hefty workloads without breaking a sweat.</li><li><strong>Still Free, Forever Awesome! </strong>💸🎉<br>Worried about costs? Don’t be! GitHub’s commitment to open source remains unwavering. No extra expenses—just more muscle for your projects.</li><li><strong>GitHub Actions and the Open Source Love Affair:</strong> 💙🤝<br>GitHub Actions has been the secret sauce for countless open-source projects. With 20,000+ actions on the Marketplace, it’s not just a tool; it’s a treasure trove for developers worldwide.</li><li><strong>Ready, Set, Soar!</strong> 🚁🌐<br>Your upgraded workflows are just a click away. No complicated steps—simply run your public workflows with existing labels, and let the 4-core hosted runners do their magic.</li><li>Cheers to a Faster, Stronger, and Still Free Open Source Dev! 🥂🚀</li></ul><p>#GitHubActions #OpenSourceRevolution #DevOpsMagic #GitHubUpgrade</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f65eac17a022" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Terraform State Management: Best Practices for Collaboration]]></title>
            <link>https://medium.com/@vv-devops/terraform-state-management-best-practices-for-collaboration-388eaaa419ae?source=rss-a4f78f48f248------2</link>
            <guid isPermaLink="false">https://medium.com/p/388eaaa419ae</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[devops-tool]]></category>
            <dc:creator><![CDATA[Vinod Varma]]></dc:creator>
            <pubDate>Wed, 10 Jan 2024 17:22:02 GMT</pubDate>
            <atom:updated>2024-01-10T17:23:33.170Z</atom:updated>
            <content:encoded><![CDATA[<p>When it comes to managing infrastructure as code (IaC) with Terraform, handling the state becomes a critical aspect, especially in collaborative environments.</p><h3>Best Practices for Terraform State Management.</h3><p><strong>1. Remote Backend Configuration:-</strong><br>Utilize a remote backend to store Terraform state centrally. Popular options include Amazon S3, Azure Storage, or HashiCorp Terraform Cloud. This prevents state file and enables seamless collaboration.</p><pre>terraform {<br>  backend &quot;s3&quot; {<br>    bucket = &quot;your-s3-bucket&quot;<br>    key    = &quot;path/to/terraform.tfstate&quot;<br>    region = &quot;us-east-1&quot;<br>  }<br>}<br><br></pre><p>2. <strong>State Locking:-</strong><br>Implement state locking to prevent concurrent modifications. Tools like Amazon DynamoDB or HashiCorp Consul can be configured as lock mechanisms.</p><pre>terraform {<br>  backend &quot;s3&quot; {<br>    # ... (previous configuration)<br>    dynamodb_table = &quot;terraform-state-lock&quot;<br>  }<br>}<br><br></pre><p><strong>3. Remote State Versioning:-</strong><br>Enable versioning on your remote backend to track changes over time. This ensures that you have a historical record of your infrastructure state.</p><pre>terraform {<br>  backend &quot;s3&quot; {<br>    # ... (previous configuration)<br>    versioning = true<br>  }<br>}<br><br></pre><p><strong>4</strong>. <strong>Workspaces for Environment Isolation:-</strong><br>Leverage Terraform workspaces to separate state files for different environments (e.g., dev, staging, prod). This aids in maintaining a clear and organized structure.</p><pre>terraform {<br>  workspace &quot;dev&quot; {}<br>  workspace &quot;staging&quot; {}<br>  workspace &quot;prod&quot; {}<br>}<br><br></pre><h3>Conclusion:-</h3><p>Effective Terraform state management is crucial for collaboration, consistency, and scalability. By adopting these best practices, you can create a robust foundation for collaborative infrastructure development. Remember, state management is not just a technical consideration; it’s a key aspect of fostering a smooth and secure collaboration among your team members.</p><p>Happy Terraforming! 🛠️🌐</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=388eaaa419ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Terraform Modules: A Deep Dive into Infrastructure as Code Reusability]]></title>
            <link>https://medium.com/@vv-devops/mastering-terraform-modules-a-deep-dive-into-infrastructure-as-code-reusability-2d14fca0217c?source=rss-a4f78f48f248------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d14fca0217c</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[terraform-modules]]></category>
            <category><![CDATA[hashicorp]]></category>
            <dc:creator><![CDATA[Vinod Varma]]></dc:creator>
            <pubDate>Tue, 21 Nov 2023 16:21:08 GMT</pubDate>
            <atom:updated>2023-11-21T16:21:08.420Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WO2CPmzfN8YiZmHmWGFKUA.png" /></figure><h3><strong>Introduction:</strong></h3><p>In the dynamic landscape of DevOps and infrastructure as code (IaaC), Terraform has emerged as a powerful tool, simplifying the management and provisioning of cloud resources. One key feature that amplifies Terraform prowess is its modular architecture, allowing developers to create reusable components known as modules.</p><h3><em>The Essence of Terraform Modules:</em></h3><p>Terraform modules are encapsulated collections of resources that can be reused across different parts of your infrastructure or even shared with the community.</p><h4>1. Creating a Module:</h4><p>Creating a Terraform module involves structuring your code in a way that promotes reusability. Typically organized in a dedicated directory, a module comprises Terraform configuration files defining resources, variables, and outputs.</p><h4>2. Parameterizing Modules:</h4><p>The true power of modules lies in their ability to be parameterized. By defining variables within a module, you can customize its behavior when used in different contexts. This flexibility ensures that modules adapt to the specific needs of various parts of your infrastructure.</p><h3>Benefits of Using Terraform Modules:</h3><h4>1. Code Reusability:</h4><p>Modules promote the reuse of infrastructure code, reducing duplication and minimizing the risk of inconsistencies across deployments. This not only saves time but also enhances the maintainability of your codebase.</p><h4>2. Consistency Across Environments:</h4><p>With modules, you can maintain a consistent infrastructure across different environments, from development and testing to production. Any updates or changes made to a module automatically propagate throughout all instances where it’s utilized.</p><h4>3. Collaboration and Sharing:</h4><p>Terraform modules can be shared within your organization or even with the wider community. This fosters collaboration, as teams can leverage existing modules to accelerate their own development efforts. The Terraform Module Registry serves as a centralized repository for sharing and discovering modules.</p><h3>Best Practices for Working with Terraform Modules:</h3><h4>1. Clear Documentation:</h4><p>Document your modules thoroughly, providing insights into their purpose, input variables, and expected outputs. Clear documentation is crucial for users who might consume or contribute to your modules.</p><h4>2. Versioning:</h4><p>Embrace semantic versioning for your modules. This ensures that changes to a module are backward-compatible when possible, preventing disruptions in independent projects.</p><h4>3. Testing:</h4><p>Implement testing strategies for your modules to validate their functionality. This can include unit tests, integration tests, or even end-to-end tests, depending on the complexity of your modules.</p><h3>Conclusion:</h3><p>Terraform modules empower DevOps engineers with a scalable and efficient approach to managing infrastructure. By encapsulating resources, parameterizing configurations, and promoting reusability, modules become the cornerstone of well-architected and easily maintainable infrastructure as code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d14fca0217c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating an AWS EC2 Instance with a Custom AMI using Terraform]]></title>
            <link>https://medium.com/@vv-devops/creating-an-aws-ec2-instance-with-a-custom-ami-using-terraform-a41f08d3c4ad?source=rss-a4f78f48f248------2</link>
            <guid isPermaLink="false">https://medium.com/p/a41f08d3c4ad</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[terraform-cloud]]></category>
            <category><![CDATA[infrastructure]]></category>
            <dc:creator><![CDATA[Vinod Varma]]></dc:creator>
            <pubDate>Fri, 28 Apr 2023 08:54:02 GMT</pubDate>
            <atom:updated>2023-04-28T08:54:02.298Z</atom:updated>
            <content:encoded><![CDATA[<h3>Creating an AWS EC2 Instance with a Custom AMI using Terraform Cloud</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*thzy84p_3m2BVkUCiuBOvw.png" /></figure><h3><strong>Introduction:-</strong></h3><blockquote>In this blog post, we will learn how to create an EC2 instance using a custom AMI ID with the help of Terraform Cloud. We will cover all the necessary steps to set up the infrastructure using Terraform Cloud.</blockquote><h3>Prerequisites:-</h3><p>Before we get started, here are the things you will need:</p><ul><li>An AWS account</li><li>Basic knowledge of AWS services and Terraform</li><li>A Terraform Cloud account</li></ul><h3>Steps:-</h3><ol><li><strong>Create a Custom AMI of the Instance</strong></li></ol><p>Before creating an EC2 instance, you need to create a custom Amazon Machine Image (AMI). You can create a custom AMI from an existing instance by following the instructions in the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html">AWS documentation</a>. Note down the AMI ID, as we will use this ID in our Terraform configuration file.</p><p>2. <strong>Create Access Token and Secret for Access to AWS by Terraform:</strong></p><p>To access your AWS account from Terraform Cloud, you need to create an access token and secret key. Follow the instructions in the <a href="https://docs.aws.amazon.com/powershell/latest/userguide/pstools-appendix-sign-up.html">AWS documentation</a> to create the access token and secret key.</p><p>3. <strong>Store Credentials and AMI ID in Variables Set (Sensitive) at Organization Level in Terraform Cloud:</strong></p><p>Once you have created the access token and secret key, you need to store them in the Terraform Cloud. To store the credentials and AMI ID in variables, go to the workspace settings and click on the Variables tab. Add variables aws_access_key, aws_secret_key, ami_id, instance_type aws_region and set the values as, respectively.</p><p>4. <strong>Referring to Provider and Variable File:</strong></p><p>In your Terraform configuration file, refer to the variables that you have created in Step 3. In the provider block, set the region, access, and secret key variables. In the resource block for EC2 instance creation, set the AMI ID and Instance type variable.</p><p>5. <strong>Create GitHub Repo and Copy all the Configuration Files:</strong></p><p>Create a GitHub repository to store all your Terraform configuration files. Copy the configuration file from the Practice-2 directory of the <a href="https://github.com/Vinodvarma1999/Terraform-Cloud_Practices.git">provided repository</a> and paste it into your repository. Commit and push the changes to your repository.</p><p>6. <strong>Open Terraform Cloud and Create VCS-Driven Workspace:</strong></p><p>In the Terraform Cloud dashboard, click on the “New Workspace” button and select “Version control workflow.” Choose the GitHub provider and select the repository that you have created in Step 5. Click on the “Create Workspace” button.</p><p>7. <strong>Go to the action Button “Run &amp; Apply”:</strong></p><p>Now, you are ready to create your EC2 instance. Click on the “Queue Plan” button to run the Terraform plan. Once the plan is successful, click on the “Confirm &amp; Apply” button to create the EC2 instance.</p><p><strong>Conclusion:</strong></p><p>In this blog post, we learned how to create an EC2 instance using a custom AMI ID with the help of Terraform Cloud.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a41f08d3c4ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Terraform provisions an RDS instance and an EC2 instance in AWS.]]></title>
            <link>https://medium.com/@vv-devops/using-terraform-provisions-an-rds-instance-and-an-ec2-instance-in-aws-3f8d8656204d?source=rss-a4f78f48f248------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f8d8656204d</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Vinod Varma]]></dc:creator>
            <pubDate>Fri, 03 Mar 2023 06:51:15 GMT</pubDate>
            <atom:updated>2023-04-28T09:26:54.684Z</atom:updated>
            <content:encoded><![CDATA[<p>In this tutorial, we’ll walk through the process of using Terraform to provision RDS and EC2 instances in AWS. By the end of this tutorial, you’ll have a solid understanding of how to use Terraform to automate the creation and management of your infrastructure.</p><p>Step 1: Install the <a href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html#cliv2-linux-install">AWS CLI</a></p><p>Step 2: Configure the AWS CLI</p><ul><li>Open your terminal or command prompt and enter the following command:</li></ul><pre>aws configure</pre><ul><li>You’ll be prompted to enter your AWS Access Key ID, Secret Access Key, default region name, and default output format.</li><li>Enter your Access Key ID and Secret Access Key in the respective fields when prompted. These credentials can be obtained from the AWS console.</li><li>Once you’ve entered your credentials, you’ll be prompted to enter your default region name (e.g. us-east-1) and default output format (e.g. json).</li><li>Once you’ve entered all the necessary information, hit enter to save your configuration.</li></ul><p>Step 3: Create a Terraform Configuration File</p><p>Pull from the GitHub repo and navigate to the Practice-4directory:</p><pre>https://github.com/Vinodvarma1999/Terraform-Cloud_Practices.git</pre><p>Step 2: Initialize Terraform</p><p>Now that we have our configuration file, we need to initialize Terraform. Open up your terminal, navigate to the directory where your configuration file is located, and run the following command:</p><pre>terraform init</pre><p>This command will download the necessary plugins and modules that Terraform needs to provision your resources in AWS.</p><p>Step 3: Plan Your Resources</p><p>Next, you’ll need to previewTerraform configuration file that describes the resources you want to provision.</p><pre>terraform plan</pre><p>This command will output a summary of the changes that Terraform will make to your infrastructure. Verify that the output looks correct, and make any necessary modifications to your configuration file.</p><p>Step 4: Provision Your Resources</p><p>With Terraform initialized, we’re ready to provision our resources. Run the following command in your terminal:</p><pre>terraform apply</pre><p>This command will prompt you to confirm that you want to create the resources specified in your configuration file. Type yes and hit enter to confirm.</p><p>Terraform will now provision your RDS instance and your EC2 instance. This may take a few minutes, so be patient.</p><p>Step 5: Verify Your Resources</p><p>Once Terraform has finished provisioning your resources, you can verify that they were created successfully by logging into your AWS console.</p><p>Also, you can follow the other method to verify the resources</p><pre>terraform state list</pre><p>It displays a list of all the resource instances in the Terraform state. This command can help you quickly check that all the resources you expect to be created are actually present in the state.</p><p>or,</p><pre>terraform show</pre><p>It displays the attributes and values of all the resources in a more detailed and human-readable format.</p><p>Conclusion</p><p>Terraform is a powerful tool for automating the creation and management of infrastructure. By defining your infrastructure as code, you can easily provision and manage resources, and ensure that your infrastructure is always consistent and up-to-date.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f8d8656204d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Managing Data Persistence in Kubernetes Deployments with Persistent Volumes and Claims.]]></title>
            <link>https://medium.com/@vv-devops/managing-data-persistence-in-kubernetes-deployments-with-persistent-volumes-and-claims-f3db0ee1a650?source=rss-a4f78f48f248------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3db0ee1a650</guid>
            <category><![CDATA[kubernetes-cluster]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[data-persistence]]></category>
            <category><![CDATA[k8s]]></category>
            <dc:creator><![CDATA[Vinod Varma]]></dc:creator>
            <pubDate>Mon, 27 Feb 2023 06:32:52 GMT</pubDate>
            <atom:updated>2023-02-27T06:32:52.796Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2tZdZheDPvAYKDNg5kc5SA.png" /></figure><p>This guide will walk you through the process of creating a pod in a Kubernetes cluster, creating a file within that pod, deleting the pod, and verifying that the file still exists in a new pod that is created using the same deployment.</p><h3>Prerequisites</h3><p>To follow along with this guide, you will need:</p><ul><li>A running Kubernetes cluster</li><li>kubectl command-line tool installed on your local machine and configured to connect to your Kubernetes cluster</li><li>Clone these <a href="https://github.com/Vinodvarma1999/Kubernetes.git">repositories</a></li></ul><h3>Step 1: Create a Pod and Create a File</h3><ol><li>Apply the provided YAML file to create a deployment and a pod in the Kubernetes cluster:</li></ol><pre>kubectl apply -f deployment.yaml</pre><p>2. Exec into the pod to create a file:</p><pre>kubectl exec -it &lt;pod-name&gt; -- /bin/bash</pre><pre>echo &quot;Hello, World!&quot; &gt; /data/example/hello.txt</pre><pre>exit</pre><p>Replace &lt;pod-name&gt; with the name of the pod that was created by the deployment.</p><h3>Step 2: Delete the Pod by Deleting the Deployment</h3><p>To simulate a failure, delete the pod by deleting the deployment that was used to create it:</p><pre>kubectl delete deployment example-deployment</pre><h3>Step 3: Create a New Pod and Verify that the File Exists</h3><ol><li>Apply the same YAML file to create a new pod with a different name, but using the same PVC as before:</li></ol><pre>kubectl apply -f deployment.yaml</pre><ol><li>Exec into the new pod to verify that the file still exists:</li></ol><pre>kubectl exec -it &lt;new-pod-name&gt; -- /bin/bash</pre><pre>cat /data/example/hello.txt</pre><pre>exit</pre><p>Replace &lt;new-pod-name&gt; with the name of the new pod that was created by the deployment.</p><h3>Conclusion</h3><p>In this guide, we created a pod in a Kubernetes cluster, created a file within that pod, deleted the pod, and verified that the file still exists in a new pod that is created using the same deployment. By using Persistent Volumes and Persistent Volume Claims, we were able to ensure that our data persisted across pod failures.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3db0ee1a650" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Best Practices for Running Docker Containers with Non-Root Users]]></title>
            <link>https://medium.com/@vv-devops/best-practices-for-running-docker-containers-with-non-root-users-6c9d3dbbd4cb?source=rss-a4f78f48f248------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c9d3dbbd4cb</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <dc:creator><![CDATA[Vinod Varma]]></dc:creator>
            <pubDate>Thu, 23 Feb 2023 07:40:19 GMT</pubDate>
            <atom:updated>2023-02-23T07:40:19.433Z</atom:updated>
            <content:encoded><![CDATA[<p>Docker is a powerful tool for building and running applications in containers. However, security concerns arise when running containers as the root user. By default, Docker runs containers as the root user.</p><p>To solve these security risks, Docker provides the ability to run containers as non-root users. In this blog post, we’ll discuss how to secure Docker containers by using non-root users, and we’ll provide an example Dockerfile to get you started.</p><h3>Why run containers as non-root users?</h3><p>Running containers as the root user poses several security risks. For example, if an attacker gains access to a container running as the root user, they can easily escalate their privileges to gain root access to the host machine. Additionally, running containers as the root user allows the container to modify files on the host machine.</p><h3>Creating a Dockerfile with a non-root user</h3><pre># Use an official lightweight version of Ubuntu as the base image<br>FROM ubuntu:latest<br><br># Install Apache<br>RUN apt-get update &amp;&amp; apt-get install -y apache2<br><br># Create a non-root user and group to run Apache with<br>RUN groupadd -r apache &amp;&amp; \<br>    useradd -r -g apache apache<br><br># Change ownership of directories that Apache needs to write to<br>RUN mkdir -p /var/run/apache2 /var/lock/apache2 /var/log/apache2<br>RUN chown -R apache:apache /var/run/apache2 /var/lock/apache2 /var/log/apache2 /var/www/html<br><br># Copy files into /var/www/html<br>COPY . /var/www/html/<br><br># Expose port 80<br>EXPOSE 80<br><br># Start Apache as the non-root user we created<br>USER apache<br>CMD [&quot;/usr/sbin/apache2ctl&quot;, &quot;-D&quot;, &quot;FOREGROUND&quot;]</pre><p>This Dockerfile creates a Docker image based on the latest lightweight version of Ubuntu that includes the Apache2 server. It also creates a non-root user and group to run the Apache server with, and sets the ownership of directories that Apache needs to write to.</p><p>This specifies that the base image for our Docker image will be the latest version of Ubuntu.</p><pre>FROM ubuntu:latest</pre><p>This updates the package repository and installs the Apache2 server. This creates a new system group called apache and a system user also called apache that belongs to the apache group.</p><pre>RUN groupadd -r apache &amp;&amp; \<br>    useradd -r -g apache apache</pre><p>These two commands create three directories that Apache needs to write to and set the ownership of those directories and /var/www/html to the apache user and group.</p><pre>RUN mkdir -p /var/run/apache2 /var/lock/apache2 /var/log/apache2<br>RUN chown -R apache:apache /var/run/apache2 /var/lock/apache2 /var/log/apache2 /var/www/html</pre><p>The -p option tells mkdir to create the directories as needed, so it won’t throw an error if the directories already exist. Then, we’re running the chown command to give ownership of both directories to the myuser user.</p><p>This copies all the files in the current directory into the /var/www/html directory in the container.</p><pre>COPY . /var/www/html/</pre><p>This exposes port 80 so that we can access the Apache server running in the container.</p><pre>EXPOSE 80</pre><p>This sets the user that the container will run the Apache server as to apache and specifies the command that will be run to start the server when the container is launched.</p><pre>USER apache<br>CMD [&quot;/usr/sbin/apache2ctl&quot;, &quot;-D&quot;, &quot;FOREGROUND&quot;]</pre><p>Using a non-root user in a Dockerfile provides several benefits:</p><p>Improved security: By default, a process running as root has full access to the system, which can be a security risk. Running a process as a non-root user with reduced privileges can limit the damage that can be done in the event of a security breach.</p><p>Better isolation: When running a container as a non-root user, the container is isolated from the host system and other containers, which reduces the attack surface.</p><p>Avoiding file permission issues: Running a container as a non-root user can help avoid file permission issues, as the user running the container will have the same permissions as the user who created the files.</p><p>Overall, using a non-root user in a Dockerfile can improve the security and isolation of your container, help meet compliance requirements, and avoid file permission issues.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c9d3dbbd4cb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Continuous Integration and Deployment with Docker and Kubernetes using Jenkin.]]></title>
            <link>https://medium.com/@vv-devops/continuous-integration-and-deployment-with-docker-and-kubernetes-using-jenkin-19f1fbaf374b?source=rss-a4f78f48f248------2</link>
            <guid isPermaLink="false">https://medium.com/p/19f1fbaf374b</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Vinod Varma]]></dc:creator>
            <pubDate>Tue, 21 Feb 2023 19:33:33 GMT</pubDate>
            <atom:updated>2023-02-21T19:33:33.317Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*VlsBt31azsp6rb-qzq2Etg.png" /></figure><p>Prerequisites</p><p>Before we dive into the tutorial, you will need the following:</p><ul><li>A DockerHub account</li><li>A Kubernetes cluster</li><li>kubectl installed on your machine</li></ul><p>Server1: Jenkins</p><p>This server hosts the Jenkins automation server, To enable Jenkins to work with Docker, you will need to install Docker on the server and add the Jenkins user to the Docker group.</p><pre>sudo apt update<br>sudo apt install docker.io -y</pre><p>To add the Jenkins user to the Docker group and grant the required permissions, run the following commands:</p><pre>sudo usermod -aG docker jenkins<br>sudo chmod 666 /var/run/docker.sock</pre><p>Finally, to ensure that the changes take effect, restart the Jenkins service using the following command:</p><pre>sudo systemctl restart jenkins</pre><p>Server2: K-master</p><p>This server acts as the master node for the Kubernetes cluster and is connected to Jenkins as a slave using the label “k_master”.</p><p>Server3: K-Slave</p><p>This server acts as a worker node in the Kubernetes cluster and is connected to the K-master server. It is responsible for running containerized applications and supporting the deployment and scaling of those applications.</p><p>Step 1: Create a Dockerfile</p><p>A Dockerfile is a script that contains a series of instructions for building a Docker image. This tutorial will use a simple Node.js application as an example.</p><pre>FROM node:12<br>WORKDIR /app<br>COPY package*.json ./<br>RUN npm install<br>COPY . .<br>EXPOSE 3000<br>CMD [&quot;npm&quot;, &quot;start&quot;]</pre><p>This Dockerfile instructs Docker to use the official Node.js 12 image as the base image, set the working directory to “/app”, copy the package.json file to the working directory, install dependencies, copy the application code to the container, expose port 3000, and run the command “npm start” when the container starts.</p><p>Step 2: Build the Docker image</p><pre>docker build -t your-dockerhub-username/node-app:latest .</pre><p>This command will build the Docker image and tag it with “your-dockerhub-username/node-app:latest”</p><p>Step 3: Push the Docker image to DockerHub</p><p>Now that the Docker image has been built, we can push it to DockerHub so that it can be easily pulled down and deployed to a Kubernetes cluster.</p><pre>docker login</pre><p>Next, push the Docker image to DockerHub by running the following command:</p><pre>docker push your-dockerhub-username/node-app:latest</pre><p>This command will upload the Docker image to DockerHub, where it can be accessed by anyone with the appropriate credentials.</p><p>Step 4: Deploy the Docker image to a Kubernetes cluster</p><p>Now that the Docker image has been built and pushed to DockerHub, we can deploy it to a Kubernetes cluster.</p><p>Create a new file named “deployment.yaml” and add the following contents:</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: node-app<br>  labels:<br>    app: node-app<br>spec:<br>  replicas: 3<br>  selector:<br>    matchLabels:<br>      app: node-app<br>  template:<br>    metadata:<br>      labels:<br>        app: node-app<br>    spec:<br>      containers:<br>      - name: node-app<br>        image: your-dockerhub-username/node-app:latest<br>        ports:<br>        - containerPort: 3000</pre><p>This file defines a Kubernetes Deployment resource that will create 3 replicas of our application</p><p>Next, create a new file named “service.yaml” and add the following contents:</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: node-app<br>spec:<br>  selector:<br>    app: node-app<br>  type: NodePort<br>  ports:<br>  - port: 80<br>    targetPort: 80<br>    nodePort: 3000</pre><p>Create a Jenkins pipeline to automate this process</p><pre>pipeline {<br>    agent any<br><br>    stages {<br>        stage(&#39;Clone Repo&#39;) {<br>            steps {<br>                sh &#39;rm -rf &lt;repo-directory-name&gt;&#39;<br>                sh &#39;git clone &lt;repo&gt;&#39;<br>            }<br>        }<br>         <br>        stage(&#39;Install_Docker&#39;) {<br>            steps {<br>                script {<br>                    def dockerPath = sh(script: &#39;which docker&#39;, returnStatus: true)<br>                    if (dockerPath != 0) {<br>                        sh &#39;apt update&#39;<br>                        sh &#39;apt-get install docker.io -y -q&#39;<br>                    } else {<br>                        echo &#39;Docker is already installed&#39;<br>                  }<br>               }<br>            }<br>         }        <br><br>        stage(&#39;Build Image&#39;) {<br>            steps {<br>                sh &#39;docker build -t your-dockerhub-username/node-app:latest .&#39;<br>            }<br>        }<br><br>        stage(&#39;Run Container&#39;) {<br>            steps {<br>                sh &#39;&#39;&#39;<br>                    #!/bin/bash<br>                    docker stop my_project-1 || true<br>                    docker rm my_project-1 || true<br>                    docker run -d -p 8081:80 --name my_project-1 your-dockerhub-username/node-app:latest<br>                &#39;&#39;&#39;<br>            }<br>        }<br><br>        stage(&#39;Push Image&#39;) {<br>            steps {<br>                withCredentials([string(credentialsId: &#39;dockerhub-cred&#39;, variable: &#39;dockerhub-cred&#39;)]) {<br>                    sh &#39;&#39;&#39;<br>                        #!/bin/bash<br>                        docker login -u &lt;Dockerhub_username&gt; -p ${dockerhub-cred}<br>                        docker push your-dockerhub-username/node-app:latest<br>                    &#39;&#39;&#39;<br>                }<br>            }<br>        }<br><br>        stage(&#39;Deploy to K8s Server&#39;) {<br>            agent {<br>                label &#39;k_master&#39;<br>            }<br>            steps {<br>                script {<br>                    try {<br>                        sh &#39;kubectl apply -f deployment.yaml --record=true&#39;<br>                        sh &#39;kubectl apply -f services.yaml&#39;<br>                    } catch (error) {<br>                        sh &#39;kubectl create -f deployment.yaml&#39;<br>                        sh &#39;kubectl create -f services.yaml&#39;<br>                    }<br>                }<br>            }<br>        }<br>    }<br>}</pre><ol><li>Clone Repo: This stage clones the source code from a GitHub repository.</li><li>Install_Docker: This stage checks if Docker is installed and installs it if it is not already installed. If Docker is already installed, the stage skips the installation.</li><li>Build Image: This stage builds a Docker image using the source code and Dockerfile in the cloned repository.</li><li>Run Container: This stage runs a Docker container from the image built in the previous stage.</li><li>Push Image: This stage logs into Docker Hub using a set of credentials, and pushes the newly built Docker image to the Docker Hub registry.</li><li>Deploy to K8s Server: This stage deploys the newly built Docker image to a Kubernetes cluster. This stage is executed on a Kubernetes agent, which is specified using the label attribute in the agent block.</li></ol><p>Overall, the pipeline automates the entire process of building and deploying a Docker image to a Kubernetes cluster, enabling continuous integration and deployment of applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19f1fbaf374b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>