<?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 Rejani on Medium]]></title>
        <description><![CDATA[Stories by Rejani on Medium]]></description>
        <link>https://medium.com/@rejani2906?source=rss-f78994a1beec------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*WURz_p1PClzdEwB7</url>
            <title>Stories by Rejani on Medium</title>
            <link>https://medium.com/@rejani2906?source=rss-f78994a1beec------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 19:08:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rejani2906/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[Day 39 : AWS and IAM Basics☁]]></title>
            <link>https://blog.devops.dev/day-39-aws-and-iam-basics-8cec1e83d934?source=rss-f78994a1beec------2</link>
            <guid isPermaLink="false">https://medium.com/p/8cec1e83d934</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[iam-roles]]></category>
            <category><![CDATA[aws-iam]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Rejani]]></dc:creator>
            <pubDate>Tue, 11 Apr 2023 14:54:08 GMT</pubDate>
            <atom:updated>2023-04-14T19:48:00.657Z</atom:updated>
            <content:encoded><![CDATA[<p>Here is the summary of the Day 39 of <a href="https://github.com/LondheShubham153/90DaysOfDevOps"><strong>#90DaysOfDevOps </strong></a>Challenge:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UceuORfs19MG7H8N.png" /></figure><h4><strong>AWS:</strong></h4><p>Amazon Web Services is one of the most popular Cloud Provider that has free tier too for students and Cloud enthutiasts for their Hands-on while learning.</p><h4><strong>User Data in AWS:</strong></h4><ul><li>When you launch an instance in Amazon EC2, you have the option of passing user data to the instance that can be used to perform common automated configuration tasks and even run scripts after the instance starts. You can pass two types of user data to Amazon EC2: shell scripts and cloud-init directives.</li><li>You can also pass this data into the launch instance wizard as plain text, as a file (this is useful for launching instances using the command line tools), or as base64-encoded text (for API calls).</li><li>This will save time and manual effort everytime you launch an instance and want to install any application on it like apache, docker, Jenkins etc.</li></ul><h4><strong>IAM:</strong></h4><p>AWS Identity and Access Management (IAM) is a web service that helps you securely control access to AWS resources. With IAM, you can centrally manage permissions that control which AWS resources users can access. You use IAM to control who is authenticated (signed in) and authorized (has permissions) to use resources.</p><h4><strong>Task1:</strong></h4><ul><li>Launch EC2 instance with already installed Jenkins on it. Once server shows up in console, hit the IP address in browser and you Jenkins page should be visible.</li><li>Take screenshot of Userdata and Jenkins page, this will verify the task completion.</li></ul><p>1.Go to “EC2 home page”. Select “Instances” on the left menu and click on “Launch Instance”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s7vSjf-Lra6o7CWgZgQlZA.png" /></figure><p>2. Enter the necessary details. Under User data, enter the shell script required to install Jenkins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KyjqidIE0CjlaaSgXpkaZQ.png" /></figure><pre>#!/bin/bash<br>sudo apt-get update<br>sudo apt install docker.io -y<br>sudo apt install openjdk-11-jre -y<br>curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee \<br>    /usr/share/keyrings/jenkins-keyring.asc &gt; /dev/null<br>echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \<br>    https://pkg.jenkins.io/debian binary/ | sudo tee \<br>    /etc/apt/sources.list.d/jenkins.list &gt; /dev/null<br>sudo apt-get update<br>sudo apt-get install -y jenkins<br>sudo systemctl enable jenkins<br>sudo systemctl start jenkins<br>sudo systemctl status jenkins</pre><p>3. Click on “Launch instance” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cvrdyjJwvO6Nh4Phmu7unw.png" /></figure><p>4. Now go to “Security Group” and edit <strong>inbound rules</strong> to allow inbound traffic on port 8080 for Jenkins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j87p_k5GqP8secBSKKH5Eg.png" /></figure><p>5. Copy the public IP from the Instance details section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K83c54LFx7WzZQHLn4vO_Q.png" /></figure><p>6. Go to publicIP:8080 on your browser to see a successfull installation of Jenkins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wX_YcRIqGawsHmSzQ2SWBw.png" /></figure><h4><strong>Task2:</strong></h4><ul><li>Read more on IAM Roles and explain the IAM Users, Groups and Roles in your own terms.</li></ul><p><strong>IAM Users</strong>: They can be <strong>individuals, systems, or applications that require AWS services</strong>. Each user is identified by a unique username and has its own set of security credentials, such as an access key ID and secret access key, which are used to authenticate and authorize API requests to AWS services.</p><p><strong>IAM Groups</strong>: It is a collection of IAM users. <strong>User groups</strong> let you specify permissions for multiple users, which can make it easier to manage the permissions for those users.</p><p><strong>IAM Roles</strong>: It is very similar to a user, in that it is an identity with permission policies that determine what the identity can and cannot do in AWS. Role helps in access delegation to grant permissions to someone that allows access to resources that you control. They are often used to grant temporary access to resources for a specific task or service.</p><ul><li>Create three Roles named: DevOps-User, Test-User and Admin.</li></ul><p>1.Navigate to “IAM Dashboard” and click on “Roles” in the left-hand menu and click on “Create Role”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*upAy90B20rUL2ltvLvsxWA.png" /></figure><p>2. Now, choose “AWS service” and then “EC2”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Hr7tW5mP9qYFHZgfEnOKA.png" /></figure><p>3. Choose the policy that defines the permissions for the role. Then click on “Create role”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7JoaOGwOOyBejuZh36jWEw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fL7zvUMOsdfQiMBXuAy2MA.png" /></figure><p>4. Repeat the same steps to create the role “Test-User”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-B7tm3xNd7DZ9a2Y510r_Q.png" /></figure><p>5. Repeat the same steps to create the role “Admin” and apply the necessary permissions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c-IzPHkc41wtrb1y-twk3g.png" /></figure><p>6. Once the roles are created, you may regulate who has access to which Amazon resources after the roles have been created and can allocate them to specific IAM users or groups as necessary.</p><p>Thank you for reading !!</p><p>Follow and click 👏 button below to show your support<strong> 😄 !!!</strong></p><p>See you tomorrow, with another blog…</p><p><a href="https://www.linkedin.com/in/rejani-rajesh-36335217a/">Rejani Rajesh</a> ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8cec1e83d934" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/day-39-aws-and-iam-basics-8cec1e83d934">Day 39 : AWS and IAM Basics☁</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 38 : Getting Started with AWS Basics ☁️]]></title>
            <link>https://awstip.com/day-38-getting-started-with-aws-basics-%EF%B8%8F-a2b79b1f4133?source=rss-f78994a1beec------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2b79b1f4133</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Rejani]]></dc:creator>
            <pubDate>Tue, 28 Mar 2023 14:58:09 GMT</pubDate>
            <atom:updated>2023-03-31T17:39:10.209Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Day 38 : Getting Started with AWS Basics ☁️</strong></h3><p>Here is the summary of the Day 38 of <a href="https://github.com/LondheShubham153/90DaysOfDevOps"><strong>#90DaysOfDevOps </strong></a>Challenge:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/0*1qhvK6cpg2YDpadE.png" /></figure><h4><strong>AWS</strong></h4><p>Amazon Web Services is one of the most popular Cloud Provider that has free tier too for students and Cloud enthutiasts for their Handson while learning (Create your free account today to explore more on it).</p><p>Read from <a href="https://aws.amazon.com/what-is-aws/">here</a></p><h4><strong>IAM</strong></h4><p>AWS Identity and Access Management (IAM) is a web service that helps you securely control access to AWS resources. With IAM, you can centrally manage permissions that control which AWS resources users can access. You use IAM to control who is authenticated (signed in) and authorized (has permissions) to use resources.</p><p>Read from <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html">here</a></p><h4><strong>Task 1</strong></h4><p>Create an IAM user with username of your own wish and grant EC2 Access. Launch your Linux instance through the IAM user that you created now and install jenkins and docker on your machine via single Shell Script.</p><p>1.Log into AWS management console as root user. Go to your IAM dashboard by simpky searching <strong>IAM</strong> in the search box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PjYmoxFRVzBepatxdhwjHw.png" /></figure><p>2. Click on <strong>Users</strong> on the left menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VDnclbYFtiqjM48GAu-rwg.png" /></figure><p>3. Enter the name of the user. Click Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F6B4BWs4byYOBDTiPHhylQ.png" /></figure><p>4. Click on “<strong>Attach Policies directly</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nKGk7p2y5RMCLONm8roKsA.png" /></figure><p>5. Search for “<strong>AmazonEC2FullAccess</strong>” in the permission policies search bar and select the policy. Click Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Opm9-jwC5STjq2Nn8UQSg.png" /></figure><p>6. Review all the details and then click “Create user”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*adcURc46mCZ9GWYyuU8C_Q.png" /></figure><p>7. Take a note of the username and password which would be used for authentication of the IAM user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o8ZN2JhPBQWLtDHzyeb5sg.png" /></figure><p>8. Sign into AWS account as IAM user we just created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tB0UZih6JgD586_BCODGVg.png" /></figure><p>9. Reset the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c6Qi3ViLTZFK53VrRh2qbw.png" /></figure><p>10. Now, lets launch an EC2 instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B1MFf4_EOMADgZB1Mn_IHw.png" /></figure><p>11. After the instance is created, select the instance and click <strong>Connect</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c9jXsLriaStiQh-KTyoVFg.png" /></figure><p>12. SSH into your instance, create a single shell script that installs Jenkins and docker.</p><pre>#! /bin/bash<br>sudo apt-get update<br>sudo apt install docker.io -y<br>sudo apt install openjdk-11-jre -y<br>curl -fsSL https://pkg.jenkins.io/debian/jenkins.io.key | sudo tee \   /usr/share/keyrings/jenkins-keyring.asc &gt; /dev/null<br>echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \   https://pkg.jenkins.io/debian binary/ | sudo tee \   /etc/apt/sources.list.d/jenkins.list &gt; /dev/null<br>sudo apt-get update<br>sudo apt-get install jenkins -y<br>sudo systemctl enable jenkins<br>sudo systemctl start jenkins<br>sudo systemctl status jenkins</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KhN8IqNgtc9dDUN0QDjyUQ.png" /></figure><p>13. Lets verify that the installation is successfull by check the versions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*pbREM6yVi_UqvaklVYHV-A.png" /></figure><p>14. Furthermore, we can open a new tab and paste the public IP followed by “:8080” &lt;Making sure port 8080 is open in the Security group → Inbound rules&gt;.. If Jenkins is successfully installed, you will get this page!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*sfPZPiKW8vnj-jSZdcN_dw.png" /></figure><h4><strong>Task 2</strong></h4><p>In this task you need to prepare a devops team of avengers. Create 3 IAM users of avengers and assign them in devops groups with IAM policy.</p><p>1.Go to IAM → Users. As we just learned how to create a user, use the same steps and create 3 more users. Here I have created 3 new users. Lets add them to a group now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kKHkUSL_C1EiQ1K0S0tj-A.png" /></figure><p>2. Click on <strong>User groups</strong> in the left menu and click on <strong>Create group</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cntMU1vbuH2QNQyrVNV_6Q.png" /></figure><p>3. Enter a name for the group and select the users to add into the group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IiIWm-WyGZcISa9y5sGQqA.png" /></figure><p>4. Attach the following policies by searching in the search bar and then selecting them : “AmazonEC2FullAccess”, “AmazonRDSFullAccess” and “AmazonS3FullAccess”. You can add other policies as required. Click on <strong>Create group</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*icKtRdyL1Lsu8lDc-o-Ubw.png" /></figure><p>5. New group DevOps-Avengers is created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7EU0f42thp5Ainro1gPd6w.png" /></figure><p>6. By click on the new group we created, we can see that the 3 users were added successfully !!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-D4kwkPno5hEFu19RLv0iQ.png" /></figure><p>Thank you for reading !!</p><p>Follow and click 👏 button below to show your support<strong> 😄 !!!</strong></p><p>See you tomorrow, with another blog…</p><p><a href="https://www.linkedin.com/in/rejani-rajesh-36335217a/">Rejani Rajesh</a> ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2b79b1f4133" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/day-38-getting-started-with-aws-basics-%EF%B8%8F-a2b79b1f4133">Day 38 : Getting Started with AWS Basics ☁️</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 36 : Managing Persistent Volumes in Your Deployment ]]></title>
            <link>https://medium.com/@rejani2906/day-36-managing-persistent-volumes-in-your-deployment-84bcede836a6?source=rss-f78994a1beec------2</link>
            <guid isPermaLink="false">https://medium.com/p/84bcede836a6</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[k8s-series]]></category>
            <category><![CDATA[kubernetes-storage]]></category>
            <dc:creator><![CDATA[Rejani]]></dc:creator>
            <pubDate>Mon, 27 Mar 2023 03:53:50 GMT</pubDate>
            <atom:updated>2023-03-27T03:53:50.576Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day 36 : <strong>Managing Persistent Volumes in Your Deployment 💥</strong></h3><p>Here is the summary of the Day 36 of <a href="https://github.com/LondheShubham153/90DaysOfDevOps"><strong>#90DaysOfDevOps </strong></a>Challenge:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*guYXO0tv3hGKPY-S.png" /><figcaption><a href="https://k21academy.com/docker-kubernetes/kubernetes-persistent-storage-pv-pvc-and-storage-class/">Persistent Storage</a></figcaption></figure><h4><strong>What are Persistent Volumes in k8s</strong></h4><p>In Kubernetes, a <strong>Persistent Volume (PV)</strong> is a piece of storage in the cluster that has been provisioned by an administrator. A <strong>Persistent Volume Claim (PVC)</strong> is a request for storage by a user. The PVC references the PV, and the PV is bound to a specific node. Read official documentation of <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/">Persistent Volumes</a>.</p><h4><strong>Task 1:</strong></h4><p>Add a Persistent Volume to your Deployment todo app.</p><ul><li>Create a Persistent Volume using a file on your node.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*16cpcRQ-8O-ZRDkZuaFVGw.png" /></figure><p>Apply the updates using command :</p><pre>kubectl apply -f persistent.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*3siANiTl92rro7vu0x2now.png" /></figure><ul><li>Create a Persistent Volume Claim that references the Persistent Volume.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*rCrXN1RtpMupkzDcTd5GRA.png" /></figure><p>Apply the updates using command :</p><pre>kubectl apply -f  persistentClaimvolume.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*MZHZ4RUcznMTVjsvYeL_OQ.png" /></figure><ul><li>Update your deployment.yml file to include the Persistent Volume Claim. After Applying pv.yml pvc.yml your deployment file look like this.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*TNZylX9fz8Pv9NS0xDtxSg.png" /></figure><ul><li>Apply the updated deployment using the command:</li></ul><pre>kubectl apply -f deployment.yml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*dGZJ1G-ROha17Yqe7489rQ.png" /></figure><ul><li>Verify that the Persistent Volume has been added to your Deployment by checking the status of the Pods and Persistent Volumes in your cluster. Use this commands kubectl get pods ,kubectl get pv</li></ul><p>⚠️ Don’t forget: To apply changes or create files in your Kubernetes deployments, each file must be applied separately. ⚠️</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mDRSJPLYMtpNy54jplnL6Q.png" /></figure><h4><strong>Task 2:</strong></h4><p>Accessing data in the Persistent Volume,</p><ul><li>Connect to a Pod in your Deployment using command :</li></ul><pre>kubectl exec -it &lt;pod-name&gt; -- /bin/bash</pre><p>Now lets create a folder ( TEST-FILE.txt ) and add content to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*vrNtKFvF3qkCqrcHSdKPjg.png" /></figure><ul><li>Verify that you can access the data stored in the Persistent Volume from within the Pod</li></ul><p>To verify that we can access the data stored, delete the pod we have used in the above step and create a new pod. Connect to the new pod and verify whether the same file exists.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HeHWEk41smDiZ9ItiHJiiw.png" /></figure><p>Thank you for reading !!</p><p>Follow and click 👏 button below to show your support<strong> 😄 !!!</strong></p><p>See you tomorrow, with another blog…</p><p><a href="https://www.linkedin.com/in/rejani-rajesh-36335217a/">Rejani Rajesh</a> ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84bcede836a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 35 : Mastering ConfigMaps and Secrets in Kubernetes️]]></title>
            <link>https://medium.com/@rejani2906/day-35-mastering-configmaps-and-secrets-in-kubernetes-%EF%B8%8F-cb11122b504?source=rss-f78994a1beec------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb11122b504</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes-configmap]]></category>
            <category><![CDATA[kubernetes-secret]]></category>
            <dc:creator><![CDATA[Rejani]]></dc:creator>
            <pubDate>Thu, 23 Mar 2023 14:22:45 GMT</pubDate>
            <atom:updated>2023-03-23T14:22:45.464Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day 35 : <strong>Mastering ConfigMaps and Secrets in Kubernetes🔒🔑🛡️</strong></h3><p>Here is the summary of the Day 35 of <a href="https://github.com/LondheShubham153/90DaysOfDevOps"><strong>#90DaysOfDevOps </strong></a>Challenge:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pDpkINTCknbNWTtz.png" /><figcaption><a href="https://k21academy.com/docker-kubernetes/configmaps-secrets/">ConfigMaps and Secrets</a></figcaption></figure><h4><strong>What are ConfigMaps and Secrets in k8s ?</strong></h4><p>In Kubernetes, ConfigMaps and Secrets are used to store configuration data and secrets, respectively. <strong>ConfigMaps</strong> store configuration data as key-value pairs, while <strong>Secrets</strong> store sensitive data in an encrypted form.</p><p>💡<em>Example :- Imagine you’re in charge of a big spaceship (</em><strong><em>Kubernetes cluster</em></strong><em>) with lots of different parts (</em><strong><em>containers</em></strong><em>) that need information to function properly. 📂 </em><strong><em>ConfigMaps</em></strong><em> are like a file cabinet where you store all the information each part needs in simple, labeled folders (key-value pairs). </em><strong><em>Secrets</em></strong><em>, on the other hand, are like a safe where you keep the important, sensitive information that shouldn’t be accessible to just anyone (encrypted data). So, using ConfigMaps and Secrets, you can ensure each part of your spaceship (Kubernetes cluster) has the information it needs to work properly and keep sensitive information secure! 🚀</em></p><p>🚄Read more about <a href="https://kubernetes.io/docs/concepts/configuration/configmap/">ConfigMap</a> &amp; <a href="https://kubernetes.io/docs/concepts/configuration/secret/">Secret</a>.</p><h4><strong>Task 1:</strong></h4><ul><li>Create a ConfigMap for your Deployment</li><li>Create a ConfigMap for your Deployment using a file or the command line</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/411/1*5TNUn2JVpbEvNpRp3yskdw.png" /></figure><p>Apply the changes using :</p><pre>kubectl apply -f configMap.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*xauNA5bXiwa5iWYgeDLXwQ.png" /></figure><ul><li>Update the deployment.yml file to include the ConfigMap</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*dWgB2YzVgoEA1gWJE0glRg.png" /></figure><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: config-todo-app<br>  labels:<br>    app: todo<br>  namespace: todo-app<br>spec:<br>  replicas: 2<br>  selector:<br>    matchLabels:<br>      app: todo<br>  template:<br>    metadata:<br>      labels:<br>        app: todo<br>    spec:<br>      containers:<br>      - name: todo<br>        image: trainwithshubham/django-todo:latest<br>        ports:<br>        - containerPort: 8000<br>        env:<br>          - name: TODO_APP<br>            valueFrom:<br>              configMapKeyRef:<br>                name: todo-app<br>                key: application</pre><p>Here, the pod definition includes an environment variable whose value is taken from the ConfigMap. The <strong>valueFrom</strong> field specifies the source of the value, which is the ConfigMap and the key application. Here, the <strong>name</strong> field consists of the name of the configMap we just used in the above step.</p><ul><li>Apply the updated deployment using the command:</li></ul><pre>kubectl apply -f deployment.yml -n &lt;namespace-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*cfJzAxwotY8kLbZROXjMHg.png" /></figure><ul><li>Verify that the ConfigMap has been created by checking the status of the ConfigMaps in your Namespace.</li></ul><p>The given command displays list of all ConfigMaps in your namespace</p><pre> kubectl get configmaps -n &lt;namespace-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*TwqpsW-cmEazbeAnHb00mg.png" /></figure><p>The describe command is used to display the status imformation of all the ConfigMaps in your namespace.</p><pre> kubectl describe configmap &lt;configmap-name&gt; -n &lt;namespace-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*TUEXsSnhjHlkIq4R0E7N2A.png" /></figure><p>This command displays the list of pods:</p><pre>kubectl get pod -n &lt;namespace-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*WuwVCmoVCPfS3-2gB3ldCA.png" /></figure><p>Now, lets go inside one of the pods and see the key-value pair we declared earlier in the ConfigMap.</p><pre>kubectl -n &lt;namespace-name&gt; -it &lt;pod-name&gt; -- bash</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*_XMWOH1HkQVjsgasDqBVbg.png" /></figure><h4><strong>Task 2:</strong></h4><ul><li>Create a Secret for your Deployment</li><li>Create a Secret for your Deployment using a file or the command line</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*CzmXLdlS6S6nO6kd_NcEFg.png" /></figure><pre>apiVersion: v1<br>kind: Secret<br>metadata:<br>  name: my-secret<br>type: Opaque<br>data:<br>  username: YWRtaW4=  # base64 encoded value for &quot;admin&quot;<br>  password: cGFzc3dvcmQyOTA2  # base64 encoded value for &quot;password123&quot;</pre><p>In this example, we’re creating a Secret called my-secret with two keys: username and password. The values for these keys are base64-encoded, so that the encoded sensitive information can be stored as plain text in a file.</p><p>Lets apply the changes of secret.yaml :</p><pre>kubectl apply -f secret.yaml -n &lt;namespace-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*bfJYv4AaJFZHCX6t0MvYJg.png" /></figure><ul><li>Update the deployment.yaml file to include the Secret</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*Spw06R2vlv68V7rTilH4-w.png" /></figure><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: config-demo<br>  labels:<br>    app: todo<br>  namespace: todo-app<br>spec:<br>  replicas: 2<br>  selector:<br>    matchLabels:<br>      app: todo<br>  template:<br>    metadata:<br>      labels:<br>        app: todo<br>    spec:<br>      containers:<br>      - name: todo<br>        image: trainwithshubham/django-todo:latest<br>        ports:<br>        - containerPort: 8000<br>        env:<br>          - name: env_secret<br>            valueFrom:<br>              secretKeyRef:<br>                name: my-secret<br>                key: password</pre><ul><li>Apply the updated deployment using the command:</li></ul><pre>kubectl apply -f deployment.yml -n &lt;namespace-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*smakNHEHfba7eHcv9N6l-A.png" /></figure><ul><li>Verify that the Secret has been created by checking the status of the Secrets in your Namespace.</li></ul><p>You can use the following command to verify that the Secret has been created :</p><pre>kubectl get secrets -n &lt;namespace-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*9DQkNdpJVjMKcqnxmEJCGA.png" /></figure><p>To view the details of a specific Secret:</p><pre>kubectl describe secret &lt;secret-name&gt; -n &lt;namespace-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*qTeGNj0Gzkx744ZzmYPS2A.png" /></figure><p>To see the key-value pairs of an environment variable in a ConfigMap inside a pod :</p><pre>kubectl get pod -n &lt;namespace-name&gt;<br>kubectl exec -it &lt;pod-name&gt; -n &lt;namespace-name&gt; -- bash</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*2ntNQZlKkOs9rXP_DXu92g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Z8QLQMSncMfVxigMtckCw.png" /></figure><p>Thank you for reading !!</p><p>Follow and click 👏 button below to show your support<strong> 😄 !!!</strong></p><p>See you tomorrow, with another blog…</p><p><a href="https://www.linkedin.com/in/rejani-rajesh-36335217a/">Rejani Rajesh</a> ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb11122b504" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 34 : Working with Services in Kubernetes]]></title>
            <link>https://blog.devops.dev/day-34-working-with-services-in-kubernetes-ec5c4445b9f3?source=rss-f78994a1beec------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec5c4445b9f3</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes-service]]></category>
            <category><![CDATA[ngrok]]></category>
            <dc:creator><![CDATA[Rejani]]></dc:creator>
            <pubDate>Fri, 17 Mar 2023 14:25:02 GMT</pubDate>
            <atom:updated>2023-03-23T19:38:45.425Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day 34 : <strong>Working with Services in Kubernetes</strong></h3><p>Here is the summary of the Day 34 of <a href="https://github.com/LondheShubham153/90DaysOfDevOps"><strong>#90DaysOfDevOps </strong></a>Challenge:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*eMpOJYQj2lHmeavUuYEJpQ.jpeg" /><figcaption><a href="https://www.educba.com/kubernetes-service/">Kubernetes Service</a></figcaption></figure><h4><strong>What are Services in K8s</strong></h4><p>In Kubernetes, Services are objects that provide stable network identities to Pods and abstract away the details of Pod IP addresses. Services allow Pods to receive traffic from other Pods, Services, and external clients.</p><h4>Types of <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/service">Kubernetes services</a>:</h4><p>There are five types of Services:</p><ul><li><strong>ClusterIP (default):</strong> Internal clients send requests to a stable internal IP address.</li><li><strong>NodePort:</strong> Clients send requests to the IP address of a node on one or more nodePort values that are specified by the Service.</li><li><strong>LoadBalancer:</strong> Clients send requests to the IP address of a network load balancer.</li><li><strong>ExternalName:</strong> Internal clients use the DNS name of a Service as an alias for an external DNS name.</li><li><strong>Headless:</strong> You can use a headless service when you want a Pod grouping, but don’t need a stable IP address</li></ul><h4><strong>Task-1:</strong></h4><ul><li>Create a Service for your todo-app Deployment from Day-32</li></ul><p>Refer <a href="https://medium.com/@rejani2906/day-32-launching-your-kubernetes-cluster-with-deployment-84c431748ce1">here</a></p><ul><li>Create a Service definition for your todo-app Deployment in a YAML file.</li></ul><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: node-todo-app<br>  namespace: todo-app<br>spec:<br>  type: NodePort<br>  selector:<br>    app: todo<br>  ports:<br>    - protocol: TCP<br>      port: 8000<br>      targetPort: 8000<br>      nodePort: 30080</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*FopmiSvnLR3rYQFM5L-4nw.png" /></figure><p>Lets break this down and understand the components of the service definition in detail :</p><pre>apiVersion: v1<br>kind: Service</pre><p>In this section, <strong>apiVersion</strong> specifies which API version of kubernetes is to be used and <strong>kind</strong> specifies the type of resource being used in the given deployment.</p><pre>metadata:<br>  name: node-todo-app<br>  namespace: todo-app</pre><p>The <strong>name</strong> of the k8s service and the <strong>namespace</strong> it belongs to is mentioned here.</p><pre>spec:<br>  type: NodePort<br>  selector:<br>    app: todo</pre><p>This section defines the <strong>selector</strong> for the pods that the service should target. In this case, it will target the pods that have the app label as ‘ todo ‘. <strong>NodePort</strong> is the type of service being used here.</p><pre>ports:<br>    - protocol: TCP<br>      port: 8000<br>      targetPort: 8000<br>      nodePort: 30080</pre><p>The <strong>port mapping</strong> for the Service is described in this section. The Service will listen on port 8000 and redirects the traffic to the target port 8000 on the pods. A nodePort is defined as 30080, making it possible to contact the Service from outside the cluster by using the IP addresses.</p><ul><li>Apply the Service definition to your K8s (minikube) cluster using the</li></ul><pre>kubectl apply -f service.yml -n &lt;namespace-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*P1ZhP256AHe5_ddxuMFUyQ.png" /></figure><p>Services in a Kubernetes cluster can be listed using the <strong>kubectl get svc</strong> command. The -n flag is used to specify the <strong>namespace</strong> in which the service is located.</p><pre>kubectl get svc -n todo-app</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*876Cx-lRanYos23rrEMOxg.png" /></figure><p>Using the <strong>minikube service</strong> command, the user will be able to communicate with the services in a Minikube cluster, . The --url option allows the user to visit the service through the browser.</p><pre>minikube service node-todo-app -n=todo-app --url</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*vmnHQhI3U7PeYnNNP0t9Kg.png" /></figure><p>The URL won’t work on your local system; it will only work within the Minikube cluster.</p><p>Now, curl the above IP address of the kubernetes service to access the to-do app.</p><pre>curl -L &lt;service-ip&gt;:&lt;service-port&gt;</pre><p>If the to-do app works correctly, it will show the following output :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*Lx9gL3X70S8ONn2ruDO43g.png" /></figure><ul><li>Now we need to make our IP public.</li></ul><p><strong>Ngrok</strong> is a cross-platform application that enables developers to expose a local development server to the Internet with minimal effort. It creates a <strong>secure tunnel</strong> from the public internet to a local web server on your computer, making it possible to access the local web server from anywhere in the world, and not just from the local machine.</p><p>Go to <a href="https://ngrok.com/">ngrok</a> homepage and login.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vYJCfTYZoE6ddOW9m2WIDQ.png" /></figure><p>Right click on <strong>Linux</strong> and copy the link address. In your instance, make a new directory and enter the directory. Now, to initiate the ngrok download setup,</p><pre>wget &lt;copied-link-address&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XV-zDQovugudCAHv30QDwQ.png" /></figure><p>A tar file will be created. Lets unzip it.</p><pre>tar -xvzf &lt;ngrox_zipped_file&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*F9CIVL4ht8vxYGB8KWz9nw.png" /></figure><p>Now, you can install ngrok and also add the authentication token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*GX8rhNTPyFEE5Dfl8IWr5g.png" /></figure><p>Now, to make the tunnel</p><pre>ngrok http &lt;service-ip&gt;:&lt;service-port&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*Vq8nA3idM1L_GgRLpDCemg.png" /></figure><p>A secure tunnel is created. Now, when we give the above command, the following screen will be displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*kl28buAGqQT4cd6n7ws-Sw.png" /></figure><p>Now, select the URL that is actually fowarding our required service IP address and then paste it into your browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eIrBs4B25vzTywpsJf_Pvg.png" /></figure><p>Click <strong>Visit Site </strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*E4XvhPYc2ntFEu4HOMwZHg.png" /></figure><p>Our site is now public and accessible from anywhere using that link !! 🔥</p><h4><strong>Task-2:</strong></h4><ul><li>Create a ClusterIP Service for accessing the todo-app from within the cluster</li><li>Create a ClusterIP Service definition for your todo-app Deployment in a YAML file.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*2__OmDtkCEjCPcZUVmDPew.png" /></figure><p>Here, Service is of the type ClusterIP.</p><ul><li><strong>Apply</strong> the ClusterIP Service definition to your K8s (minikube) cluster using :</li></ul><pre>kubectl apply -f service.yml -n &lt;namespace-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*StNxLvDQaZryT3ScmZ3gyw.png" /></figure><ul><li><strong>Get</strong> the ClusterIP Service’s <strong>IP address</strong>:</li></ul><pre>kubectl get services -n &lt;namespace&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*LrdOZRhSYlF-JxACGVOP4A.png" /></figure><ul><li>Identify all the pods in the same namespace :</li></ul><pre>kubectl get pods -n &lt;namespace&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*fvNSqbs_DZhgnMRLo_wneg.png" /></figure><ul><li>Verify that the ClusterIP Service is working by accessing the todo-app from another Pod in the cluster in your Namespace.</li></ul><p>1.Exec into the Pod: go inside container</p><pre>kubectl exec -it &lt;pod-name&gt; -n &lt;namespace&gt; -- bash</pre><p>2. Make a curl request to the ClusterIP Service using its IP address:</p><pre>curl -L &lt;cluster-ip&gt;:&lt;service-port&gt;</pre><p>If the ClusterIP service works correctly, it will show the following output :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g4tUD4lyIR2LCWa-aTSTfA.png" /></figure><h4><strong>Task-3:</strong></h4><ul><li>Create a LoadBalancer Service for accessing the todo-app from outside the cluster</li><li>Create a LoadBalancer Service definition for your todo-app Deployment in a YAML file.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*zqetZqteHUrh_DREQddnvA.png" /></figure><p>Here, the service is of the type LoadBalancer.</p><ul><li>Apply the LoadBalancer Service definition to your K8s (minikube) cluster</li></ul><pre>kubectl apply -f service.yml -n namespace-name&gt;</pre><p>Get the load balancer service:</p><pre>kubectl get services -n &lt;namespace&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*bQ64_awP9gT9eniupwg61A.png" /></figure><p>You can also get the LoadBalancer URL using :</p><pre>minikube service list</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*3LyGTZZKmDZhiXvxEJaFBg.png" /></figure><ul><li>Verify that the LoadBalancer Service is working by accessing the todo-app from outside the cluster in your Namespace.</li></ul><p>Use the load balancer’s IP address and the access port to access the to-do app from outside the cluster:</p><pre>curl -L &lt;load-balancer-ip&gt;:&lt;service-port&gt;</pre><p>If the LoadBalancer service works correctly, it will show the following output :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xhjYsJaVpmzvvUYELJDvbg.png" /></figure><p>Appreciate your time 🚀🔥</p><p>Thank you for reading !!</p><p>Follow and click 👏 button below to show your support<strong> 😄 !!!</strong></p><p>See you tomorrow, with another blog…</p><p><a href="https://www.linkedin.com/in/rejani-rajesh-36335217a/">Rejani Rajesh</a> ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec5c4445b9f3" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/day-34-working-with-services-in-kubernetes-ec5c4445b9f3">Day 34 : Working with Services in Kubernetes</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 33 : Working with Namespaces and Services in Kubernetes]]></title>
            <link>https://medium.com/@rejani2906/day-33-working-with-namespaces-and-services-in-kubernetes-d80f35a4ab09?source=rss-f78994a1beec------2</link>
            <guid isPermaLink="false">https://medium.com/p/d80f35a4ab09</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubernetes-namespaces]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Rejani]]></dc:creator>
            <pubDate>Wed, 15 Mar 2023 14:25:20 GMT</pubDate>
            <atom:updated>2023-03-15T14:25:20.739Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day 33 : <strong>Working with Namespaces and Services in Kubernetes</strong></h3><p>Here is the summary of the Day 33 of <a href="https://github.com/LondheShubham153/90DaysOfDevOps"><strong>#90DaysOfDevOps </strong></a>Challenge:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mgyTPZLyF7lCPASma_pn4w.jpeg" /><figcaption><a href="https://www.armosec.io/glossary/kubernetes-namespace/">Namespace</a></figcaption></figure><p><strong>What are Namespaces and Services in k8s</strong></p><p>In Kubernetes, Namespaces are used to create isolated environments for resources. Each Namespace is like a separate cluster within the same physical cluster. Services are used to expose your Pods and Deployments to the network. Read more about Namespace <a href="https://kubernetes.io/docs/concepts/workloads/pods/user-namespaces/">here</a>.</p><h4><strong>Task 1:</strong></h4><ul><li>Create a Namespace for your Deployment</li></ul><p>Use the given command to create a Namespace</p><pre>kubectl create namespace &lt;namespace-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*LZfRmItZ8H_Y6dFdT_kMgA.png" /></figure><ul><li>Update the deployment.yml file to include the Namespace</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/1*SpZBcwYOSMyvWTzpamezUA.png" /></figure><ul><li>Apply the updated deployment using the command:</li></ul><pre>kubectl apply -f deployment.yml -n &lt;namespace-name&gt;<br></pre><p>The <strong>kubectl apply</strong> command is used to create or update resources in a Kubernetes cluster.</p><p>The <strong>-f </strong>flag specifies the <strong>file</strong> that contains the definition of the resources you want to create or update.</p><p>The <strong>-n</strong> flag is used to specify the <strong>namespace</strong> in which the resources should be created or updated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*PxrI26HCLAee69CguAvSmg.png" /></figure><p>Check pods and deployment created</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*cRCHbGWFPyvPKY7B9muVgw.png" /></figure><ul><li>Verify that the Namespace has been created by checking the status of the Namespaces in your cluster.</li></ul><pre>kuubectl get namespaces</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*ttVPZ9MCfN-C9yiitC_BLQ.png" /></figure><h4><strong>Task 2:</strong></h4><ul><li>Read about Services, Load Balancing, and Networking in Kubernetes. Refer official documentation of <a href="https://kubernetes.io/docs/concepts/services-networking/">kubernetes</a></li></ul><p><strong>Services</strong> : It is a method for exposing a network application that is running as one or more <a href="https://kubernetes.io/docs/concepts/workloads/pods/">Pods</a> in your cluster. It serves as an abstraction layer that defines a set of pods and the policies used to access them. It is used to provide a stable IP address and DNS name, and can load balance traffic between pods. This enables communication between pods and decouples the client from the backend pods.</p><p><strong>Load Balancing : </strong>It is the process of distributing network traffic efficiently among multiple backend services. In K8s, load balancing is typically achieved by using a Service of type LoadBalancer, which creates an external load balancer in the cluster’s network and distributes traffic to the pods of the Service.</p><p><strong>Networking</strong> : Kubernetes networking gives you flexibility and helps drive the adoption of loosely coupled service architectures.</p><p>Thank you for reading !!</p><p>Follow and click 👏 button below to show your support<strong> 😄 !!!</strong></p><p>See you tomorrow, with another blog…</p><p><a href="https://www.linkedin.com/in/rejani-rajesh-36335217a/">Rejani Rajesh</a> ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d80f35a4ab09" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 32 : Launching your Kubernetes Cluster with Deployment]]></title>
            <link>https://medium.com/@rejani2906/day-32-launching-your-kubernetes-cluster-with-deployment-84c431748ce1?source=rss-f78994a1beec------2</link>
            <guid isPermaLink="false">https://medium.com/p/84c431748ce1</guid>
            <category><![CDATA[kubernetes-cluster]]></category>
            <category><![CDATA[kubectl]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Rejani]]></dc:creator>
            <pubDate>Tue, 14 Mar 2023 14:32:19 GMT</pubDate>
            <atom:updated>2023-03-14T14:32:19.220Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day 32 : <strong>Launching your Kubernetes Cluster with Deployment</strong></h3><p>Here is the summary of the Day 32 of <a href="https://github.com/LondheShubham153/90DaysOfDevOps"><strong>#90DaysOfDevOps </strong></a>Challenge:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Mw9K0Fy0hH51QwfzupabA.png" /><figcaption><a href="https://appfleet.com/blog/kubernetes-and-self-healing-micro-services/">Kubernetes</a></figcaption></figure><h4><strong>What is Deployment in k8s</strong></h4><p>A Deployment provides a configuration for updates for Pods and ReplicaSets.</p><p>You describe a desired state in a Deployment, and the Deployment Controller changes the actual state to the desired state at a controlled rate. You can define Deployments to create new replicas for scaling, or to remove existing Deployments and adopt all their resources with new Deployments.</p><h4><strong>Create one Deployment file to deploy a sample todo-app on K8s using “Auto-healing” and “Auto-Scaling” feature</strong></h4><ul><li><strong>Add a deployment.yml file</strong></li></ul><p>The “<strong>deployment.yaml</strong>” files gives the specification for the container to be deployed. It uses the image “<strong>user29/node-todo</strong>” .The deployment uses the <em>selector</em> to identify the pods that belong to the deployment. Here, we can see that the label that is used for identification is “<strong>todo</strong>”. The container listens on the port <strong>8000. </strong>Here, the number of replicas specified is 3 (<strong>Auto-scaling</strong>). Even if one of the pod goes down, it will deploy a new pod thus maintaining the required number of replicas (<strong>Auto-healing</strong>)/</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: todo-app<br>  labels:<br>    app: todo<br>spec:<br>  replicas: 3<br>  selector:<br>    matchLabels:<br>      app: todo<br>  template:<br>    metadata:<br>      labels:<br>        app: todo<br>    spec:<br>      containers:<br>      - name: todo<br>        image: user29/node-todo<br>        ports:<br>        - containerPort: 8000</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/1*SpZBcwYOSMyvWTzpamezUA.png" /><figcaption>deployment.yaml</figcaption></figure><ul><li><strong>Apply the deployment to your k8s (minikube) cluster by command</strong></li></ul><pre>kubectl apply -f deployment.yml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*w_4rBZa8L2n4qK6l3Ommmw.png" /></figure><ul><li><strong>To list a deployment</strong></li></ul><pre>kubectl get deployments</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*w4NCqr9jZsLn8OJeelOahQ.png" /></figure><ul><li><strong>To list the pods</strong></li></ul><pre>kubectl get pods</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*RGR90cKAF5DqYyneuiy84w.png" /></figure><p>The deployment file creates 3 pod replicas of the given container specifications.</p><p>Thank you for reading !!</p><p>Follow and click 👏 button below to show your support<strong> 😄 !!!</strong></p><p>See you tomorrow, with another blog…</p><p><a href="https://www.linkedin.com/in/rejani-rajesh-36335217a/">Rejani Rajesh</a> ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84c431748ce1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 31 : Launching your First Kubernetes Cluster with Nginx running]]></title>
            <link>https://medium.com/@rejani2906/day-31-launching-your-first-kubernetes-cluster-with-nginx-running-2bf04a111f71?source=rss-f78994a1beec------2</link>
            <guid isPermaLink="false">https://medium.com/p/2bf04a111f71</guid>
            <category><![CDATA[kubectl]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubernetes-cluster]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Rejani]]></dc:creator>
            <pubDate>Fri, 10 Mar 2023 14:59:00 GMT</pubDate>
            <atom:updated>2023-03-10T14:59:00.185Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day 31 : <strong>Launching your First Kubernetes Cluster with Nginx running</strong></h3><p>Here is the summary of the Day 31 of <a href="https://github.com/LondheShubham153/90DaysOfDevOps"><strong>#90DaysOfDevOps </strong></a>Challenge:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*60CwdQImKN29_Bx6-Zz8Rg.png" /></figure><p>Let’s read about minikube and implement <strong>k8s</strong> in our local machine</p><h4><strong>What is minikube?</strong></h4><p>Minikube is a tool which quickly sets up a local Kubernetes cluster on macOS, Linux, and Windows. It can deploy as a VM, a container, or on bare-metal.</p><p>Minikube is a pared-down version of Kubernetes that gives you all the benefits of Kubernetes with a lot less effort.</p><p>This makes it an interesting option for users who are new to containers, and also for projects in the world of edge computing and the Internet of Things.</p><h4><strong>Features of minikube</strong></h4><p>(a) Supports the latest Kubernetes release (+6 previous minor versions)</p><p>(b) Cross-platform (Linux, macOS, Windows)</p><p>(c) Deploy as a VM, a container, or on bare-metal</p><p>(d) Multiple container runtimes (CRI-O, containerd, docker)</p><p>(e) Direct API endpoint for blazing fast image load and build</p><p>(f) Advanced features such as LoadBalancer, filesystem mounts, FeatureGates, and network policy</p><p>(g) Addons for easily installed Kubernetes applications</p><p>(h) Supports common CI environments</p><h4><strong>Task-1: Install minikube on your local</strong></h4><p>1.Launch an instance <strong>Kubernetes-instance</strong> with <strong>t2.medium</strong> instance-type, <strong>Ubuntu OS.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iOzGiDF7WbHad9Za0ILIqQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9X2bwelrg2sghV8GGe4P0A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*StrMkrav6RxlsfzJjP8zdQ.png" /></figure><p><strong>C</strong>onnect to the terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*Oi_U3e1lTC0vWmqrFApKlQ.png" /></figure><p>2. Update the packet manager &amp; install docker by using the following commands</p><pre>sudo apt-get update<br>sudo apt install docker.io -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*CRVakqd87R40m3bUHXJHBg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3GDQeefyL-bZ135sOs1s5A.png" /></figure><p>3. Minikube installation (visit <a href="https://minikube.sigs.k8s.io/docs/start/">this page</a>)</p><pre>curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64<br>sudo install minikube-linux-amd64 /usr/local/bin/minikube</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*-vnSoT93OTO1Sauj5VwqVA.png" /></figure><p>4. Add sudo permission and start kubernetes cluster</p><pre>sudo usermod -aG docker $USER &amp;&amp; newgrp docker<br>minikube start --driver=docker</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*4wuWxuP6ur75teuOWWLVVQ.png" /></figure><p>5. Check status of cluster using <strong>minikube status</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*0WLRhcggGd-rLk5wbFX1Rg.png" /></figure><p>&lt; If you want to try an alternative way, you can check <a href="https://k8s-docs.netlify.app/en/docs/tasks/tools/install-minikube/">this</a>. &gt;</p><p><strong>~~ Let’s understand the concept <em>Pod ~~</em></strong></p><p>Pods are the <em>smallest deployable units</em> of computing that you can create and manage in Kubernetes.</p><p>A Pod (as in a pod of whales or pea pod) is a group of one or more containers, with shared storage and network resources, and a specification for how to run the containers. A Pod’s contents are always co-located and co-scheduled, and run in a shared context. A Pod models an application-specific “logical host”: it contains one or more application containers which are relatively tightly coupled.</p><p>You can read more about pod from <a href="https://kubernetes.io/docs/concepts/workloads/pods/">here</a> .</p><h4><strong>Task-2: Create your first pod on Kubernetes through minikube.</strong></h4><p>1.Install kubectl using the given command</p><pre>sudo snap install kubectl --classic</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*OKSuK1AMrCnlxOA7klQLHg.png" /></figure><p>2. Create “nginx-pod.yaml” , n nginx deployment YAML file and enter the required specifications for running nginx.</p><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: nginx-pod<br>spec:<br>  containers:<br>  - name: nginx-container<br>    image: nginx<br>    ports:<br>    - containerPort: 80</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*bcPAVgck0zrRp9VVzxPNlA.png" /></figure><p>3. Create the pod by running the command</p><pre>kubectl apply -f nginx-pod.yml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*b8vn2-AF8m8_eXjE_NledQ.png" /></figure><p>4. Verify that the pod is running</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*ZqPVIvLSdlgF6H_LzcTIYg.png" /></figure><p>Thank you for reading !!</p><p>Follow and click 👏 button below to show your support<strong> 😄 !!!</strong></p><p>See you tomorrow, with another blog…</p><p><a href="https://www.linkedin.com/in/rejani-rajesh-36335217a/">Rejani Rajesh</a> ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2bf04a111f71" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 30 : Kubernetes Architecture]]></title>
            <link>https://medium.com/@rejani2906/day-30-kubernetes-architecture-a59c08d4863c?source=rss-f78994a1beec------2</link>
            <guid isPermaLink="false">https://medium.com/p/a59c08d4863c</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Rejani]]></dc:creator>
            <pubDate>Sun, 05 Mar 2023 12:31:16 GMT</pubDate>
            <atom:updated>2023-03-14T14:49:33.912Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day 30 : <strong>Kubernetes Architecture</strong></h3><p>Here is the summary of the Day 30 of <a href="https://github.com/LondheShubham153/90DaysOfDevOps"><strong>#90DaysOfDevOps </strong></a>Challenge:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5-LJw8RG96qMMxPZeKcV5w.png" /></figure><h4><strong>Kubernetes Overview</strong></h4><p>With the widespread adoption of <a href="https://cloud.google.com/containers">containers</a> among organizations, Kubernetes, the container-centric management software, has become a standard to deploy and operate containerized applications and is one of the most important parts of DevOps.</p><p>Originally developed at Google and released as open-source in 2014. Kubernetes builds on 15 years of running Google’s containerized workloads and the valuable contributions from the open-source community. Inspired by Google’s internal cluster management system, <a href="https://research.google.com/pubs/pub43438.html">Borg</a>.</p><h4><strong>What is Kubernetes? Why do we call it k8s?</strong></h4><p>Kubernetes (also known as k8s or “kube”) is an open source container orchestration platform that automates many of the manual processes involved in deploying, managing, and scaling containerized applications.<br>Google open-sourced the Kubernetes project in 2014.</p><p>K8s as an abbreviation results from counting the eight letters between the “K” and the “s”.</p><h4><strong>What are the benefits of using k8s?</strong></h4><p>Some key benefits of using k8s :</p><p>1) <strong><em>Kubernetes Automates Containerized Environments</em></strong></p><p>Containerization is the notion of packaging code with only the OS or operating system, and the required dependencies to create a single executable, the container, which can run on infrastructure.</p><p>Because containers do not need a full OS and instead run with a shared OS kernel, containers are smaller, faster, and more portable versus traditional virtual machines, or VMs.</p><p>For companies using a microservices architecture, containers are the go-to choice. Kubernetes makes containerized environments possible by acting as the <strong>orchestration system</strong>. Kubernetes automates the operational requirements of running containerized workloads.</p><p>2) <strong><em>AutoScaling</em></strong></p><p>It is one of Kubernetes’ most talked about and important features. With Kubernetes, companies are able to efficiently scale up and down based on actual demand. Kubernetes has three different autoscaling capabilities:</p><p><strong>Horizontal Pod Autoscaler (HPA)</strong>, often referred to as scaling out, will automatically scale the number of pods available depending on resource usage.<br><strong>Vertical Pod Autoscaler (VPA)</strong>, often referred to as scaling up, can automatically adjust the CPU and memory for existing machines.<br><strong>Cluster Autoscaler </strong>is importantly able to scale up the number of nodes automatically when pods are unable to scale further, up to the maximum size of the node pool.</p><p>3) <strong><em>Multi-Cloud Possibilities</em></strong></p><p>Kubernetes makes it easy for all organizations to take advantage of multi-cloud environments, and avoid vendor lock-in. The majority of major cloud providers have Kubernetes-specific offerings. For example, Amazon’s AWS has EKS, Google’s GCP has GKE, and Microsoft’s Azure has AKS.</p><p>4) <strong><em>Strong Open Source Communities</em></strong></p><p>Kubernetes was created by Google and donated to the CNCF in 2014. Since the v1.0 release in 2015, the open-source community has rallied around the project with over 100,000 commits by over 3,000 contributors.</p><p>5) <strong><em>Cost Efficiencies and Savings</em></strong></p><p>One of the earliest and most popular reasons to migrate to Kubernetes was due to the cost efficiencies and savings that are possible. Organizations with varying degrees of demand and scalability challenges have found meaningful cost savings with Kubernetes.</p><h4><strong>Explain the architecture of Kubernetes.</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*bGxdHs4aUd4HlKAfMNvMJw.png" /></figure><p>From a high level, a Kubernetes environment consists of a <strong>control plane</strong> (<strong>master</strong>), a distributed storage system for keeping the cluster state consistent (etcd), and a number of <strong>cluster nodes</strong> (<strong>Kubelets</strong>).</p><p><strong>The Master node</strong> has various components :</p><h4>etcd</h4><p>It stores the configuration information which can be used by each of the nodes in the cluster. It is a high availability key value store that can be distributed among multiple nodes. It is accessible only by Kubernetes API server as it may have some sensitive information. It is a distributed key value Store which is accessible to all.</p><h4>API Server</h4><p>Kubernetes is an API server which provides all the operation on cluster using the API. API server implements an interface, which means different tools and libraries can readily communicate with it. <strong>Kubeconfig</strong> is a package along with the server side tools that can be used for communication. It exposes Kubernetes API.</p><h4>Controller Manager</h4><p>This component is responsible for most of the collectors that regulates the state of cluster and performs a task. In general, it can be considered as a daemon which runs in nonterminating loop and is responsible for collecting and sending information to API server. It works toward getting the shared state of cluster and then make changes to bring the current status of the server to the desired state. The key controllers are replication controller, endpoint controller, namespace controller, and service account controller. The controller manager runs different kind of controllers to handle nodes, endpoints, etc.</p><h4>Scheduler</h4><p>This is one of the key components of Kubernetes master. It is a service in master responsible for distributing the workload. It is responsible for tracking utilization of working load on cluster nodes and then placing the workload on which resources are available and accept the workload. In other words, this is the mechanism responsible for allocating pods to available nodes. The scheduler is responsible for workload utilization and allocating pod to new node.</p><p><strong>Worker nodes</strong> have the various components :</p><h4>Pod</h4><p>A pod is one or more containers controlled as a single application. It encapsulates application containers, storage resources, and is tagged by a unique network ID and other configurations that regulate the operation of containers</p><h4>Docker</h4><p>The first requirement of each node is Docker which helps in running the encapsulated application containers in a relatively isolated but lightweight operating environment.</p><h4>Kubelet</h4><p>Service responsible for conveying information to and from to the control plane service. It gets the configuration of a pod from the API server and ensures that the containers are working efficiently. The kubelet process is responsible for maintaining the work status and the node server</p><h4>Kubernetes Proxy Service</h4><p>This is a proxy service which runs on each node and helps in making services available to the external host. It helps in forwarding the request to correct containers and is capable of performing primitive load balancing. It makes sure that the networking environment is predictable and accessible and at the same time it is isolated as well. It manages pods on node, volumes, secrets, creating new containers’ health checkup, etc.</p><h4><strong>What is Control Plane?</strong></h4><p>The control plane manages the worker nodes and the Pods in the cluster. In production environments, the control plane usually runs across multiple computers and a cluster usually runs multiple nodes, providing fault-tolerance and high availability.</p><h4><strong>Write the difference between kubectl and kubelets.</strong></h4><p>kubectl is the command-line interface (CLI) tool for working with a Kubernetes cluster. Kubelet is the technology that applies, creates, updates, and destroys containers on a Kubernetes node.</p><h4><strong>Explain the role of the API server.</strong></h4><p>The Kubernetes API server validates and configures data for the api objects which include pods, services, replicationcontrollers, and others. The API Server services REST operations and provides the frontend to the cluster’s shared state through which all other components interact.</p><p><strong>💡 You might also like:</strong></p><ul><li>A great resource for kubernetes architecture : <a href="https://spacelift.io/blog/kubernetes-architecture"><strong>Spacelift</strong></a></li></ul><p>Thank you for reading !!</p><p>Follow and click 👏 button below to show your support<strong> 😄 !!!</strong></p><p>See you tomorrow, with another blog…</p><p><a href="https://www.linkedin.com/in/rejani-rajesh-36335217a/">Rejani Rajesh</a> ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a59c08d4863c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 28 : Jenkins Agents]]></title>
            <link>https://medium.com/@rejani2906/day-28-jenkins-agents-2d17a883d29f?source=rss-f78994a1beec------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d17a883d29f</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[jenkins-freestyle-project]]></category>
            <category><![CDATA[jenkins-agent]]></category>
            <category><![CDATA[jenkins]]></category>
            <dc:creator><![CDATA[Rejani]]></dc:creator>
            <pubDate>Thu, 02 Mar 2023 14:21:18 GMT</pubDate>
            <atom:updated>2023-03-02T14:21:18.476Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day 28 : <strong>Jenkins Agents</strong></h3><p>Here is the summary of the Day 28 of <a href="https://github.com/LondheShubham153/90DaysOfDevOps"><strong>#90DaysOfDevOps </strong></a>Challenge:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*0iAfr-MRabT2DfEpSqi3cg.png" /></figure><h4><strong>Jenkins Master (Server)</strong></h4><p>Jenkins’s server or master node holds all key configurations. Jenkins master server is like a control server that orchestrates all the workflow defined in the pipelines. For example, scheduling a job, monitoring the jobs, etc.</p><h4><strong>Jenkins Agent</strong></h4><p>An agent is typically a machine or container that connects to a Jenkins master and this agent that actually execute all the steps mentioned in a Job. When you create a Jenkins job, you have to assign an agent to it. Every agent has a label as a unique identifier.</p><p>When you trigger a Jenkins job from the master, the actual execution happens on the agent node that is configured in the job.</p><p>A single, monolithic Jenkins installation can work great for a small team with a relatively small number of projects. As your needs grow, however, it often becomes necessary to scale up. Jenkins provides a way to do this called “master to agent connection.” Instead of serving the Jenkins UI and running build jobs all on a single system, you can provide Jenkins with agents to handle the execution of jobs while the master serves the Jenkins UI and acts as a control node.</p><h4><strong>Pre-requisites</strong></h4><p>Let’s say we’re starting with a fresh Ubuntu 22.04 Linux installation. To get an agent working make sure you install Java ( same version as jenkins master server ) and Docker on it.</p><p>Note:- While creating an agent, be sure to separate rights, permissions, and ownership for jenkins users.</p><h4><strong>This blog covers:</strong></h4><ul><li>Connecting master and agent using SSH.</li><li>Setting up Jenkins agent</li><li>Creating a freestyle Jenkins project and running it on particular agent.</li></ul><h4>Task -1</h4><ul><li>Create an agent by setting up a node on Jenkins</li><li>Create a new AWS EC2 Instance and connect it to master(Where Jenkins is installed)</li><li>The connection of master and agent requires SSH and the public-private key pair exchange.</li><li>Verify its status under “Nodes” section.</li></ul><p>Create two AWS instances — Master and Agent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TRlEsxXfzhvyek1goqhTgw.png" /></figure><p>In Master instance, install Java and Jenkins.</p><pre>##Java<br><br>$ sudo apt update<br>$ sudo apt install openjdk-11-jre<br>$ java -version<br><br><br>##Jenkins<br><br>$ curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo tee \<br>  /usr/share/keyrings/jenkins-keyring.asc &gt; /dev/null<br>$ echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \<br>  https://pkg.jenkins.io/debian-stable binary/ | sudo tee \<br>  /etc/apt/sources.list.d/jenkins.list &gt; /dev/null<br>$ sudo apt-get update<br>$ sudo apt-get install jenkins</pre><p>In Agent instance, install Java and Docker.</p><pre>##Java<br><br>$ sudo apt update<br>$ sudo apt install openjdk-11-jre<br>$ java -version<br><br>##Docker<br><br>$ sudo apt-get update<br>$ sudo apt-get install docker.io<br></pre><p>Verify all services are up and running in their respective instances. Go to Jenkins UI and set up Jenkins account by installing the required/recommended plugins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SwmsQ0aR_-762jVXHV_QZg.png" /></figure><p>Now, lets connect the master and agent.</p><p>The connection of master and agent requires SSH and the public-private key pair exchange.</p><p>In master,</p><pre>$ ssh-keygen<br>$ cd .ssh<br>$ ls</pre><p>ssh-keygen produces a public-private key pair.</p><pre>id_rsa --&gt; private key<br>id_rsa.pub --&gt; public key</pre><p>Copy the public key[id_rsa.pub] (to give to the agent node)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F5copvB51aOvuifhI-mH9g.png" /></figure><p>Now, in agent,</p><pre>$ cd .ssh<br>$ vim authorized_keys</pre><p>Edit authorized keys and paste the public key from the master instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3iWZR7O4JhNrf2T7fQ1g_A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*mihZqBfmwYInF8WUz0PfOA.png" /></figure><p>Now, lets set up a new node. Go to <strong>Manage Jenkins</strong> and click on <strong>Set up node</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4tH_3hPLs4afeWBCOolIRw.png" /></figure><p>Enter Node name and select Permanent agent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*k4QgGyyWROjpwk_VVXgRsg.png" /></figure><p>Enter all details. Here, when we use labels for the agent, your master server would trigger the builds for the agent server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zySP8GBjVRuZW89rIUqIdA.png" /></figure><p>For launch method, select ‘<strong>Launch agents via SSH</strong>’. Add public IP of Agent instance at the <strong>Host</strong> field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m0vGRTHns6eKGvD6hk4KqQ.png" /></figure><p>For Credentials, add new credentials (if you do not already have them saved in Jenkins). Select ‘<strong>SSH username with private key</strong>’ . Fill all required details, and in the private key area add <strong>Private key from master instance (id_rsa).</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GJKiT1aYemOyNf2805v3mA.png" /></figure><p>Save the configuration details. And you can verify that the Agent is up and running if set-up properly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TFSuG_R93j-IacfFlcRQRQ.png" /></figure><p>In case of any error, check the logs and try to resolve them accordingly using the Agent instance CLI.</p><h4>Task-2</h4><ul><li>Run your previous Jobs on the new agent</li><li>Use labels for the agent, your master server should trigger builds for the agent server.</li></ul><p>Lets create a freestyle project that we have already deployed previously and try to trigger the build on the agent node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*-TY2ngvKdCtDh-RoF8osiA.png" /></figure><p>Add the necessary details. Here, Select <strong>Restrict where the project can be run</strong> and enter the label of the agent node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gw0KqpG4JWLiPUlTGnXxyQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*X7la_5EJIzJ_hUmZIw1A4w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xOWMqHJkqgT5PVFsE63Uqw.png" /></figure><p>The rest of the configuration is filled as done previously. For more details on this specific deployment steps, <a href="https://medium.com/devops-dev/day-23-jenkins-freestyle-project-for-devops-engineers-e35849700ee0">refer here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*frq6VAlEwatdGYqHLxsOaw.png" /></figure><p>We can see that the build was successfull and the console output provides the log of the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*qL3wHlZw8st_NF9AjMyX8g.png" /></figure><p>We can verify that the docker container is running from the CLI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Or1Ao8CM8lFNthcWU6ciKw.png" /></figure><p>Now, since we deployed the trigger build in the agent. Go to the <strong>public IP of the agent instance</strong> and port <strong>:8000</strong> and you can verify that the docker container was deployed in the agent instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*nAKPZCV2PjNP4vvSfM3FEw.png" /></figure><p>Thats it for Jenkins. Next blog we will start with Kubernetes !!!</p><p>Thank you for reading !!</p><p>Follow and click 👏 button below to show your support<strong> 😄 !!!</strong></p><p>See you tomorrow, with another blog…</p><p><a href="https://www.linkedin.com/in/rejani-rajesh-36335217a/">Rejani Rajesh</a> ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d17a883d29f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>