<?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 Deepa Mathan on Medium]]></title>
        <description><![CDATA[Stories by Deepa Mathan on Medium]]></description>
        <link>https://medium.com/@deepamathan?source=rss-a7598c126c66------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*MmPdpq-q2dGAK2qq4bPRrA.jpeg</url>
            <title>Stories by Deepa Mathan on Medium</title>
            <link>https://medium.com/@deepamathan?source=rss-a7598c126c66------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 23:56:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@deepamathan/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[Step-by-Step Guide to Generate AWS Security Credentials]]></title>
            <link>https://medium.com/@deepamathan/step-by-step-guide-to-generate-aws-security-credentials-8c0b433e5de6?source=rss-a7598c126c66------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c0b433e5de6</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Deepa Mathan]]></dc:creator>
            <pubDate>Wed, 01 Nov 2023 09:13:49 GMT</pubDate>
            <atom:updated>2024-03-14T14:14:03.566Z</atom:updated>
            <content:encoded><![CDATA[<p>AWS authenticates and authorizes your requests using the security credentials. There are different types of users in AWS. All AWS users have security credentials. In this blog, you will a detailed steps to generate AWS Credentials and IAM user account creation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yh3W4nuaWIGtiTvK6qmuZQ.png" /></figure><p>If you are new to AWS and want to know how to create your own AWS account, please refer to my blog post on a detailed walkthrough on <a href="https://medium.com/p/85bd735cacff/edit"><strong>AWS account creation</strong></a><strong>.</strong></p><p>Then, generate an Access Key ID and Secret Access Key via the AWS Identity and Access Management (IAM) console. Set environment variables or configure the AWS CLI with these credentials so Terraform may interact with AWS on your behalf.</p><p>Generating AWS credentials involves creating an IAM (Identity and Access Management) user and obtaining access keys. Here’s a step-by-step guide to help you on creating IAM user account:</p><p><strong>Step 1: Sign into the AWS Management Console:</strong></p><ul><li>Go to <a href="https://aws.amazon.com/">AWS Management Console</a>.</li><li>Sign in using your AWS account credentials.</li></ul><p><strong>Step 2: Access the IAM Dashboard:</strong></p><ul><li>Navigate to the “Services” menu and select “IAM” under the “Security, Identity, &amp; Compliance” section.</li></ul><p><strong>Step 3: Create a New IAM User:</strong></p><ul><li>In the IAM dashboard, select “Users” from the left-hand menu.</li><li>Click on the “Add user” button to create a new user.</li></ul><p><strong>Step 4: Set User Details:</strong></p><ul><li>Enter a username for the new IAM user.</li><li>Choose the type of access for the user (e.g., programmatic access, AWS Management Console access, or both).</li></ul><p><strong>Step 5: Attach Policies:</strong></p><ul><li>Attach the policies that define the permissions for this user. You can choose existing policies or create custom ones based on your requirements.</li></ul><p><strong>Step 6: Review and Create:</strong></p><ul><li>Review the configuration to ensure it’s correct.</li><li>Click “Create user” to create the IAM user.</li></ul><p>After creating the user, you’ll receive a success message with the user’s access key and secret access key. Now let&#39;s see the steps to generate AWS security credentials.</p><h3><strong>Steps to generate Security credentials:</strong></h3><p><strong>Step 1: </strong>In the AWS management console, Search for the services IAM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*JsIB9GkIqLNnkm0FgB46vw.png" /></figure><p><strong>Step 2: </strong>Choose IAM Services to create an access ID and Security Key. On the right side under ‘Quick Links’ click on “<a href="https://us-east-1.console.aws.amazon.com/iamv2/home?region=us-east-1#/security_credentials">My security credentials</a>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*Un-tPAyGJhIwUUO7KMfeRw.png" /></figure><p><strong>Step 3:</strong> Click on Create Access Key to generate the access ID and Security Key. Always best practice to create security credentials from the IAM user account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*TKWNEz8tBFwjz3yD-gj9Yg.png" /></figure><p><strong>Step 4: </strong>Download the .csv file and save it for future login, if you lose or forget the secret access key, we can’t retrieve it. Instead, you have to create a new access key and inactive the old keys.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*sHrMFhtykUlSp-E6q7QuFQ.png" /></figure><p>Generated access key ID details will be reflected under the Access keys section in an active status.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*Z441HmOEp3b52LHg69VsIQ.png" /></figure><p>Make sure to save these credentials securely, as the secret access key is only shown once.</p><p>Now you have the access key and secret access key, which are essential for programmatic access to AWS services. Always ensure you securely manage and store these credentials, following best security practices.</p><p>Stay tuned for more blogs on Amazon Web Service (AWS) !!</p><p>I’m filled with joy to present this article, eager to ignite your curiosity with fresh insights. Join me and our community on Medium.com; let your applause resonate by clicking that heartfelt 👏 button below, a gesture that means the world to us.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c0b433e5de6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Terraform — Infrastructure as Code Tool]]></title>
            <link>https://medium.com/@deepamathan/terraform-infrastructure-as-a-code-1dbf0f7ed3e1?source=rss-a7598c126c66------2</link>
            <guid isPermaLink="false">https://medium.com/p/1dbf0f7ed3e1</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Deepa Mathan]]></dc:creator>
            <pubDate>Mon, 23 Oct 2023 08:47:25 GMT</pubDate>
            <atom:updated>2024-03-14T14:15:33.979Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Beginner’s Guide to Infrastructure Automation with Terraform</h3><p>In this blog, you can learn an introduction to Terraform which is an infrastructure as a code tool. Among the different tools available for IaC, Terraform appeared to be a popular choice. Here we cover some basic concepts of Terraform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e1gfKgJ9VHvwdQb7yoo2Ug.png" /></figure><h3><strong>Introduction:</strong></h3><p>Terraform is an open-source infrastructure provisioning tool created by HashiCorp, it allows you to define and manage your infrastructure using a declarative language which is written in GO language.</p><p>Terraform allows you to create, modify, and destroy infrastructure resources across different cloud providers, such as AWS, Azure, GCP, etc. It describes the desire state of the infrastructure on the premises environment.</p><h3>Benefits of Using Terraform</h3><p>🔥 It supports multiple cloud providers such as AWS, Azure, Oracle, GCP, and more.</p><p>🔥Terraform configuration is written in easy-to-understand language.</p><p>🔥 It simplifies the management and orchestration of multi-tier infrastructure.</p><p>🔥Terraform modules allow you to spate resources in dedicated and reusable templates.</p><h3><strong>Terraform Lab setup:</strong></h3><p>To make a terraform lab setup we have to install the following pre-requisites:</p><ol><li>Download &amp; install <a href="https://developer.hashicorp.com/terraform/downloads">terraform.</a></li><li>IDE has used <a href="https://code.visualstudio.com/download">VS code editor</a> can be downloaded.</li><li>Terraform Extensions for VS Code Editor:</li></ol><p>👉Terraform Autocomplete</p><p>👉 AWS Tool Kit</p><p>👉Simple Terraform Snippets</p><p>👉 AWS CLI</p><p>4. Configure AWS Credentials:</p><p>👉<a href="https://medium.com/cloudnloud/aws-account-creation-made-easy-a-detailed-walkthrough-85bd735cacff">AWS Account</a></p><p>👉 Generate Security Credentials</p><p>👉Configure in AWS CLI</p><h3>Terraform Configuration</h3><p>🫱Terraform script/code are stored in plain text file .tf extension</p><p>🫱The file that contains terraform code is called a configuration file or terraform manifest.</p><p>🫱You should know you&#39;re working directory before executing the code, whenever you execute the terraform code you should be in the working directory where the configuration file is available.</p><h3>Terraform Configuration Syntax</h3><pre>&lt;BLOCK TYPE&gt; &quot;&lt;BLOCK LABEL&gt;&quot; &quot;&lt;BLOCK LABEL&gt;&quot;   {<br>  # Block body<br>  &lt;IDENTIFIER&gt; = &lt;EXPRESSION&gt; # Argument<br>}</pre><h3>Blocks and Arguments:</h3><ul><li>Blocks are like a container to define other contents of your infrastructure.</li><li>An argument assigns a value to a particular name: argument name and argument value.</li><li>Argument names, block type names, and the names of most Terraform-specific constructs like resources, input variables, etc. are all identifiers.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z0bNAiLISAwAc23nCnSO-g.png" /></figure><blockquote><strong>Let’s starts with terraform basic concepts in terraform registry, providers and resources and terraform workflow.</strong></blockquote><p><strong>Registry</strong> has all the reusable components for providers and modules. For more information check the website <a href="https://registry.terraform.io/">registry</a>. It provides official, verified, and community tier providers for free in terraform configuration.</p><p><strong>Providers</strong> are plugins that implement resource types. It’s a logical abstraction of an upstream API. They are responsible for understanding API interactions and exposing resources.</p><p><strong>Modules</strong> make your work easy, as we can just plug in the common modules to our terraform code. Modules are self-contained packages of Terraform configurations that are managed as a group.</p><h3><strong>Terraform Workflow</strong></h3><p>The workflow consists of lifecycle stages which start with the init, plan, apply, and destroy. All these have been executed as a command for the written code to update or changes in the infrastructure built.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*pj5yGOUqZPh2xziDCiRMdA.png" /><figcaption>Terraform workflow</figcaption></figure><p><strong>Terraform Init</strong><br> <br>🎯 Terraform initializes the working directory containing terraform configuration files.<br> <br>🎯 Terraform initializes downloads and installs the provider’s plugin so that it can later be executed.<br> <br> 🎯Terraform has created a lock file .terraform.lock.hcl to record the provider selections it made above. And also, it initializes the backend configuration.<br> <br> <strong>Terraform fmt</strong><br> <br> 🎯Terraform format command is used to rewrite Terraform configuration files to a canonical format and style.<br> <br> <strong>Terraform Validate</strong><br> <br>🎯 The terraform validate command validates the configuration files in a directory.<br> <br>🎯 Validate command to verify whether a configuration is syntactically valid and thus primarily useful for general verification of reusable modules, including the correctness of attribute names and value types.<br> <br> 🎯It can run before the terraform plan. Validation requires an initialized working directory with any referenced plugins and modules installed.<br> <br> <strong>Terraform Plan<br> </strong><br>🎯 Terraform plan command is used to create an execution plan. It will not modify things in infrastructure. It compares the desired terraform state with the current state in the cloud. It doesn’t change the deployment. <br> <br> 🎯This command is a convenient way to check whether the execution plan for a set of changes matches your expectations without making any changes to the state<br> <br> <strong>Terraform Apply</strong><br> <br> 🎯It applies the changes required to reach the desired state of the configuration. This command executes the plan that is already created. It compares the correct state with desire state. <br> <br>🎯 It will write data into terraform.tfstate file. Once the application is completed, resources are immediately available.<br> <br> <strong>Terraform Destroy</strong><br> <br> 🎯The Terraform destroy command is used to delete the created resources in the Terraform-managed infrastructure.</p><p><strong><em>In the terraform configuration file, most of the terraform features are controlled by top-level blocks. We need to have the following 3 blocks for creating a terraform configuration.</em></strong></p><p><strong>Terraform Block — </strong>Here is the required terraform version, list of providers required, and terraform backend.</p><pre>terraform {<br>required_providers {<br>aws = {<br>source = &quot;hashicorp/aws&quot;<br>version = &quot;5.0.1&quot;<br>}</pre><p><strong>Provider Block — </strong>It declares providers for Terraform to install the providers which is going to be used. Terraform relies on the providers to interact with remote systems. Provider configuration belongs to the root module.</p><pre>provider &quot;aws&quot; {<br>region = &quot;us-east-1&quot;<br>profile = &quot;default&quot;<br>}</pre><p><strong>Resource Block — </strong>Each resource block describes one or more infrastructure objects. Each resource block is an infrastructure object, like compute instances, virtual networks, or other components.</p><pre>resource &quot;aws_instance&quot; &quot;webserver&quot; {<br>ami = &quot;ami_id&quot;<br>instance_type = &quot;t2.micro&quot;<br>}</pre><p><strong>Let us apply the above terraform blocks in configuration and execute commands.</strong></p><h3><strong>Creating an EC2 Instance on AWS using Terraform</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*JzZzk6Kti4aBG7LbJLfOQg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*v6cX8SiqIfFVbH-0sd0n3A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*F0aaXun1Oqtk9uvS-LdD9A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*ZaHwb3iCzSdM32d09QKWuA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*XrQdh3KxZmfu7JZTJAjb6A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*fAcvWDxU_FZvlZ1PXidf-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*b-1xaBl957uj7mAJTovChA.png" /></figure><p><strong>Now let us discuss the important files created during execution:</strong></p><h3><strong>1. Dependency Lock File:</strong></h3><p>❇️ The dependency lock file belongs to the configuration as a whole, rather than to each separate module in the configuration</p><p>❇️ The lock file is named as <strong>.terraform.lock.hcl and </strong>available in the subdirectory of .terraform of your working directory.</p><p>❇️ It automatically gets created when we execute the <em>terraform init </em>command to record the provider so that terraform can make the same selections by default when you run terraform init in the future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*9SD1eQybD-FkO_kEpdmLyA.png" /></figure><h3><strong>2. Terraform State File:</strong></h3><p>❇️ Terraform state stores the infrastructure information and its configuration. The state file maintains a record of the resources created by your configuration and maps them to real-world resources.</p><p>❇️ The state file is stored in JSON format in the name of <strong>terraform.tfstate </strong>by default in our local workspace. Also, terraform maintains a backup file for terraform state which is named <strong>terraform.tfstate.backup</strong></p><p>❇️ Whenever we execute <em>terraform apply </em>a new terraform.tfstate file will be created and its backup will be written in terraform.tfstate.backup file.</p><p>❇️ The state file can be stored/maintained remotely in various methods like using the version control tool Git, Amazon S3 as remote store and also in terraform cloud, enterprise, and consul.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*6vqqJZ8A9APdyrPmUEf0TQ.png" /></figure><h3><strong>Terraform State commands:</strong></h3><p>These are the list of terraform state commands used frequently.</p><p>📢<strong>terraform state list:</strong> It lists the resources within the state file.</p><p>📢<strong>terraform state mv :</strong> Move items within terraform state. This will be used for resource renaming without destruction.</p><p>📢<strong>terraform state pull:</strong> It manually downloads and outputs the state from the state file.</p><p>📢<strong>terraform state push:</strong> Manually upload a local state file to the remote state</p><p>📢<strong>terraform state rm:</strong> It removes items from the state &amp; no longer managed by Terraform. The resources removed from the state are not physically destroyed.</p><p>📢<strong>terraform state show: </strong>Show attributes of a single resource in the state.</p><h3><strong>What Is the Current State and Desire State in Terraform</strong></h3><h3><strong>Current state</strong></h3><p>📍Current state is the present state of the resources deployed, stored locally as terraform.tfstate file and not in remote infrastructure.</p><p>📍After creating the infrastructure, any manual changes made in the configuration will not reflect in the current state file.</p><p>📍In the next execution of the terraform apply command, it will make all the infrastructure changes manually and keep the infrastructure the same in its current state.</p><h3><strong>Desire state</strong></h3><p>📍Desire state is the new state expected to apply from your terraform configuration.</p><p>📍It compares with the current state every time to update the infrastructure.</p><p>📍It will detect the changes between the desired state and the current state and try to ensure that the deployed infra is based on the desired state.</p><p>📍If there is a difference between the two, the <em>terraform plan</em> will show the necessary changes required to achieve the desired state.</p><h3><strong>Types of Terraform state store:</strong></h3><p>There are two types of stores for Terraform state: local and remote.</p><p><strong>Local state</strong> refers to the Terraform state stored on the local filesystem, i.e. on your laptop or whatever system you are running the Terraform command from.</p><p><strong>Remote state</strong> is Terraform state stored remotely, such as in an S3 bucket or a database like PostgreSQL.</p><h3><strong>Terraform Variables:</strong></h3><p>Terraform variables store the values which can be reusable in terraform configuration. The functions of variables are as follows:</p><p><strong>Input Variables</strong> as function arguments, so users can customize behavior without editing the source.</p><p><strong>Output Values </strong>are like return values for a Terraform module.</p><p><strong>Local Values</strong> are a convenience feature for assigning a short name to an expression.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/481/1*p7LdrM8m2AtaKtfAJwAhDw.png" /></figure><p><strong>Input Variables</strong></p><p>Input variables are declared in the variable block. It has the following arguments declared in the variable block such as name, type, default, and description.</p><pre>Variable &lt;variable name&gt; {<br>description = &quot;updating instance type&quot; - - - Give a meaningful description<br>type = string - - - - - - - - - - - - - ex: string, number, bool, list, map<br>default = &quot;t2.micro&quot; - - - - - - - - - - variable default value</pre><p><strong>Let’s create a few simple variable files, the type of value of the variables like string, number, or bool.</strong></p><ul><li><strong>String </strong>— A sequence of Unicode characters representing some text</li><li><strong>Number</strong> — A numeric value that includes either a whole number or a fractional value.</li><li><strong>Bool </strong>— It&#39;s either TRUE or FALSE. A Boolean value.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*cuHxe5QEuXptzGttaRIVZw.png" /></figure><p>Next check on the <strong>complex variable </strong>types of variables like <strong>Map </strong>and <strong>list</strong> are collection type.</p><h3>Maps</h3><p>Maps are associative arrays used for situations where you want to use one value to look up another value. We can take the example, AMI for creating EC2 instances should be taken as region-specific.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*DmHprWe7n46uIHDW8j8igw.png" /></figure><p>To change the region, we need to look up a new AMI using the input variable Map of strings.</p><h3><strong>List</strong></h3><p>Each value can be called by its corresponding index in the list. Here is an example of a list variable definition. Also in the list, we need to denote the index value that you are looking for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*0fQ-0LIByFa5KmitSUB7vA.png" /></figure><h3><strong>Assigning Values to Input Variables:</strong></h3><p>There are multiple ways to assign values for input variables as listed below.</p><p>💡In command-line option</p><p>💡In variable definitions files</p><p>💡As an environment variable</p><p><strong>Command-line Option:</strong></p><p>To mention the specific individual variables on the command line, we can use the <strong>–var</strong> option while running the terraform plan and terraform apply commands. Ex: We will specify a region on the command line.</p><pre>$ terraform plan -var &#39;aws_region=us-west-1&#39;</pre><p>Same as can do an authentication of the access key and secret key in the command line as given below:</p><pre>$ terraform apply –var=&quot;AWS_ACCESS_KEY=&lt;Access key&gt;&quot;<br>$ terraform apply –var=&quot;AWS_SECRET_KEY=&lt;Secret key&gt;&quot;</pre><h3><strong>CLI Variables:</strong></h3><p>We can mention the same file in the command line option using <strong>–var-file </strong>in “terraform apply” as follows:</p><pre>$ terraform apply -var=&quot;image_id=ami-xyz234&quot;</pre><p><strong>Variable Definition Files Option:</strong></p><h3><strong>Tfvars file:</strong></h3><p>To set many variables by specifying their values in a single variable file will be convenient that we can use the variable definition file ending in <strong>.tfvars. </strong>The file created is named <strong>terraform.tfvars</strong> or <strong>terraform.tfvars.json</strong> as shown below.</p><pre>$ terraform apply –var-file=&quot;sample.tfvars&quot;</pre><p><strong>auto tfvars files:</strong></p><p>Another file name is given as <strong>.auto.tfvars</strong> or <strong>.auto.tfvars.json . </strong>The file .auto we add will be loaded automatically without specifying the –var-file flag.</p><h3><strong>Environment Variables:</strong></h3><p>Terraform by default searches environment variables named <strong>TF_VAR_</strong> followed by the name of the declared variable. The environment variable names are case-sensitive, they match the variable name exactly as given in the configuration.</p><pre>Export TF_VAR_AWS_REGION=us-east-1</pre><h3><strong>Output Values:</strong></h3><p>Output values make information about your infrastructure available on the command line and can expose information for other Terraform configurations to use. Output values are similar to return values in a programming language.</p><h3><strong>Local Values:</strong></h3><p>Terraform local values are like temporary local variables. It’s an expression name assigned by local values so that we can use it multiple times within the same modules. It helps to avoid repeating the same values in a module configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*rWpkqGYFozhbfVe9e9kjHQ.png" /></figure><h3><strong>Meta Arguments in Terraform</strong></h3><p>Meta arguments are used to control how resources are created, updated, and destroyed. It controls the behavior of resources.</p><p>🎯count</p><p>🎯count.index</p><p>🎯for_each</p><p>🎯depends_on</p><p>🎯provider</p><p>🎯lifecycle</p><p><strong>Count </strong>argument with its value as a whole number, terraform creates that many numbers of resources on the execution of the configuration. The argument can be used with each type of resource block.</p><pre>resource &quot;aws_instance&quot; &quot;sample&quot; {<br>Count = 4<br>Ami = &quot;ami-ID&quot;<br>Instance_type = &quot;t2.micro&quot;<br>}</pre><p><strong>Count.Index </strong>To modify each of the instances or any other resource, here we can use count.index ${count.index} in our configuration in all blocks where the count argument is declared. The index numbers always start from 0.</p><pre>resource &quot;aws_instance&quot; &quot;linux_server&quot; {<br>count = 4 - - - - - - - creates four similar EC2 instances<br>ami = &quot;ami-ID&quot;<br>instance_type = &quot;t2.micro&quot;<br>tags = {<br>Name = &quot;linux_server ${count.index}&quot;<br>}<br>}</pre><p>This will create four instances with the names “linux_server_0” , “linux_server_1”, up to 4.</p><p><strong>For_Each </strong>looping can be used when the value is either as a map or a set of strings. It allows you to create n number of resources of the same type but different properties. In the below example, the resource block takes the inputs from variable to for_each argument to create EC2 instances from the values declared in vars.tf configuration.</p><pre>resource &quot;aws_instance&quot; &quot;webserver&quot; {<br>for_each =var.webservers<br>ami = &quot;ami-ID&quot;<br>instance_type =&quot;t2.micro&quot;<br>tags = {<br>name = each.value[&quot;name&quot;]<br>}<br>}</pre><p><strong>Depends_on is </strong>used to specify that the resource depends on another resource. This can be useful when creating resources that require other resources to exist first, such as a load balancer that depends on an auto-scaling group.</p><p><strong>Lifecycle</strong> it is used to manage a complete life cycle of the resources in the configuration file. It handles when to create, destroy, or change. Examples of these sub-arguments include <em>create_before_destroy, prevent_destroy, ignore_changes</em>.</p><pre>Resource &quot;aws_instance&quot; &quot;example&quot; {<br>Lifecycle {<br>Create_before_destroy = true<br>}<br>}</pre><p>Here <em>create_before_destroy</em> meta-argument changes this behavior so that the new replacement object is created first, and the prior object is destroyed after the replacement is created.</p><h3><strong>Terraform Provisioners</strong></h3><p>Provisioners are used to create specific actions on the local machine or on a remote machine in order to prepare servers or other infrastructure objects for service. There are two types of provisioners generic (listed below) and vendor (chef, puppet)</p><p><strong>· file</strong></p><p><strong>· local-exec</strong></p><p><strong>· remote-exec</strong></p><p><strong>file provisioner</strong> helps to transfer files or directories from one source to the destination machine like we can transfer the file from your local machine to an ec2 instance.</p><pre>provisioner &quot;file&quot; {<br>source = &quot;specify the path from where we need to copy&quot;<br>destination = &quot;destination path where you want your file to be&quot;<br>}</pre><p><strong>Local-exec provisioner </strong>used to perform a task on to our local machine where you have been installed terraform. The provisioner executes the command locally after the resource gets created.</p><p><strong>Remote-exec provisioner </strong>executes the script on the resource created by the terraform script. It can be done by connecting with remote resources using ssh.</p><h3><strong>Terraform Modules</strong></h3><p>The Terraform module allows you to create a logical abstraction on some resource sets. It allows you to group resources and reuse them for later use. We can customize our module by using already-built Terraform modules hosted in the Terraform Registry.</p><h3><strong>Root Module</strong></h3><p>🔥Each terraform configuration has at least one module known as the root module, which consists of the resources defined in the .tf files in the main working directory.</p><h3><strong>Child Modules</strong></h3><p>🔥A root module can call other modules to include their resources into the configuration is referred to as a child module.</p><p>🔥Child modules can be called multiple times within the same configuration, and multiple configurations can use the same child module.</p><h3><strong>Published Modules</strong></h3><p>🔥Terraform Registry hosts a broad collection of publicly available Terraform modules for configuring many kinds of common infrastructure.</p><p>🔥Terraform can download them automatically if you specify the appropriate source and version in a module call block.</p><p>🔥Terraform can load modules from a public or private registry. These modules are free to use.</p><h3><strong>How to Use Modules</strong></h3><p>🔥Module Blocks document the syntax for calling a child module from a parent module, including meta-arguments like for_each.</p><p>🔥Module Sources document what kinds of paths, addresses, and URIs can be used in the source argument of a module block.</p><p>🔥The Meta-Arguments section documents special arguments that can be used with every module, including providers, depends_on, count, and for_each.</p><p><strong>Let’s do it with Terraform Modules which can create a re-usable module for hosting a static website.</strong></p><p>Have created a terraform module structure that contains a directory called modules with respective .tf files and inside the module, we will be creating another directory S3, within this file we’re going to define an aws_S3_bucket resource. <br> <br> <strong>Terraform</strong><br> | <br><strong> Modules <br></strong> | — -<a href="http://main.tf/">main.tf</a><br> | — -<a href="http://variables.tf/">variables.tf</a><br> | — -<a href="http://outputs.tf/">outputs.tf</a><br><strong> | — — — — S3</strong> <br> | — — <a href="http://main.tf/">main.tf</a><br> | — — <a href="http://variables.tf/">variables.tf</a><br> | — — <a href="http://output.tf/">output.tf</a><br> | — — — — — — www<br> | — — -index.html<br> | — — -error.html</p><p>Apply the structure, and syntax for creating S3 bucket and attach the policy.</p><pre>resource &quot;aws_s3_bucket&quot; &quot;staticsite&quot; {<br> bucket = var.bucket_name<br> acl = &quot;public-read&quot;<br> policy = &lt;&lt;EOF # here paste the aws_iam_policy_document<br> EOF <br> website {<br> index_document = &quot;index.html&quot;<br> error_document = &quot;error.html&quot;<br> }<br> tags = var.tags<br> force_destroy = true<br> }</pre><p>Step up module within the root terraform.tf file. Within here we’ll specify a Provider, variable, and initiate our static site module.</p><pre>module &quot;website_s3_bucket&quot; {<br> source = &quot;../modules/s3&quot; # relative path<br>bucket_name = var.my_bucket<br> <br> tags = var.my_tags<br> }</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*55-5TR02RkZA8OG8CNvszw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*CPhcFtkXF7DRTQ2oIDZDcA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*hzLZnnA4IGa7aONt1IrgnQ.png" /></figure><p>Using the terraform module in this configuration we have hosted the static website.</p><p><em>Execution Result — Static webpage created screenshot given below</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*Klu9zI6NhQkdhCa2bmnilA.png" /></figure><h3><strong>Terraform workspace</strong></h3><p>It allows you to create different and independent states on the same configuration. Terraform workspace reduces the usage of code. As it’s compatible with the remote backend this workspace is shared with your team.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*Dm2Bty1V3lud60f1djpEAw.png" /><figcaption>source:google.com</figcaption></figure><p><strong>How to use Workspace?</strong></p><p><strong><em>$ terraform -help workspace</em></strong></p><p>Usage: It lists the terraform workspace commands given below</p><p>💥<strong>new</strong> Create a new workspace</p><p>💥<strong>list</strong> Lists Workspaces</p><p>💥<strong>show</strong> It shows the name of the current workspace</p><p>💥<strong>select</strong> Select a workspace</p><p>💥<strong>delete</strong> To delete a workspace</p><h3><strong>How does it work?</strong></h3><p>Multiple workspaces are supported by backends like <em>S3, AzureRM, Remote, Consul</em>, etc.,</p><p>This example will be deployed locally on 3 different stages, one state for each environment which are development, staging, and production.</p><p>If deployed to all 3-environment workspace will produce three different state files.</p><p>├── website.sh</p><p>├── instance.tf</p><p>├── provider.tf</p><p>├── terraform.tfstate.d</p><p><strong>│ └── dev</strong></p><p>│ └── terraform.tfstate</p><p><strong>│ └── Stag</strong></p><p>│ └── terraform.tfstate</p><p><strong>│ └── Prod</strong></p><p>│ └── terraform.tfstate</p><p>├── terraform.tfvars</p><p>└── vars.tf</p><h3><strong>Workspace Setup — S3 as Remote Backend:</strong></h3><p>We can also backup the remote state of each workspace to S3, here the terraform script is given below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*sYp1go97icf-5Q5NuaPPxg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Gc0KEoiikAE246SSQ4sgCw.png" /></figure><p><strong>Created a new workspace for developing an environment.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*_E1Mdhgb6cVJnw2vXOhdJQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*V0oLApiI0MBRADKbjbAlgA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*-uM9GV7jnPqDe-RgnSpCHQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*0-aAHlOmXqpZj3imT4-SrA.png" /></figure><p>We require ideally similar infrastructure for development, production, staging, and QA. Terraform workspace is the perfect solution for this kind of problem.</p><p>Finally, workspace cleanup was performed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*sjB77ep7pkfub484Tl0-Ng.png" /></figure><p>In conclusion, we have delved into the fundamentals of Terraform configuration, equipping you with the necessary knowledge to get started on your infrastructure-as-code journey.</p><p>Remember, continuous learning and staying up to date with the latest Terraform releases and best practices will enhance your proficiency and lead to even more successful infrastructure deployments.</p><p>Happy Terraforming🙂!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1dbf0f7ed3e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Account Creation Made Easy: A Detailed Walkthrough]]></title>
            <link>https://medium.com/@deepamathan/aws-account-creation-made-easy-a-detailed-walkthrough-85bd735cacff?source=rss-a7598c126c66------2</link>
            <guid isPermaLink="false">https://medium.com/p/85bd735cacff</guid>
            <category><![CDATA[budget]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[infrastructure]]></category>
            <dc:creator><![CDATA[Deepa Mathan]]></dc:creator>
            <pubDate>Tue, 17 Oct 2023 14:46:04 GMT</pubDate>
            <atom:updated>2023-10-21T18:16:17.110Z</atom:updated>
            <content:encoded><![CDATA[<p>Amazon Web Services (AWS) is Amazon.com’s widely used and extensive cloud computing platform. It offers a wide range of cloud services to assist individuals, businesses, and organizations in the development and management of their applications and infrastructure in a flexible, scalable, and cost-effective manner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SFHCT411xA0Kuv8PYBN-SQ.png" /></figure><p>AWS continues to evolve and expand its services to meet the growing demands of the cloud computing landscape, making it a popular choice for businesses of all sizes and industries. AWS offers a wide range of services that cater to various computing needs. Users can access and use these services without the need to own or manage physical hardware.</p><p>Creating an Amazon Web Services (AWS) account involves several steps. Here’s a step-by-step guide to help you create an AWS account:</p><p>Step 1: <strong>Visit AWS Website</strong></p><p>Go to the AWS website at <a href="https://aws.amazon.com/"><strong>URL</strong></a><strong> c</strong>lick on “Sign into the Console”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*deJ9koJtPzvBLrVHW9RX1w.png" /></figure><p>Step 2: <strong>Click “Create an AWS Account”</strong></p><p>Click the “Create an AWS Account” button on the top right corner of the AWS homepage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*gJXHRobvLueVCYgN5Bv-JA.png" /></figure><p>Step 3: <strong>Provide Your Email Address</strong></p><p>Enter your email address and choose “I am a new user.” then enter the verification code process then Click “Next.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*vlcKjvv3zIn4dP9U7LefEA.png" /></figure><p>Step 4: <strong>Enter Your Account Information</strong></p><p>Fill in the required information, including your name, desired AWS account name, and password. Click “Next.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*4vKQMElgVfE_w58w7_rb8w.png" /></figure><p>Step 5: <strong>Update Contact Information</strong></p><p>Provide your contact information, including your phone number and address. Click “Next.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*PTd0vTUqSb6oJX7eIRS24A.png" /></figure><p>Step 6: <strong>Payment Information</strong></p><p>Enter your payment information. AWS requires a valid credit card for account creation, even for the free tier. Fill in the necessary details and click “Secure Submit.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*D_R1mdnNd5SBRkbiLymV8g.png" /></figure><p>Step 7: <strong>Identity Verification</strong></p><p>AWS will perform an identity verification process, usually by making an automated call to the phone number you provided. Follow the instructions for verification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*wT7gSO42z37uARfdeXCmJA.png" /></figure><p>Step 8: <strong>Choose a Support Plan</strong></p><p>Choose the desired AWS support plan. If you’re just starting out, you might choose the free Basic support plan. Click “Continue.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*1dAkz3x_a91poQyG0QA2uA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*3A10dGz7H4ixn-LVOnLLFw.png" /></figure><p>Step 9: <strong>Confirmation</strong></p><p>Review your details and make sure everything is accurate. Read and accept the AWS Customer Agreement, AWS Service Terms, and AWS Privacy Notice. Click “Create Account and Continue.” And your account will be created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*33fAZaTpGs8MrqV2jEXHeg.png" /></figure><p>Step 10: <strong>Access the AWS Management Console</strong></p><p>Once the setup is complete, you can access the AWS Management Console using your new AWS account credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oq7mbTTh5_8VDXHV-c73AQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*GZEUNZcMoN2Me6t353Xktw.png" /></figure><p>Congratulations! You now have an AWS account, and you can start using AWS services and resources. Be sure to manage your account responsibly and securely.</p><p><strong>AWS Billing and Cost Management:</strong></p><p>Creating a zero-budget AWS billing account involves configuring budget alerts and cost controls to ensure that you do not exceed the AWS Free Tier limits and incur any charges.</p><p>Here are the steps to set up AWS billing to maintain a zero budget:</p><p>Step 1: <strong>Billing Dashboard</strong></p><p>Sign in to the AWS Management Console and go to the AWS Billing and Cost Management dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*iE4g6HwsCkY6JWNZvtCeCg.png" /></figure><p>Step 2: <strong>Set Up Billing Alerts</strong></p><p>Navigate to the “Budgets” section in the left-hand menu and click on “Create budget.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*9R7ToLbuFRJcoPIfm5PM1A.png" /></figure><p>Step 3: <strong>Choose Zero Budget</strong></p><p>Choose “Cost budget” and set a budget amount of $0 to ensure no charges exceed this limit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*kqvwwGpI4G7Vfs7hmwlVag.png" /></figure><p>Set up email alerts to notify you if your usage or spending approaches the budgeted amount. Its Created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*emkpM1kKhCqtN0qtugS-kw.png" /></figure><p>By following these steps and actively monitoring your AWS usage and costs, you can effectively maintain a zero-budget AWS account while utilizing the AWS Free Tier resources and avoid any unexpected charges..</p><p>Regularly monitor your AWS usage and set up billing alerts to notify you when your usage approaches or exceeds the free tier limits.</p><p>Remember, while aiming for a “zero budget” account, it’s crucial to manage and monitor your usage to avoid unexpected charges. Always review your AWS account and usage regularly to stay within budget and take advantage of the free tier offerings.</p><p>Stay tuned for more blogs on Amazon Web Service (AWS) !!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85bd735cacff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Integrate Tomcat Server in CICD Pipeline]]></title>
            <link>https://medium.com/@deepamathan/how-to-integrate-tomcat-server-in-cicd-pipeline-bbe59557a083?source=rss-a7598c126c66------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbe59557a083</guid>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[pipeline]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[maven]]></category>
            <dc:creator><![CDATA[Deepa Mathan]]></dc:creator>
            <pubDate>Thu, 21 Sep 2023 18:11:52 GMT</pubDate>
            <atom:updated>2023-09-21T18:12:56.985Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U00V3vcYcWPTUS7kxmUrpA.png" /></figure><p>In this blog, you can get an idea on how to deploy an artifact on Tomcat server, its a simple job Integrating Apache Tomcat server into a Continuous Integration/Continuous Deployment (CICD) pipeline involves automating the deployment and management of your web application on the Tomcat server.</p><p>In this example, Maven is used to build the application and generate a WAR file. The WAR file is then deployed to the Tomcat server.<strong> </strong>For that have to setup CI/CD pipeline with Github, Jenkins, Maven and Tomcat.</p><h3><strong>A step-by-step guide to Deploying Artifacts on a Tomcat Server</strong></h3><p>Deploying artifacts on a Tomcat server typically involves deploying web applications (WAR files) onto the Tomcat container. Here’s a step-by-step guide to deploying artifacts on a Tomcat server:</p><p>✳️ Prepare your artifact</p><p>✳️ Access Tomcat Manager</p><p>✳️ Access the Tomcat Manager URL</p><p>✳️ Login Tomcat</p><p>✳️ Deploy the Artifact</p><p>✳️ Monitor Deployment</p><p>✳️ Access your application</p><p>Lets dive into the detailed view on how to deploy the artifact in target environment which we using here is Tomcat server.</p><h4><strong>Table of Contents:</strong></h4><p>📌Installation of Java</p><p>📌 Configure Tomcat</p><p>📌Create EC2 instance</p><p>📌 Start Tomcat Server</p><p>📌 Setup Jenkins Job to deploy code on tomcat server</p><p>📌Access web page on port 8080</p><p><strong>Installation of Java:</strong></p><p><strong>Step 1:</strong> Create Ec2 instance, here taken linux machine connected via mobaxtrem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*8sZyFLgCH7ZOS65cay4Hfg.png" /></figure><p><strong>Step 2: </strong>To install Tomcat server, primarily we need to install Java using the command “amazon-linux-extras”</p><pre>$ amazon-linux-extras install java-openjdk11</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*sf_4Mx4qNi_bs-U5ypQ7Ig.png" /></figure><p><strong>Step 3:</strong> Next, in setup of Tomcat Server, have to get the tomcat download link from website <a href="https://tomcat.apache.org/download-90.cgi">URL</a> .</p><p>Copy the latest version Tomcat 9 link tar.gz file shown in screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*PmF8Kpa3GpbwHz7awLnJqg.png" /></figure><p><strong>Step 4:</strong> Using the command wget&lt;tomcat download link&gt;</p><pre>wget&lt;tomcat download link&gt;<br>wget https://downloads.apache.org/tomcat/tomcat-9/v9.0.80/bin/apache-tomcat-9.0.80.tar.gz.sha512</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*9EQEO1vAN1P_sLdV3pXxTA.png" /></figure><p><strong>Step 5: </strong>Unzip/extract the .tar file using the command “tar –xvzf &lt;file name&gt;”</p><pre>tar –xvzf &lt;file name&gt;<br>tar –xvzf apache-tomcat-9.0.76.tar.gz</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*SR3CzDMLnG5f6RxN5FemXA.png" /></figure><p><strong>Step 6: </strong>After extracting, This is optional, if required you can change the name using the command mv &lt;oldname&gt; &lt;newname&gt;</p><pre>mv &lt;oldname&gt; &lt;newname&gt;<br>mv apache-tomcat-9.0.76 tomcat</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*fELi2w5UQHNUTCBxnH3hgQ.png" /></figure><p><strong>Step 7:</strong> Now go inside tomcat and within that we have a bin directory to start the tomcat services.</p><p>In bin directory, if you listed you get startup.sh script which we need to run “./startup.sh” to start the tomcat services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*wHhwJHXHWkLfbGJiWuwmbw.png" /></figure><p>Tomcat started successfully. We can check it in browser via port 8080</p><pre>&lt;public IP&gt;:8080</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*THPSkbyHWdKB6UYT0cUEcw.png" /></figure><p><strong>Step 8: </strong>In Tomcat web page, click on Manager APP and login with your login username and password which we created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*OfSfqnTH4g19galpX5fcmQ.png" /></figure><p>Now we have configured our tomcat server successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*Q7dkkfV3Z_rBA8olml8bMQ.png" /></figure><p><strong>Step 9:</strong> Next have to integrate tomcat with Jenkins to deploy the code in tomcat server. First need to install plugins and then configure tomcat.</p><p><strong>Step 10:</strong> Install Deploy to Container plugins. To install plugins go to “manage Jenkins” search for the available plugins “deploy to container” and install it without restart.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*dn3dKNZnOdcZX3RmFdoqiA.png" /></figure><p><strong>Step 11:</strong> Next to Configure tomcat server with credentials, again go to manage Jenkins then click on credentials in that click on “Global Credentials” here you can add new credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*-mSWvdVJfjtof8E796tF3Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*iNQjjDwXGvoSEqvWIn0Plg.png" /></figure><p><strong>Step 12:</strong> Next have to create the new job that to deploy the code on tomcat server. I have created the job in the name of deploytomcatjob. In creating a job have selected the maven project, then updated the git repository URL in SCM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*T-5mxUSrDMyspgtsIZzvfw.png" /></figure><p>Update the github url where the code is available to deploy in tomcat server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*iHi4jOTMSu0A-vfyc3Iy9w.png" /></figure><p><strong>Step 13:</strong> Set the goals as clean and install, to clean the previous build cache information and install.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*uS93mz1unP-o3ndrJ0EOjg.png" /></figure><p><strong>Step 14: </strong>Next click on post build actions, where we can deploy our code on tomcat server. Under post-build actions choose<strong> </strong>Deploy war/ear to a container. This option to be enabled because we have already installed deploy to container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*u5jI2B4EYjlfOFH-UrQJmQ.png" /></figure><p>We can give the full path of the .war file or else can mention like<strong> </strong>War/ear files to deploy. Relative to the workspace root. You can also specify Ant-style GLOBs, like “<strong>**/*.war</strong>” so that it will can wherever the file available.</p><p><strong>Step 15: Next add the containers choose </strong>Tomcat 8.x Remote then add credential which we already added to deploy container and tomcat url.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*PXDHbYTkusFlkfsMPCfomA.png" /></figure><p><strong>Step 16:</strong> Finally click on Apply and save the details then click on Build now to build the created job.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*FxVvWNIqhsp7gfuKGQFsCQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Wnh3YAfX55co0-q0Rj1iCA.png" /></figure><p><strong>Step 17: </strong>Job sucessfully created the same can be seen in Build history. The same you can check in tomcat server where the artifact webapp.war file is available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*q0NgY3T82mVrYwvn80Qb5A.png" /></figure><p>After successful deployment, you can check the same in tomcat webpage, where one more webapp directory got created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*iLqgfMA0mviwuLh4phXuew.png" /></figure><p><strong>Step 18:</strong> If you click on the “webapp” directory it redirects to the deployed app webpage output is given below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*txgX2JlsTbv-Qrc_lJ02-A.png" /></figure><p>📝Hope you got a complete process on how to deploy a simple html code using CICD Pipeline integrated on Tomcat server.</p><p><em>In the next blog will share on how to automate the job whenever their is a change in code commit, how can we schedule and the various options in build triggers to make the job automated </em>🪄</p><p><em>Let’s keep the conversation going! Your engagement through claps </em>👏<em>and comments </em>✍️<em> helps build a vibrant community of like-minded individuals </em>😇<em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbe59557a083" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“Containerization Using Docker”]]></title>
            <link>https://medium.com/@deepamathan/containerization-using-docker-dde6b675797?source=rss-a7598c126c66------2</link>
            <guid isPermaLink="false">https://medium.com/p/dde6b675797</guid>
            <category><![CDATA[dockerfiles]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[learning]]></category>
            <dc:creator><![CDATA[Deepa Mathan]]></dc:creator>
            <pubDate>Tue, 19 Sep 2023 17:11:20 GMT</pubDate>
            <atom:updated>2023-09-19T17:11:20.328Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*bafV40VlR5UusngMB_ivOQ.png" /></figure><p>If you’re new to Docker or simply looking to refresh your knowledge, this blog post serves as a comprehensive introduction to Docker containerization.</p><p><em>Let’s get started!!</em></p><h3><strong>Why do we need Containerization?</strong></h3><p>🔥<strong><em>There is a scenario where a code runs in two different environment by different persons.</em> </strong>When the developer runs the code in his system and he gets perfect result hence he forwarding it to testing team, here the same code with the same dependencies but the code doesn’t work, why? What will be the problem? Let’s go in deep on this issue.</p><p>🔥<strong><em>Here they using two different environment based on their needs, they may have different OS.</em></strong> Having different environment cause issues when the code has to be run. A developer used different OS, different version of softwares and particular dependencies but the testing person may not have same environment, so in different environment the code behaves differently.</p><p>🔥<strong><em>To resolve this issues, containers plays a vital role to create an isolated environment. </em></strong>Containers are portable to deliver software in packages. Here developer writes the code in container and then send this container to the tester, so that the tester will run the code in the same environment everything will work fine.</p><p>🔥<strong><em>To launch the Containers we have multiple applications like lxd, MESOS, Docker, rkt out of this Docker is the best containerization tool.</em></strong> It will have a better performance as they are hosted in a single Docker engine.</p><p>🔥Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package.</p><h4><strong>Benefits of Using Containers</strong></h4><p>✅Container occupies very less space.</p><p>✅ It takes very less time to boot up when compared to virtual machine.</p><p>✅ Containers runs steadily having better performance as they runs in single Docker engine.</p><p>✅ High scalability and high efficiency</p><p>✅ Containers are very easily portable from one system to another.</p><p>✅ The data volume can be reused and shared among multiple containers.</p><h3><strong>What is Docker?</strong></h3><p>💥<strong>Docker </strong>is a tool which containerize the application, allows you to separate your application from infrastructure so that we can deliver the software quickly.</p><p>💥It provides an ability to create container, in that we can launch OS level virtualization, here we can launch our OS level virtualization to deliver software in packages and these containers are isolated from one another and bundled in your own software.</p><p>💥Docker streamlines the development lifecycle by allowing developers to work in standardized environments using local containers which provide your applications and services. Containers are greatly used for continuous integration and continuous delivery (CI/CD) workflows.</p><h3>Key Concepts:</h3><p><em>Before we dive deeper into Docker, let’s familiarize ourselves with some essential concepts:</em></p><ol><li><strong>Docker Images:</strong> Docker images are read-only templates that define the application, its dependencies, and runtime instructions. Think of them as blueprints for containers.</li><li><strong>Containers:</strong> Containers are instances of Docker images that can be run and executed. They are isolated environments where applications can run without interfering with the host system or other containers.</li><li><strong>Docker Engine:</strong> This is the core component of Docker responsible for building, running, and managing containers. It consists of a server, REST API, and a command-line interface.</li><li><strong>Dockerfile:</strong> A Dockerfile is a text file that contains a set of instructions for building a Docker image. It specifies the base image, application code, environment variables, and more.</li><li><strong>Registry:</strong> Docker images can be stored and shared in repositories called Docker registries. Docker Hub is a popular public registry, but organizations can set up private registries for security and control.</li><li><strong>Docker Volumes: </strong>Docker volumes are a feature in Docker that allows you to persist data generated by and used by Docker containers. Volumes provide a way to manage and share data between containers and the host machine.</li><li><strong>Dockerhub: </strong>Docker Hub is a cloud-based platform and a central component of the Docker ecosystem. It serves as a public registry for Docker images, providing a place for Docker users to discover, share, and distribute container images.</li></ol><h3><strong>Installation — Docker Desktop</strong></h3><blockquote>Let’s see how to install Docker on different operating system like windows, Ubuntu, Mac OS. Sharing you the installation guide URL for Windows and Mac OS Desktop.</blockquote><p>📌This page contains download <a href="https://docs.docker.com/desktop/install/mac-install/"><strong>URLs</strong></a><strong>,</strong> information about system requirements, and instructions on how to install Docker Desktop for Mac.</p><p>📌In this <a href="https://docs.docker.com/desktop/install/windows-install/"><strong>URL</strong></a> you can get the information and instructions on how to install Docker Desktop for Windows.</p><p>📌This page contains information about general system requirements, supported platforms, and instructions on how to install Docker Desktop for Linux. <a href="https://docs.docker.com/desktop/install/linux-install/"><strong>URL</strong></a></p><p>📌Docker Engine is available on a variety of <a href="https://docs.docker.com/desktop/install/linux-install/">Linux distros</a>, <a href="https://docs.docker.com/desktop/install/mac-install/">macOS</a>, and <a href="https://docs.docker.com/desktop/install/windows-install/">Windows 10</a> through Docker Desktop, and as a <a href="https://docs.docker.com/engine/install/binaries/">static binary installation</a>. Find your preferred operating system in the given <a href="https://docs.docker.com/engine/install/">URL</a>.</p><h4><strong>Installation On Linux System</strong></h4><p>As if now we have seen on how to install Docker desktop version. Also let’s have detailed steps on installing Docker on Linux machine. Let’s use an Ubuntu example to begin installing Docker.</p><p><strong><em>To install packages into the Linux system via the following command, the latest packages can be updated to the OS.</em></strong></p><p><strong>sudo− </strong>Make sure you run in root user, use sudo command is used to make sure the command runs with root access.</p><p><strong>update− </strong>Update option ensures that all packages on the Linux system are updated.</p><pre>$ sudo apt-get update<br>$ sudo apt-get install docker.io</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*42megbP94uI8mD65bVs4iA.png" /><figcaption>docker installation command</figcaption></figure><h3><strong>Docker Commands:</strong></h3><p>➤ <strong>To check the installed Docker version, use the command given below.</strong></p><pre>$ docker --version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*AuDYFzFQy6yEaLBVon4SUg.png" /><figcaption>docker version</figcaption></figure><p>➤ <strong>To pull an image of an application use the command. Using this image, we can go-ahead and launch a container.</strong></p><pre>$ docker pull &lt;image name&gt;<br>$ sudo docker pull ubuntu </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*47huaMReflgmCj9RBLuK3A.png" /></figure><p>➤ <strong>To check the image of an application which we downloaded and its information, use the below command.</strong></p><pre>$ sudo docker images</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*rpQklE7UhyGXkC1uzWASvQ.png" /></figure><p>The command “ docker images” lists all the images you have in your current machine.</p><p>➤ <strong>To create or run a container, use the command given below.</strong></p><pre>$ sudo docker run &lt;image name&gt;<br>$ sudo docker run -itd -p 80:80 ubuntu</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FxUp81GaU_9eqmKwXbQ-QA.png" /></figure><p>Here, “sudo docker run” is to run your container and the flag “-it” it makes the container interactive then -p is to run in the port number which i have given 80:80, followed by the name of the image “Ubuntu”.</p><p>This command output will gives alpha-numeric result which is shows docker container has been created.</p><p>➤ <strong>To show the list of containers we have created running in current instance, use the command below.</strong></p><pre>$ sudo docker ps</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jor-p6l9C7DUUdwdOqARIQ.png" /></figure><p>Here the name of the container will be created as a generic name they will be a randomly assigned name like <em>vigilant gold</em>. To change the container name, run the following command.</p><pre>$ sudo docker run -it -d --name &lt;new name of the container&gt; &lt;image name&gt;<br>$ sudo docker run -it -d --name first-container ubuntu</pre><p>This will create another container with the new name you have given.</p><p>➤ <strong>To list all the containers which is running and stopped containers use the command below.</strong></p><pre>$ sudo docker ps -a</pre><p>➤ <strong>To go inside a container use the command “exec” is given below. </strong>Now you are inside the container “Ubuntu” server.</p><pre>$ sudo docker exec -it &lt;container ID&gt; bash<br>$ sudo docker exec -it 3e3ba29e0f95 bash</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*-2xtgvki6V1YKiEoX9xC_w.png" /><figcaption>Inside the container -ubuntu</figcaption></figure><p>➤ Now you are inside the container Ubuntu server which is root account. Here I give a sample on how to install Apache2 using linux commands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*VPyfvhC8clnnpaJOD2WVMA.png" /></figure><p>Next, have to start the installed apache2 server. using the command given in screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*x76Cj3IvcKjH3zXHC_9hRg.png" /></figure><p><strong>➤ Check if you are able to access the apache page on your browser. Copy the public IP followed by mention :port number.</strong></p><pre>&lt;public IP&gt;:port_number<br>http://3.83.126.153:81/</pre><p>The apache2 page is accessible on the browser using IP address and the port number.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*E70LHOgbkvu_oulxxQrGhw.png" /></figure><p>➤ <strong>To stop the container use the command “stop” is given below.</strong></p><pre>$ sudo docker stop &lt;container ID&gt;<br>$ sudo docker stop 3e3ba29e0f95</pre><p>➤ <strong>To create a new image using the existing image for creating new container and to save the changes to docker have to commit the container.</strong></p><pre>Sudo docker commit &lt;previously created image container ID&gt; &lt;name for the new image&gt;<br>Sudo docker commit 3e3ba29e0f95 deepa_img</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*kiSAPxXUy8fvYl2ZQXHbOw.png" /></figure><p>Launched the container from the new image and mapped to the port number 82 (as port 81 is already in use)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*DUHm1FRslrTLcAFrHd6F2w.png" /></figure><p>In this new container you can install apache2/nginx required webserver.</p><p>➤ <strong>To push the image in to “Docker hub” for that we need to give the login credential of this machine.</strong></p><pre>$ sudo docker login<br>username:<br>Password:</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r978GyzrU66uKkG6_uv4qw.png" /></figure><p>➤ <strong>To push the image in to “Docker hub” use the command given below.</strong></p><pre>$ sudo docker push &lt;image_name&gt;<br>$ sudo docker push deepamathanapp1:v1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eyGTpnl6N14z8xXMu8nm_g.png" /></figure><p>Image successfully pushed in docker hub in new repository created app1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*JKBsJNlMjYqe5rl6iFgw3Q.png" /></figure><p>➤ <strong>To pull the image from docker hub use the command given below.</strong></p><pre>$ sudo docker pull &lt;image_name&gt;<br>$ sudo docker pull deepamathanapp1:v1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KcSY_OH6Ck4I8hU_k83BQQ.png" /></figure><p>Hope you are clear on how to push and pull images from docker hub.</p><h3>Docker File</h3><p><em>As we already seen the definition for dockerfile in above Key concepts. Now lets see on how builds images automatically by reading the instructions from a docker file.</em></p><h3><strong>Commands to write Dockerfile:</strong></h3><p><strong>FROM</strong>: It helps to pull the base image.</p><p><strong>RUN</strong>: To execute commands</p><p><strong>CMD</strong>: To run defaults on the start of the container. It can be replaceable.</p><p><strong>ENTRYPOINT</strong>: To configure the container which will run as an executable.</p><p><strong>WORKDIR</strong>: To create the working directory.</p><p><strong>COPY</strong>: To copy directory from local machine to docker container.</p><p><strong>ADD</strong>: To copy files and folders from local to docker container.</p><p><strong>EXPOSE</strong>: To listens on the specified network ports at runtime.</p><p><strong>ENV</strong>: To setup environment variable.</p><blockquote><strong>Using the above given dockerfile commands, Creating a dockerfile where apache 2 installed.</strong></blockquote><p>To create dockerfile, make a directory in that create one dockerfile using the command.</p><pre>$ sudo nano dockerfile<br><br>FROM ubuntu<br>RUN apt-get update<br>RUN DEBIAN_FRONTEND=&quot;non interactive&quot; apt-get install tzdata -y<br>RUN apt-get install apache2 --y<br>ENTRYPOINT apachectl -D FOREGROUND</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*hZpBDbpYFNps_RgdboSAkg.png" /></figure><p>After updating the linux script to install apache 2 server, save and exit the docker file and run it.</p><pre>$ sudo docker build -t C3</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*qgW5M6uzBFZe4wX-QxT5Nw.png" /></figure><p>Image created new repository c3</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*NC1FYF9TR33G7E5jEPXACg.png" /></figure><p>Next have to run the docker image in port 83:80</p><pre>$ sudo docker run -itd -p 83:80 C3</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*gWsons8p8WqO9hden0iOdQ.png" /></figure><p>And finally check the same in browser using the public IP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gmGcxYgDVcnDNhSHgYoxTg.png" /></figure><p>In the same docker file we can run our own HTML file also.</p><h3>Conclusion:</h3><p>Docker containerization has transformed the way we build and deploy applications, offering portability, consistency, and efficiency. In this introductory post, we’ve covered the fundamental concepts and benefits of Docker, setting the stage for further exploration into Docker’s practical usage, best practices, and advanced features.</p><h4>🎯Stay tuned for more Docker-related insights and tutorials to level up your containerization skills!</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dde6b675797" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ansible Basics and its Playbook Configuration]]></title>
            <link>https://medium.com/@deepamathan/ansible-basics-and-its-playbook-configuration-219b42915201?source=rss-a7598c126c66------2</link>
            <guid isPermaLink="false">https://medium.com/p/219b42915201</guid>
            <category><![CDATA[configuration-management]]></category>
            <category><![CDATA[ansible]]></category>
            <category><![CDATA[modules]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Deepa Mathan]]></dc:creator>
            <pubDate>Wed, 06 Sep 2023 12:23:17 GMT</pubDate>
            <atom:updated>2023-09-06T12:23:17.535Z</atom:updated>
            <content:encoded><![CDATA[<p>This blog completely talks about the basic concepts of Ansible and playbook configurations with hands-on⏳.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gDR0p864RMc0ctkUv2z4hg.png" /></figure><p><strong>Ansible</strong> is an open-source configuration management tool that automates application deployment, orchestration and cloud provisioning.</p><p>✳️It automates the task of software installation, and infrastructure provisioning, improves security and compliance, patch systems and share automation across the entire organization.</p><h3><strong>Features of Ansible:</strong></h3><p>👉Ansible is agentless and doesn’t need any client software to manage node machines.</p><p>👉 It has simple installation steps that have one control machine and you can authenticate to all the remote machines via ssh.</p><p>👉Playbooks are written in YAML language and are easy to understand.</p><p>👉Ansible has more than 1,000 inbuilt modules that we can use in our project</p><p>👉We can customize the modules in any other programming language too.</p><h3><strong>Components In Ansible:</strong></h3><h3><strong>Playbooks</strong></h3><p>Playbook is a script which describes the automation jobs that need to be done, written in YAML (Yet Another Markup Language), often used to create configuration files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R-LdlQ5dN04FEkl1MtRx4Q.png" /><figcaption>Ansible Architecture</figcaption></figure><h3><strong>Inventory</strong></h3><p>It has the information about the remote machine. It has a list of hosts/nodes, IP addresses, servers, databases, DNS, etc., which need to be managed and where playbook tasks will be operated. By default inventory file stored in path <em>/etc/Ansible/hosts.</em></p><h3><strong>Modules</strong></h3><p>Ansible modules is a separate units of code can be reused in playbook task. It can control central resources, services, files, or packages, etc. and handle executing system commands. The modules also referred to as task plugins or library plugins.</p><pre>ansible webservers -m service -a &quot;name=httpd state=started&quot;</pre><h3><strong>Plugins</strong></h3><p>Plugins are pieces of code that augment Ansible’s core functionality. Ansible uses a plugin architecture to enable a rich, flexible, and expandable feature set.</p><h3><strong>Handler</strong></h3><p>It rebound the service automatically but are only run if the task contains a notify keyword.</p><h3><strong>Notify</strong></h3><p>Notifying the same handler multiple times will result in executing the handler only once regardless of how many tasks notify it.</p><h3>Playbook Structure</h3><pre>---<br>- name: Example playbook<br>  hosts: all<br>  vars:<br>    my_var: &quot;Hello, World!&quot;<br>  tasks:<br>    - name: Print message<br>      debug:<br>        msg: &quot;{{ my_var }}&quot;</pre><p><strong>— — —</strong>Starts with three indent</p><p><strong>Hosts </strong>-(provide the list of host machines means where do you want to run the playbook)</p><p><strong>Variables </strong>-(provides the variables list)</p><p><strong>Tasks </strong>-(have to give the list of tasks need to execute, give in the order in which you need to proceed)</p><p><strong>Handlers </strong>-(its also same as tasks but after its task executed will notify)</p><h3><strong>Hands-On Practice Ansible:</strong></h3><blockquote><strong><em>Creating Simple Ansible Playbook in 3 cluster nodes installing Java on host nodes using the playbook. The steps are as follows:</em></strong></blockquote><p>1. Create control machine</p><p>2. Install Ansible in your control machine</p><p>3. To make cluster, create two more host machine</p><p>4. Connect them via SSH</p><p>5. Add the host machine details in Inventory file</p><p>6. Write a playbook to install Java</p><p>7. Deployment completed using Ansible</p><h3>☄️<em>Let’s start with the hands-on step by step process for creating 3 cluster nodes </em>☄️</h3><p><strong>Step 1:</strong> Create 3 EC2 instances with Ubuntu 22.04 operating system and Ansible installed in the control node and connect via SSH using Putty or MobaXterm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*6WmUfcmwbBTcFZP1eT5Mfw.png" /><figcaption>created 3 EC2 instance 1 control/master machine &amp; 2 host nodes</figcaption></figure><p><strong>Step 2:</strong> Install the following commands in your control/master machine and followed by give <em>a “sudo apt update”</em> in all the node machines.</p><pre>$ sudo apt update<br>$ sudo apt install software-properties-common<br>$ sudo add-apt-repository - yes - update ppa:ansible/ansible<br>$ sudo apt install Ansible<br>$ sudo Ansible –version</pre><p>Step 3: Once the above commands, check whether the installation done correctly or not, for that run –version to check the installed Ansible version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*36LDcLKqCUR8wGe7BdyAKw.png" /><figcaption>To ensure ansible installation completion check version</figcaption></figure><p><strong>Step 4:</strong> To make the cluster, first, we have to generate an SSH key, for that run the command given below.</p><pre>$ ssh-keygen</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*397vCUv20CVGDkZIILXJGQ.png" /><figcaption>Generated public key saved path to be noted</figcaption></figure><p><strong>Step 5:</strong> The generated SSH key is saved in the below file path which needs to be copied and pasted into the host file authorized_keys.</p><pre>Public key saved in /home.ubuntu/.ssh/id_rsa.pub</pre><p><em>To read the generated ssh key use the command sudo cat &lt;public key saved path&gt;</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*2xT9XXNb8K0OxU63pk7SBA.png" /><figcaption>generated ssh key saved path</figcaption></figure><p><strong>Step 6:</strong> Copy the generated ssh key and paste it to the host nodes which we need to connect from the master. Once the public key is copied to the host machines need to check on the connectivity.</p><p><strong>Step 7:</strong> Next have to set the host file, to make the cluster between the master and the slave nodes. We need to store the private IP address of the slave nodes in the Ansible host file which is available in the default path is <em>/etc/Ansible</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*ZfBGBbBUUjgEVDtfCPG3xw.png" /><figcaption>default path of ansible host file</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*bnxjX7UC9ywOqE38xiVVQg.png" /><figcaption>Past the host details in the file created in ansible hosts</figcaption></figure><p><strong>Step 8:</strong> To check the cluster connectivity between master and slave nodes, have to use the following commands. Once you get a success message it means successfully connected the master-slave clusters.</p><pre>$ Ansible –m ping all</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*aURLIxwiQkp-eMCwTAVAYQ.png" /><figcaption>Connection Success for control and host machines</figcaption></figure><p><strong>Step 9:</strong> Let’s now build a playbook, which must be saved as a YAML file with the.yml or.yaml extension.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*4yh13Z9pER9d7rDey1nwPQ.png" /></figure><p><strong>Step 10:</strong> A playbook yaml file should begin with — — — , which denotes that the yaml file begins here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*otG8H_e2a7CTG78XzmS5gg.png" /><figcaption>Simple task in our fist playbook</figcaption></figure><p><strong>Step 11:</strong> Finally, execute the simple playbook command listed below.</p><pre>$ Ansible-playbook web.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*jfLkSO4xZmiDpeFmyvhm8w.png" /></figure><p>After this, if you checked your node1, Java got installed successfully using the Ansible playbook.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*gEglBauE2h-obfymv1-qYA.png" /><figcaption>Check the host nodes java got installed</figcaption></figure><p>The above given is an example of creating a playbook using a single task. In a single playbook, we can able to create multiple tasks as per the job requirements.</p><h3><strong>Ansible Roles</strong></h3><p>Ansible Roles is a group of tasks, vars_files and handlers stored in a standardized file structure. Grouping content by roles also allows easy sharing of roles with other users. It organizes the playbooks.</p><p><strong>Structure of Ansible Role:</strong></p><p>A role directory structure contains directories: defaults, vars, tasks, files, templates, meta, handlers. Each directory must contain a main. yml file which contains relevant content.</p><pre>site.yml<br>webservers.yml<br>fooservers.yml<br>roles/<br>    common/<br>        tasks/<br>        handlers/<br>        files/<br>        templates/<br>        vars/<br>        defaults/<br>        meta/<br>    webservers/<br>        tasks/<br>        defaults/<br>        meta/</pre><p>To create a Ansible roles, use ansible-galaxy command which has the templates to create and it will be created in default directory <strong>/etc/ansible/role</strong>s and do the modifications else we need to create each directories and files manually.</p><p>The command to create the roles using the templates: <em>ansible-glaxy &lt;filename&gt;</em></p><h3><strong>Variables Used In Ansible:</strong></h3><p>Ansible uses variables to manage multiple different systems with a single command using variable can execute tasks and playbooks.</p><p>Within a playbook, variables can be defined and used in a variety of ways.</p><p>The simplest way to use variables is to define them in the playbook YAML file with a single value.</p><p>Take a look on an example playbook that prints a message to stdout.</p><pre>---<br>- hosts: all<br>  vars:<br>    greetings: Welcome to My Blog Page!<br><br>  tasks:<br>  - name: Ansible Variable Example <br>    debug:<br>      msg: &quot;{{ greetings }}, Ansible Basics Concepts&quot;</pre><p>Here, variable starts with the vars block followed by the variable name and its corresponding value. In this example, greetings is the variable name and the value assigned isWelcome to my blog page!</p><p>To refer to the value of the variable, enclose it in double curly brackets like in the following: {{ greetings }}.</p><p>Same like we can use, arrays to define variables with multiple values and also ansible variables with loops. In seperate blog will share examples and execution results for the same.</p><h3>Ansible Ad hoc Command:</h3><p>Ansible ad hoc commands automate a single task on one or more managed nodes using the /usr/bin/ansible command-line tool. Although they are quick and simple, ad hoc commands are not reusable.</p><p><strong>Use cases for ad hoc tasks:</strong></p><p>❇️ Rebooting servers</p><p>❇️ Managing files</p><p>❇️ Managing packages</p><p>❇️ Managing users and groups</p><p>❇️ Managing services</p><p>❇️ Gathering facts</p><p>❇️ Check mode</p><p>❇️ Patterns and ad-hoc commands</p><p>See the <a href="https://docs.ansible.com/ansible/latest/command_guide/intro_adhoc.html">adhoc </a>and <a href="https://docs.ansible.com/ansible/latest/inventory_guide/intro_patterns.html#intro-patterns">patterns</a> documentation for details on all of the available options, including how to limit using patterns in ad-hoc commands.</p><h3>Ansible Modules:</h3><p>✳️ A units of code known as Ansible modules which are capable of managing system resources or carrying out system commands.</p><p>✳️ You can run Ansible’s module library either directly on remote hosts or through playbooks.</p><p>✳️ Modules (also referred to as “task plugins” or “library plugins”) are discrete units of code that can be used from the command line or in a playbook task.</p><p>✳️ Ansible executes each module, usually on the remote managed node, and collects return values.</p><p>Each module supports taking arguments. Nearly all modules take key=value arguments. To pass arguments to a module is using YAML syntax,</p><pre>---<br>- name: Installation of Nginx<br>  hosts: node2<br>  become: true<br>  tasks:<br>  - name: Install nginx on node2 <br>    apt: name=nginx<br>    state=latest <br></pre><p>To see the complete documentation for each module from the command line with the ansible-doc tool.</p><pre>ansible-doc yum</pre><p>To get the list of all available modules, see the <a href="https://docs.ansible.com/ansible/latest/collections/index.html#list-of-collections"><strong>Collection docs</strong></a>, or run the following at a command prompt.</p><pre>ansible-doc -l</pre><h3><strong>Some Ansible Commands For Practise:</strong></h3><p>🌟<strong> </strong>To check Ansible version:<strong> <em>Ansible –version</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*5wAO24viFHWL_J7sUAJV_A.png" /><figcaption>Installed Ansible Version</figcaption></figure><p>🌟 To check installed Ansible ID:<strong><em> Id</em></strong></p><p>🌟 To list all the check the list of nodes: <strong><em>Ansible all –list</em></strong></p><p>🌟 To check connected node: <strong><em>Ansible –m ping all or Ansible all –m ping</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*KE7cgHtVr0cRou6jESXHvw.png" /></figure><p>🌟 To check the document list about Ansible: <strong><em>Ansible-doc –l</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*pSsztckYIKHCr10_3wz5Lg.png" /><figcaption>document list</figcaption></figure><p>🌟 To check number of modules available till now:<em> </em><strong><em>Ansible-doc –l |wc –l</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*ieFVke2hkNE8WYKUeL3tqQ.png" /><figcaption>number of modules</figcaption></figure><p>🌟 Check package related modules:<strong> <em>Ansible-doc –l | grep package</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*AnojbHqHS0SavilzFaDvhg.png" /><figcaption>Search related module</figcaption></figure><p>🌟 For Syntax check:<strong> <em>Ansible-playbook &lt;filename.yaml&gt; — syntax-check</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*91yAWNjjGqySRmo4LJWFYA.png" /><figcaption>playbook syntax check</figcaption></figure><p>🌟 To run a playbook: <strong>Ansible-playbook &lt;filename.yaml&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*RJw4uO5Ud6Ec__JmmMs36g.png" /></figure><p>🌟 <strong><em>Ansible-playbook &lt;filename.yaml&gt; -C –vvvv</em></strong> (it gives detailed output of the execution, detailed verbose helpful for background action)</p><p>In conclusion, We’ve explored ansible core features such as playbooks, roles, and modules, and discussed how it simplifies configuration management☀️.</p><p>I will write a seperate blog on application deployment, and orchestration tasks using ansible🙌.</p><p>🙂<em>Thank you for reading this blog on Ansible basics and its playbook configuration.</em>😇<em>If you have any questions or need further assistance, don’t hesitate to reach out. Happy automating! </em>💻<em>”</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=219b42915201" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jenkins — Continuous Integration Tool]]></title>
            <link>https://medium.com/@deepamathan/jenkins-continuous-integration-tool-f8bbb9351cf3?source=rss-a7598c126c66------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8bbb9351cf3</guid>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[pipeline]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <dc:creator><![CDATA[Deepa Mathan]]></dc:creator>
            <pubDate>Wed, 30 Aug 2023 18:21:54 GMT</pubDate>
            <atom:updated>2023-08-30T18:21:54.362Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Jenkins — Continuous Integration Tool</strong></h3><p>In previous blog, we have seen that the developer written code has been packaged and converted into executable format (JAR or WAR file) by Maven is a build tool. After this code build, continuous integration phase starts. Let’s see more on the Continuous Integration using Jenkins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BQQ67OrF_outmUSyOJfS2Q.png" /></figure><p>Jenkins is an open-source tool written in Java. It helps to automate the software development process with continuous integration. We can integrate Jenkins with a number of testing and deployment technologies.</p><p><strong>Benefits of Using Jenkins:</strong></p><p>💥The task is accurate and quick because to the continuous build process and the testing of reduced code.</p><p>💥Once the developer commit the code to the remote repository it automatically build, test and deploy.</p><p>💥Everything has been controlled in one place which is Jenkins.</p><p><strong>What is Jenkins Pipeline?</strong></p><p>A collection of plugins called Jenkins Pipeline helps you set up and incorporate continuous delivery pipelines into Jenkins.</p><p>A continuous delivery (CD) pipeline is an automated representation of your software delivery process, from version control to users and clients.</p><p><strong>Pipeline syntax</strong></p><p><strong>There are two types of syntax are used for defining Jenkins File.</strong></p><p>📌 <strong>Declarative Pipeline</strong></p><p>📌 <strong>Scripted Pipeline</strong></p><p><strong>Declarative:</strong></p><p>A straightforward method for building pipelines is the declarative pipeline syntax. It has a preconfigured hierarchy that is used to build Jenkins pipelines. It is designed to make writing and reading Pipeline code easier.</p><pre>#Jenkinsfile (Declarative Pipeline syntax)<br><br>pipeline {<br>    agent any<br>    stages {<br>        stage(&#39;Build&#39;) {<br>            steps {<br>                //<br>            }<br>        }<br>        stage(&#39;Test&#39;) {<br>            steps {<br>                //<br>            }<br>        }<br>        stage(&#39;Deploy&#39;) {<br>            steps {<br>                //<br>            }<br>        }<br>    }<br>}</pre><p>Firstly it defines the Build Stage — where it perform the steps related to Build Stage.</p><p>Then Test stage — where the same it perform the steps related to Test Stage.</p><p>And Finally Deploy Stage — Performs the steps in Deploy Stage.</p><p><strong>Scripted:</strong></p><p>It runs on the Jenkins master with the help of a lightweight executor. The pipeline is transformed into atomic commands with the minimal use of resources.</p><p>Declarative and Scripted Pipelines are constructed fundamentally differently. Declarative Pipeline is a more recent feature of Jenkins Pipeline</p><pre>#Jenkinsfile (Scripted Pipeline)<br><br>node {<br>    stage(&#39;Build&#39;) {<br>        //<br>    }<br>    stage(&#39;Test&#39;) {<br>        //<br>    }<br>    stage(&#39;Deploy&#39;) {<br>        //<br>    }<br>}</pre><p>Stage blocks are optional in Scripted Pipeline syntax. But using stage blocks in a scripted pipeline makes each’stage’s subset of tasks/steps in the Jenkins UI more easily visible.</p><p><strong>Plugins In Jenkins:</strong></p><p>🔥Jenkins Plugins are the most important components allows you to customize the Jenkins environment in an easy way as per user requirment.</p><p>🔥There are 1800+ community contributed Jenkins plugins available to support building, deploying and automating any project.</p><p>🔥We can install plugins as per our project requirments , For example if we use a tool like Maven for that we need to install the respective plugin.</p><p>🔥You can refer the plugins in Jenkins and dependencies from the <a href="https://updates.jenkins.io/download/plugins/"><strong>URL</strong></a><strong> .</strong></p><h3>⌛️ <strong>Jenkins — Installation </strong>⏳</h3><p>Lets see the installation part of Jenkins.</p><p><strong>Download Jenkins </strong>— Official website for Jenkins is <a href="https://www.jenkins.io/">URL</a> <strong>.</strong></p><p>Once Jenkins is up and running, one can access Jenkins from the link − <a href="http://localhost:8080/"><strong>http://localhost:8080</strong></a></p><p><strong>Steps to download and Install Jenkins on AWS in an EC2 Instance to Run a Simple Job :</strong></p><p><strong>Content Preview:</strong></p><p>💡EC2 Instance Creation linux machine</p><p>💡 Connect via Mobaxterm</p><p>💡Install Java</p><p>💡 Install Jenkins</p><p>💡Start Jenkins</p><p>💡Access the Web page</p><p><strong>Now let us explore on step by step process</strong></p><p><strong>Step1: </strong>Create EC2 Instance as an amazon linux server. Connected via mobaxterm.</p><p><strong>Step2: </strong>Once you have connected the machine via ssh. Next have to install Java and Jenkins. To install Jenkins, got to Jenkins official website ( <a href="https://www.jenkins.io/download/">https://www.jenkins.io/download/</a> ) In that choose “Stable Version” in that select the linux version “Red Hat/Fedora/Alma/Rocky/CentOS” .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*InB0kDLT7PGZ6utKD_vV0A.png" /><figcaption>steps to dwonload jenkins</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*SR0D7-oC9B0W_-0JgEPhbA.png" /><figcaption>copy the highlighted os link to download jenkins</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*O8XpWtnmeXT93RTOMMXolA.png" /><figcaption>commands to install in linux system</figcaption></figure><p><strong>Step3: </strong>The above given commands executed one by one and installed Jenkins and Java.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*aDMjaTrFDKraysVqicJ1HQ.png" /><figcaption>Command applied to install jenkins</figcaption></figure><p>Epel –release is available in amazon linux extra topic “epel”</p><p>Run the below command to use this.</p><p><strong><em>#sudo amazon-linux-extras install epel</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*2b1skmH-0uHaoS-z8vq1zg.png" /></figure><p><strong>Step4:</strong> Next for installing Java run the below given command.</p><p><strong><em>#sudo amazon-linux-extras install java-openjdk11</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*p3VqqQPaE3fOyvZvXysFkg.png" /><figcaption>java installation</figcaption></figure><p><strong>Step5: </strong>After successfully installed Java, now need to install Jenkins<em>. </em>Run the command “ yum install Jenkins”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*7dwPbhZ2FkLKnoT6DleMUA.png" /></figure><p><strong>Step6:</strong> Now have to check the installed Jenkins status which will be inactive state, have to start the Jenkins service using the commands highlighted in the below screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*-HxQiqUUvpkPCKQ8tb31SQ.png" /><figcaption>Checking jenkins status</figcaption></figure><p><strong><em>Step7:</em></strong><em> Once it is enabled and changed to active status, now we can access on the page using the port number 8080 with the public IP of the created linux server — ec2 instance.</em></p><p><strong><em>&lt;Publicip&gt;:&lt;portnumber 8080&gt;</em></strong></p><p><strong><em>Step8:</em></strong><em> We have logged in to the web UI, give the administrator password to access Jenkins. Copy the default password file path given in the screenshot.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*vLKl2l-Dvm-Hv5YsOlQgFw.png" /><figcaption>Jenkins login Page</figcaption></figure><p><strong>Step9: </strong>To retrieve password copy the path and check for the administrator password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*2qEriFbevqLJTTB1OerICQ.png" /><figcaption>copy the path &amp; use cat command</figcaption></figure><p><strong>Step10: </strong>Once logged in Jenkins I have installed the suggested plugins and created admin user login details. Now Jenkins is ready to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*QdCBI6HxHiQ2tlBvm4NiFA.png" /><figcaption>Jenkins Dashboard</figcaption></figure><h3><strong>How to run your first Jenkins Job?</strong></h3><p><strong><em>Here you can see the steps to run a simple jenkins job build from its execute shell using freestyle project.</em></strong></p><p><strong>Step1: </strong>Lets create our first Jenkins job, it’s a simple one am creating. Click on “New Item” in that selecting “Freestyle project”, then in next page give the description about the job.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ux6yfkk1hDfICCAEz7k5uQ.png" /><figcaption>Here Showing Example on Freestyle Project</figcaption></figure><p><strong>As I told you already, this is a simple Jenkins job execution so am selecting the build steps as “Execute Shell” as we using linux server.</strong></p><p>In the command box you can give script which you want to execute and save it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*KImr8h44XQmc1FUR142SIA.png" /><figcaption>Simple Job- Execution Given In Execute Shell</figcaption></figure><p><strong>Step2: </strong>Next click on build now, whenever we trigger build then the build history will show on the left hand side in which green check mark represents as our build is success.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*DYKLHUp5jo6ze_wq8RxCmg.png" /><figcaption>After clicked Build Now your first job is build</figcaption></figure><p>If you want to see the console output, click on the green tick mark. It will take to the console output page shows complete details and the script command which we given has been executed successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*sEbwv067SLmkdTOv8-kA9Q.png" /></figure><p>This completes execution of our first simple Jenkins job.</p><p><strong>Also I would like to share on how to trigger a pipeline using Git when it Push/Pull the content.</strong></p><h3><strong>Steps to Tigger a Pipepline in Jenkins Using Git</strong></h3><p><strong>Step1: </strong>Launch an EC2 Instance for Node1 (slave), connect via mobaxtrem We have already having master Jenkins where we install Jenkins and Java latest version as mentioned above in the same blog.</p><p>Step2: In slave node, once you installed Jenkins Successfully, to create and mange nodes, click on Manage Jenkins in Jenkins Dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*CAlp87g5MXJbr7OxIwp-YA.png" /><figcaption>Click on Manage nodes &amp; Jenkins</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*eh5WE40FYdgEWsTvr2euEg.png" /></figure><p>Next add Node/Slave instance where you no need to Jenkins again. Update the details as given in below screenshots.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*8G6e1L0JM80ujsnH9MRj-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*eovgSi7RVBoSFZPrOO9Ybg.png" /><figcaption>Jenkins path</figcaption></figure><p>Next have to provide Jenkins credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*v9fhc_S8oNJ181EkqPgfWQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*gLqqBjAcsszgSDmXMclvpg.png" /><figcaption>Update the private Key</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wF2YiX-Sbkhj-HzBUIWwfQ.png" /><figcaption>Update the Node Instace Public IP</figcaption></figure><p>After updating credential, click on next then submit and your node1 will be created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*l9523ftT8ZJgj2WC3nlkJw.png" /><figcaption>Node1 added</figcaption></figure><p>Next let trigger a pipeline using Git , it will be used whenever their is a push to from Github after code commit via git in a particular branch.</p><p>Sharing you the screenshot on the activity i have done in Git.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*FZbG3Jg1hTvIx4sSzAAgng.png" /><figcaption>Created new file for Jenkins pipeline</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*fl-AKybftwtvVISsHmjZqg.png" /></figure><p>Added one new file “main.tf” in the created repository for jenkins pipeline testing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*zCcP2i8QQlaREP_8LalZWA.png" /></figure><p>Also have to create and add the <strong>Webhooks</strong>, if you are not aware on webhook read the details given below.</p><p>A Webhook enables a Jenkins project to be built automatically in response to a commit that is pushed to a Git repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fbr-lgI8uAsCtp1nJ3Xb8g.png" /><figcaption>Git Webhooks</figcaption></figure><p>Add the URL when their is a commit in Git then Jenkins automatically triggers a job.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*fbpDBlfwwi5Iik99NzJxog.png" /><figcaption>here give the Jenkins instance IP:portnumber</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*d5KCOyqxUR4ddqGmuOo6zw.png" /></figure><p>Now we created a webhook in github for jenkins, next go to the jenkins dashboard click on Build Now</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UnEAo5_Jt791SVED4NJ4Vw.png" /><figcaption>Click on Build Now</figcaption></figure><p>Now you can check on the Jenkins workspace from successful build of Job1 on Node1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*hkrCVWR1VCgsOpuUWly5fA.png" /></figure><p>Also you can go to Node1 Server (EC2 Instance) via SSH, check for the Job status in Jenkins Workspace the commit file will be available in Slave Node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*dZOBHXW-etAfeE53L8QunQ.png" /><figcaption>This is the slave node Instance</figcaption></figure><p>Don’t forget till now we have just installed Jenkins run a job. I will write a separate blog in creating an automated CI/CD Pipeline in Jenkins along with that using Git, Maven and Tomcat Setup.</p><p>📝In this blog, we have seen some of the basic understanding on Jenkins and how it works. Lots more are waiting, will explore more on jenkins pipeline in upcoming blogs 🤝.</p><p><em>Let’s keep the conversation going! Your engagement through claps </em>👏<em>and comments </em>✍️<em> helps build a vibrant community of like-minded individuals </em>😇<em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8bbb9351cf3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache Maven — Build Tools in DevOps]]></title>
            <link>https://medium.com/@deepamathan/apache-maven-build-tools-in-devops-6ed44d8ca4e?source=rss-a7598c126c66------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ed44d8ca4e</guid>
            <category><![CDATA[apache]]></category>
            <category><![CDATA[build]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[devops-tool]]></category>
            <dc:creator><![CDATA[Deepa Mathan]]></dc:creator>
            <pubDate>Mon, 28 Aug 2023 19:34:24 GMT</pubDate>
            <atom:updated>2023-08-28T19:37:47.240Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Apache Maven — Build Tools in DevOps</strong></h3><p>In this blog let’s explore on one of the best and widely used build tool in devops 🚀.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z4nrzYg2cbcEKYv-VrTwkQ.png" /></figure><p><strong>Maven </strong>is a build tool which is used to manage the complete lifecycle of the project, generating reports, storing the documents in its POM repository. Mostly maven used in Java based applications .</p><p><strong>Why we need Maven?</strong></p><p>📌The directory structure is enforced and a standard directory structure is created for the storage of code and its related resources.</p><p>📌 It downloads the dependencies, enforces the directory structure, and maintains the application..</p><p>📌 Maven downloads the project dependencies. If the project needs Java API or any other dependencies which are packaged in their own JAR files.</p><p>There are two types of dependencies:</p><p>✶External dependencies</p><p>✶Snapshot dependencies.</p><h3><strong>What is POM Files?</strong></h3><p>🪄POM abbreviation of Project Object Model saved in extension of .xml and Maven project needs pom.xml files.</p><p>🪄These files contains all the details which are required for maven to build a project. POM file stored in ‘src’ (root directory).</p><p>🪄Some of the configuration that can be specified in the POM are project dependencies, plugins or goals that can be run, construction profiles, etc.</p><p>🪄These are written by developers based on the project needs.</p><p><strong>Super POM: I</strong>t is the default POM.</p><p><strong>Minimal POM: </strong>The minimum requirement for a POM are the following:</p><ul><li>project root</li><li>modelVersion - should be set to 4.0.0</li><li>groupId - the id of the project&#39;s group.</li><li>artifactId - the id of the artifact (project)</li><li>version - the version of the artifact under the specified group</li></ul><p>Example:</p><pre>&lt;project&gt;<br>  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; <br><br>  &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;<br>  &lt;artifactId&gt;my-app&lt;/artifactId&gt;<br>  &lt;version&gt;1&lt;/version&gt;<br><br>&lt;/project&gt;</pre><p><strong>Features of Maven:</strong></p><p>⚡️Simple project setup that follows best practices — get a new project or module started in seconds</p><p>⚡️Superior dependency management including automatic updating, dependency closures (also known as transitive dependencies)</p><p>⚡️Able to easily work with multiple projects at the same time</p><p>⚡️Instant access to new features with little or no extra configuration</p><p><strong>Model based builds:</strong></p><p>Maven is able to build any number of projects into predefined output types such as a JAR, WAR, or distribution based on metadata about the project, without the need to do any scripting in most cases. (source: <a href="https://maven.apache.org/">URL</a><a href="https://maven.apache.org/)">)</a></p><p><strong>Maven Repositories:</strong></p><p>1. Local Repository: This is locally stored path like developer system.</p><p>2. Central Repository: The repository maintained by maven community.</p><p>3. Remote Repository: To maintain integral projects mainly used by companies.</p><p><strong>Maven Installation:</strong></p><p>💥 Maven is distributed in several formats for your convenience.</p><p>💥Simply pick a ready-made binary distribution archive and follow the installation instructions.</p><p>💥Use a source archive if you intend to build Maven yourself.</p><p>💥<strong>Download Apache Maven from the given link: </strong><a href="https://maven.apache.org/download.cgi"><strong>URL</strong></a></p><h4>📜<strong>Let’s explore the steps to install Maven and used in a java based project to build the code </strong>📜<strong>.</strong></h4><p>This project is to integrate Maven in an EC2 instance (Jenkins server).</p><p>Click the<strong> </strong><a href="https://maven.apache.org/download.cgi"><strong>maven installation</strong></a> link from this website you need to copy the link highlighted in the screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Ra9814g4wXfAKLHkcsMqIQ.png" /><figcaption>copy the highlighted link</figcaption></figure><p>Go to the EC2 instance connected via SSH, use the linux command<strong> “wget paste the url”</strong> as shown in the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ohh0elalaKdH2Kt4UF2tjg.png" /></figure><p>To extract the installed maven tar file use the command “tar –xvzf &lt;filename&gt; as given in screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*LqLfFV-Hhdvj2y3Q5einKg.png" /></figure><p>Extracted tar file name apache-maven-3.9.3</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*msLb-q7gz5efiH_FmJGhkw.png" /></figure><p>For my convenient changed the name from apache-maven-3.9.3 to maven using the command <strong>mv &lt;oldname&gt; &lt;newfilename&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*uwuI_i8BVT54ga3PTNA8QA.png" /></figure><p>We have installed Maven &amp; Java inEC2 Instance (Jenkins server), now we have to go back to our Jenkins webpage and update the maven and java available path.</p><p>To integrate maven with Jenkins, we have to install plugins same as we did for git. First install maven plugins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*3oo_NZnkeGAqWbQ2d0aQIQ.png" /></figure><p>After installation of maven plugins, go to manage plugins in dashboard in that choose “tools” which is the configuration tool where need to give the path for JDK and Maven.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*pvsQkkg6ZXRT-GBVJEkCeQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*vyBNbZbD7jDFnU0840RAAQ.png" /></figure><p>In final step, build a java project using Maven.</p><p>Create a build job to build the source code which is pulled from github, for that create a new job in that select “MavenProject”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*iL8urrbozuWAkks2D5oJ-w.png" /></figure><p>And then update the maven goal and save. Now build the maven project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Zv8988GxN1A4787eD8Wmkw.png" /></figure><p>When I build this job it pulls the code from github repository and builds with the help of maven.</p><p>Build with the help of maven got finishes successfully. It created a .war file (webapp.war) under Jenkins workspace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*7qZAVsllyM1bMg2mmorcQw.png" /></figure><p>My build history is after two failure got successfully build the target. Artifact (webapp.war) got created under target directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*GF5pNJuBFAHhJjpxsBsugg.png" /><figcaption>build history</figcaption></figure><p>Throughout this blog, we’ve explored the core concepts of dependency resolution, the Project Object Model (POM), and the Maven repository, it’s evident that Maven not only simplifies the development process.</p><p><em>Let’s keep the conversation going! Your engagement through claps </em>👏<em>and comments </em>✍️<em> helps build a vibrant community of like-minded individuals.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ed44d8ca4e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GitHub and Git: A Comprehensive Guide to Version Control]]></title>
            <link>https://medium.com/@deepamathan/github-and-git-a-comprehensive-guide-to-version-control-b46a05d22e2e?source=rss-a7598c126c66------2</link>
            <guid isPermaLink="false">https://medium.com/p/b46a05d22e2e</guid>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Deepa Mathan]]></dc:creator>
            <pubDate>Thu, 24 Aug 2023 14:51:21 GMT</pubDate>
            <atom:updated>2023-08-24T14:51:21.885Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, you can explore on How to create a GitHub, Git commands and a perfect Readme template for your GitHub profile. Also will show you on how to use GitHub for your professional growth effectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VvqaJa8Bn7ezyy6GRr5Bbg.png" /></figure><p><strong>Come On! Let’s Go!</strong></p><p><strong>Content Preview:</strong></p><p>👉 Introduction</p><p>👉 Steps to Create GitHub Profile</p><p>👉 Customize your profile</p><p>👉 Attractive READMe profile</p><p>👉 Git &amp; GitHub How it Works</p><p>👉 Git Commands execution</p><p><strong>What is Git and GitHub?</strong></p><p>Git is a DevOps tool for managing source code. It is a version control system that can efficiently manage small to very large projects and is free and open-source.</p><p>A platform for collaboration and version control is called GitHub. It enables remote collaboration on projects between you and other people.</p><p><strong>Why do you need GitHub?</strong></p><p>💥Users can easily contribute to open-source projects using GitHub.</p><p>💥GitHub offers excellent documentation on just about any subject you can imagine.</p><p>💥GitHub can increase the visibility of your work.</p><p>💥An advantage of using GitHub is the ability to track changes in your code across versions.</p><p><strong>Firstly if you don’t have GitHub account before then follow the given steps. Let’s signup for creating new GitHub profile.</strong></p><p><strong>Follow the Steps to Sign-up:</strong></p><p>1. Click the <a href="https://github.com/">URL</a></p><p>2. In right top corner click on Sign in</p><p>3. Enter the email id, create your own strong password and give the user name</p><p>4. Then have to account verification by solving simple puzzle</p><p>5. Next have to do email id verification by providing the code received via mail.</p><p>6. After verified email id account will be created successfully! Select the free plan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yfnKpQFurz6UEcbseS8ayQ.png" /></figure><p><strong>Customize you Profile Click on Your Profile.</strong></p><p>To create an attractive profile, customize your READme file on your github profile.</p><p>Just follow the step by step walkthrough given below:</p><ol><li>Click on the profile.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*je4JBUb2hGe91e6Vuea8aA.png" /></figure><p>2. Click on create repository.</p><p>3. Give the repository name should be same as your username, so that repo created in your overview.</p><p>4. Select it as Public repository.</p><p>5. Click the check box –Add as a README file</p><p>6. Final click create repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hFeKA_7rg9MaHN9d9vDCVw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wUsqdLac1zqaZjdKidyZeg.png" /></figure><p>Edit the file to add your profile content</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-s1zq7Nzv_9Y-ceT2uHi5A.png" /></figure><p>Update your profile content to enhace your profile visibility use the below given templates.</p><p><strong>To make it more attractive…</strong></p><p>You have some websites where will get templates to create an extraordinary profile, Just need to fill-up the details, copy the html code and past it in your profile.</p><p>Sharing you some of the Useful links:</p><p>To create badges for social network icon or skills selection : <a href="https://shields.io/">URL</a></p><p>To get profile template: <a href="https://rahuldkjain.github.io/gh-profile-readme-generator/">README Generator</a></p><p>That’s it! GitHub Profile is Ready!!</p><h4><strong>What is Forking in GitHub?</strong></h4><p>A repository is copied in a fork. You can experiment with modifications without affecting the original project by forking a repository.</p><p><strong>Now Lets explore more on Git — Github how it works.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VFjKrif4T0MQ2AgcazXPIQ.png" /></figure><p>Firstly, To connect the Github repository in local machine to read and write access, can be done via SSH.</p><h4><strong>Step by step Illustration</strong></h4><p>Once the ssh key is generate, we can add it in our github account to operate github via SSH.</p><p>To generate SSH key, in Gitbash/cmd run</p><p><strong>$ssh-keygen</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v_mUJhHcuwsr1TvjhSFNAw.png" /></figure><p>Copy the public key path , then using $cat command give the file path as given below screenshot.</p><p><strong>$ cat “file path of public key”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FT1MmZkrXrfJ5I6kTcHK-Q.png" /></figure><p>Copy and paste the generated rsa key in your github settings and click on add ssh key.</p><p>Now you can connect your Github repository in local machine to read and write access. First check on how to create a folder in local machine and push them in to git repository.</p><p><strong>Steps to Push the folder in to git repository</strong></p><p>To Create a new folder use the command</p><p><strong>$ mkdir &lt;folder name&gt;</strong></p><p>To view and go into the folder use <strong>$ cd &lt;foldername&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*IMYfyT6ITzbcx6wR8uYIdg.png" /></figure><p>Then add few files in that folder, here am adding two .txt files. using the command.</p><p>$ touch &lt;file name&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Dp0rDCzeHz9eLlNxWmyW7A.png" /></figure><p>After creating the files it will be in stagging. We need to add the files using the command</p><p><strong>$ git add &lt; file name .txt&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*SeQHOGnpXhmw428MHeaN9w.png" /></figure><p>After adding the files you can check the git status using the command.</p><p><strong>$ git status</strong></p><p>It will show no commits yet, it means the files are added but not commited the changes/addition we made.</p><p>In git status command you can see the detailed view of commited and not commited files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QtEOIUn_fTcvNg-tZRuhlQ.png" /></figure><p>To commit the file use the below given command.</p><p><strong>$ git commit -m “message to commit”</strong></p><p>After the commit you will get an output message as given in below screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*7Z6XwITg-yBhbX8RuGiVGg.png" /></figure><p>Once everthing is ready, push the comited file into the git repository using the command. Copy your repository link and paste it in the<br>command</p><p><strong>$ git remote add origin &lt;URL to repository&gt;</strong></p><p>To push the changes in your repository use the command given below.</p><p><strong>$ git push origin master</strong></p><p>This command will then prompt for username and password, enter the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*bWeS7XWNIGCoNNPSXtx0Zw.png" /></figure><p>Finally the created files are pushed in to the github repository. Your local repository is now synced with the remote repository on github.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*6L4OxeBt3pPOHqFxDY_f5Q.png" /></figure><p><strong>Its time to see on how to clone the repository in to the local machine.</strong></p><p><strong>$ git clone &lt;URL&gt;</strong></p><p>This command will create a folder with the repository name, and download all the contents of the repository inside this folder. first create new folder in local machine using the below commands.</p><p><strong>$ mkdir &lt;folder name&gt;</strong></p><p><strong>$ cd &lt;folder name&gt;</strong></p><p>Copy the URL to clone the repository via ssh.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*bGILnNVoPTqqxNyFshMiaA.png" /></figure><p>Next to get the updated repository files after some changes. use the git pull command.</p><p><strong>$ git pull origin master</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*WlyqN_iLDf3nqlq_zJbxpA.png" /></figure><p>To check the log details of every commit in detail, use the command.</p><p><strong>$ git log</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*U9DjH26BgVWF5LAPwH17dw.png" /></figure><p>The most important git command to know is to create branch. To handle workspace for multiple users/developers we use branches.</p><p><strong>$ git branch &lt;name of the new branch&gt;</strong></p><p>Illustrated the creation of 3 branches as develop, feature1 and feature2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*MIcn24eB_Y68RUtwD2bblw.png" /></figure><p>Similarly to delete the branch use the command.</p><p><strong>$ git branch -D &lt;branch name&gt;</strong></p><p>To switch from one branch to another branch use the command</p><p><strong>$ git checkout</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*k1Ekq-xkflrkTtCF06GOLg.png" /></figure><p>While switching from one branch to another branch, you can work without commit the code, if you dont want to save the work to git repository and can be saved later using the command.</p><p><strong>$ git stash</strong></p><p>If you want to stash your untracked files as well, use the command</p><p><strong>$ git stash –u.</strong></p><p>Once you are back and want to retrieve working, use the command.</p><p><strong>$ git stash pop</strong></p><p><strong>Lets explore on How to Merging the branches :</strong></p><p>Once the developer has finished his code/feature on his branch, the code will have tobe combined with the master branch.</p><p>This can be done using two ways:</p><p>👉<strong>Git Merge</strong></p><p>To apply changes from one branch to another branch we can use merge command.</p><p><strong>$ git merge &lt;source branch&gt;</strong></p><p>👉<strong>Git Rebase</strong></p><p>To Changing the base of your branch from one commit to another making it appear as if you’d created your branch from a different commit.</p><p>$git rebase &lt;source branch&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*rXezCWEOjz-o1JiE0ZDXbQ.png" /></figure><h3>Sharing you lists of the Git commands you need to know.</h3><p>To Initialize a repository: <strong><em>git init</em></strong></p><p>Add file in repo: <strong><em>git add filename</em></strong></p><p>To add all file in staging: <strong><em>git add .</em></strong></p><p>To add a particular file: <strong><em>git add filename*</em></strong></p><p>Check repository status: <strong><em>git status</em></strong></p><p>Commit the changes: <strong><em>git commit –m “mention your commit message here”</em></strong></p><p>To check the commit history: <strong><em>git log</em></strong></p><p>Remove tracked file: <strong><em>git rm filename</em></strong></p><p>To rename files: <strong><em>git mv oldfilename newfilename</em></strong></p><p>Ignore files in git:<strong><em> create .gitignore file&amp; commit it</em></strong></p><p>Revert unstaged changes:<strong><em> git checkout filename</em></strong></p><p>Revert staged changes: <strong><em>git reset HEAD filename</em></strong></p><p>Create new branch: <strong><em>git branch branchname</em></strong></p><p>Switch to new branch: <strong><em>git checkout newbranchname</em></strong></p><p>To list the branch: <strong><em>git branch</em></strong></p><p>Delete a branch: <strong><em>git branch –d branchname</em></strong></p><p>Merge two branches: <strong><em>git merge branchname</em></strong></p><p>Commit log as a graph: <strong><em>git log — graph — oneline –all</em></strong></p><p>To abort a conflicting merge: <strong><em>git merge –abort</em></strong></p><p>To add a remote repository: <strong><em>git add remote </em></strong><a href="https://reponame_here/"><strong><em>https://reponame_here</em></strong></a></p><p>To see remote URLs: <strong><em>git remote –v</em></strong></p><p>About a remote repo: <strong><em>git remote show origin</em></strong></p><p>Push changes to a remote repo: <strong><em>git push</em></strong></p><p>Pull changes from a remote repo:<strong><em> git pull</em></strong></p><p>Check remote branches: <strong><em>git branch –r</em></strong></p><p>To fetch remote repo changes: <strong><em>git fetch</em></strong></p><p>Merge a remote repo with your local repo:<strong><em> git merge origin/main</em></strong></p><p>Push a new branch to a remote repo: <em>git push -u origin branch_name</em></p><p>Remove a remote branch: <strong><em>git push — delete origin branch_name_here</em></strong></p><p>Force a push request: <strong><em>git push -f</em></strong></p><p>Transfer completed work from one branch to another: <strong><em>git rebase branch_name_here</em></strong></p><p>Rebase commands lists: <strong><em>git rebase -i master</em></strong></p><p># p, pick = use commit</p><p># r, reword = use commit, but edit the commit message</p><p># e, edit = use commit, but stop for amending</p><p># s, squash = use commit, but meld into previous commit</p><p># f, fixup = like “squash”, but discard this commit’s log message</p><p># x, exec = run command (the rest of the line) using shell</p><p># d, drop = remove commit</p><p>I hope you got basic information on Git commands and how it works.</p><p><strong>Thanks for Reading my blog! If you find this useful, give a clap!!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b46a05d22e2e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Series Of DevOps Tools]]></title>
            <link>https://medium.com/@deepamathan/a-series-of-devops-tools-e1de1aecbf28?source=rss-a7598c126c66------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1de1aecbf28</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Deepa Mathan]]></dc:creator>
            <pubDate>Tue, 22 Aug 2023 18:10:38 GMT</pubDate>
            <atom:updated>2024-03-14T14:22:03.705Z</atom:updated>
            <content:encoded><![CDATA[<p>I am excited to share you on the series of 7 blogs on DevOps tools. In this blog series, we will embark on an enlightening journey through the realm of tools in DevOps, each day focusing on a different tool that plays a pivotal role in streamlining the software development lifecycle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b9L2LJcFOZF3hZqO8RAWgA.png" /></figure><p>Throughout this blog series, we will explore the tools that empower DevOps teams to automate repetitive tasks, enhance collaboration, monitor performance, and ultimately deliver top-notch products with faster release cycles and higher quality.</p><p>So, let’s delve into the world of DevOps, uncovering the magic behind their functionalities and understanding how they contribute to creating a more agile, resilient, and innovative software development process.</p><p>Before going deep into the devops tools, I would like to give a detailed information on DevOps and its role in development and deployment process.</p><p><strong>What is DevOps?</strong></p><p>DevOps is a combination of tools which helps in automation of whole infrastructure. It can be defined as a combination of software development (dev) and operations (ops). In DevOps model, development and operations teams work together across the entire software application life cycle, from development and test through deployment to operations.</p><p><strong>How Devops works?</strong></p><p>The devops workflow consist of a set of phases which are Plan is the next iteration of the product development, have to build the code then test and deploy then delivery product updates, monitoring and logging the software performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*TQ56_zBsG6jVo2gZ5bi3Jw.png" /><figcaption>source:google.com</figcaption></figure><p><strong>Why we need DevOps?</strong></p><p>DevOps Methodology having huge benefits as follows:</p><p>⚡️ It does faster, better product delivery.</p><p>⚡️ Faster issue resolution and reduced complexity.</p><p>⚡️ Its scalability and availability.</p><p>⚡️ More stable operating environments.</p><p>⚡️ Better utilization on resources.</p><p><strong>What is the best Practice in DevOps lifecycle?</strong></p><p><strong>Continuous Development</strong></p><p>This stage involves on planning and coding of the software which we are going to develop. In this planning phase, developer starts developing the code for the application. The code can be maintained by using version control tools.</p><p>Some of the popular tools used are Git, JIRA and tools like Ant, Maven, Gradle can be used in this phase for building the code in an executable file ready for next stage.</p><p><strong>Continuous Testing</strong></p><p>Continuous Testing is a sort of software testing where the product is assessed frequently and early on throughout the Continuous Delivery (CD) process.</p><p><strong>Continuous integration (CI)</strong></p><p>The combination of configuration management (CM) tools and other test and development tools is used to monitor how code is being developed for production. It implies fast feedback between testing and development to quickly identify and resolve code problems.</p><p><strong>Continuous delivery.</strong></p><p>A continuous delivery approach involves combining development, testing, and deployment operations into a streamlined process that relies on automation. This phase enables the automatic delivery of code updates into a production environment.</p><p><strong>Continuous deployment (CD).</strong></p><p>Similar to continuous delivery, this also automates the release of new or changed code into production. It releases code or feature changes several times that means frequent deployment allows for a “fail fast” approach, means that the new features or bugs are tested and verified early.</p><p>The use of container technologies, such as Docker and Kubernetes, can enable continuous deployment to maintain consistency of the code across different deployment platforms and environments.</p><p><strong>Continuous monitoring</strong></p><p>The continuous monitoring is the important stage where we are detecting the problematic areas of a process and analyzing the feedback from the team and users to report existing errors and improves the production.</p><p><strong>Let’s embark on this thrilling expedition together, One Tool at a Time!</strong></p><p><strong>Stay Tuned for the 7 days Series!!</strong></p><p>1. Version Control Tools: <em>Git, GitHub</em></p><p>2. Build Tool: <em>Maven</em></p><p>3. CI Tool: <em>Jenkins</em></p><p>4. Configuration Management Tool: <em>Ansible</em></p><p>5. Container Platform: <em>Docker</em></p><p>6. Container Orchestration Platform: <em>Kubernetes</em></p><p>7. Infrastructure as a Code: <em>Terraform</em></p><p><strong>GIT &amp; GitHub:</strong></p><p>Git is an open-source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. URL: <a href="https://git-scm.com/">Git</a></p><p>GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere. URL: <a href="https://github.com/">Github</a></p><p><strong>Maven</strong></p><p>Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project’s build, reporting and documentation from a central piece of information. URL: <a href="https://maven.apache.org/">Maven</a></p><p><strong>Jenkins</strong></p><p>Jenkins is a self-contained, open-source automation server which can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software.</p><p>Jenkins can be installed through native system packages, Docker, or even run standalone by any machine with a Java Runtime Environment (JRE) installed. URL: <a href="https://www.jenkins.io/">Jenkins</a></p><p><strong>Docker</strong></p><p>Docker is an open-source platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly.</p><p>Docker provides the ability to package and run an application in a loosely isolated environment called a container. URL: <a href="https://www.docker.com/">Docker</a></p><p><strong>Kubernetes</strong></p><p>Kubernetes is an open-source container orchestration engine for automating deployment, scaling, and management of containerized applications. The open-source project is hosted by the Cloud Native Computing Foundation (<a href="https://www.cncf.io/about">CNCF</a>). URL: <a href="https://kubernetes.io/">Kubernetes</a></p><p><strong>Ansible</strong></p><p>Ansible is an open-source IT automation tool. It can configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployments or zero downtime rolling updates. URL: <a href="https://www.ansible.com/">Ansible</a></p><p><strong>Terraform</strong></p><p>Terraform is an infrastructure as code tool that lets you build, change, and version infrastructure safely and efficiently. This includes low-level components like compute instances, storage, and networking, and high-level components like DNS entries and SaaS features.<strong> </strong>URL:<strong> </strong><a href="https://www.terraform.io/">Terraform</a></p><p>Also, will see a note on <strong>Linux</strong> is an open-source operating system which plays an important role in DevOps. Linux is widely supported across cloud platforms, container orchestration tools (e.g., Kubernetes, Docker), and other DevOps tools.</p><p>At the end of this blog series, I hope you will get a solid foundation on the most important Tools in DevOp process sand their key functionalities, highlighting their impact on various stages of the development lifecycle.</p><p>🌈<strong><em>I suggest you experiment, explore, and apply your knowledge in real-world scenarios, lab practice is more important.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4rr_LzZK55B-Ra8e3cRClw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1de1aecbf28" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>