<?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 Ankita Singh on Medium]]></title>
        <description><![CDATA[Stories by Ankita Singh on Medium]]></description>
        <link>https://medium.com/@a-s-ankitasingh11a04?source=rss-c9e24e7d52cd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*yqN5-M5icqg4y5x-T5f3Rg.jpeg</url>
            <title>Stories by Ankita Singh on Medium</title>
            <link>https://medium.com/@a-s-ankitasingh11a04?source=rss-c9e24e7d52cd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 00:26:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@a-s-ankitasingh11a04/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[Website Hosting by Dynamic Launching of Node & Zero Downtime]]></title>
            <link>https://a-s-ankitasingh11a04.medium.com/website-hosting-by-dynamic-launching-of-node-zero-downtime-7e129d4855?source=rss-c9e24e7d52cd------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e129d4855</guid>
            <dc:creator><![CDATA[Ankita Singh]]></dc:creator>
            <pubDate>Mon, 08 Jun 2020 18:21:36 GMT</pubDate>
            <atom:updated>2020-12-24T15:45:41.955Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*PzlKUWgDXjjiHssaS7VE2A.jpeg" /></figure><h3>Introduction:-</h3><p>This is a project based on hosting website at <strong><em>ZERO DOWNTIME!!</em></strong> Zero Downtime describes a site without service interruption. To achieve such lofty goals, redundancy becomes a critical requirement at every level of your infrastructure.</p><p>As all leading business depends on their regular,continuous and easy service providence , trust of their users/customers with various Business strategies. for ex.- Amazon , flipkart , Netflix, youtube etc.</p><p>This all depends on the <strong>Deployment Architecture.</strong> None of the users want any type of delay in their work just for downtime. Obviously they will move/switch to the another Website.</p><p>So here the role of Automation come into play , as none of the business guys intentionally wants their service to go down.As for them this business is their bread and butter , they are earning money because of their services.So with the help of Automation we can resolve this issue of downtime.</p><p>Here is one of my Project which depends on to deploy our Web server using a very good feature of Jenkins that is <strong>Distributed Jenkins</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*JfXwsBSoRu1Q0CsEnqxfuQ.png" /></figure><p><strong>Master Slave Architecture :-</strong> A Jenkins master comes with the basic installation of Jenkins, and in this configuration, the master handles all the tasks for your build system. The job of a <strong>Slave</strong> is to do as they are told to, which involves executing build jobs dispatched by the <strong>Master</strong>.</p><p>As we that there can be two types of Slave nodes in Jenkins(Master Slave Architecture)<br>1.Static node<br>2.Distributed/Dynamic node</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*49JemATeH1NHlD04jr9Kqw.png" /></figure><p><strong>Static node:-</strong> Static node includes making Jenkins slave to a different VM which will work when Master will assign job to them.<br>Otherwise they will sit idle .</p><p><strong>Dynamic node:-</strong>this is to resolve the limitation of static nodes i.e. Reducing the power usage of static node when they are idle, reducing provisioning cost , Reducing storage problem etc.<br>Dynamic launching of node can be done by the use of containerization technology.</p><p>Now let us see with a very good example :-</p><h3>Project Task:-</h3><p>1. Create container image that’s has Linux and other basic configuration required to run Slave for Jenkins. ( example here we require kubectl to be configured )</p><p>2. When we launch the job it should automatically starts job on slave based on the label provided for dynamic approach.</p><p>3. Create a job chain of job1 &amp; job2 using build pipeline plugin in Jenkins</p><p>4. Job1 : Pull the Github repo automatically when some developers push repo to Github and perform the following operations as:<br> 4.1 Create the new image dynamically for the application and copy the application code into that corresponding docker image<br> 4.2 Push that image to the docker hub (Public repository) <br> ( Github code contain the application code and Dockerfile to create a new image )</p><p>5. Job2 ( Should be run on the dynamic slave of Jenkins configured with Kubernetes kubectl command): Launch the application on the top of Kubernetes cluster performing following operations:<br> 5.1 If launching first time then create a deployment of the pod using the image created in the previous job. Else if deployment already exists then do rollout of the existing pod making zero downtime for the user.<br> 5.2 If Application created first time, then Expose the application. Else don’t expose it.</p><h3>Tools Required:-</h3><ol><li>git</li><li>github</li><li>jenkins</li><li>docker</li><li>kubernetes</li></ol><h3>Procedure:-</h3><p><strong>Step 1:-</strong> Creation of Dockerfile for creation of docker image.</p><ol><li>For kubernetes:-</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9DYjmkQ5QE1Vb2v0S000QQ.jpeg" /></figure><p>I created ssh_config file , which I have created for the ssh authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cHlCvp8C1dQHzCr7HaTt4g.png" /></figure><p>2. For Launching Web server:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DkHRfbqHJP8JXkj0KbPKQg.jpeg" /></figure><p>Now with the help of docker <strong>docker push &lt;container_name&gt;</strong></p><p>I just checked this image , whether it is working fine or not, by launching it first time.</p><p><strong>docker push ankita0610/webserver-html:v2</strong></p><p>code inside <strong>index.html </strong>in <strong>ankita0610/webserver-html:v2 :-</strong></p><p>&lt;html&gt;<br>&lt;body bgcolor=”aqua”&gt;<br>&lt;h1&gt;Hello World!!&lt;/h1&gt;<br>&lt;h3&gt;My first webpage&lt;/h3&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xQUMoajriELWjar0Qk8YYg.jpeg" /></figure><p><strong>Now we gonna change our website with zero downtime.This is what our practical is.</strong></p><p><strong>Step 2:-</strong> Creation of Dynamic node(Dynamic cloud)</p><p>-Go to <strong>manage jenkins</strong><br>-Go to <strong>Manage node and clouds<br>-</strong>Go to<strong> configure cloud<br>-</strong>And do following steps</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i-uWJF3MYkDXzKlFrwn0Wg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Is1wALe7vxkoYNqTxg0JWA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mDXpFv_UDtptYmk3FxVdew.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sXFCdXc0ooVQfdyWQxuScg.jpeg" /></figure><p>Now , we have to create web-hook on github so that as soon as developer push their program file on github, github will trigger our job1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1eJXADAabpBBnfr1HHlpLA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o-msNlHGtF4WYUKn5UQG6g.jpeg" /></figure><p>Now to create jobs in jenkins:-</p><p><strong>Job 1:- </strong>job1 will pull the repository from github and copy the files/content from workspace to our local directory.</p><p>- Create the new image dynamically for the application and copy the application code into that corresponding docker image<br>- Push that image to the docker hub (Public repository) <br> ( Github code contain the application code and Dockerfile to create a new image )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DD4smt2SDLNGEmODUMlayg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F-sTvcYSbuA8KfX9Ih1geQ.jpeg" /></figure><p>And here is the output on <strong>Build of job1.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QJFSeH8CRdCnAw9PPVsjbQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ODXEmbaQGnRn5smjrc8WFQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uxlnFkwum6iXLf33UcbLFQ.jpeg" /></figure><p>Job2:- For launching the slave node dynalically and then deploy the webserver.</p><p>- If launching first time then create a deployment of the pod using the image created in the previous job. Else if deployment already exists then do rollout of the existing pod making zero downtime for the user.<br>- If Application created first time, then Expose the application. Else don’t expose it.</p><p>Code of <strong>index.html </strong>in<strong> ankita0610/webserver-html:v3 :-</strong></p><p>&lt;html&gt;<br>&lt;body bgcolor=”orange”&gt;<br>&lt;h1&gt;Hello World!!&lt;/h1&gt;<br>&lt;h3&gt;My first webpage&lt;/h3&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yvS3ptJNPKqssW1r8HLK0w.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q4dDZHaHG3PeFdNLH9PYsw.jpeg" /></figure><p>I have created <strong>deploy.yml </strong>program file for creating deployment, and it will use the container image, which I have pushed into docker hub in job1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s1zd38CZcv0NRiklwSqYpQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5GRMl1PNWv33xuZIK3QXZQ.jpeg" /></figure><p>And here is the output of <strong>Build</strong> of Job2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZVTwdswOfGIkKdvv0EPc6A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*41UF1riPUNRBJRSBt79XRQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WS_iopnS54nuPSgkueW9ZQ.jpeg" /></figure><p>Here is build pipeline view:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yqHdLggio4Mjcj978RAXaA.jpeg" /></figure><p>Here is the <strong>output ,</strong> which I get:-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TQo4SJDdQI1vN2Sh8gdkNQ.jpeg" /></figure><p>So this is how we launched our website with no downtime, <strong>ZERO DOWNTIME!! with the use of automation tools .</strong></p><p><strong>Thank you for reading my article.</strong></p><p>Regards-<br><strong>Ankita Singh</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e129d4855" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>