<?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 Pratiksha Ruthe on Medium]]></title>
        <description><![CDATA[Stories by Pratiksha Ruthe on Medium]]></description>
        <link>https://medium.com/@pratiksharuthe?source=rss-87b743eb8f4e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*xAlQZI8dMgk2AExlTB09ug.jpeg</url>
            <title>Stories by Pratiksha Ruthe on Medium</title>
            <link>https://medium.com/@pratiksharuthe?source=rss-87b743eb8f4e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 05:56:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pratiksharuthe/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[DOCKER NOTES]]></title>
            <link>https://medium.com/@pratiksharuthe/docker-notes-3eca4d0f6f3c?source=rss-87b743eb8f4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3eca4d0f6f3c</guid>
            <dc:creator><![CDATA[Pratiksha Ruthe]]></dc:creator>
            <pubDate>Mon, 02 Sep 2024 08:15:10 GMT</pubDate>
            <atom:updated>2024-09-02T17:57:23.657Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>DOCKER FILE</strong></h3><p>A Dockerfile is a text file that contains a set of instructions used to build a Docker image. Docker uses this file to create an image layer by layer, where each instruction in the Dockerfile adds a new layer to the image. Once the image is built, it can be run as a container, which is a lightweight, standalone, and executable package that includes everything needed to run a piece of software.</p><p>Here’s a basic breakdown of common Dockerfile instructions:</p><p>FROM:<br>This specifies the base image to use for the Docker image.<br>Example: FROM ubuntu:20.04 starts from the official Ubuntu 20.04 image.<br>LABEL:<br>Adds metadata to an image, like author name or version information.<br>Example: LABEL maintainer=”<a href="/service/mailto:youremail@example.com">youremail@example.com</a>”<br>RUN:<br>Executes commands in the image during the build process, typically used to install software packages.<br>Example: RUN apt-get update &amp;&amp; apt-get install -y nginx<br>COPY:<br>Copies files or directories from your local filesystem to the Docker image.<br>Example: COPY . /app copies everything from the current directory on your host machine to the /app directory in the image.<br>ADD:<br>Similar to COPY but with additional capabilities like extracting tar files.<br>Example: ADD myapp.tar.gz /app extracts and copies the content of myapp.tar.gz to /app.<br>WORKDIR:<br>Sets the working directory for any RUN, CMD, ENTRYPOINT, COPY, and ADD instructions that follow it.<br>Example: WORKDIR /app sets /app as the working directory.<br>CMD:<br>Specifies a command to run within the container when it starts. Only one CMD instruction is allowed per Dockerfile.<br>Example: CMD [“nginx”, “-g”, “daemon off;”] runs Nginx in the foreground.<br>ENTRYPOINT:<br>Configures a container to run as an executable, allowing you to specify a default command that can be overridden.<br>Example: ENTRYPOINT [“python”, “app.py”] sets Python and app.py as the default command, but you can pass additional arguments when running the container.<br>EXPOSE:<br>Informs Docker that the container will listen on the specified network ports at runtime.<br>Example: EXPOSE 80 declares that the container listens on port 80.<br>ENV:<br>Sets environment variables inside the container.<br>Example: ENV NODE_ENV=production sets the NODE_ENV environment variable to production.<br>VOLUME:<br>Creates a mount point with a specified path and marks it as holding externally mounted volumes from the host or other containers.<br>Example: VOLUME /data specifies that /data will be a mount point.<br>USER:<br>Sets the user name or UID to use when running the image and for any RUN, CMD, and ENTRYPOINT instructions.<br>Example: USER node switches the user to node before executing further instructions.<br>ARG:<br>Defines a variable that users can pass at build time to the Dockerfile with the docker build command using the — build-arg flag.<br>Example: ARG VERSION=latest allows you to specify a version variable.</p><h3><strong>DOCKER COMPOSE</strong></h3><p>Docker Compose is a tool that helps you run multiple Docker containers together as a single application. Instead of starting each container one by one, you define everything in one file, and Docker Compose takes care of the rest.</p><p>YAML File: Docker Compose uses a YAML file (docker-compose.yml) to define the services, networks, and volumes needed for your application. This file contains the configuration for all the services that make up your application.</p><p>Commands: Docker Compose provides commands for managing the lifecycle of your application, such as starting, stopping, and rebuilding services.</p><p>Common Docker Compose Commands<br>docker-compose up:<br>Starts all the services defined in the docker-compose.yml file. If the images are not already built, they will be built automatically.<br>docker-compose down:<br>Stops and removes all the containers, networks, and volumes created by docker-compose up.<br>docker-compose build:<br>Builds or rebuilds the services in the docker-compose.yml file.<br>docker-compose logs:<br>Shows the logs of all services or a specific service.</p><h3><strong>docker architect</strong></h3><p>Docker’s architecture is designed to provide a lightweight and efficient way to run applications in isolated environments called containers.</p><p>Key Components of Docker Architecture<br>Docker Client:<br>The Docker Client is the user interface for Docker. It’s what you interact with when you run Docker commands in your terminal (like docker build, docker run, etc.).<br>The client sends these commands to the Docker Daemon (server) using the Docker API.</p><p>Docker Daemon (dockerd):<br>The Docker Daemon is the brain of Docker. It listens for Docker API requests and manages Docker objects like images, containers, networks, and volumes.<br>The Daemon does the heavy lifting, like creating and running containers on your machine.</p><p>Docker Images:<br>Docker Images are templates used to create containers. They include everything your application needs to run: code, libraries, environment variables, and more.<br>Images are built from Dockerfiles, which define the instructions for what the image should contain.</p><p>Docker Containers:<br>Containers are running instances of Docker Images. They are isolated environments where your application runs, ensuring it behaves the same way regardless of where it’s deployed.<br>Containers share the host system’s kernel but have their own filesystem, networking, and process space, making them lightweight.</p><p>Docker Registry (Docker Hub):<br>A Docker Registry is a place where Docker Images are stored. Docker Hub is the default public registry, but you can also set up private registries.<br>When you run docker pull or docker push, you’re interacting with a Docker Registry, either pulling images to your machine or pushing them to the registry.</p><p>Docker Engine:<br>The Docker Engine is the core part of Docker that includes the Docker Daemon, REST API, and CLI. It provides the underlying technology that runs and manages containers.<br>How Docker Works</p><p>Here’s a simplified flow of how Docker works:<br>Building an Image:<br>You create a Dockerfile with instructions on how to build your application.<br>You use the Docker Client to run docker build, which sends the instructions to the Docker Daemon.<br>The Daemon builds the image and stores it on your local machine or pushes it to a Docker Registry.</p><p>Running a Container:<br>You run docker run &lt;image&gt; using the Docker Client.<br>The Client communicates with the Docker Daemon, which creates a container from the specified image.<br>The container runs your application in an isolated environment.</p><p>Managing Containers:<br>The Docker Daemon continues to manage the container’s lifecycle, including starting, stopping, and restarting containers as needed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3eca4d0f6f3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Step-by-Step Guide for Setting Up AWS Site-to-Site VPN Connection]]></title>
            <link>https://medium.com/@pratiksharuthe/step-by-step-guide-for-setting-up-aws-site-to-site-vpn-connection-de5753944881?source=rss-87b743eb8f4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/de5753944881</guid>
            <dc:creator><![CDATA[Pratiksha Ruthe]]></dc:creator>
            <pubDate>Sun, 18 Aug 2024 11:36:36 GMT</pubDate>
            <atom:updated>2024-08-18T11:36:36.062Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Here are the key services typically used in this setup:</strong></p><p><strong>Amazon VPC (Virtual Private Cloud):</strong></p><ul><li>VPC is the fundamental networking construct in AWS. It provides an isolated virtual network where resources can be launched, including the ones involved in the Site-to-Site VPN connection.</li></ul><p><strong>Amazon Virtual Private Gateway:</strong></p><ul><li>The Virtual Private Gateway is the AWS-side endpoint for the VPN connection. It facilitates communication between your VPC and on-premises network.</li></ul><p><strong>Customer Gateway:</strong></p><ul><li>The Customer Gateway represents the on-premises side of the VPN connection. It includes information such as the public IP address of your on-premises VPN device.</li></ul><p><strong>Site-to-Site VPN Connection:</strong></p><ul><li>This service orchestrates the secure communication between the Virtual Private Gateway and the Customer Gateway. It involves configuring encryption parameters, routing information, and the pre-shared key.</li></ul><p><strong>Amazon CloudWatch:</strong></p><ul><li>CloudWatch is used for monitoring and logging. It provides logs for the VPN connection, allowing you to monitor its status and troubleshoot any issues that may arise.</li></ul><p><strong>Amazon EC2 Instances (Optional):</strong></p><ul><li>In some cases, EC2 instances may be used as VPN appliances or instances that require connectivity through the Site-to-Site VPN connection.</li></ul><p><strong>AWS Identity and Access Management (IAM):</strong></p><ul><li>IAM is used to manage permissions and roles, ensuring that the necessary permissions are granted to create and manage the Site-to-Site VPN resources.</li></ul><p><strong>Amazon Route 53 (Optional):</strong></p><ul><li>Route 53, AWS’s DNS service, might be used for DNS resolution and management of domain names associated with resources connected through the Site-to-Site VPN.</li></ul><p><strong>Security Groups and Network ACLs:</strong></p><ul><li>These services are used to control inbound and outbound traffic to and from resources in the VPC. They play a crucial role in securing communication over the Site-to-Site VPN.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*iqa7b1uFZVbgWzSf4IBzHw.png" /></figure><p><strong>Here is a step-by-step guide to implementing an AWS Site-to-Site VPN connection between on-premises networks to AWS environments securely:</strong></p><p><strong>Step 1: AWS Configuration in NV Region</strong></p><ul><li>Create AWS VPC:</li><li>Name: AWS-SIDE</li><li>CIDR Block: 10.0.0.0/16</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*JkfQtRLEI3-JNtQtjZT4mQ.png" /></figure><ul><li>Create Subnet in AWS-SIDE:</li><li>Name: AWS-SIDE-SUBNET</li><li>CIDR Block: 10.0.1.0/24</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*6OiK6_GVgtIYhvBtbUH0bQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*dGeLyMe_mM6izmrl6RK3Yg.png" /></figure><ul><li>Name: AWS-ROUTE</li><li>Create Route Table in AWS-ROUTE:</li><li>Define routes for the VPC and associate with the subnet.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*J_Fo4ws2iiq33JxV-djCHA.png" /></figure><p><strong>Step 2: CALIFORNIA Region Configuration</strong></p><ul><li>Create VPC in CALIFORNI Region:</li><li>Name: CUSTOMER-END</li><li>CIDR Block: 11.0.0.0/16</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Pw3hIKOd5plLrNXxnN-Vgg.png" /></figure><ul><li>Create Subnet in CUSTOMER-END:</li><li>Name: CALIFORNIA-SIDE-SUBNET</li><li>CIDR Block: 11.0.1.0/24</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*xOVoXHpz1cJBD05MMJGqBw.png" /></figure><ul><li>Create Internet Gateway</li><li>Name: CUSTOMER-IGW:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*8JfoUC60xXFXhU447oukww.png" /></figure><ul><li>Create Route Table</li><li>Name: CUSTOMER-ROUTE</li><li>Define routes for the VPC and associate with the subnet.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*-yarYyz6_-RPD96d44oL4w.png" /></figure><p>Launch Linux Virtual Machine : CUSTOMER-SERVER</p><ul><li>Security Group Rules: SSH, All TCP, All ICMP.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*DlV9QU_QShkO2mEWconSjA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*U2_5L8L7_dMWMXJ1hlt_1Q.png" /></figure><p><strong>Step 3: Establish VPN Connection in NV Region</strong></p><ul><li>Create AWS Virtual Private Gateway:</li><li>Attach to AWS-SIDE VPC</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Z2W6jq-FOADgaAFX4KQFfA.png" /></figure><ul><li>Create Customer Gateway:</li><li>Use CALIFORNIA SERVER Public IP</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*QpX2-8Dpvgudwcn612uYCQ.png" /></figure><p>· Create Site-to-Site VPN Connection:</p><p>· Configure VPG, CGW, and static MUMBAI subnet IP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*VCxoRwFr5YzBLHzgkhB0Zg.png" /></figure><ul><li>Download Configuration: VENDOR-GENERIC</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*JvLBNEi4gHMo8bJNbZbVIQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*wNA01FZUZJ48FDRPVaPAdg.png" /></figure><ul><li>Enable Route Propagation in Route Table</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*uIMe-_8e5EeixaW6HHWexw.png" /></figure><p><strong>Step 4: Install libreswan</strong></p><p><strong>It is recommended to use libreswan, which is created by a fork of openswan.<br> To install libreswan, please add the fedora repository with the following command.</strong></p><p><a href="https://repost.aws/questions/QUtheNp29LQyGHQL41hGCVTA/unable-to-install-openswan-amzon-linux-2023"><strong>unable to install openswan amzon linux 2023 | AWS re:Post (repost.aws)</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Gxffs-1KznfeiBVUDGVApA.png" /></figure><p><strong>Vim /etc/ipsec.conf</strong></p><p><strong>Vim /etc/sysctl.conf</strong></p><p>Add this in file</p><p>[[[ net.ipv4.ip_forward = 1</p><p>net.ipv4.conf.all.accept_redirects = 0</p><p>net.ipv4.conf.all.send_redirects = 0</p><p>]]]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*1GjFWevmvH3zj6iC9vrxNg.png" /></figure><p>Vim /etc/ipsec.d/aws-vpn.conf</p><p>conn Tunnel1</p><p>authby=secret</p><p>auto=start</p><p>left=%defaultroute</p><p>leftid=Customer end Gateway VPN public IP</p><p>right=AWS Virtual private gateway ID- public IP</p><p>type=tunnel</p><p>ikelifetime=8h</p><p>keylife=1h</p><p>phase2alg=aes128-sha1;modp1024</p><p>ike=aes128-sha1;modp1024</p><p>keyingtries=%forever</p><p>keyexchange=ike</p><p>leftsubnet=Customer end VPN CIDR</p><p>rightsubnet=AWS end VPN CIDR</p><p>dpddelay=10</p><p>dpdtimeout=30</p><p>dpdaction=restart_by_peer</p><p>paste it as it is.</p><p>Please make changes in left/right id and left/right subnet</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*g5O7v9zvTrupAkGDAWXdSw.png" /></figure><p>Vim /etc/ipsec.d/aws-vpn.secrets</p><p>customer_public_ip aws_vgw_public_ip: PSK “shared secret”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*2R8LOFzW5RxBXq4FmC3cfQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ZrARfOinOV662kh9ggYfkA.png" /></figure><p><strong>Step 5: Commands to enable/start ipsec service</strong></p><p>$ chkconfig ipsec on</p><p>$ service ipsec start</p><p>$ service ipsec status</p><p><strong>Update AWS Route Table</strong></p><ul><li>Edit Route in AWS Route Table:</li><li>Add 10.0.1.0/24 with Virtual Private Gateway attached.</li></ul><p><strong>Step 6 : Test Connectivity</strong></p><ul><li>Launch Linux Virtual Machine in AWS-SIDE-SUBNET:</li><li>Security Group Rules: SSH, All TCP, All ICMP.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*PHdClL5Qfe8oFe_UK-IxZg.png" /></figure><p><strong>Step 7 : Adjust Route for VPN Connection</strong></p><ul><li>Edit Static Route in Site-to-Site VPN Connection:</li><li>Remove the route and observe packet loss.</li><li>Re-add the static route and observe the resumption of connectivity.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de5753944881" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to deploy multi-tier web application locally]]></title>
            <link>https://medium.com/@pratiksharuthe/how-to-deploy-multi-tier-web-application-locally-c01505d8fdfd?source=rss-87b743eb8f4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c01505d8fdfd</guid>
            <dc:creator><![CDATA[Pratiksha Ruthe]]></dc:creator>
            <pubDate>Fri, 24 May 2024 07:39:09 GMT</pubDate>
            <atom:updated>2024-05-24T07:39:35.085Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, we embark on a journey to explore the deployment process of a multi-tier web application within a local environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aFH7V0Bopl6urdAz.png" /></figure><p>We need to have some <strong>Prerequisite:-</strong></p><p>1. Oracle VM Virtualbox</p><p>2. Vagrant</p><p>3. Vagrant plugins</p><p>Execute below command in your computer to install hostmanager plugin</p><pre>$ vagrant plugin install vagrant-hostmanager</pre><p>4. Git bash or equivalent editor</p><p>We need to do some <strong>VM SETUP , which is given below:-</strong></p><p>1. Clone source code.</p><p>2. Cd into the repository.</p><p>3. Switch to the main branch.</p><p>4. cd into vagrant/Manual_provisioning</p><p>Once follow all the above steps we need to Bring up vm’s:-</p><p><strong>Bring up vm’s</strong></p><pre>$ vagrant up</pre><p><strong><em>NOTE: </em></strong>Bringing up all the vm’s may take a long time based on various factors.</p><p>If vm setup stops in the middle run “vagrant up” command again.</p><p><strong><em>INFO: </em></strong>All the vm’s hostname and /etc/hosts file entries will be automatically updated.</p><p><strong>PROVISIONING</strong></p><p><strong>Services</strong></p><p>1. Nginx =&gt; Web Service</p><p>2. Tomcat =&gt; Application Server</p><p>3. RabbitMQ =&gt; Broker/Queuing Agent</p><p>4. Memcache =&gt; DB Caching</p><p>5. ElasticSearch =&gt; Indexing/Search service</p><p>6. MySQL =&gt; SQL Database</p><p><strong><em>Setup should be done in below mentioned order</em></strong></p><p><strong>MySQL (Database SVC)</strong></p><p><strong>Memcache (DB Caching SVC)</strong></p><p><strong>RabbitMQ (Broker/Queue SVC)</strong></p><p><strong>Tomcat (Application SVC)</strong></p><p><strong>Nginx (Web SVC)</strong></p><p>We can check number of running server status with the help of command</p><p>vagrant status</p><p><strong>Phase1:- First of all we need to do MYSQL Setup</strong></p><p>Just Login to the <strong>db vm</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/0*b8xnZ3s7gt5xdA9T.png" /></figure><pre>$ vagrant ssh db01 ##db01 is the hostname</pre><p><strong>Verify Hosts</strong> entry, if entries missing update the it with IP and hostnames</p><pre># cat /etc/hosts</pre><p>Update OS with <strong>latest patches</strong></p><pre># yum update -y</pre><p>Set<strong> Repository</strong></p><pre># yum install epel-release -y</pre><p>Install <strong>Maria DB </strong>Package</p><pre># yum install git mariadb-server -y</pre><p><strong>Starting &amp; enabling</strong> mariadb-server</p><pre># systemctl start mariadb<br># systemctl enable mariadb</pre><p>RUN mysql secure installation script.</p><pre># mysql_secure_installation</pre><p><strong><em>NOTE</em></strong><em>: Set db </em><strong><em>root password</em></strong><em>, I will be using </em><strong><em>admin123 as password , you </em></strong><em>can choose any db password.</em></p><p>It will display the messages which is given below , you just need to provide the same permission as shown below:-</p><pre>Set root password? [Y/n] Y<br>New password:<br>Re-enter new password:<br>Password updated successfully!<br>Reloading privilege tables..<br>... Success!<br>By default, a MariaDB installation has an anonymous user, allowing anyone<br>to log into MariaDB without having to have a user account created for<br>them. This is intended only for testing, and to make the installation<br>go a bit smoother. You should remove them before moving into a<br>production environment.<br>Remove anonymous users? [Y/n] Y<br>... Success!<br>Normally, root should only be allowed to connect from &#39;localhost&#39;. This<br>ensures that someone cannot guess at the root password from the network.<br>Disallow root login remotely? [Y/n] n<br>... skipping.<br>By default, MariaDB comes with a database named &#39;test&#39; that anyone can<br>access. This is also intended only for testing, and should be removed<br>before moving into a production environment.<br>Remove test database and access to it? [Y/n] Y<br>- Dropping test database...<br>... Success!<br>- Removing privileges on test database...<br>... Success!<br>Reloading the privilege tables will ensure that all changes made so far<br>will take effect immediately.<br>Reload privilege tables now? [Y/n] Y<br>... Success!</pre><p><strong>Set DB name and users.</strong></p><pre># mysql -u root -padmin123</pre><pre>mysql&gt; create database accounts;<br>mysql&gt; grant all privileges on accounts.* TO &#39;admin&#39;@&#39;%&#39; identified by &#39;admin123&#39;;<br>mysql&gt; FLUSH PRIVILEGES;<br>mysql&gt; exit;</pre><p><strong>Download Source code &amp; Initialize Database.</strong></p><pre># git clone -b main https://github.com/hkhcoder/vprofile-project.git<br># cd vprofile-project<br># mysql -u root -padmin123 accounts &lt; src/main/resources/db_backup.sql<br># mysql -u root -padmin123 accounts<br>mysql&gt; show tables;<br>mysql&gt; exit;</pre><p><strong>Restart mariadb-server</strong></p><pre># systemctl restart mariadb</pre><p>Starting the firewall and allowing the mariadb to access from port no. 3306</p><pre># systemctl start firewalld<br># systemctl enable firewalld<br># firewall-cmd - get-active-zones<br># firewall-cmd - zone=public - add-port=3306/tcp - permanent<br># firewall-cmd - reload<br># systemctl restart mariadb</pre><p><strong>Phase 2:- Now we need to do MEMCACHE SETUP</strong></p><p><strong>Install, start &amp; enable memcache on port 11211</strong></p><p>First of all we need to do ssh</p><p>vargant ssh mc01</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/0*KqjNt2QliPFtIvoc.png" /></figure><pre># sudo dnf install epel-release -y<br># sudo dnf install memcached -y<br># sudo systemctl start memcached<br># sudo systemctl enable memcached<br># sudo systemctl status memcached<br># sed -i &#39;s/127.0.0.1/0.0.0.0/g&#39; /etc/sysconfig/memcached<br># sudo systemctl restart memcached</pre><p>Starting the firewall and allowing the port 11211 to access memcache</p><pre># firewall-cmd --add-port=11211/tcp<br># firewall-cmd --runtime-to-permanent<br># firewall-cmd --add-port=11111/udp<br># firewall-cmd --runtime-to-permanent<br># sudo memcached -p 11211 -U 11111 -u memcached -d</pre><p><strong>Phase 3:- We need to do RABBITMQ SETUP</strong></p><p>Login to the RabbitMQ vm</p><pre>$ vagrant ssh rmq01</pre><p><strong>Verify Hosts entry,</strong> if entries missing update the it with IP and hostnames</p><pre># cat /etc/hosts</pre><p>Update OS with latest patches</p><pre># yum update -y</pre><p>Set EPEL Repository</p><pre># yum install epel-release -y</pre><p>Install Dependencies</p><pre># sudo yum install wget -y<br># cd /tmp/<br># dnf -y install centos-release-rabbitmq-38<br># dnf - enablerepo=centos-rabbitmq-38 -y install rabbitmq-server<br># systemctl enable - now rabbitmq-server</pre><p>Setup access to user test and make it admin</p><pre># sudo sh -c &#39;echo &quot;[{rabbit, [{loopback_users, []}]}].&quot; &gt; /etc/rabbitmq/rabbitmq.config&#39;<br># sudo rabbitmqctl add_user test test<br># sudo rabbitmqctl set_user_tags test administrator<br># sudo systemctl restart rabbitmq-server</pre><p>Starting the firewall and allowing the port 5672 to access rabbitmq</p><pre># firewall-cmd - add-port=5672/tcp<br># firewall-cmd - runtime-to-permanent<br># sudo systemctl start rabbitmq-server<br># sudo systemctl enable rabbitmq-server<br># sudo systemctl status rabbitmq-server</pre><p><strong>Phase 4:- We need to do TOMCAT SETUP :-</strong></p><p>Login to the tomcat vm</p><pre>$ vagrant ssh app01</pre><p>Verify Hosts entry, if entries missing update the it with IP and hostnames</p><pre># cat /etc/hosts</pre><p>Update OS with latest patches</p><pre># yum update -y</pre><p>Set Repository</p><pre># yum install epel-release -y</pre><p>Install Dependencies</p><pre># dnf -y install java-11-openjdk java-11-openjdk-devel<br># dnf install git maven wget -y</pre><p>Change dir to /tmp</p><pre># cd /tmp/</pre><p>Download &amp; Tomcat Package</p><pre># wget https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.75/bin/apache-tomcat-9.0.75.tar.gz<br># tar xzvf apache-tomcat-9.0.75.tar.gz</pre><p>Add tomcat user</p><pre># useradd - home-dir /usr/local/tomcat - shell /sbin/nologin tomcat</pre><p>Copy data to tomcat home dir</p><pre># cp -r /tmp/apache-tomcat-9.0.75/* /usr/local/tomcat/</pre><p>Make tomcat user owner of tomcat home dir</p><pre># chown -R tomcat.tomcat /usr/local/tomcat</pre><p>Setup systemctl command for tomcat</p><p>Create tomcat service file</p><pre># vi /etc/systemd/system/tomcat.service</pre><p>Update the file with below content</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/0*pBWYPB3dYXxA4SXl.png" /></figure><p>Reload systemd files</p><pre># systemctl daemon-reload</pre><p>Start &amp; Enable service</p><pre># systemctl start tomcat<br># systemctl enable tomcat</pre><p>Reload systemd files</p><pre># systemctl daemon-reload</pre><p>Start &amp; Enable service</p><pre># systemctl start tomcat<br># systemctl enable tomcat</pre><p><strong>Enabling the firewall and allowing port 8080 to access the tomcat</strong></p><pre># systemctl start firewalld<br># systemctl enable firewalld<br># firewall-cmd - get-active-zones<br># firewall-cmd - zone=public - add-port=8080/tcp - permanent<br># firewall-cmd - reload</pre><p><strong>Phase 5:- Now We need to do CODE BUILD &amp; DEPLOY (app01)</strong></p><p><strong>Download Source code</strong></p><pre># git clone -b main https://github.com/hkhcoder/vprofile-project.git</pre><p>Update configuration</p><pre># cd vprofile-project<br># vim src/main/resources/application.properties<br># Update file with backend server details</pre><p><strong>Build code</strong></p><p><em>Run below command inside the repository (vprofile-project)</em></p><pre># mvn install</pre><p>Deploy artifact</p><pre># systemctl stop tomcat<br># rm -rf /usr/local/tomcat/webapps/ROOT*<br># cp target/vprofile-v2.war /usr/local/tomcat/webapps/ROOT.war<br># systemctl start tomcat<br># chown tomcat.tomcat usr/local/tomcat/webapps -R<br># systemctl restart tomcat</pre><p><strong>Phase 5:- We need to do NGINX SETUP</strong></p><p><strong>Login to the Nginx vm</strong></p><pre>$ vagrant ssh web01<br>$ sudo -i</pre><p>Verify Hosts entry, if entries missing update the it with IP and hostnames</p><pre># cat /etc/hosts</pre><p>Update OS with latest patches</p><pre># apt update<br># apt upgrade</pre><p>Install nginx</p><pre># apt install nginx -y</pre><p>Create Nginx conf file</p><pre># vi /etc/nginx/sites-available/vproapp</pre><p>Update with below content</p><pre>upstream vproapp {<br>server app01:8080;<br>}<br>server {<br>listen 80;<br>location / {<br>proxy_pass http://vproapp;<br>}<br>}</pre><p>Remove default nginx conf</p><pre># rm -rf /etc/nginx/sites-enabled/default</pre><p>Create link to activate website</p><pre># ln -s /etc/nginx/sites-available/vproapp /etc/nginx/sites-enabled/vproapp</pre><p>Restart Nginx</p><pre># systemctl restart nginx</pre><p>To check the running application we need to get the ip address of our webapplication , just enter<strong><em> ip addr show </em></strong>to check the ip address of nginx</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/0*qWQZgE9BLXtDx3tB.png" /></figure><p>copy the inet ip address and paste in the browser</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HDx2--VH5g2gX4n7.png" /></figure><p>As we can see login page is display to us , its mean our tomcat server is working , let login the with the username &amp; password admin_vp</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EFjnQHd2c5nSY9Yw.png" /></figure><p>After login we get the new window , its mean our database is also working.</p><p>Now we need to check our rabitmq is working or not, just types user/rabbit in search console</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8Yw16efK1g_myoMC.png" /></figure><p>It means our rabbitmq is working .</p><p>Now we need to verify that our cache is working or not , for that we just need to enter the users in search console</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*y9jp0SOodotbGIk5.png" /></figure><p>Just click on userid</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oxBAgl7xxPN321CU.png" /></figure><p>Here you can see that it will indicate the message i.e data is from DB and data inserted in Cache . It means our cache is working.</p><p>You can join the telegram page for latest update :-</p><p><a href="https://t.me/devopssolutionhubofficial">https://t.me/devopssolutionhubofficial</a></p><p>Github Repo :-</p><p><a href="https://github.com/devopshydclub/vprofile-project/tree/main">https://github.com/devopshydclub/vprofile-project/tree/main</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c01505d8fdfd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Top 10 Security Tools for Your AWS Environment]]></title>
            <link>https://medium.com/@pratiksharuthe/the-top-10-security-tools-for-your-aws-environment-ed898d595e7d?source=rss-87b743eb8f4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed898d595e7d</guid>
            <dc:creator><![CDATA[Pratiksha Ruthe]]></dc:creator>
            <pubDate>Tue, 23 Jan 2024 03:04:42 GMT</pubDate>
            <atom:updated>2024-01-23T03:04:42.336Z</atom:updated>
            <content:encoded><![CDATA[<p>Amazon Web Services (AWS) enables organizations to build and scale applications quickly and securely. However, continuously adding new tools and services introduces new security challenges. According to reports, 70 percent of enterprise IT leaders are <a href="https://www.techrepublic.com/article/70-of-it-leaders-say-security-concerns-restrict-adoption-of-public-cloud/">concerned about how secure they are in the cloud</a> and 61 percent of small- to medium-sized businesses (SMBs) believe their <a href="https://dzone.com/articles/61-of-smbs-believe-that-their-data-is-unsafe-in-th">cloud data is at risk</a>.</p><p>AWS provides many different security tools to help customers keep their AWS accounts and applications secure. In fact, there was significant focus on AWS security best practices at re:Invent 2020. See the <a href="https://aws.amazon.com/blogs/storage/aws-reinvent-recap-best-practices-with-amazon-s3/">Best practices with Amazon S3</a> recap and Jeremy Cowan’s <a href="https://youtu.be/06ueJAhXU9E">Securing your Amazon EKS applications: Best practices</a> session for some of the details.</p><p>In this article, we’ll review the top ten AWS security tools you should consider using to improve your security posture in 2021 and beyond. Before we do that, we will briefly explain AWS account security versus application and service security. Organizations must focus on keeping both secure to protect against different types of attacks.</p><h3>Account Security Versus Application and Service Security</h3><p>AWS provides security tools designed to improve both account security and application and service security.</p><p>An AWS account is an attack vector, as resources and data are accessible through the public application programming interface (API). Implementing a secure identity and access management strategy helps prevent leaking data — such as in S3 buckets — to the public. AWS’s many tools provide insights into your configured permissions and access patterns, and record all actions for compliance and audit purposes.</p><p>Applications and services hosted in AWS are susceptible to different kinds of threats from the outside. Cross-site scripting (XSS), SQL injection, and brute-force attacks target public endpoints. Distributed denial-of-service (DDoS) attacks may attempt to bring down your services, potentially compromising your architecture security. Without proper management, sensitive information — such as database credentials — may leak.</p><p>Therefore, it’s critical that organizations migrating to the cloud focus on minimizing risk and improving their overall security posture by addressing both account security as well as application and service security. The following AWS services lock down your cloud security, helping keep your customer data and systems safe from attack.</p><h3>Top 6 AWS Account Security Tools</h3><h3>1. AWS Identity and Access Management (IAM)</h3><p><a href="https://aws.amazon.com/iam/">AWS IAM</a> is essential for controlling access to your AWS resources. It enables you to create users and roles with permissions to specific resources in your AWS environment. Always assigning least-privilege permissions to these users and roles minimizes the impact of a breach where an attacker has gained access. AWS IAM also has multi-factor authentication and supports single sign-on (SSO) access to further secure and centralize user access.</p><p>Use the <a href="https://policysim.aws.amazon.com/">IAM policy simulator</a> to test and troubleshoot the extent of permissions you assign to your users and roles, and make sure you’re following the principle of least privilege when configuring your IAM permissions.</p><h3>2. Amazon GuardDuty</h3><p><a href="https://aws.amazon.com/guardduty/">Amazon GuardDuty</a> uses machine learning to look for malicious activity in your AWS environments. It combines your CloudTrail event logs, VPC Flow Logs, S3 event logs, and DNS logs to continuously monitor and analyze all activity. GuardDuty identifies issues such as privilege escalation, exposed credentials, and communication with malicious IP addresses and domains. It can also detect when your EC2 instances are serving malware or mining bitcoin.</p><p>In addition, GuardDuty can detect anomalies in your access patterns such as API calls in new regions. Pricing is based on the amount of data analyzed, so costs will increase linearly as your AWS environments grow.</p><h3>3. Amazon Macie</h3><p><a href="https://aws.amazon.com/macie/">Amazon Macie</a> discovers and protects your sensitive data stored in AWS S3 buckets. It first identifies sensitive data in your buckets, such as personally-identifiable information or personal health information, through discovery jobs. You can schedule these jobs to monitor new data added to your buckets. After it finds sensitive data, Macie continuously evaluates your buckets and alerts you when a bucket is unencrypted, is publicly accessible, or is shared with AWS accounts outside of your organization.</p><p>Macie’s pricing scales with the amount of data it processes and the number of S3 buckets it monitors.</p><h3>4. AWS Config</h3><p><a href="https://aws.amazon.com/config/">AWS Config</a> records and continuously evaluates your AWS resource configuration. This includes keeping a historical record of all changes to your resources, which is useful for compliance with legal requirements and your organization’s policies. AWS Config evaluates new and existing resources against rules that validate certain configurations. For example, if all EC2 volumes must be encrypted, AWS Config can detect non-encrypted volumes and send a notification. In addition, it can also execute remediation actions such as encrypting the volume or deleting it.</p><p>Config is configured per region, so it’s essential to enable AWS Config in all regions to ensure all resources are recorded, including in regions where you don’t expect to create resources.</p><h3>5. AWS CloudTrail</h3><p><a href="https://aws.amazon.com/cloudtrail/">AWS CloudTrail</a> tracks all activity in your AWS environment. It records all actions a user executes in the AWS console and all API calls as events. You can view and search these events to identify unexpected or unusual requests in your AWS environment.</p><p><a href="https://aws.amazon.com/about-aws/whats-new/2019/11/aws-cloudtrail-announces-cloudtrail-insights/">AWS CloudTrail Insights</a> is an add-on to help identify unusual activity. It automatically analyzes your events and raises an event when it detects abnormal activity.</p><p>CloudTrail is enabled by default in all AWS accounts since August 2017. If you also use AWS Organizations to manage multiple accounts, you can enable CloudTrail within the organization on all existing accounts.</p><h3>6. Security Hub</h3><p><a href="https://aws.amazon.com/security-hub/?aws-security-hub-blogs.sort-by=item.additionalFields.createdDate&amp;aws-security-hub-blogs.sort-order=desc">AWS Security Hub</a> combines information from all the above services in a central, unified view. It collects data from all security services from multiple AWS accounts and regions, making it easier to get a complete view of your AWS security posture. In addition, Security Hub supports collecting data from third-party security products. Security Hub is essential to providing your security team with all the information they may need.</p><p>A key feature of Security Hub is its support for industry recognized security standards including the CIS AWS Foundations Benchmark and Payment Card Industry Data Security Standard (PCI DSS).</p><p>Combine Security Hub with <a href="https://www.missioncloud.com/blog/aws-organizations-organizing-and-controlling-spend">AWS Organizations</a> for the simplest way to get a comprehensive security overview of all your AWS accounts.</p><p>Now that we have addressed the top account security tools, let’s focus on the top four AWS application Security Tools you should consider.</p><h3>Top 4 AWS Application Security Tools</h3><h3>1. Amazon Inspector</h3><p><a href="https://aws.amazon.com/inspector/">Amazon Inspector</a> is a security assessment service for applications deployed on EC2. These assessments include network access, common vulnerabilities and exposures (CVEs), Center for Internet Security (CIS) benchmarks, and common best practices such as disabling root login for SSH and validating system directory permissions on your EC2 instances.</p><p>Based on data provided on an agent application you can install on your EC2 VMs, Inspector generates a report with a detailed list of security findings prioritized by severity. Run Inspector as part of a gated check in your deployment pipeline to assess your applications’ security before deploying to production.</p><h3>2. AWS Shield</h3><p><a href="https://aws.amazon.com/shield">AWS Shield</a> is a fully managed distributed denial-of-service (DDoS) protection service. Shield is enabled by default as a free standard service with protection against common DDoS attacks against your AWS environment.</p><p>Shield Advanced goes a step further by integrating with <a href="https://aws.amazon.com/waf/">AWS WAF</a> to prevent a wide variety of malicious traffic from reaching your websites and applications. It can cover multiple accounts under an organization to ensure that <em>all</em> of your organization’s internet-facing endpoints are protected from attackers.</p><h3>3. AWS Web Application Firewall</h3><p><a href="https://aws.amazon.com/waf/">AWS Web Application Firewall</a> (WAF) monitors and protects applications and APIs built on services such as CloudFront, API Gateway, and AppSync. You can block access to your endpoints based on different criteria such as the source IP address, the request’s origin country, values in headers and bodies, and more (i.e., you can enable rate limiting, only allowing a certain number of requests per IP</p><p>The AWS Marketplace also includes a set of managed rules you can associate with your WAF, along with 3rd party managed rules from leading security vendors.</p><h3>4. AWS Secrets Manager</h3><p><a href="https://aws.amazon.com/secrets-manager/">AWS Secrets Manager</a> is a managed service where you can store and retrieve sensitive information such as database credentials, certificates, and tokens. Use fine-grained permissions to specify exact actions an entity can perform on the secrets, such as creating, updating, deleting, or retrieving secrets.</p><p>Secrets Manager also supports automatic rotation for AWS services such as <a href="https://aws.amazon.com/rds/">Amazon Relational Database Service (RDS).</a> Through <a href="https://www.missioncloud.com/professional-services/aws-lambda-serverless">Lambda</a> functions, secrets for other services can be automatically rotated as well. Never store your sensitive information in source control management systems, such as Git. Always use a tool like Secrets Manager.</p><h3>Conclusion</h3><p>AWS has an abundance of security services, making it a challenge to pick the right one for your specific needs. If you’re looking for solutions to specific security use cases, it’s worth diving into <a href="https://aws.amazon.com/security/security-learning/?nc=sn&amp;loc=5&amp;cards-top.sort-by=item.additionalFields.sortDate&amp;cards-top.sort-order=desc">AWS’ cloud security learning resources</a>.</p><p>Identifying vulnerabilities is only a portion of AWS security. Work with Mission to ensure your cloud assets are properly configured from the start. Enabling these tools will provide valuable insight into your AWS account and application security, but the majority of security incidents stem from misconfiguration. Mission can help you choose the right tools to secure your cloud environment.</p><p>Learn more about our <a href="https://www.missioncloud.com/managed-cloud/managed-aws/managed-detection-and-response">Managed Detection and Response (MDR) service</a> and <a href="https://www.missioncloud.com/contact-us">contact us</a> to discover how to best leverage these AWS security services to improve your security posture.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed898d595e7d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy a ReactJS Application to AWS EC2 Instance using AWS Code-Pipeline]]></title>
            <link>https://medium.com/@pratiksharuthe/deploy-a-reactjs-application-to-aws-ec2-instance-using-aws-code-pipeline-3ca3a76081cf?source=rss-87b743eb8f4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ca3a76081cf</guid>
            <dc:creator><![CDATA[Pratiksha Ruthe]]></dc:creator>
            <pubDate>Fri, 13 Oct 2023 10:21:23 GMT</pubDate>
            <atom:updated>2023-10-13T10:29:40.719Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>AWS CodePipeline</strong> is a continuous integration and continuous delivery (CI/CD) AWS service that allows you to automate the release process for your application or service. Every time you commit a code change to your source(GitHub, AWS CodeCommit, etc), CodePipeline automatically builds, tests, and deploys your code based on the release process models you define while initializing your CodePipeline. This enables you to rapidly and reliably deliver features and updates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*4Ielv_7wkeb92adYXZc1jw.jpeg" /></figure><p><strong>Steps that we will follow:</strong></p><ol><li>Create IAM Role for EC2 &amp; AWS CodeDeploy<br><strong>2.</strong> Launch an EC2 instance &amp; then will attach that EC2 Role.<br><strong>3. </strong>Create a CodePipeline using Github, CodeBuild and CodeDeploy</li></ol><p><strong>Step 1) Create IAM Role for EC2 and AWS CodeDeploy</strong></p><ul><li>Create a new role for <strong>EC2</strong> and attach <strong>AmazonS3ReadOnlyAccess</strong> policy which will allow our EC2 instance to access stored artifacts from the Amazon S3 bucket.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*oeTHjmF7Kaz3sqxnTVSNKA.png" /></figure><ul><li>Create a new service role for <strong>CodeDeploy</strong> and attach <strong>AWSCodeDeployRole</strong> policy which will provide the permissions for our service role to read tags of our EC2 instance, publish information to Amazon SNS topics and much more task.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*MR1n4CXsgkAxClUeaXNbIw.png" /></figure><p><strong>Step 2) Launch an Linux EC2 instance</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZUX0OOZRE_r7W5TZ_unlLA.png" /></figure><p><strong>Note:</strong> Please Select t3.medium Instance Type</p><p>And then Install code depoloy agent by follwing commands on terminal.</p><ul><li><strong>For Centos &amp; Amazon Linux 2</strong></li></ul><p>sudo yum update<br>sudo yum install ruby<br>sudo yum install wget<br>wget <a href="https://aws-codedeploy-us-east-1.s3.amazonaws.com/latest/install">https://aws-codedeploy-us-east-1.s3.amazonaws.com/latest/install</a><br>chmod +x ./install<br>sudo ./install auto<br>sudo service codedeploy-agent status</p><ul><li><strong>For Ubuntu &amp; Debian Based</strong></li></ul><p>sudo apt-get update<br>sudo apt-get install ruby</p><p>sudo apt-get install wget<br>cd /home/ubuntu<br>wget <a href="https://aws-codedeploy-ca-central-1.s3.ca-central-1.amazonaws.com/latest/install">https://aws-codedeploy-ca-central-1.s3.ca-central-1.amazonaws.com/latest/install</a><br>chmod +x ./install<br>sudo ./install auto<br>sudo service codedeploy-agent status</p><ul><li><strong>Now, Let’s Attach that EC2 Role with it.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xeYN7XTBqSZY0N1AtrCQnQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*10cH7EQ391wyxjNahLhohQ.png" /></figure><p><strong>Note :</strong> Let’s Make a Github Repository and download the following source code and push on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*VCZP4Y2aK_MkjZlAlEwgKw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*912lGTFqFT9-7fTzX2JDEA.png" /></figure><p><a href="https://mega.nz/file/h9c3TaJK#L5szgPDEQ6UMQzaZrchq0WRtkBLU1lsapWaOxERVgew"><strong>Download-SourceCode</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*As61QQzyvwd5NCJt9HQz-A.png" /></figure><p><strong>Step 3) Create a CodePipeline using Github, CodeBuild and CodeDeploy</strong></p><p><strong>a) Create CodePipeline</strong></p><ul><li>Let’s navigate to CodePipeline via AWS Management Console and click on Create pipeline</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*961T-saVy2AFAONzgaVdDQ.png" /></figure><p><strong>b) Choose Github in Code Source</strong></p><ul><li>After selecting GitHub as the source provider, click on the Connect to GitHub button. You’ll then be prompt to enter your GitHub login credentials</li><li>Once you grant AWS CodePipeline access to your GitHub repository, you can select a repository and branch for CodePipeline to upload commits to this repository to your pipeline</li></ul><p><strong>c) Configure CodeBuild (Optional)</strong></p><ul><li>If you haven’t created a project prior to creating your pipeline,then you can create a project directly from here by clicking Create project button.</li></ul><p><strong>Note: </strong>Buildspec file is a collection of build commands and related settings, in YAML format, that CodeBuild uses to run a build. For my project, I created a buildspec.yaml file and added it in the root of my project directory:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oupzHSQQKInBYsAzxXcgag.png" /></figure><p><strong>d) Add Depoly Stage</strong></p><ul><li>Note : Before going to configure Add Depoly Stage, Let’s make duplicate tab of current tab.</li><li>and then go to code deploy in the nevigation, Select Application, then add create a deployment group.</li><li>In deployment group Select EC2 instances and select Tag and Value</li><li>Untick Load Blancer Option</li><li>and Finally Come on Add Deploy Stage and select that created Application name &amp; Deployment group</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sHWFvHicdy3HOOtjfdU79A.png" /></figure><p><strong>e) At the end, just review and create.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3WH1NRp6UYaqyMbtWZx6Vw.png" /></figure><p><strong>If You will Get below error in pipeline then follow further instruction to resolve it.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*uP4mKh7etHN_nkBWvlTIcA.png" /></figure><ul><li><strong>Error : </strong>CodeDeploy agent was not able to receive the lifecycle event. Check the CodeDeploy agent logs on your host and make sure the agent is running and can connect to the CodeDeploy server.</li></ul><p><strong>Conclusion:</strong> Its happening Because we installed codedeployment-agent before attaching ec2role to EC2 Instance, and error will be resolve when you will first attach ec2role and then install codedeployment-agent on EC2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*W9oyxmAMKzT0DkbeuDxuyA.png" /></figure><p><strong>Run the following commands.</strong></p><ul><li>sudo systemctl stop codedeploy-agent</li><li>sudo yum erase codedeploy-agent -y</li><li>sudo rm -rf /opt/codedeploy-agent</li><li>cd /home/ec2-user/server</li><li>sudo ./install auto</li><li>sudo systemctl status codedeploy-agent</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hKUsRDFlptdy7T23h2YG_g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ca3a76081cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes: How to deploy a Simple Game App into Amazon EKS]]></title>
            <link>https://medium.com/@pratiksharuthe/kubernetes-how-to-deploy-a-simple-game-app-into-amazon-eks-e8f0cfcc1670?source=rss-87b743eb8f4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8f0cfcc1670</guid>
            <dc:creator><![CDATA[Pratiksha Ruthe]]></dc:creator>
            <pubDate>Sun, 08 Oct 2023 05:27:49 GMT</pubDate>
            <atom:updated>2023-10-08T05:27:49.664Z</atom:updated>
            <content:encoded><![CDATA[<p>Create an EKS Cluster</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*aVrbgnK2xPa6lfQnthU3DQ.png" /></figure><p>Attach the iam roles and security group</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*jD1MfZaih9qRikup9TOfyw.png" /></figure><p>Create Nodes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*mCTDTJY3XUmbZxc4y9KQEw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*D8JfL4-GfMyDvbSlfAGXqA.png" /></figure><p>Open Powershell and run the following commands as it is.</p><pre># Type on your AWS CLI window <br>aws sts get-caller-identity<br># observe your account and user id details<br><br># Create a  kubeconfig file where it stores the credentials for EKS:<br># kubeconfig configuration allows you to connect to your cluster using the kubectl command line.<br>aws eks update-kubeconfig --region region-code --name my-cluster<br>ex: aws eks update-kubeconfig --region us-east-1 --name unus-eks-cluster-1 # Use the cluster name you just <br>created<br><br><br># see if you can get the nodes you created<br>kubectl get nodes<br><br># Install nano editor in cloudshell. We will need this in the next task<br>sudo yum install nano -y<br><br><br><br>Task 4: Create a new POD in EKS for the 2048 game<br>================================================<br><br># clean up the files in cloudshell (Optional)<br>rm *.* <br><br># create the config file in YAML to deploy 2048 game pod into the cluster<br>nano 2048-pod.yaml<br><br>### code starts ###<br>apiVersion: v1<br>kind: Pod<br>metadata:<br>   name: 2048-pod<br>   labels:<br>      app: 2048-ws<br>spec:<br>   containers:<br>   - name: 2048-container<br>     image: blackicebird/2048<br>     ports:<br>       - containerPort: 80<br><br>### code ends ###<br><br><br># apply the config file to create the pod<br>kubectl apply -f 2048-pod.yaml<br>#pod/2048-pod created<br><br># view the newly created pod<br>kubectl get pods<br><br><br>Task 5: Setup Load Balancer Service<br>===================================<br>nano mygame-svc.yaml  <br><br>### code starts ###<br><br>apiVersion: v1<br>kind: Service<br>metadata:<br>   name: mygame-svc<br>spec:<br>   selector:<br>      app: 2048-ws<br>   ports:<br>   - protocol: TCP<br>     port: 80<br>     targetPort: 80<br>   type: LoadBalancer<br><br>### code ends ###<br><br># apply the config file<br>kubectl apply -f mygame-svc.yaml<br><br># view details of the modified service<br>kubectl describe svc mygame-svc</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bIs4sE8sazBhEmhAfcvUkw.png" /></figure><p>you will see a loadbalancer created</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*lAAzzZAz9ikK4utbYTT-cA.png" /></figure><p>copy the DNS and check it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pYOynt8CmDmj94hLLKlFgQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jZ5rjOQ0-j0ozr3S2J7ftg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8f0cfcc1670" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy a three-tier architecture in AWS using Terraform]]></title>
            <link>https://medium.com/@pratiksharuthe/deploy-a-three-tier-architecture-in-aws-using-terraform-5f55f8d61bcd?source=rss-87b743eb8f4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f55f8d61bcd</guid>
            <dc:creator><![CDATA[Pratiksha Ruthe]]></dc:creator>
            <pubDate>Sat, 07 Oct 2023 13:40:37 GMT</pubDate>
            <atom:updated>2023-10-07T13:40:37.580Z</atom:updated>
            <content:encoded><![CDATA[<h3><a href="https://github.com/RuthePratiksha/Terraform-AWS-3tier-Architecture#what-is-terraform">What is Terraform?</a></h3><p>Terraform is an open-source infrastructure as a code (IAC) tool that allows to create, manage &amp; deploy the production-ready environment. Terraform codifies cloud APIs into declarative configuration files. Terraform can manage both existing service providers and custom in-house solutions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*2eXIJ9g3MBdyqNQwZlS8zQ.png" /></figure><p>Step 1:- Create a file for the VPC</p><ul><li>Create vpc.tf file and add the below code to it</li></ul><p># Creating VPC<br>resource “aws_vpc” “demovpc” {<br> cidr_block = “${var.vpc_cidr}”<br> instance_tenancy = “default”<br>tags = {<br> Name = “Demo VPC”<br>}<br>}</p><p>Step 2:- Create a file for the Subnet</p><ul><li>For this project, I will create total 6 subnets for the front-end tier and back-end tier with a mixture of public &amp; private subnet</li><li>Create subnet.tf file and add the below code to it</li></ul><p># Creating 1st web subnet <br>resource “aws_subnet” “public-subnet-1” {<br> vpc_id = “${aws_vpc.demovpc.id}”<br> cidr_block = “${var.subnet_cidr}”<br> map_public_ip_on_launch = true<br> availability_zone = “us-east-1a”<br>tags = {<br> Name = “Web Subnet 1”<br>}<br>}<br># Creating 2nd web subnet <br>resource “aws_subnet” “public-subnet-2” {<br> vpc_id = “${aws_vpc.demovpc.id}”<br> cidr_block = “${var.subnet1_cidr}”<br> map_public_ip_on_launch = true<br> availability_zone = “us-east-1b”<br>tags = {<br> Name = “Web Subnet 2”<br>}<br>}<br># Creating 1st application subnet <br>resource “aws_subnet” “application-subnet-1” {<br> vpc_id = “${aws_vpc.demovpc.id}”<br> cidr_block = “${var.subnet2_cidr}”<br> map_public_ip_on_launch = false<br> availability_zone = “us-east-1a”<br>tags = {<br> Name = “Application Subnet 1”<br>}<br>}<br># Creating 2nd application subnet <br>resource “aws_subnet” “application-subnet-2” {<br> vpc_id = “${aws_vpc.demovpc.id}”<br> cidr_block = “${var.subnet3_cidr}”<br> map_public_ip_on_launch = false<br> availability_zone = “us-east-1b”<br>tags = {<br> Name = “Application Subnet 2”<br>}<br>}<br># Create Database Private Subnet<br>resource “aws_subnet” “database-subnet-1” {<br> vpc_id = “${aws_vpc.demovpc.id}”<br> cidr_block = “${var.subnet4_cidr}”<br> availability_zone = “us-east-1a”<br>tags = {<br> Name = “Database Subnet 1”<br>}<br>}<br># Create Database Private Subnet<br>resource “aws_subnet” “database-subnet-2” {<br> vpc_id = “${aws_vpc.demovpc.id}”<br> cidr_block = “${var.subnet5_cidr}”<br> availability_zone = “us-east-1a”<br>tags = {<br> Name = “Database Subnet 1”<br>}<br>}</p><p>Step 3:- Create a file for the Internet Gateway</p><ul><li>Create igw.tf file and add the below code to it</li></ul><p># Creating Internet Gateway <br>resource “aws_internet_gateway” “demogateway” {<br> vpc_id = “${aws_vpc.demovpc.id}”<br>}</p><p>Step 4:- Create a file for the Route table</p><ul><li>Create route_table_public.tf file and add the below code to it</li></ul><p># Creating Route Table<br>resource “aws_route_table” “route” {<br> vpc_id = “${aws_vpc.demovpc.id}”<br>route {<br> cidr_block = “0.0.0.0/0”<br> gateway_id = “${aws_internet_gateway.demogateway.id}”<br> }<br>tags = {<br> Name = “Route to internet”<br> }<br>}<br># Associating Route Table<br>resource “aws_route_table_association” “rt1” {<br> subnet_id = “${aws_subnet.demosubnet.id}”<br> route_table_id = “${aws_route_table.route.id}”<br>}<br># Associating Route Table<br>resource “aws_route_table_association” “rt2” {<br> subnet_id = “${aws_subnet.demosubnet1.id}”<br> route_table_id = “${aws_route_table.route.id}”<br>}</p><ul><li>In the above code, I am creating a new route table and forwarding all the requests to the 0.0.0.0/0 CIDR block.</li><li>I am also attaching this route table to the subnet created earlier. So, it will work as the Public Subnet</li></ul><p>Step 5:- Create a file for EC2 instances</p><ul><li>Create ec2.tf file and add the below code to it</li></ul><p># Creating 1st EC2 instance in Public Subnet<br>resource “aws_instance” “demoinstance” {<br> ami = “ami-087c17d1fe0178315”<br> instance_type = “t2.micro”<br> count = 1<br> key_name = “tests”<br> vpc_security_group_ids = [“${aws_security_group.demosg.id}”]<br> subnet_id = “${aws_subnet.demoinstance.id}”<br> associate_public_ip_address = true<br> user_data = “${file(“data.sh”)}”<br>tags = {<br> Name = “My Public Instance”<br>}<br>}<br># Creating 2nd EC2 instance in Public Subnet<br>resource “aws_instance” “demoinstance1” {<br> ami = “ami-087c17d1fe0178315”<br> instance_type = “t2.micro”<br> count = 1<br> key_name = “tests”<br> vpc_security_group_ids = [“${aws_security_group.demosg.id}”]<br> subnet_id = “${aws_subnet.demoinstance.id}”<br> associate_public_ip_address = true<br> user_data = “${file(“data.sh”)}”<br>tags = {<br> Name = “My Public Instance 2”<br>}<br>}</p><p>Step 6:- Create a file for Security Group for the FrontEnd tier</p><ul><li>Create web_sg.tf file and add the below code to it</li></ul><p># Creating Security Group <br>resource “aws_security_group” “demosg” {<br> vpc_id = “${aws_vpc.demovpc.id}”<br># Inbound Rules<br># HTTP access from anywhere<br>ingress {<br> from_port = 80<br> to_port = 80<br> protocol = “tcp”<br> cidr_blocks = [“0.0.0.0/0”]<br>}<br># HTTPS access from anywhere<br>ingress {<br> from_port = 443<br> to_port = 443<br> protocol = “tcp”<br> cidr_blocks = [“0.0.0.0/0”]<br>}<br># SSH access from anywhere<br>ingress {<br> from_port = 22<br> to_port = 22<br> protocol = “tcp”<br> cidr_blocks = [“0.0.0.0/0”]<br>}<br># Outbound Rules<br># Internet access to anywhere<br>egress {<br> from_port = 0<br> to_port = 0<br> protocol = “-1”<br> cidr_blocks = [“0.0.0.0/0”]<br>}<br>tags = {<br> Name = “Web SG”<br>}<br>}</p><ul><li>I have opened 80,443 &amp; 22 ports for the inbound connection and I have opened all the ports for the outbound connection</li></ul><p>Step 7:- Create a file for Security Group for the Database tier</p><ul><li>Create database_sg.tf file and add the below code to it</li></ul><p># Create Database Security Group<br>resource “aws_security_group” “database-sg” {<br> name = “Database SG”<br> description = “Allow inbound traffic from application layer”<br> vpc_id = aws_vpc.demovpc.id<br>ingress {<br> description = “Allow traffic from application layer”<br> from_port = 3306<br> to_port = 3306<br> protocol = “tcp”<br> security_groups = [aws_security_group.demosg.id]<br>}<br>egress {<br> from_port = 32768<br> to_port = 65535<br> protocol = “tcp”<br> cidr_blocks = [“0.0.0.0/0”]<br>}<br>tags = {<br> Name = “Database SG”<br>}<br>}</p><ul><li>I have opened 3306 ports for the inbound connection and I have opened all the ports for the outbound connection.</li></ul><p>Step 8:- Create a file Application Load Balancer</p><ul><li>Create alb.tf file and add the below code to it</li></ul><p># Creating External LoadBalancer<br>resource “aws_lb” “external-alb” {<br> name = “External LB”<br> internal = false<br> load_balancer_type = “application”<br> security_groups = [aws_security_group.demosg.id]<br> subnets = [aws_subnet.public-subnet-1.id, aws_subnet.public-subnet-1.id]<br>}<br>resource “aws_lb_target_group” “target-elb” {<br> name = “ALB TG”<br> port = 80<br> protocol = “HTTP”<br> vpc_id = aws_vpc.demovpc.id<br>}<br>resource “aws_lb_target_group_attachment” “attachment” {<br> target_group_arn = aws_lb_target_group.external-alb.arn<br> target_id = aws_instance.demoinstance.id<br> port = 80<br>depends_on = [<br> aws_instance.demoinstance,<br>]<br>}<br>resource “aws_lb_target_group_attachment” “attachment” {<br> target_group_arn = aws_lb_target_group.external-alb.arn<br> target_id = aws_instance.demoinstance1.id<br> port = 80<br>depends_on = [<br> aws_instance.demoinstance1,<br>]<br>}<br>resource “aws_lb_listener” “external-elb” {<br> load_balancer_arn = aws_lb.external-alb.arn<br> port = “80”<br> protocol = “HTTP”<br>default_action {<br> type = “forward”<br> target_group_arn = aws_lb_target_group.external-alb.arn<br>}<br>}</p><ul><li>The above load balancer is of type external</li><li>Load balancer type is set to application</li><li>The aws_lb_target_group_attachment resource will attach our instances to the Target Group.</li><li>The load balancer will listen requests on port 80</li></ul><p>Step 9:- Create a file for the RDS instance</p><ul><li>Create a rds.tf file and add the below code to it</li></ul><p># Creating RDS Instance<br>resource “aws_db_subnet_group” “default” {<br> name = “main”<br> subnet_ids = [aws_subnet.database-subnet-1.id, aws_subnet.database-subnet-1.id]<br>tags = {<br> Name = “My DB subnet group”<br>}<br>}<br>resource “aws_db_instance” “default” {<br> allocated_storage = 10<br> db_subnet_group_name = aws_db_subnet_group.default.id<br> engine = “mysql”<br> engine_version = “8.0.20”<br> instance_class = “db.t2.micro”<br> multi_az = true<br> name = “mydb”<br> username = “username”<br> password = “password”<br> skip_final_snapshot = true<br> vpc_security_group_ids = [aws_security_group.database-sg.id]<br>}</p><ul><li>In the above code, you need to change the value of username &amp; password</li><li>multi-az is set to true for the high availability</li></ul><p>Step 10:- Create a file for outputs</p><ul><li>Create outputs.tf file and add the below code to it</li></ul><p># Getting the DNS of load balancer<br>output “lb_dns_name” {<br> description = “The DNS name of the load balancer”<br> value = “${aws_lb.external-alb.dns_name}”<br>}</p><ul><li>From the above code, I will get the DNS of the application load balancer.</li></ul><p>Step 11:- Create a file for variable</p><ul><li>Create vars.tf file and add the below code to it</li></ul><p># Defining CIDR Block for VPC<br>variable “vpc_cidr” {<br> default = “10.0.0.0/16”<br>}<br># Defining CIDR Block for 1st Subnet<br>variable “subnet_cidr” {<br> default = “10.0.1.0/24”<br>}<br># Defining CIDR Block for 2nd Subnet<br>variable “subnet1_cidr” {<br> default = “10.0.2.0/24”<br>}<br># Defining CIDR Block for 3rd Subnet<br>variable “subnet2_cidr” {<br> default = “10.0.3.0/24”<br>}<br># Defining CIDR Block for 3rd Subnet<br>variable “subnet2_cidr” {<br> default = “10.0.4.0/24”<br>}<br># Defining CIDR Block for 3rd Subnet<br>variable “subnet2_cidr” {<br> default = “10.0.5.0/24”<br>}<br># Defining CIDR Block for 3rd Subnet<br>variable “subnet2_cidr” {<br> default = “10.0.6.0/24” <br>}</p><p>Step 12:- Create a file for user data</p><ul><li>Create data.sh file and add the below code to it</li></ul><p>#!/bin/bash<br>yum update -y<br>yum install -y httpd.x86_64<br>systemctl start httpd.service<br>systemctl enable httpd.service<br>echo “Hello World from $(hostname -f)” &gt; /var/www/html/index.html</p><ul><li>The above code will install an apache webserver in the EC2 instances</li></ul><p>So, now our entire code is ready. We need to run the below steps to create infrastructure.</p><ul><li>terraform init is to initialize the working directory and downloading plugins of the provider</li><li>terraform plan is to create the execution plan for our code</li><li>terraform apply is to create the actual infrastructure. It will ask you to provide the Access Key and Secret Key in order to create the infrastructure. So, instead of hardcoding the Access Key and Secret Key, it is better to apply at the run time.</li></ul><p>Step 13:- Verify the resources</p><p>Terraform will create below resources</p><ul><li>VPC</li><li>Application Load Balancer</li><li>Public &amp; Private Subnets</li><li>EC2 instances</li><li>RDS instance</li><li>Route Table</li><li>Internet Gateway</li><li>Security Groups for Web &amp; RDS instances</li><li>Route Table</li></ul><p>Once the resource creation finishes you can get the DNS of a load balancer and paste it into the browser and you can see load balancer will send the request to two instances.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f55f8d61bcd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[DEVOPS] - Basic Questions and Answer to know.]]></title>
            <link>https://medium.com/@pratiksharuthe/devops-basic-questions-and-answer-to-know-ef62e23a7542?source=rss-87b743eb8f4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef62e23a7542</guid>
            <dc:creator><![CDATA[Pratiksha Ruthe]]></dc:creator>
            <pubDate>Mon, 18 Sep 2023 06:38:27 GMT</pubDate>
            <atom:updated>2023-10-14T08:24:40.957Z</atom:updated>
            <content:encoded><![CDATA[<p>1-A freestyle project in Jenkins is a type of project that allows you to build, test, and deploy software using a variety of different options and configurations.</p><p>2-pipelines enable you to define the whole application lifecycle. Pipeline functionality helps Jenkins to support continuous delivery (CD). The Pipeline plugin was built with requirements for a flexible, extensible, and script-based CD workflow capability in mind.</p><p>3-Use the Jenkins Credentials Plugin to store sensitive information such as passwords, API keys, and SSH keys. On manage Jenkins. Can create user name , password of secret text credential.</p><p>4-Jenkinsfile is a text file that contains the definition of a Jenkins Pipeline. There are few steps we need to define while creating Jenkins file ,built, test, deploy steps.</p><p>5-Jenkins plugins are extensions to the Jenkins system. There are around 1,500 plugins available for a variety of applications. The thousands of plug-ins available allow for a great deal of customization.</p><p>6-If we want jenkins pipeline execution to multiple agents how would you do that- Pipeline allows utilizing multiple agents in the Jenkins environment from within the same Jenkins file , which can helpful for more advanced use-cases such as executing builds/tests across multiple platforms. stash-unstash will also help us to achieve that. It alsoconsist of node block, within this block you can specify which agent label to use for execution so it will unable sort of parrallel execution of stages accross multiple agent.</p><p>7-What is Agent- The agent section specifies where the entire Pipeline, or a specific stage, will execute in the Jenkins environment depending on where the agent section is placed. You can use multiple Jenkins Agents to balance build load, improve performance, and create a secure environment independent of the Controller. To run it, you’ll need to install Java on a physical machine, virtual machine, cloud compute instance, Docker image, or Kubernetes cluster.</p><p>8-How will you parameterized jenkins pipeline or job- When we talk about pipeline in jenkins, we can parameterize them by defining parameters in the job configuration or you can do that in jenkins file as well.</p><p>9-an artifact is an immutable file, generated during a Build or Pipeline run in Jenkins.</p><p>10-Jenkins Shared Library is the concept of having a common pipeline code in the version control system that can be used by any number of pipelines just by referring to it in the pipeline code. It reduces the effort of the developer by keeping the same logic in multiple files. Jenkins pipelines benefit from the consistency, maintainability, and code reuse provided by Jenkins Shared Libraries.</p><p>11-Running stages in parallel with Jenkins Workflow/Pipeline is a technique that allows developers to execute multiple stages simultaneously, which can improve the overall performance and speed of the development process.</p><p>12-Pipeline as code is the practice of defining software delivery pipelines with code versioned in a source repository. it refers to mostly defining pipeline using code like the jenkins file.</p><p>13-declarative and scripted pipeline- declarative and scripted pipelines differ in terms of the programmatic approach.Scripted Pipeline is the original pipeline syntax for Jenkins, and it is based on Groovy scripting language. In Scripted Pipeline, the entire workflow is defined in a single file called a Jenkinsfile. The Jenkinsfile is written in Groovy and is executed by the Jenkins Pipeline plugin. Scripted Pipeline provides a lot of flexibility and control over the workflow, but it can be more complex and verbose than Declarative Pipeline.Declarative Pipeline is a more recent addition to Jenkins and provides a more structured and simpler syntax for defining pipelines. Declarative Pipeline is based on the Groovy programming language, but it uses a Groovy-based DSL (Domain-Specific Language) for pipeline configuration.. The main benefit of Declarative Pipeline is its readability and ease of use, as it is designed to be more intuitive and less verbose than Scripted Pipeline.</p><p>what is blue/green deployment? A blue/green deployment is a deployment strategy in which you create two separate, but identical environments. One environment (blue) is running the current application version and one environment (green) is running the new application version. Using a blue/green deployment strategy increases application availability and reduces deployment risk…… Blue/green deployment is a continuous deployment process that reduces downtime and risk by having two identical production environments, called blue and green.</p><p>what is devops? DevOps, in simple terms, is a set of practices and principles that aim to improve collaboration and communication between software development (Dev) and IT operations (Ops) teams. It emphasizes automation, continuous integration, and continuous delivery to enable faster and more reliable software development and deployment.</p><p>what is cicd? CI/CD stands for Continuous Integration and Continuous Delivery (or Continuous Deployment).In simple terms, Continuous Integration (CI) in software development means that as developers work on a project, their code changes are automatically and frequently combined with the main shared repository.In simple terms, “CD” in software development can refer to either Continuous Delivery or Continuous Deployment. Both involve automating the process of getting new code changes into the hands of users.</p><p>what is codepipeline in aws?AWS CodePipeline is a fully managed continuous delivery service offered by Amazon Web Services (AWS).It automates and orchestrates the building, testing, and deployment of your software applications.</p><p>how to transfer s3 data to another region? 1.Create a New S3 Bucket in the Destination Region. 2.Install and Configure the AWS Command Line Interface (CLI). 3.Copy Data from the Source Bucket to the Destination Bucket. you can use the aws s3 sync command to copy data from the source bucket to the destination bucket. ::aws s3 sync s3://source-bucket-name s3://destination-bucket-name:: 4.If you want to copy all data, including overwriting any existing files in the destination bucket, you can use the cp command. ::aws s3 cp s3://source-bucket-name s3://destination-bucket-name — recursive::</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef62e23a7542" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JENKINS INTERVIEW QUESTIONS AND ANSWERS.]]></title>
            <link>https://medium.com/@pratiksharuthe/jenkins-interview-questions-and-answers-ad1ae5104e7a?source=rss-87b743eb8f4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad1ae5104e7a</guid>
            <dc:creator><![CDATA[Pratiksha Ruthe]]></dc:creator>
            <pubDate>Wed, 30 Aug 2023 05:47:13 GMT</pubDate>
            <atom:updated>2023-08-30T05:47:13.617Z</atom:updated>
            <content:encoded><![CDATA[<p>JENKINS INTERVIEW QUESTIONS AND ANSWERS.</p><p>1. What is Jenkins?</p><ul><li>Jenkins is an open-source automation server used to automate various tasks in the software development process, including building, testing, and deploying applications.</li></ul><p>2. What is a Jenkins pipeline?</p><ul><li>A Jenkins pipeline is a set of instructions defined in code that specifies how a software application should be built, tested, and deployed. It allows for defining the entire software delivery process as code.</li></ul><p>3. How can you create a Jenkins pipeline?</p><ul><li>Jenkins pipelines can be created using the “Pipeline” plugin, which allows you to define pipelines using either Declarative or Scripted syntax. Declarative syntax is recommended for simpler pipelines, while Scripted syntax offers more flexibility.</li></ul><p>4. What is the difference between Declarative and Scripted pipelines?</p><ul><li>Declarative pipelines provide a more structured and simplified syntax for defining pipelines, making them easier to read and maintain. Scripted pipelines, on the other hand, use a more flexible scripting language and are better suited for complex scenarios.</li></ul><p>5. How do you define stages in a Jenkins pipeline?</p><ul><li>Stages are defined within a pipeline block. Each stage represents a specific phase of the software delivery process, such as building, testing, and deploying. Stages allow you to organize and visualize the flow of your pipeline.</li></ul><p>6. What is Jenkinsfile?</p><ul><li>A Jenkinsfile is a text file that contains the definition of a Jenkins pipeline. It can be stored in the version control repository along with the application code, enabling versioning and traceability of pipeline changes.</li></ul><p>7. How can you trigger a Jenkins job?</p><ul><li>Jenkins jobs can be triggered manually by users or automatically based on various events such as code commits, pull requests, and timer-based scheduling.</li></ul><p>8. What is the purpose of Jenkins plugins?</p><ul><li>Jenkins plugins extend the functionality of Jenkins by providing additional features and integrations with other tools and technologies. There are thousands of plugins available to enhance various aspects of the CI/CD process.</li></ul><p>9. How can you secure sensitive information like passwords in Jenkins?</p><ul><li>Jenkins provides a feature called “Credentials” that allows you to securely manage and store sensitive information. You can use credentials in your pipeline scripts without exposing the actual values.</li></ul><p>10. How can you achieve parallel execution in Jenkins pipelines? — Parallel execution can be achieved using the parallel directive in the pipeline script. It allows you to run multiple stages or steps concurrently, which can significantly speed up the build and test process.</p><p>11. What is the difference between a freestyle project and a pipeline in Jenkins? — A freestyle project is a traditional Jenkins job that allows you to configure build steps, post-build actions, and triggers through the Jenkins web interface. A pipeline, on the other hand, is defined in code (Jenkinsfile) and offers more flexibility and reusability by allowing you to version control the entire build and deployment process.</p><p>12. How can you pass parameters to a Jenkins job? — Parameters can be passed to a Jenkins job using the “This build is parameterized” option in the job configuration. You can define various parameter types such as string, boolean, choice, etc. These parameters can then be accessed and used in your pipeline or freestyle job.</p><p>13. What is the purpose of the Jenkins Master-Slave architecture? — The Master-Slave architecture in Jenkins allows for distributing build and testing workloads across multiple nodes (slaves). The master node manages the distribution of tasks to the slave nodes, which can help in scaling and optimizing the build process.</p><p>14. How can you archive artifacts in Jenkins? — The “Archive the artifacts” post-build action allows you to specify files and directories that you want to keep as build artifacts. These artifacts can be used for downstream jobs, deployments, or for keeping a record of the build outputs.</p><p>15. Explain what a Jenkins shared library is. — A Jenkins shared library is a way to define and share commonly used code snippets, functions, and entire pipelines across multiple Jenkins jobs. It promotes code reusability, maintainability, and consistency in your pipeline definitions.</p><p>16. How can you integrate Jenkins with version control systems like Git? — Jenkins integrates with version control systems like Git through plugins. You can set up your Jenkins job to monitor a Git repository for changes, and trigger builds automatically whenever new code is pushed.</p><p>17. What is Blue Ocean in Jenkins? — Blue Ocean is a modern, user-friendly interface for Jenkins that provides a more visual representation of your pipeline. It offers better visualization of pipeline stages, easier navigation, and a more intuitive experience.</p><p>18. How can you schedule a Jenkins job to run at a specific time? — You can schedule Jenkins jobs using the “Build periodically” option in the job configuration. You can use cron syntax to define the schedule, specifying when and how often the job should run.</p><p>19. What is the purpose of the “Jenkinsfile Agent” section? — The agent section in a Jenkinsfile specifies where the pipeline should run. It defines the execution environment, such as a specific Jenkins node or Docker container, where the pipeline stages will be executed.</p><p>20. How can you trigger downstream jobs in Jenkins? — Downstream jobs can be triggered using the “Build other projects” post-build action. You can configure your current job to trigger one or more other jobs after its successful completion.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad1ae5104e7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[20 most important Docker Interview Questions and answers.]]></title>
            <link>https://medium.com/@pratiksharuthe/20-most-important-docker-interview-questions-and-answers-15bd20c65580?source=rss-87b743eb8f4e------2</link>
            <guid isPermaLink="false">https://medium.com/p/15bd20c65580</guid>
            <dc:creator><![CDATA[Pratiksha Ruthe]]></dc:creator>
            <pubDate>Tue, 29 Aug 2023 16:37:09 GMT</pubDate>
            <atom:updated>2023-08-29T16:37:09.599Z</atom:updated>
            <content:encoded><![CDATA[<p>Question 1: What is Docker? Answer: Docker is a platform that allows you to develop, deploy, and run applications in containers. Containers provide a lightweight and consistent environment for applications to run in, along with their dependencies.</p><p>Question 2: What is a Docker image? Answer: A Docker image is a standalone, executable package that includes everything needed to run a piece of software, including the code, runtime, system tools, libraries, and settings. Images are used to create containers.</p><p>Question 3: How do you create a Docker image? Answer: Docker images are created using a Dockerfile, which is a text file that contains a set of instructions for building the image. The docker build command is used to build an image from a Dockerfile.</p><p>Question 4: What is a Docker container? Answer: A Docker container is an instance of a Docker image. Containers are isolated environments that encapsulate an application and its dependencies, ensuring consistency across different environments.</p><p>Question 5: How can you share Docker images with others? Answer: Docker images can be shared using Docker Hub (or other container registries) or by exporting and importing them as tarball files.</p><p>Question 6: What are Docker volumes? Answer: Docker volumes are used to persist data beyond the lifecycle of a container. They provide a way to store and manage data separately from the container itself, making it easier to manage stateful applications.</p><p>Question 7: How can you link containers together? Answer: While container linking is an older approach, Docker recommends using user-defined networks for communication between containers. You can create a custom bridge network and attach containers to it, enabling them to communicate via DNS-based service discovery.</p><p>Question 8: What is Docker Compose? Answer: Docker Compose is a tool that allows you to define and manage multi-container applications using a simple YAML file. It enables you to define the services, networks, and volumes required for an application in a single file.</p><p>Question 9: How can you scale Docker containers horizontally? Answer: Docker containers can be scaled horizontally by using container orchestration tools like Docker Swarm or Kubernetes. These tools manage the deployment, scaling, and availability of containers across a cluster of machines.</p><p>Question 10: What is the difference between Docker and virtualization? Answer: Docker uses containerization, which shares the host OS kernel among containers, resulting in lightweight and efficient deployments. Virtualization, on the other hand, uses hypervisors to create isolated virtual machines with separate OS instances.</p><p>Question 11: What is the difference between Docker and Kubernetes? Answer: Docker is a platform that enables you to create, deploy, and run applications in containers. Kubernetes, on the other hand, is a container orchestration platform that automates the deployment, scaling, and management of containerized applications.</p><p>Question 12: How does Docker help with application portability? Answer: Docker containers encapsulate applications and their dependencies, making them highly portable across different environments. This ensures that applications run consistently across development, testing, and production environments.</p><p>Question 13: Explain the concept of a Dockerfile. Answer: A Dockerfile is a text file that contains a set of instructions for building a Docker image. It includes commands to install dependencies, configure settings, and set up the environment needed to run an application.</p><p>Question 14: How do you manage environment variables in Docker containers? Answer: Environment variables can be set within a Docker container using the -e flag with the docker run command or by defining them in a Docker Compose file. Alternatively, environment variables can be specified within the Dockerfile using the ENV instruction.</p><p>Question 15: What is Docker Swarm? Answer: Docker Swarm is a built-in container orchestration tool in Docker that allows you to create and manage a cluster of Docker nodes. It provides features for scaling, load balancing, and high availability.</p><p>Question 16: Can you explain the difference between an image and a container? Answer: An image is a template that includes an application and its dependencies. A container is a running instance of an image. Multiple containers can be created from the same image.</p><p>Question 17: How can you remove unused Docker images and containers? Answer: You can use the docker image prune and docker container prune commands to remove unused images and containers, respectively.</p><p>Question 18: What is Docker Registry? Answer: A Docker Registry is a storage and distribution system for Docker images. Docker Hub is a popular public registry, and you can also set up your private Docker Registry.</p><p>Question 19: How do you troubleshoot issues in Docker containers? Answer: Troubleshooting Docker containers involves checking container logs, inspecting running processes, examining network configurations, and using tools like docker exec to access containers.</p><p>Question 20: How does Docker ensure isolation between containers on the same host? Answer: Docker uses namespaces and control groups (cgroups) to provide isolation between containers. Namespaces create separate environments for processes, while cgroups manage resource allocation and usage.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15bd20c65580" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>