<?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 VijayaLakshmi Yvl on Medium]]></title>
        <description><![CDATA[Stories by VijayaLakshmi Yvl on Medium]]></description>
        <link>https://medium.com/@vijayalakshmiyvl?source=rss-65a669a368d7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hJv-M61JXinYXm73995SLw.jpeg</url>
            <title>Stories by VijayaLakshmi Yvl on Medium</title>
            <link>https://medium.com/@vijayalakshmiyvl?source=rss-65a669a368d7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 02:13:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vijayalakshmiyvl/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[AWS Session Manager-Securely Access Your AWS EC2 Instances Without SSH]]></title>
            <link>https://medium.com/@vijayalakshmiyvl/aws-session-manager-securely-access-your-aws-ec2-instances-without-ssh-69740e2bb430?source=rss-65a669a368d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/69740e2bb430</guid>
            <dc:creator><![CDATA[VijayaLakshmi Yvl]]></dc:creator>
            <pubDate>Sat, 05 Apr 2025 18:55:13 GMT</pubDate>
            <atom:updated>2025-04-13T17:33:36.296Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Vijaya</strong>: “Hey, have you ever struggled with managing SSH keys for your AWS EC2 instances?”</p><p><strong>Likitha: </strong>Yeah, all the time! I either misplace them or worry about security risks. Why? Got a better way?”</p><p><strong>Vijaya: </strong>“Absolutely! Have you tried AWS Session Manager? It lets you access your EC2 instances without SSH keys or even opening port 22!”</p><p><strong>Likitha:</strong> “Wait, what? No SSH keys? No open ports? How does that even work?”</p><p><strong>Vijaya:</strong> “Simple! AWS Systems Manager has a feature called Session Manager. It gives you secure CLI access to your instances via the AWS console or CLI — without the headache of SSH keys. Plus, all sessions are logged in CloudTrail for auditing!”</p><p><strong>Likitha: </strong>“That sounds amazing! But what’s the catch? Do I need to do some complex setup?”</p><p><strong>Vijaya: </strong>“Not at all! It’s a quick few-step process. Here’s how you enable it:”</p><p>𝗦𝘁𝗲𝗽𝘀: Attach an IAM Role to Your EC2 Instance<br>1️⃣ Go to AWS IAM Console → Roles.<br>2️⃣ Click Create role, select EC2, then click Next.<br>3️⃣ Attach the AmazonSSMManagedInstanceCore policy.<br>4️⃣ Name the role (e.g., SSM-SessionManagerRole) and create it.<br>5️⃣ Now, go to the EC2 Console, select your instance, and attach the IAM role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mC-G2ufFjzvYE9PDyjxJgQ.png" /><figcaption>add policy 𝑨𝒎𝒂𝒛𝒐𝒏𝑺𝑺𝑴𝑴𝒂𝒏𝒂𝒈𝒆𝒅𝑰𝒏𝒔𝒕𝒂𝒏𝒄𝒆𝑪𝒐𝒓𝒆 to role</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lUgQb4fJegKUmj_Ks886GA.png" /><figcaption>𝑵𝒂𝒎𝒆 𝒕𝒉𝒆 𝒓𝒐𝒍𝒆 (𝒆.𝒈., 𝑺𝑺𝑴-𝑺𝒆𝒔𝒔𝒊𝒐𝒏𝑴𝒂𝒏𝒂𝒈𝒆𝒓𝑹𝒐𝒍𝒆)</figcaption></figure><p>scroll down and click create it.</p><p>Now create EC2 Instance and attach the Role</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hRdB9FswW3g_iBrlit7IOA.png" /><figcaption>𝑳𝒂𝒖𝒏𝒄𝒉 𝑰𝒔𝒕𝒂𝒏𝒄𝒆 𝒏𝒂𝒎𝒆 𝒊𝒕 (𝒕𝒆𝒔𝒕𝑺𝑺𝑴), 𝒉𝒆𝒓𝒆 𝑶𝑺 𝒔𝒆𝒍𝒆𝒄𝒕𝒆𝒅 𝒊𝒔 𝑨𝒎𝒂𝒛𝒐𝒏 𝑳𝒊𝒏𝒖𝒙 2023</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Iimk4HPu9amm4DZrZHTlpw.png" /><figcaption>𝒑𝒓𝒐𝒄𝒆𝒆𝒅 𝒘𝒊𝒕𝒉𝒐𝒖𝒕 𝑲𝒆𝒚𝒑𝒂𝒊𝒓 𝒂𝒏𝒅 𝑳𝒂𝒖𝒏𝒄𝒉 𝑰𝒏𝒔𝒕𝒂𝒏𝒄𝒆</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7ExPl8Q1RbkYjVUWKz95UA.png" /><figcaption>𝑼𝒏𝒅𝒆𝒓 𝑨𝒅𝒗𝒂𝒏𝒄𝒆𝒅 𝑫𝒆𝒕𝒂𝒊𝒍𝒔, 𝑨𝒅𝒅 𝒖𝒔𝒆𝒓𝒅𝒂𝒕𝒂 𝒕𝒐 𝒊𝒏𝒔𝒕𝒂𝒍𝒍 𝒔𝒔𝒎-𝒂𝒈𝒆𝒏𝒕</figcaption></figure><pre>#!/bin/bash<br>yum update -y<br>yum install -y amazon-ssm-agent<br>systemctl enable amazon-ssm-agent<br>systemctl start amazon-ssm-agent</pre><p>Now, go to the EC2 Console, select your instance, and attach the IAM</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*056rZEC8jK-qyuBXdX3eSA.png" /><figcaption>𝑨𝒕𝒕𝒂𝒄𝒉 𝑰𝑨𝑴 𝒓𝒐𝒍𝒆 𝒕𝒐 𝒕𝒉𝒆 𝒊𝒏𝒔𝒕𝒂𝒏𝒄𝒆</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cqzlvZDyT1F0xYCW_X5kVA.png" /><figcaption>:<br>𝐬𝐞𝐥𝐞𝐜𝐭 𝐭𝐡𝐞 𝐑𝐨𝐥𝐞(𝐒𝐒𝐦-𝐒𝐞𝐬𝐬𝐢𝐨𝐧𝐌𝐚𝐧𝐚𝐠𝐞𝐫𝐑𝐨𝐥𝐞), 𝐭𝐡𝐞𝐧 𝐜𝐥𝐢𝐜𝐤 𝐔𝐩𝐝𝐚𝐭𝐞 𝐈𝐀𝐌 𝐫𝐨𝐥𝐞</figcaption></figure><p>Likitha: “Got it. Now, how do I actually start a session?”</p><p>𝗦𝘁𝗲𝗽𝘀: Start a Session Using AWS Console<br>1️⃣ Go to AWS Systems Manager → Session Manager.<br>2️⃣ Click Start Session, select your EC2 instance, and click Start session.<br>3️⃣ Boom! You’re now securely inside your instance — without SSH!”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CsqQn3WIOUSCecUR9ARxhQ.png" /><figcaption>𝐒𝐞𝐫𝐯𝐢𝐜𝐞𝐬 --&gt;𝐀𝐖𝐒 𝐒𝐲𝐬𝐭𝐞𝐦 𝐌𝐚𝐧𝐚𝐠𝐞𝐫 --&gt; 𝐒𝐞𝐬𝐬𝐢𝐨𝐧 𝐌𝐚𝐧𝐚𝐠𝐞𝐫--&gt; 𝐒𝐭𝐚𝐫𝐭 𝐚 𝐒𝐞𝐬𝐬𝐢𝐨𝐧 --&gt; 𝐓𝐚𝐫𝐠𝐞𝐭 𝐈𝐧𝐬𝐭𝐚𝐧𝐜𝐞𝐬 --&gt; 𝐒𝐞𝐥𝐞𝐜𝐭 𝐭𝐡𝐞 𝐈𝐧𝐬𝐭𝐚𝐧𝐜𝐞 𝐲𝐨𝐮 𝐰𝐚𝐧𝐭 𝐭𝐨 𝐜𝐨𝐧𝐧𝐞𝐜𝐭</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mJGgTqTKYv9CizdFfcH4ZQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7KUZ6_NG5-d1Wc5eA6Cc9g.png" /></figure><p>Likitha: “Dude, this is a game-changer! No more SSH headaches, and it’s way more secure. Thanks for the tip!”</p><p>Happy Learning :)</p><p>🚀Thank you for being a part of this enriching exploration! If you discovered value in this article, be sure to show your appreciation with a round of applause (claps)👏 if you enjoyed the read. Your support is invaluable. Stay tuned for more insights! Follow and subscribe <a href="https://medium.com/@vijayalakshmiyvl">vijayalakshmiyvl</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69740e2bb430" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Overcoming Kubernetes Upgrade Challeges:]]></title>
            <link>https://medium.com/@vijayalakshmiyvl/overcoming-kubernetes-upgrade-challeges-d5f39521c1c6?source=rss-65a669a368d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5f39521c1c6</guid>
            <dc:creator><![CDATA[VijayaLakshmi Yvl]]></dc:creator>
            <pubDate>Sun, 01 Dec 2024 04:27:22 GMT</pubDate>
            <atom:updated>2025-02-18T01:39:46.402Z</atom:updated>
            <content:encoded><![CDATA[<h3>Overcoming Kubernetes Upgrade Challeges: kubent</h3><h3>Tackle Deprecated APIs using “Kubent”</h3><p>Kubernetes upgrades, while essential for unlocking new features and security enhancements, often come with a challenges like API deprecations.</p><p>From the release of Kubernetes 1.24, several APIs have been deprecated.</p><p><strong>But how do you efficiently track these deprecated APIs?</strong></p><p>This is where Kube No Trouble (kubent) becomes invaluable.</p><p><strong>What is Kube No Trouble (kubent)?</strong><br><strong>kubent</strong> is a tool that scans Kubernetes clusters to detect resources using deprecated APIs. It offers a clear overview of outdated APIs, helping you update them for a smooth upgrade process.</p><p><strong>How kubent Works?</strong><br><strong>kubent detects deprecated APIs</strong> by analyzing your resources based on how they were deployed.</p><h4>Installation:</h4><p>Installing kubent on Windows manually using Tar file:</p><ol><li><strong>Download kubent</strong><br>Visit the <a href="https://github.com/doitintl/kube-no-trouble">official kubent GitHub page</a> and download the latest<a href="https://github.com/doitintl/kube-no-trouble/releases/tag/0.7.3"> .tar.gz file</a> for Windows.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ef0cGCfQszOqm4_9XURB9w.png" /><figcaption>Download .tar.gz file</figcaption></figure><p><strong>2. Extract the TAR File</strong><br>Open a terminal (like Git Bash) and run the following commands:</p><pre>cd /path/to/download  <br>tar -xvzf kubent_&lt;version&gt;.tar.gz</pre><p>or you can extract manually from your files/downloads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nYYhCAN7Was97eCYZLtoYw.png" /></figure><p><strong>3. Move the Binary</strong><br>Move the kubent.exe file to a directory in your PATH:</p><pre>mv kubent.exe /usr/local/bin/</pre><p>Note: make sure your .kube and .aws are present in the same location.</p><p><strong>4. Verify Installation</strong><br>Check if kubent is installed correctly:</p><pre>kubent --version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*aNuWn6BRHFPUTryMyCPgsg.png" /><figcaption>Kubent --version</figcaption></figure><p><strong>How to use kubent?</strong><br>After installing kubent, follow these steps to scan your cluster and identify deprecated APIs.</p><p><strong>Step 1:</strong> Connect to Your Cluster<br>Make sure your kubeconfig is pointing to the correct cluster:</p><pre> aws eks update-kubeconfig --name &lt;your_cluster-name&gt; --region &lt;Region-name&gt;</pre><p><strong>Step 2:</strong> Run the command — kubent</p><pre>kubent </pre><p><strong>Output:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*a83x0EFf-Culym89XD3IoQ.png" /><figcaption>Deprivated Apis- Cronjob, Horizontal PodAutoscalar(HPA) PodDisruptionBudget(PDB)</figcaption></figure><p><strong>Other than using Kubent where we find the list of Deprecated APIs ?</strong></p><p>For a comprehensive list of deprecated APIs in each Kubernetes version,</p><p>you can refer to the <a href="https://kubernetes.io/docs/reference/using-api/deprecation-guide/">official Kubernetes Deprecation Guide</a>.</p><p>This guide provides up-to-date information on all API deprecations across Kubernetes versions, helping you stay current with your cluster’s requirements.</p><p>🚀Thank you for being a part of this enriching exploration!</p><p>If you discovered value in this article , be sure to hit the follow and show your appreciation with a round of applause 👏👏.</p><p>your support is invaluable. Stay tuned for more insights! Follow and subscribe <a href="https://medium.com/@vijayalakshmiyvl">vijayalakshmiyvl</a></p><p>Happy Learning…..:)</p><p>#Kubernetes #kubent #EKS #EKSupgrade #APIManagement</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5f39521c1c6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy your first Custom Helm Chart in Kubernetes from scratch]]></title>
            <link>https://medium.com/@vijayalakshmiyvl/deploy-your-first-custom-helm-chart-in-kubernetes-from-scratch-f5738b0c714b?source=rss-65a669a368d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5738b0c714b</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[containers]]></category>
            <dc:creator><![CDATA[VijayaLakshmi Yvl]]></dc:creator>
            <pubDate>Sun, 10 Dec 2023 07:10:34 GMT</pubDate>
            <atom:updated>2025-04-25T04:09:40.057Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day3-Deploy your first Custom Helm Chart in Kubernetes from scratch</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jwxRbSmUylUkgASOBzZ3YA.jpeg" /></figure><p>A custom Helm chart is a Helm chart that is tailored to the specific needs of an application.</p><p>It is created by modifying an existing chart or by creating new one from scratch.</p><p>custom Helm charts simplify the process of deploying applications to Kubernetes cluster.</p><p><strong>Prerequisites</strong></p><ol><li>A Kubernetes cluster must be installed and running.</li></ol><p>to create Kubernetes cluster <a href="https://medium.com/@vijayalakshmiyvl/building-your-kubernetes-playground-on-aws-microk8s-71eca6ec5d26">click</a></p><p>2. Helm must be installed on your machine.</p><p>You can download the latest version of Helm from the <a href="https://helm.sh/docs/intro/install/">official website</a>, or follow my previous <a href="https://medium.com/@vijayalakshmiyvl/deploy-your-first-helm-chart-in-kubernetes-cluster-20f5e33e58b6">blog</a></p><p>3. For SouceCode management create <a href="https://github.com/">GitHub</a> account.</p><p>and then Fork the repository from<a href="https://github.com/vijayalakshmiyvl/python-flask-rest-api-project"> here</a> to your own GitHub account</p><p>4. <a href="https://hub.docker.com/">DockerHub</a> repository to store and to manage Docker Images</p><p>5. You should have a basic understanding of Kubernetes and Helm</p><p>🚀connect to the instance where we created Kubernetes play ground</p><ol><li><strong>Get the source code of the application along with Dockerfile, using clone command</strong></li></ol><pre>git clone https://github.com/vijayalakshmiyvl/python-flask-rest-api-project</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OE5yiBAro3ASHCOnuUjlyA.png" /><figcaption>clone the repository from github</figcaption></figure><pre>$ ls<br>$ cd python-flask-rest-api-project</pre><p>In this directory we will have source code in main.py. and also the Dockerfile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bbEDF_g6t1fpq0BmWH9MBw.png" /><figcaption>dockerfile is present here</figcaption></figure><p>The application code is written in the main.py</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xQcv9bCBFfjknSuJ03rH1g.png" /><figcaption>main.py</figcaption></figure><p>🚀<strong>2. Now build the docker image from Dockerfile</strong></p><p>to run Docker commands Docker need to be installed for this use below command and <strong>install docker</strong></p><pre>sudo apt install docker.io</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ejZjte3LOjdrWf24OvZX-A.png" /><figcaption>Docker is installed</figcaption></figure><p>Now build the image with below command</p><pre>docker build -t xyzbankimage .</pre><p>here . represents all the files from present directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*DYJe-goW04ltK-P7oylawA.png" /><figcaption>docker image got created from Dockerfile</figcaption></figure><p>To check the image which got created</p><pre>docker image ls</pre><p>If above command not working, then add ubuntu user to the docker group with below command and then restart the session and try</p><pre>sudo usermod -aG docker ubuntu</pre><p>After restart ‘docker image ls’ command is working</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZpqW6UQ2r9rb1xxjCykWhQ.png" /><figcaption>before adding ubuntu user to the Docker group got error</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YxXZyc7ohtOxwI_wvx_-AQ.png" /><figcaption>after adding ubuntu user to the Docker group, able to list the docker images</figcaption></figure><p>🚀<strong>3. push the image to the DockerHub Repository</strong></p><p>Create a repository with name ‘xyzbankimage’ in DockerHub registry</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gp0S06VAPFw7Fzy7MVDdkA.png" /><figcaption>xyzbankimage repository got created in DockerHub</figcaption></figure><p>Tag it with below command</p><pre>docker tag xyzbankimage dockerhudsons/xyzbankimage:1</pre><p>In the above command</p><p>xyzbankimage — -&gt;<em>Image_name</em></p><p><em>dockerhudsons — -&gt;DockerHub username</em></p><p>xyzbankimage → <em>is the repository name, which is created in DockerHub</em> with the image name</p><p>1 → <em>is the tag</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7pf9bvn3es5-tlnfJ2L6KQ.png" /><figcaption>tag the image</figcaption></figure><p>Push the Image to DockerHub</p><pre>docker push dockerhudsons/xyzbankimage</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T4t8Q8onA-fEbDX10RmqYg.png" /><figcaption>pushed image to the DockerHub repository</figcaption></figure><p>in DockerHub you will find xyzbankimage with tag 1 as below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f1-0aNXM_OLk3M1nLe0_KA.png" /><figcaption>docker image is available with tag ‘1&#39;</figcaption></figure><p>🚀<strong>4. create the Helm chart, and modify them according to the application code</strong></p><pre>$ cd ..<br>$ helm create xyzbankapp</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mLB3FK3NQ-fmcO7jU817AA.png" /><figcaption>helm chart directory with name xyzbankapp got created</figcaption></figure><p>Now update the docker image name, port, serviceName etc. according to the application code in the helm default charts</p><p>Comment(put#) for appversion in the chart.yaml, as we are not using any appversion here</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*E7eiH-WAEH77l7MXFB_9-Q.png" /><figcaption>appVersion is commented</figcaption></figure><p>modify values.yaml with repository name and image tag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*-I5Egw_tiQqlouxAHt-22w.png" /><figcaption>repository name is modified</figcaption></figure><p>Also update</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*H6vsxVC4Xf3QJf8D9DROGg.png" /><figcaption>updated service type to NodePort</figcaption></figure><p>In templates directory, edit <strong>deployment.yaml</strong> file change containerport to 9001</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*rHGZH-0VkjmBGNawgGVpjA.png" /></figure><p>Comment all the liveness probe in deployment.yaml, as we not required now</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*U2wp3O2BDJqgzqcZc-nsgw.png" /></figure><p>As we commented appversion in the chart.yaml we remove appversion part from the image portion in the deployment.yaml</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*phIMY-vN3FM_L3C2fIDsPQ.png" /></figure><p>🚀<strong>5. install(deploy) helm chart</strong></p><pre>helm install xyzbankapp1 xyzbankapp</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*FEPL_Vszu9e9rzUTWwJZCA.png" /><figcaption>myxyzbankapp1 is the helm revision name</figcaption></figure><p><strong>check:</strong></p><pre>helm list -a</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*uvQawAj2qmUOWVaxD3GguQ.png" /><figcaption>myxyzbankapp of revision1 got installed</figcaption></figure><p><strong>🚀6. Access the application in the browser</strong></p><pre>http://publicIp:nodeport/hello</pre><p><strong>Note:</strong> ‘kubectl get service’ command will give the port number(30898) where your application is running.</p><pre>kubectl get service</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*TC0Qc-kbqG-uirIaTIjBqA.png" /></figure><p>Happy Learning :)</p><p>🚀Thank you for being a part of this enriching exploration! If you discovered value in this article, be sure to hit the follow button for a continuous stream of insightful content. Subscribe to our updates and show your appreciation with a round of applause (claps)👏 if you enjoyed the read. Your support is invaluable. Stay tuned for more insights! Follow and subscribe <a href="https://medium.com/@vijayalakshmiyvl">vijayalakshmiyvl</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5738b0c714b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Helm Basic Commands]]></title>
            <link>https://medium.com/@vijayalakshmiyvl/helm-basic-commands-535511050c54?source=rss-65a669a368d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/535511050c54</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[VijayaLakshmi Yvl]]></dc:creator>
            <pubDate>Sat, 02 Dec 2023 11:35:31 GMT</pubDate>
            <atom:updated>2025-04-25T04:08:52.853Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qf77x4jAy_DHKp9Y50rNDw.jpeg" /></figure><h3>Day2-Helm Basic Commands</h3><p>Helm, the Kubernetes package manager, has become an essential tool for developers and system administrators seeking to streamline the deployment and management of applications on Kubernetes clusters. As Kubernetes environments grow in complexity, Helm provides a declarative and versioned approach to managing applications, simplifying the process of packaging, deploying, and maintaining them.</p><p>In this blog post, we’ll explore the fundamental Helm commands that every user should be familiar with.</p><p>To run these commands in your own lab</p><p><strong>prerequisites:</strong></p><ol><li>create kubernetes cluster <a href="https://medium.com/@vijayalakshmiyvl/building-your-kubernetes-playground-on-aws-microk8s-71eca6ec5d26">click</a></li><li>You should have a basic understanding of Kubernetes and Helm.</li></ol><p>💥1. <strong>create helm chart</strong></p><p>This command is used to create helm chart.</p><pre>helm create xyzbank</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yg49NFrhre6bVm_PbRRwbA.png" /></figure><p>to check the default directory structure of xyzbank use tree command</p><pre>tree xyzbank</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*jj-9E1WCRfePlOncpS55vg.png" /></figure><p>💥<strong>2. Install helm chart</strong></p><p>the command to install helm chart is given below</p><p>here xyzbankrelease1 is the release name of xyzbank helm chart.</p><pre>helm install myxyzbankrelease1 xyzbank</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-H91xPzQGqdLYQFLzHbBIw.png" /></figure><p>to check how many revisions of xyzbank is got created use command</p><pre>helm list -a</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y_j2bLyb1sNawkurSZL3Wg.png" /></figure><p>💥<strong>3. helm upgrade</strong></p><p>If you need to change configuration values, such as environment variables, resource requests/limits, or other settings, you can use ‘helm upgrade’ to apply these changes without redeploying the entire application.</p><pre>helm upgrade xyzbankrelease1 xyzbank</pre><p>Before using upgrade command, update values.yaml file with required configurations as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-hY3E9X2L1e9y7_3a_9iHQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ymAqKNryDk1j-odKFWw5jQ.png" /><figcaption>replicaCount given 2(by default it is 1)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/1*i63ngos4WBK2hLKxqmse5A.png" /><figcaption>service name changed to NodePort(by default it is ClusterIp)</figcaption></figure><p>after required configuration changes in values.yaml, to apply those changes, we are using helm upgrade command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L8l4uQsy7EMipFzhYdm8sQ.png" /></figure><p>check:</p><pre>helm list -a</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4zlIqB3nnY7a-AIPrz8wdg.png" /></figure><p>as per the changes in valus.yaml file, 2 replicas of pods and service is updated to NodePort</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q1CWuiM0PtohRj2o-71Tlg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*98QjbrZm0-yrN9tkNKr-aw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UEniRzjVTV9xULS6y8TTFw.png" /></figure><p>💥<strong>4. Rolling Back Changes:</strong></p><p>Helm allows you to rollback to a previous release version in case an upgrade introduces issues. You can use helm rollback to revert to a specific revision.</p><pre>helm rollback </pre><p>the present revision is 2 we are rolled back to revision1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AW2ZZQCYPq-HvstkZbF1Ag.png" /></figure><p>if you rollback, a new revision name will get allotted</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zRqBYJEsfGtmhE_cCG5L_A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xH1afafLOD9y1aICXXS8YQ.png" /><figcaption>replicaCount rolled back to 1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pF0Djox0BrZiCnO1x7dHDg.png" /><figcaption>service type is rolled back to ClusterIp</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0AM_MqDuTHfqXjz3eQviyw.png" /></figure><p>💥<strong>5. helm — debug and — dry-run</strong></p><p>Both helm --dry-run and helm debug are helpful during development, testing, and troubleshooting phases. The former helps you preview changes before applying them, while the latter might assist in diagnosing issues with a deployed release.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ve29tf_I8CUGbzxO8qpBVg.png" /></figure><p>this command will give the helm chart details as below</p><pre>NAME: xyzbankresease1<br>LAST DEPLOYED: Sat Dec  2 09:33:59 2023<br>NAMESPACE: default<br>STATUS: pending-install<br>REVISION: 1<br>USER-SUPPLIED VALUES:<br>{}<br><br>COMPUTED VALUES:<br>affinity: {}<br>autoscaling:<br>  enabled: false<br>  maxReplicas: 100<br>  minReplicas: 1<br>  targetCPUUtilizationPercentage: 80<br>fullnameOverride: &quot;&quot;<br>image:<br>  pullPolicy: IfNotPresent<br>  repository: nginx<br>  tag: &quot;&quot;<br>imagePullSecrets: []<br>ingress:<br>  annotations: {}<br>  className: &quot;&quot;<br>  enabled: false<br>  hosts:<br>  - host: chart-example.local<br>    paths:<br>    - path: /<br>      pathType: ImplementationSpecific<br>  tls: []<br>nameOverride: &quot;&quot;<br>nodeSelector: {}<br>podAnnotations: {}<br>podLabels: {}<br>podSecurityContext: {}<br>replicaCount: 2<br>resources: {}<br>securityContext: {}<br>service:<br>  port: 80<br>  type: NodePort<br>serviceAccount:<br>  annotations: {}<br>  automount: true<br>  create: true<br>  name: &quot;&quot;<br>tolerations: []<br>volumeMounts: []<br>volumes: []<br><br>HOOKS:<br>---<br># Source: xyzbank/templates/tests/test-connection.yaml<br>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: &quot;xyzbankresease1-test-connection&quot;<br>  labels:<br>    helm.sh/chart: xyzbank-0.1.0<br>    app.kubernetes.io/name: xyzbank<br>    app.kubernetes.io/instance: xyzbankresease1<br>    app.kubernetes.io/version: &quot;1.16.0&quot;<br>    app.kubernetes.io/managed-by: Helm<br>  annotations:<br>    &quot;helm.sh/hook&quot;: test<br>spec:<br>  containers:<br>    - name: wget<br>      image: busybox<br>      command: [&#39;wget&#39;]<br>      args: [&#39;xyzbankresease1:80&#39;]<br>  restartPolicy: Never<br>MANIFEST:<br>---<br># Source: xyzbank/templates/serviceaccount.yaml<br>apiVersion: v1<br>kind: ServiceAccount<br>metadata:<br>  name: xyzbankresease1<br>  labels:<br>    helm.sh/chart: xyzbank-0.1.0<br>    app.kubernetes.io/name: xyzbank<br>    app.kubernetes.io/instance: xyzbankresease1<br>    app.kubernetes.io/version: &quot;1.16.0&quot;<br>    app.kubernetes.io/managed-by: Helm<br>automountServiceAccountToken: true<br>---<br># Source: xyzbank/templates/service.yaml<br>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: xyzbankresease1<br>  labels:<br>    helm.sh/chart: xyzbank-0.1.0<br>    app.kubernetes.io/name: xyzbank<br>    app.kubernetes.io/instance: xyzbankresease1<br>    app.kubernetes.io/version: &quot;1.16.0&quot;<br>    app.kubernetes.io/managed-by: Helm<br>spec:<br>  type: NodePort<br>  ports:<br>    - port: 80<br>      targetPort: http<br>      protocol: TCP<br>      name: http<br>  selector:<br>    app.kubernetes.io/name: xyzbank<br>    app.kubernetes.io/instance: xyzbankresease1<br>---<br># Source: xyzbank/templates/deployment.yaml<br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: xyzbankresease1<br>  labels:<br>    helm.sh/chart: xyzbank-0.1.0<br>    app.kubernetes.io/name: xyzbank<br>    app.kubernetes.io/instance: xyzbankresease1<br>    app.kubernetes.io/version: &quot;1.16.0&quot;<br>    app.kubernetes.io/managed-by: Helm<br>spec:<br>  replicas: 2<br>  selector:<br>    matchLabels:<br>      app.kubernetes.io/name: xyzbank<br>      app.kubernetes.io/instance: xyzbankresease1<br>  template:<br>    metadata:<br>      labels:<br>        helm.sh/chart: xyzbank-0.1.0<br>        app.kubernetes.io/name: xyzbank<br>        app.kubernetes.io/instance: xyzbankresease1<br>        app.kubernetes.io/version: &quot;1.16.0&quot;<br>        app.kubernetes.io/managed-by: Helm<br>    spec:<br>      serviceAccountName: xyzbankresease1<br>      securityContext:<br>        {}<br>      containers:<br>        - name: xyzbank<br>          securityContext:<br>            {}<br>          image: &quot;nginx:1.16.0&quot;<br>          imagePullPolicy: IfNotPresent<br>          ports:<br>            - name: http<br>              containerPort: 80<br>              protocol: TCP<br>          livenessProbe:<br>            httpGet:<br>              path: /<br>              port: http<br>          readinessProbe:<br>            httpGet:<br>              path: /<br>              port: http<br>          resources:<br>            {}<br><br>NOTES:<br>1. Get the application URL by running these commands:<br>  export NODE_PORT=$(kubectl get --namespace default -o jsonpath=&quot;{.spec.ports[0].nodePort}&quot; services xyzbankresease1)<br>  export NODE_IP=$(kubectl get nodes --namespace default -o jsonpath=&quot;{.items[0].status.addresses[0].address}&quot;)<br>  echo http://$NODE_IP:$NODE_PORT</pre><p>💥6<strong>. helm template</strong></p><p>The helm template command in Helm is used to render and display Kubernetes YAML manifests based on a Helm chart, without deploying the resources to a Kubernetes cluster. It is a powerful tool during the development and debugging phase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G8rbGK2CZibfg46IIQ-AlQ.png" /></figure><p>this command will give the helm chart details as below</p><pre># Source: xyzbank/templates/serviceaccount.yaml<br>apiVersion: v1<br>kind: ServiceAccount<br>metadata:<br>  name: release-name-xyzbank<br>  labels:<br>    helm.sh/chart: xyzbank-0.1.0<br>    app.kubernetes.io/name: xyzbank<br>    app.kubernetes.io/instance: release-name<br>    app.kubernetes.io/version: &quot;1.16.0&quot;<br>    app.kubernetes.io/managed-by: Helm<br>automountServiceAccountToken: true<br>---<br># Source: xyzbank/templates/service.yaml<br>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: release-name-xyzbank<br>  labels:<br>    helm.sh/chart: xyzbank-0.1.0<br>    app.kubernetes.io/name: xyzbank<br>    app.kubernetes.io/instance: release-name<br>    app.kubernetes.io/version: &quot;1.16.0&quot;<br>    app.kubernetes.io/managed-by: Helm<br>spec:<br>  type: NodePort<br>  ports:<br>    - port: 80<br>      targetPort: http<br>      protocol: TCP<br>      name: http<br>  selector:<br>    app.kubernetes.io/name: xyzbank<br>    app.kubernetes.io/instance: release-name<br>---<br># Source: xyzbank/templates/deployment.yaml<br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: release-name-xyzbank<br>  labels:<br>    helm.sh/chart: xyzbank-0.1.0<br>    app.kubernetes.io/name: xyzbank<br>    app.kubernetes.io/instance: release-name<br>    app.kubernetes.io/version: &quot;1.16.0&quot;<br>    app.kubernetes.io/managed-by: Helm<br>spec:<br>  replicas: 2<br>  selector:<br>    matchLabels:<br>      app.kubernetes.io/name: xyzbank<br>      app.kubernetes.io/instance: release-name<br>  template:<br>    metadata:<br>      labels:<br>        helm.sh/chart: xyzbank-0.1.0<br>        app.kubernetes.io/name: xyzbank<br>        app.kubernetes.io/instance: release-name<br>        app.kubernetes.io/version: &quot;1.16.0&quot;<br>        app.kubernetes.io/managed-by: Helm<br>    spec:<br>      serviceAccountName: release-name-xyzbank<br>      securityContext:<br>        {}<br>      containers:<br>        - name: xyzbank<br>          securityContext:<br>            {}<br>          image: &quot;nginx:1.16.0&quot;<br>          imagePullPolicy: IfNotPresent<br>          ports:<br>            - name: http<br>              containerPort: 80<br>              protocol: TCP<br>          livenessProbe:<br>            httpGet:<br>              path: /<br>              port: http<br>          readinessProbe:<br>            httpGet:<br>              path: /<br>              port: http<br>          resources:<br>            {}<br>---<br># Source: xyzbank/templates/tests/test-connection.yaml<br>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: &quot;release-name-xyzbank-test-connection&quot;<br>  labels:<br>    helm.sh/chart: xyzbank-0.1.0<br>    app.kubernetes.io/name: xyzbank<br>    app.kubernetes.io/instance: release-name<br>    app.kubernetes.io/version: &quot;1.16.0&quot;<br>    app.kubernetes.io/managed-by: Helm<br>  annotations:<br>    &quot;helm.sh/hook&quot;: test<br>spec:<br>  containers:<br>    - name: wget<br>      image: busybox<br>      command: [&#39;wget&#39;]<br>      args: [&#39;release-name-xyzbank:80&#39;]<br>  restartPolicy: Never</pre><p>Both debg and dryrun commands provide a way to preview changes before applying them to a Kubernetes cluster, helm template is more versatile and gives you direct access to the rendered YAML, allowing for further inspection and modification. helm --dry-run, on the other hand, is specifically designed for simulating deployments without generating the final YAML files.</p><p>💥<strong>7. helm lint</strong></p><p>It helps to find any misconfigurations like yaml syntax checking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LUxX39Mm6viK6t3C8J_naQ.png" /></figure><p>💥<strong>8. helm uninstall</strong></p><p>this command is used to remove a deployed Helm release and delete associated resources from the Kubernetes cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uLwt8HaYuuu-vw-sxQsykQ.png" /></figure><p>Happy Learning :)</p><p>🚀Thank you for being a part of this enriching exploration! If you discovered value in this article, be sure to hit the follow button for a continuous stream of insightful content. Subscribe to our updates and show your appreciation with a round of applause (claps)👏 if you enjoyed the read. Your support is invaluable. Stay tuned for more insights! Follow and subscribe <a href="https://medium.com/@vijayalakshmiyvl">vijayalakshmiyvl</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=535511050c54" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy Your First Helm Chart In Kubernetes Cluster]]></title>
            <link>https://medium.com/@vijayalakshmiyvl/deploy-your-first-helm-chart-in-kubernetes-cluster-20f5e33e58b6?source=rss-65a669a368d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/20f5e33e58b6</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[careers]]></category>
            <dc:creator><![CDATA[VijayaLakshmi Yvl]]></dc:creator>
            <pubDate>Sat, 25 Nov 2023 12:00:59 GMT</pubDate>
            <atom:updated>2025-04-25T04:08:16.187Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day1-Deploy Your First Helm Chart In Kubernetes Cluster-</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iG-2L0uwuSoicm1EBvfrQg.jpeg" /></figure><p>🚀<strong>What is Helm?</strong></p><p>Helm is a package manager for Kubernetes that helps deploy complex applications by bundling necessary resources into charts, which <em>contain all the information </em>to run an application on a cluster.</p><p>In this blog post, we will go through the steps to deploy your first Helm chart in a Kubernetes cluster.</p><p>🚀<strong>Prerequisites:</strong></p><ol><li>A Kubernetes cluster must be installed and running.</li></ol><p>to create kubernetes cluster <a href="https://medium.com/@vijayalakshmiyvl/building-your-kubernetes-playground-on-aws-microk8s-71eca6ec5d26">click</a></p><p>2. Helm must be installed on your machine.</p><p>You can download the latest version of Helm from the <a href="https://helm.sh/docs/intro/install/">official website</a>, or use below commands.</p><p>3. You should have a basic understanding of Kubernetes and Helm.</p><p>🚀<strong>Install the Helm</strong></p><pre>1. curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3<br>2. chmod 700 get_helm.sh<br>3. ./get_helm.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*wZxJ13o6mPDTJuz_4x7mow.png" /></figure><h4>🚀<strong>Create your first Helm chart</strong></h4><pre>helm create xyzbank</pre><p>Above command will create a new directory called ‘xyzbank’ with the necessary files and directories.</p><p>You will find 2 files(c<strong>hart.yaml,values.yaml</strong>) and 2directories(<strong>charts</strong>, <strong>templates</strong>) which are created by default when we run the command “helm create xyzbank”</p><p>In template directory we find some files like <strong>deployment.yaml</strong>, <strong>hpa.yaml</strong>, <strong>ingress.yaml</strong>, <strong>service.yaml</strong> and some other files and the <strong>tests</strong> directory.(check below screenshot)</p><p>The directory structure will look like this:</p><pre>tree xyzbank</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*HZrwO4tjkwEBHyAM61pvbQ.png" /></figure><p>Note: if tree command not available. Install tree with command-</p><pre>sudo apt-get install tree</pre><p>Great now you created your first Helm chart.</p><h4>🚀Run the Helm Chart.</h4><p>checkout to xyzbank directory.</p><pre>cd xyzbank</pre><p>edit the values.yaml file using vi</p><pre>vi values.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/1*wtZNlpwCqmvp6lnhJw_vzQ.png" /></figure><p>Change the service name to NodePort (by default it is ClusterIP) in the values.yaml file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/177/1*0vIOMmjr9RVqYC7ofIzPHA.png" /></figure><p>After updating the values.yaml, finally install the helm chart.</p><pre>helm install myxyzbank xyzbank</pre><p>in the above command, myxyzbank is the custom name of the helm chart which you want to deploy in the k8s cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*fvm5iETFz-1ygSUQsVsvoQ.png" /></figure><p>check helmchart details -use below command</p><pre>helm list –a</pre><p>We can observe here myxyzbank helmchart got deployed in the k8s cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*jMrxSAt4XGi1BnegW7roDw.png" /></figure><p><strong>Access the application</strong></p><p>kubectl get service is the command to get the k8s service details and the port number.</p><pre>kubectl get service</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*7XGvIgxCU563N_B28HANQA.png" /></figure><p>from any of the browser with PublicIp and port number(32756) we can access the application.</p><p><a href="http://%3cPublic_IP%3e:portnumber">http://&lt;Public_IP&gt;:portnumber</a></p><p>Note: If you got error while accessing in AWS console edit inboundrules and add port number 32756.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*j_DDiTMEr8iKPS90yX9CHw.png" /></figure><p>🎉Hurray! you have deployed helm chart on the k8s cluster and able to access the nginx application.</p><p>Uninstall helmchart using command</p><pre>helm uninstall myxyzbank</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*26XruwIwXzPyL0UIh0gSug.png" /></figure><p>🚀Thank you for being a part of this enriching exploration! If you discovered value in this article, be sure to hit the follow button for a continuous stream of insightful content. Subscribe to our updates and show your appreciation with a round of applause (claps)👏 if you enjoyed the read. Your support is invaluable. Stay tuned for more insights! Follow and subscribe <a href="https://medium.com/@vijayalakshmiyvl">vijayalakshmiyvl</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20f5e33e58b6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build Your Kubernetes Playground on AWS: MicroK8s]]></title>
            <link>https://medium.com/@vijayalakshmiyvl/building-your-kubernetes-playground-on-aws-microk8s-71eca6ec5d26?source=rss-65a669a368d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/71eca6ec5d26</guid>
            <dc:creator><![CDATA[VijayaLakshmi Yvl]]></dc:creator>
            <pubDate>Sun, 19 Nov 2023 11:40:09 GMT</pubDate>
            <atom:updated>2023-11-19T11:45:11.845Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mdhzg8LusAWIZiiFLjGedA.jpeg" /></figure><h3>A Hands-On Guide for Kubernetes and Helm Chart Practice</h3><p>Introduction: Embarking on the journey of Kubernetes and Helm chart development can be both thrilling and challenging. This comprehensive guide is designed to help you set up your own Kubernetes cluster using AWS, providing a controlled environment for hands-on exploration. The only prerequisite is an AWS free tier account.</p><p><strong>Prerequisites:</strong></p><ol><li>AWS free tier account</li><li>Basic understanding of AWS services</li></ol><p><strong>Step 1: </strong>Launch an EC2 Instance Initiate the process by launching an EC2 instance, which will serve as the foundation for your Kubernetes cluster. Follow these straightforward steps:</p><ul><li>Log in to your AWS Management Console.</li><li>Navigate to the EC2 Dashboard.</li><li>Click on “Launch Instance” and select the “Ubuntu” Amazon Machine Image (AMI).</li><li>Choose the “t2.medium” instance type for optimal performance.</li><li>Configure instance details and storage according to your requirements</li><li>Review your settings and proceed to launch the instance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SrDa_5jL6hC7r1NMcHSgyQ.png" /></figure><p><strong>Reminder:</strong> To prevent incurring charges, kindly ensure to either stop or terminate the AWS EC2 instance upon completion of your hands-on activities. This practice helps maintain cost efficiency by avoiding unnecessary billing for idle resources.</p><p><strong>Step 2: </strong>Connect to Your EC2 Instance Once your EC2 instance is running, establish an SSH connection:</p><p><strong>Step 3:</strong> Install Microk8s: Microk8s is a lightweight and easily installable Kubernetes distribution. Execute the following commands to install Microk8s on your EC2 instance:</p><pre>1. sudo snap install microk8s --classic<br>2. sudo usermod -a -G microk8s Ubuntu<br>3. newgrp microk8s</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*cb9XVVVs4GK-kPL_zgAwPw.png" /></figure><p><strong>Step4: </strong>Now install Kubectl</p><p>Kubectl is a command line interphase to interact with the k8s cluster.</p><p>use below commands to install Kubectl</p><pre>1. curl -LO https://dl.k8s.io/release/v1.28.4/bin/linux/amd64/kubectl<br>2. sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl<br>3. kubectl version --client</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*098AlMX-KVxaBaNtXPen8w.png" /></figure><p><strong>Step5:</strong> To make kubectl interact with Microk8s cluster, configure .kube directory</p><pre>1. cd $HOME<br>2. mkdir .kube<br>3. cd .kube<br>4. microk8s config &gt; config<br>5. Ls –lart<br>6. cat config<br></pre><p>In this configuration file:<br><strong>&lt;cluster-name&gt;</strong> is the name of your cluster.<br>&lt;<strong>cluster-server-url&gt; </strong>is the URL of your Kubernetes API server.<br><strong>&lt;base64-encoded-ca-cert&gt; </strong>is the base64-encoded cluster certificate authority.<br><strong>&lt;user-name&gt; </strong>is the name of the user context.<br><strong>&lt;base64-encoded-client-cert&gt;</strong> is the base64-encoded client certificate.<br><strong>&lt;base64-encoded-client-key&gt;</strong> is the base64-encoded client private key.<br><strong>&lt;context-name&gt; </strong>is the name of the context, combining the cluster and user.<br><strong>&lt;default-namespace&gt; </strong>is the default namespace for the context.</p><p>Understanding and modifying this configuration file allows you to manage multiple Kubernetes clusters and switch between them seamlessly using <strong>kubectl config use-context &lt;context-name&gt;</strong>. It’s a crucial aspect of working with Kubernetes, especially in environments with multiple clusters or users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*474d0214U1amTPZiUBH7PA.png" /></figure><p>MicroK8s Kubernetes cluster setup has been successfully completed.</p><p><strong>Step6: </strong>Now, let’s verify whether kubectl commands are functioning properly by using the following command.</p><pre>kubectl get all --all-namespaces</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*FCgFuj3dySaAdxSCi0pcOw.png" /></figure><p><strong>Hurray!</strong> The successful execution of this command indicates that we are now able to interact seamlessly with the Kubernetes cluster using kubectl commands. This milestone opens the door to a multitude of possibilities for managing and deploying applications within the Kubernetes environment. The next steps in your Kubernetes journey are ready to unfold. Happy exploring!</p><p>🚀Thank you for being a part of this enriching exploration! If you discovered value in this article, be sure to hit the follow button for a continuous stream of insightful content. Subscribe to our updates and show your appreciation with a round of applause (claps)👏 if you enjoyed the read. Your support is invaluable. Stay tuned for more insights! Follow and subscribe <a href="https://medium.com/@vijayalakshmiyvl">vijayalakshmiyvl</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71eca6ec5d26" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create GitHub Repository using Terraform]]></title>
            <link>https://medium.com/@vijayalakshmiyvl/how-to-create-github-repository-using-terraform-cd2d4d204605?source=rss-65a669a368d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd2d4d204605</guid>
            <category><![CDATA[women]]></category>
            <category><![CDATA[jobs]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[careers]]></category>
            <dc:creator><![CDATA[VijayaLakshmi Yvl]]></dc:creator>
            <pubDate>Thu, 20 Jul 2023 17:48:11 GMT</pubDate>
            <atom:updated>2023-07-20T17:48:11.561Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cWBkIri5rkF5Oglp-ibO9A.jpeg" /></figure><p>The pre requisite for creating GitHub repository is GitHub account, after having GitHub account you can use terraform to create and manage the GitHub repositories.</p><h4>This article is about, how to create GitHub Repository using Terraform</h4><p>To create, manage and to interact with GitHub repository we are using The provider called <a href="https://registry.terraform.io/providers/integrations/github/latest">GitHub provider</a></p><p>The provider allows you to manage your GitHub organization’s members and teams easily.</p><p>It needs to be configured with the proper credentials before it can be used.</p><p>here I am using GitHub Token to have access to GitHub from my AWS account.</p><p><strong>To generate Token in GitHub follow below procedure:</strong></p><p>Go to your GitHub account click small Triangle which is beside of your GitHub profile pic (up right side corner).</p><p><strong>click on settings → Developer settings → Personal access tokens → Fine-grained tokens → Generate new token</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cePfgVAp61wXrAxnZ1vM3g.png" /></figure><p><strong>Name the token as ‘terraform’, and select token expiration as ‘7days’ by default it was 30 days</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v6IQpf60y0J2-UWfVutSEA.png" /></figure><p><strong>select repository access as ‘All repositories’</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*IwTvZWd2a2rvUn8h0L7apw.png" /></figure><p><strong>Then Repository permissions →Administration →Read and Write</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C6bch8l3SL1PVrmv8YqoLw.png" /></figure><p><strong>Then click on ‘Generate Token’</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4D-4Uhr1johTRrHzIdmHfQ.png" /></figure><p><strong>token got created</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o65xFX52tQo4UmfHNoyIOA.png" /></figure><p>Now in visual studio code create a file called ‘github.tf ‘ inside the folder ‘github_repo_terraform’ (you can give any name to the folder as your wish)</p><p><strong>inside the github.tf write the code as below:</strong></p><pre>terraform {<br>  required_providers {<br>    aws = {<br>      source  = &quot;hashicorp/aws&quot;<br>      version = &quot;~&gt; 4.0&quot;<br>    }<br>    github = {<br>      source  = &quot;integrations/github&quot;<br>      version = &quot;~&gt; 5.0&quot;<br>    }<br>  }<br>}<br><br># Configure the AWS Provider<br>provider &quot;aws&quot; {<br>  region  = &quot;ap-south-1&quot;<br>  profile = &quot;terraformprofile&quot;<br>}<br><br># Configure the GitHub Provider<br>provider &quot;github&quot; {<br>  token = &quot;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&quot;<br>}<br><br>resource &quot;github_repository&quot; &quot;example&quot; {<br>  name        = &quot;example&quot;<br>  description = &quot;My awesome codebase&quot;<br><br>  visibility = &quot;public&quot;<br>}</pre><p><strong>The above cofiguration file(github.tf) was explained below</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QoTEbI5XWz71BORG5NPHpA.png" /></figure><p>In github.tf we have mentioned</p><ol><li>required_provider as github</li><li>provided token details</li><li>repository details</li></ol><p>for more details about configuring GitHub repository <a href="https://registry.terraform.io/providers/integrations/github/latest/docs/resources/repository">click</a></p><p>NOTE: insteated of profile = terraformprofile in the github.tf, you can also provide your <a href="https://medium.com/@vijayayvl/authentication-and-configuration-2c096c398379">AWS account access Key and Secret Key</a></p><p><strong>Now in the terminal use the command “terraform init’’</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hUArnYov7MT5cKzXP7-RJA.png" /></figure><p><strong>Now “terraform fmt”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*umHwC2Zk8-3vsZfn7ZWlfQ.png" /></figure><p><strong>Now “terraform plan”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lCmbAC0_zudmTYtnOR757Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*HbDAKSl58Pox2qJFbbf46A.png" /></figure><p><strong>Now “terraform apply”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_sI9pKsZwMbSKlukr6LY4Q.png" /></figure><p>you can check in the GitHub, go to the repositories</p><p><strong>Hurray….</strong>. GitHub repository with name ‘example’ got created</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OXCZCYYv0NDKI292zaW17A.png" /></figure><p><strong>To delete the repository use the command ‘terrafom destroy’</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5JGfQZejYzOZIoRgQ6Y5Sw.png" /></figure><p>Happy Learning :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd2d4d204605" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to reset Jenkins Admin password?]]></title>
            <link>https://medium.com/@vijayalakshmiyvl/how-to-reset-jenkins-admin-password-a382c90ee096?source=rss-65a669a368d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/a382c90ee096</guid>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[creativity]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[recaps]]></category>
            <dc:creator><![CDATA[VijayaLakshmi Yvl]]></dc:creator>
            <pubDate>Fri, 19 May 2023 03:09:10 GMT</pubDate>
            <atom:updated>2023-05-19T04:09:01.521Z</atom:updated>
            <content:encoded><![CDATA[<p>When you try to access Jenkins console using PublicIp:port number, it will prompt to enter username and password.</p><p>If you forgot username or password or both, follow below steps to reset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*yFmj7OQnYIRZC9Fui8M__Q.png" /></figure><p>First connect to the Jenkins server, using any of the ssh tools like MobaXterm or putty.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qsJHSO1TBp_V8GY85cDJ7Q.png" /></figure><p>After ssh to the server, Switch to root user using command ‘sudo su — ‘</p><p>and switch to Jenkins home directory using command ‘cd /var/lib/jenkins’</p><pre>sudo su -<br>cd /var/lib/jenkins</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*8C8GxtoKCzPWXGoBG3WCtA.png" /></figure><p>in the Jenkins home directory(var/lib/jenkins) we will find a file called <strong>config.xml.</strong></p><pre>ls -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h9iZikJXiVvjKydS0N6tOQ.png" /></figure><p>open the config.xml and edit. Here I used vi for edit</p><pre>vi config.xml</pre><p>in the 7th line of config.xml, you will find ‘use security’ as ‘true’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3mULTBqohHzc_FZ4a4ep8w.png" /></figure><p>change it to ‘false’ and save the file using command :wq after clicking ‘esc’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gMz6Xh2F-dGfk5Yh2l7OaQ.png" /></figure><p>now restart the Jenkins, and then check the status of the Jenkins using below commands</p><pre>systemctl restart jenkins<br>systemctl status jenkins</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yj5iPpLfTS_GeUZQ51lNeg.png" /><figcaption>Jenkins is active</figcaption></figure><p>Now go to Jenkins console and refresh, now you are able to access console without username and password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*VYef8wrlrImreBl-xyUVFg.png" /></figure><p>To reset the password follow below procedure.,</p><p>in the Jenkins Dashboard click on ‘Manage Jenkins’ and then scroll down a little and click on ‘Security’</p><p><strong>dashboard → Manage Jenkins → security</strong></p><p>then select ‘Jenkins own user database’ from the ‘Authentication’ dropdown, and then click on ‘Save’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tPNOpZy9f3CBhDyRxw5fSA.png" /></figure><p>Now go back to the Jenkins Dashboard, click on Manage Jenkins, and then click on users</p><p>Note: the users is appeared after we select ‘Jenkins own user database’ in the previous step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*5Q1nHVMVkpY4pjBq1PaFPQ.png" /></figure><p>here we will see all the users of Jenkins, here I have only admin user.</p><p>As we want to reset admin user password click on ‘settings’ icon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2P3661r_NnrAThbMJbsrNA.png" /></figure><p>scroll down and Enter whatever password you want for the admin user , and click on save</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RrdvbMG1sDHKgUVd3gZ71A.png" /></figure><p>Hurray…. you have reset the password successfully.</p><p><strong>check</strong></p><p>Now enter username and new password. and click on sign in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*KX-S_Ty8pxLqosxs_Bcirw.png" /></figure><p>like this you can set the password to Admin user.</p><p><strong>Follow this Best practice:</strong></p><p>Just by browsing publicIp:8080, without login using user name and password, all users have access to manage Jenkins option, and to previously run job details like below figure</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pSYjeqBzoeEKrSsVD14sJQ.png" /></figure><p>to restrict access to manage Jenkins tab, click on manage Jenkins, then security , scroll down a bit you will find Authorization, from Authorization dropdown select ‘Logged-in users can do anything’. and click on save.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d3OAfOLtRWt9wQgEZsE6-Q.png" /></figure><p>Now access Jenkins using publicIp:8080, now you don’t find, manage Jenkins and previously run job information, without entering username and Password. and it will prompt to enter username and password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KRO9B9gYP0PqHWrWx2gYgQ.png" /></figure><p>now with the new password you can sign in to Jenkins server.</p><p>Happy Learning :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a382c90ee096" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrate local State file to Remote]]></title>
            <link>https://medium.com/@vijayalakshmiyvl/migrate-local-state-file-to-remote-62e7f5089e01?source=rss-65a669a368d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/62e7f5089e01</guid>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[VijayaLakshmi Yvl]]></dc:creator>
            <pubDate>Sun, 16 Apr 2023 03:03:07 GMT</pubDate>
            <atom:updated>2023-05-12T16:30:39.118Z</atom:updated>
            <content:encoded><![CDATA[<p>State file will get created after running terraform apply. By default the state file is named as ‘<strong>terraform.tfstate’ </strong>and it is stored locally i.e in the same directory where you run terraform.</p><p>I am creating a simple ec2 instance , with out remote backend. So the state file will get generated locally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*JpbF1ylXKXH9GgI5hucnPA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*JaEMxY5zOhPFEBfvRusBGg.png" /></figure><p>Terraform init</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WBpcoWyM4iRebbh64uFOzg.png" /></figure><p>Terraform plan</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*L9TGHZrafUFTvKVLAkM9lQ.png" /></figure><p>Terraform apply</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*8Wk2PBB7m6QAEdXGgAg9Sg.png" /></figure><p>after terraform apply command got exicuted we find terrafom.tfstate file in the local file system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*tS0vLqPCpZWx1WzjKpbf4w.png" /></figure><p><strong>Why and How to maintain Statefile Remotely ?</strong></p><p>As terraform.tfstate file contains sensitive data like the resource IDs, and the resource attributes and the initial password details. So it is best practice toto maintain statefile remotely.</p><p>Terraform supports storing state in</p><ol><li>Amazon S3 bucket</li><li>HashiCorp<a href="https://www.consul.io/"> </a>Consul</li><li>Azure Blob Storage</li></ol><p>4. Google Cloud Storage</p><p>5. Alibaba Cloud OSS</p><p><strong>In this article we see how to migrate statefile to Amazon S3 bucket</strong></p><p>Create S3 bucket with a folder called ‘dev’ in the aws console.</p><p>I named the s3 bucket name as ‘localstate-migrate-remotebucket’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*aHr5XpSlAutRtYQZ1R9O4w.png" /></figure><p>And also create a DynamoDB table for statelock.</p><p>It ensures that the Terraform state is not being modified by two threads at the same time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*gMCHUNcBtbgrK6j13KMxBQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*D1livzyIRo_E3AQtKK3Fmw.png" /></figure><p>Now update backend details in the terraform block</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bTCm23FNW3UiVj0BSpkWgw.png" /></figure><p>terraform plan will suggest the ways to use backend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*rB1_xvIRiUTQOGOB3eIPsg.png" /></figure><p>Use “<strong>terraform init –migrate-state</strong>”. So that the statefile which is there locally is to be migrated to s3. And going forward it will use S3 backend to maintain state file.</p><p><strong>If you already created any Terraform project and it was using local state file, if require you can migrate like this.</strong></p><p>So now use “terraform init –migrate-state” to migrate terraform.tfstate file to S3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wsOETIB6Xx-qnoxbARChLA.png" /></figure><p>Now check in the console. you will find statefile in the S3 bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*SJwEhW8FpzK-b6roEkPJYQ.png" /></figure><p>Hurray….. 😊Terraform State file is copied to Remote s3.</p><p>Now even though, I deleted state file locally, it will use remote state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*_gZkSrjENGGvRrF7qe2RTg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EdwoGKABwyWpaJ6U6gc_WA.png" /></figure><p>Now , if I make any changes in the resource block, here I cahnged tags from ‘Demoserver’ to ‘Demoserver-updated’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*Fe2k46nxPIFTdsPrtU-kLA.png" /></figure><p>Terraform plan</p><p>It will compare with the remote state and will say that 1 to change.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*o7yRGjb9kgq9GMNF2PqxNg.png" /></figure><p>terraform apply</p><p>It will make the changes in tags , and will update it in the remote state file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*BZyW_lRG9EuNkbVVvq-xCQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*Ov0HcRUy9T-zBn197lr7aw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*sPP68sIP--G9yYquHe98Xw.png" /></figure><p>Enabling versioning for state file allows us to track changes and have versioning for state file.</p><p>Happy Learning…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62e7f5089e01" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Authentication and Configuration]]></title>
            <link>https://medium.com/@vijayalakshmiyvl/authentication-and-configuration-2c096c398379?source=rss-65a669a368d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c096c398379</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[jobs]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[learning]]></category>
            <dc:creator><![CDATA[VijayaLakshmi Yvl]]></dc:creator>
            <pubDate>Sun, 02 Apr 2023 08:52:41 GMT</pubDate>
            <atom:updated>2023-05-12T16:28:39.302Z</atom:updated>
            <content:encoded><![CDATA[<p>To connect to your cloud provider like AWS you need Authentication and configuration.</p><p>Configuration for the AWS Provider can be derived from several sources, which are applied in the following order:</p><p>1. ‘Parameters in the provider configuration’</p><p>2. Environment variables</p><p>3. Shared credentials files</p><p>4. Shared configuration files</p><p>5. Container credentials</p><p>6. Instance profile credentials and region</p><p>In this demo, I have explained the first 3 ways of authentication.</p><h4><strong>First Create an IAM user with Administrative access. and get the Access_key and Secret_key.</strong></h4><p>Create an IAM user in the AWS console with Administrative access or with the required policies, and get the user Access_key and Secret_key_id.</p><p>After you have user Access_key and Secret_key you can provide these directly in the Provider block of Terraform configuration.</p><p>Specify the user details</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B4MuYHRJx0f3D8OFrR4BZw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MprFWPuoKxUFSMdQQPTDmQ.png" /></figure><p>Review the user details and click on create user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*03oNjOeLRHEdNBn5Yr-96w.png" /><figcaption>‘terraformUser1&#39; got created with ‘administrative access’</figcaption></figure><p>Then click on ‘terraformUser1’ and then click on ‘Security credentials’ and scroll down little you will find under ‘Access keys’ . click on ‘create access key’.</p><p>then the below window will get opened. select ‘Command Line Interface(CLI)’ from the list of options.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*Rk-cTYlXA0aZgFYv1Dyxdg.png" /></figure><p>scroll down and tick the check box and click on ‘Next’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*lk3527hEyo9Mgj9o5qiIBg.png" /></figure><p>enter the description and click on ‘Create access key’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0BOCLCSg81jNnHNsC7ijLA.png" /></figure><p>you will find ‘Access key’ and ‘Secret access key’ . copy them and store in a notepad. These credential we are going to use for authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*1NBsnsbg_6AJvesQiizkOA.png" /></figure><ol><li><strong>Connect to AWS provider by Parameters in the provider configuration</strong></li></ol><p>This is the first method of authetication. Credentials can be provided by adding an access_key, secret_keyto the aws provider block.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*YLMyD7wCzTXkEsgCt2KDqA.png" /></figure><p>Create a folder on the your desktop and name it. I named for this demo as ‘authentication_lab’.</p><p>open it in the visual studio code.</p><p>create a file called main.tf , and write configuration code, to create any resource like ec2 instance, here in the provider block use the ‘terraformuser1&#39; access_key and secret_key.</p><pre>terraform {<br>  required_providers {<br>    aws = {<br>      source  = &quot;hashicorp/aws&quot;<br>      version = &quot;~&gt; 4.0&quot;<br>    }<br>  }<br>}<br># Configure the AWS Provider<br>provider &quot;aws&quot; {<br>  region = &quot;ap-south-1&quot;<br>  access_key = &quot;AKIAXZ6LNDQOWHDVHNHZ&quot;<br>  secret_key = &quot;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&quot;<br>}<br>resource &quot;aws_instance&quot; &quot;demoserver&quot; {<br>   ami = &quot;ami-0e07dcaca348a0e68&quot;<br>   instance_type = &quot;t2.micro&quot;<br>   tags = {<br>     Name = &quot;appserver&quot;<br>   } <br>}</pre><p>Now check with the commands terraform init, terraform plan, terraform apply weather you are able to connect to your cloud provider ‘aws’ and instance got created or not?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*GCOar4bZWTJLdHkAk8oStQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vWadMJec5kTYi17joy-xAQ.png" /></figure><p>But it is not best way, because we are hardcoding the credentials in the configuration file itself, so there is high risk of secret leakage with this method.</p><p>terraform destoy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*iS0G-uXsa5iBS_R-zSU43Q.png" /></figure><p><strong>2. Environment variables</strong></p><p>Credentials can be provided by using the AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY_ID environment variables.</p><p>For example:</p><p>for linux or mac use ‘export’ command</p><pre>$ export AWS_ACCESS_KEY_ID=&quot;AKIAXZ6LNDQOWHDVHNHZ&quot;<br>$ export AWS_SECRET_ACCESS_KEY=&quot;Pzrztq4Trgo3ld7Ge0A6z6tL+h3QF7W61gPrJysb&quot;<br>$ export AWS_REGION=&quot;ap-south-1&quot;</pre><p>for Windows use ‘set’</p><pre>$ set AWS_ACCESS_KEY_ID=&quot;AKIAXZ6LNDQOWHDVHNHZ&quot;<br>$ set AWS_SECRET_ACCESS_KEY=&quot;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&quot;<br>$ set AWS_REGION=&quot;ap-south-1&quot;</pre><p>It will work only in the current terminal. Only for that session. If you closed terminal, again need to execute.</p><p><strong>3. Shared credentials files</strong></p><p>The AWS Provider can get credentials from the shared configuration and credential file, these files are located by default at “ <strong>~/.aws/config”</strong> and ”<strong>~/.aws/credentials”</strong> on Windows. on Linux and macOS, “$HOME/.aws/config”and “$HOME/.aws/credentials”.</p><p>If no named profile is specified, the “default”profile is used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*BsXl8TqbtLqFhr2UBmnOYA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*B4MBOYAubvLuUQE2Q1drDA.png" /></figure><p>now in the Terraform configuration in main.tf, instead of hardcoding ‘access_key’ and ‘secret_key’, just insert profile = “terraformprofile”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*8MUWLcLcfLsswjKT00Zp6Q.png" /></figure><p>Now check with the commands terraform init, terraform plan, terraform apply weather you are able to connect to your cloud provider ‘aws’ and instance got created or not?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*NsjFEptmWDnl9pT5ZPFaGQ.png" /></figure><p>If credentials are provided in above all the ways, then the order what is given above is considered by the Terraform, to get authentication. Means first check for ‘Parameters in the provider configuration’ and then ‘Environment variables’ and so on..</p><p>Happy Learnng :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c096c398379" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>