<?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 Bhagia Sheri on Medium]]></title>
        <description><![CDATA[Stories by Bhagia Sheri on Medium]]></description>
        <link>https://medium.com/@bhagiasheri24?source=rss-2a8fc5127a46------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZRKHWCiZhkO0FlVZR6AHXg.jpeg</url>
            <title>Stories by Bhagia Sheri on Medium</title>
            <link>https://medium.com/@bhagiasheri24?source=rss-2a8fc5127a46------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 10:54:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bhagiasheri24/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[ECR image Deployment on EKS | Part — 2]]></title>
            <link>https://medium.com/@bhagiasheri24/ecr-image-deployment-on-eks-part-2-2b4c0b0411f2?source=rss-2a8fc5127a46------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b4c0b0411f2</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[elastickubernetesservice]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[elastic-container-service]]></category>
            <dc:creator><![CDATA[Bhagia Sheri]]></dc:creator>
            <pubDate>Wed, 24 May 2023 17:28:16 GMT</pubDate>
            <atom:updated>2023-05-24T19:16:41.121Z</atom:updated>
            <content:encoded><![CDATA[<h3>ECR image Deployment on EKS | Part — 2</h3><p><em>In my last blog, I discussed the infrastructure of EKS and the </em><strong><em>step-by-step configuration of the EKS cluster, worker nodes, and accessing the cluster from the local machine using AWS CLI and kubectl tool</em></strong><em>. If you haven&#39;t read that you can read it from </em><a href="https://medium.com/@bhagiasheri24/deep-dive-into-elastic-kubernetes-service-eks-infrastructure-and-configuration-steps-part-i-9fee25d9f423"><strong><em>here</em></strong></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EJ-MIeovzAtOR9vwGl9T3w.png" /></figure><h4><strong>Prerequisite:</strong></h4><ul><li>You have the docker image of any application which you want to deploy.</li><li>Docker Image is tested and working locally so that should not cause any issues on the cloud.</li><li>AWS CLI is installed and configured with a security credential or STS token.</li></ul><h3>Steps to Deploy our existing application to EKS:</h3><h4><strong><em>1. Create an ECR image and push it into the repository:</em></strong></h4><p>We will use <strong>AWS Elastic Container Registry (ECR)</strong> Service to create the repository of our existing application and push the docker image into that repository. In my case, I am going to deploy a static website which is <a href="https://www.bhagiasheri.click/"><strong><em>my portfolio</em></strong>.</a></p><ul><li><strong>Create a Repository in ECR Service using the below command:</strong></li></ul><pre>aws ecr create-repository --repository-name &lt;repo-name&gt; --region &lt;region-code&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*9mJ2x7NpixodnTa4WrFc_Q.png" /></figure><p>The repository has been successfully created. Let’s confirm from the AWS console as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EBSggtodbFzkhJBZ-Z_lNg.png" /></figure><ul><li><strong>To deploy the image on the repository, retrieve an authentication token and authenticate your Docker client to your registry.</strong></li></ul><pre>aws ecr get-login-password --region &lt;region-code&gt; | docker login --username AWS --password-stdin &lt;Account-ID&gt;.dkr.ecr.&lt;region-code&gt;.amazonaws.com</pre><p>Note: Before running the command make sure Docker is running on your machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZJ8h1Dkb3HIGSn_4w7l6uA.png" /></figure><ul><li><strong>For the next step, navigate to your project location where the Docker file exists and execute the below command to build a Docker image:</strong></li></ul><pre>docker build -t &lt;image-name&gt; .</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OJLrEpcmc25lo3Zi8Cd6_g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f9OVsUuLbIjZwrPbvAfuvQ.png" /></figure><ul><li><strong>The build is successful, now tag your image so you can push the image to this repository:</strong></li></ul><pre>docker tag &lt;image-name&gt;:latest &lt;Account-ID&gt;.dkr.ecr.&lt;region-code&gt;.amazonaws.com/&lt;image-name&gt;:latest</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LXQDUCNag9lCszpC6ihdJQ.png" /></figure><p>The docker image has been tagged. According to my command, I have tagged into 2023.21.01. You can choose the <strong>latest tag</strong> as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zb1a5sF7VLKTdT6VjdkQEg.png" /></figure><ul><li><strong>Now we will push this image to our created repository:</strong></li></ul><pre>docker push &lt;Account-ID&gt;.dkr.ecr.&lt;region-code&gt;.amazonaws.com/portfolio:latest</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*7Ef9dt0KwoD9W0gbtlYjBg.png" /></figure><p><strong>Now our image has been successfully pushed ECR repository.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tfn7CHWQCDOHntE5jzrxcQ.png" /></figure><h4><strong><em>2. Deploying ECR image to EKS using kubectl:</em></strong></h4><p>Now as we already have EKS infrastructure ready and the ECR image is also been pushed into the repository, all we need to do is deploy the image into the EKS orchestration.</p><ul><li><strong>Create a <em>namespace</em> to logically isolate the resources within the cluster.</strong></li></ul><pre>kubectl create namespace &lt;namespace-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*ggkkWk_idqKusSLbLq5aag.png" /></figure><p>Now to deploy the image in the EKS cluster within the namespace we need the <strong><em>Kubernetes manifest file</em></strong><em> </em>with <strong><em>Service</em></strong> and <strong><em>Deployment </em></strong>resources configuration specific to the application you have to deploy. I am providing the file below. Make changes according to your specifications.</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: &lt;service-name&gt;<br>  namespace: &lt;namespace-name&gt;<br>  labels:<br>    app: my-app<br>spec:<br>  selector:<br>    app: my-app<br>  ports:<br>    - protocol: TCP<br>      port: 80<br>      targetPort: 80<br>  type: LoadBalancer<br>---<br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: &lt;deployment-name&gt;<br>  namespace: &lt;namespace-name&gt;<br>  labels:<br>    app: my-app<br>spec:<br>  replicas: 2<br>  selector:<br>    matchLabels:<br>      app: my-app<br>  template:<br>    metadata:<br>      labels:<br>        app: my-app<br>    spec:<br>      affinity:<br>        nodeAffinity:<br>          requiredDuringSchedulingIgnoredDuringExecution:<br>            nodeSelectorTerms:<br>            - matchExpressions:<br>              - key: beta.kubernetes.io/arch<br>                operator: In<br>                values:<br>                - amd64<br>                - arm64<br>      containers:<br>      - name: web-app<br>        image: &lt;ECR-Image-URL&gt;<br>        ports:<br>        - containerPort: 80  </pre><ul><li><strong>Navigate where you have this file in your project and run the below command:</strong></li></ul><pre>kubectl apply -f &lt;menefist-file-name&gt;.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-UVGUbOzCYyANGwZ11qNhg.png" /></figure><p>ECR image has been successfully deployed on the EKS cluster within a dev-platform namespace. To get the details of deployed service run the below command:</p><pre>kubectl -n &lt;namespace-name&gt; describe service &lt;service-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*znrfMuxrwVeaoTv6bm1JuA.png" /></figure><p><strong>Point to note</strong>, we selected the spec kind “Load Balancer” within the service resource in the manifest file so that&#39;s why Load Balancer automatically has been created to route the traffic towards our application. It means our application only allows requests through the load balance which makes it more robust and secure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ypkkeSUJUkSc46OAKhB_3g.png" /></figure><p><strong><em>If your application is a static website just like in my case, you can access it through the LoadBalancer Ingress URL.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vOpkHLwVsDB9ZSzEXjy9Ew.png" /></figure><blockquote><strong>Note: AWS EKS doesn’t come under the AWS Free Tier Services. If you are creating it for learning purposes then delete the cluster within 1 hour of cluster creation otherwise, you will be charged based on running clusters on an hourly basis.</strong></blockquote><blockquote>See you in some other interesting blogs. Happy Reading :)</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b4c0b0411f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deep Dive into Elastic Kubernetes Service (EKS)Infrastructure and configuration steps | Part — I]]></title>
            <link>https://medium.com/@bhagiasheri24/deep-dive-into-elastic-kubernetes-service-eks-infrastructure-and-configuration-steps-part-i-9fee25d9f423?source=rss-2a8fc5127a46------2</link>
            <guid isPermaLink="false">https://medium.com/p/9fee25d9f423</guid>
            <category><![CDATA[elastickubernetesservice]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[elastic-container-service]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Bhagia Sheri]]></dc:creator>
            <pubDate>Wed, 24 May 2023 17:26:05 GMT</pubDate>
            <atom:updated>2023-06-11T17:06:28.821Z</atom:updated>
            <content:encoded><![CDATA[<h3>Deep Dive into Elastic Kubernetes Service (EKS) Infrastructure and configuration steps | Part — I</h3><p><em>I will introduce AWS Elastic Kubernetes Service (EKS) in this article. It is going to be super fun to set up EKS infrastructure from scratch and then in </em><a href="https://medium.com/@bhagiasheri24/ecr-image-deployment-on-eks-part-2-2b4c0b0411f2"><strong><em>Part — II, we will create the containerized image using the AWS ECR service, and deploy that image to EKS.</em></strong></a></p><blockquote>AWS provides managed Kubernetes service called Elastic Kubernetes Service (EKS) or we can say Kubernetes as a Service (KaaS). The underlying architecture of EKS is the same as Kubernetes, which is an open-source container orchestration platform that allows for automating the deployment, scaling, and management of containerized applications. With EKS we as developers don’t need to worry about managing the Kubernetes control plane or cluster, AWS will manage it for us, but great benefits come with great costs. AWS charge on an hourly basis for the EKS cluster. Each running cluster will cost $0.10 per hour.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pubyx2vXqkHbKjUwERB1tw.png" /></figure><p><em>When we talk about EKS infrastructure, we should at least know a few terminologies like:</em></p><ul><li><strong>Cluster: </strong>Consider it as a master node that is responsible to run the containerized applications within a cluster.</li><li><strong>Worker Nodes: </strong>Consider it as a slave node that is an actual compute resource where the containerized application runs. Within a cluster, there can be multiple running applications.</li><li><strong>Control Plane: </strong>It is responsible for managing and orchestrating the clusters’ resources and managing its tasks such as scheduling, maintaining, and scaling the desired state of the clusters.</li></ul><p><em>AWS manages and operates the Control Plane for us so we can just focus on the development and management of our application. As end users, we are required to set up cluster and worker nodes for EKS infrastructure. We are going to use the AWS console to look at these steps.</em></p><h4>EKS Infrastructure Set-Up Guide:</h4><ol><li><strong>Creating a Master Node (Cluster)</strong></li><li><strong>Accessing the EKS cluster using kubectl</strong></li><li><strong>Creating a Worker Node</strong></li></ol><h3>1. Creating a Master Node (Cluster):</h3><ul><li>Login to AWS Console and search for EKS.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5zRnWNix_1Z09DPHK6rZww.png" /></figure><ul><li>Create a Master Node (Cluster) and give the name to the cluster:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wMvcZw0YS0a2QPcN9DGGXA.png" /></figure><ul><li>For the next step, we need to create a role that has the permission of EKS-Cluster service:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*47evasJ1n0jg_SdQbPvsMw.png" /></figure><ul><li>Role Creation Steps (Search IAM → Go to Roles from sidebar → Click on Create Role button):</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IEn6pRNAUhauc0YETG5zyA.png" /></figure><ul><li>Choose AWS Services as Trust Entity Type:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ET7C-k89fTxnMl4JweqR-w.png" /></figure><ul><li>Choose EKS-Cluster from the dropdown option to select a Use case and hit next:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PeMN2L0Jlnt0Fp-T5vngHA.png" /></figure><ul><li>AWS-managed EKSCluster policy should be added at the next step after the review hit next:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fXN30-NlSZOpcqjO7AjT9w.png" /></figure><ul><li>Give the name to the role and review all information and hit <strong>“create role”</strong>:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4MMGe3mog-fbPum1wYFFOg.png" /></figure><ul><li>Our cluster role has been successfully created and now we can go back to the EKS cluster page and select the role after refreshing the field:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HppLZH_ZEu6_IJc2GegiRQ.png" /></figure><ul><li>After role selecting hit next and specify networking. As a best industry practice, we should create separate VPCs for cluster and worker nodes but here for demo purposes, I am using the default VPC and its subnets provided by AWS:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y2k9z7mMVY4KrsK4JCwQOA.png" /></figure><ul><li>Then choose the default security group (SG) as well as leave other options from the default configuration and hit next:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a_w1GOn-mW_-XZuJVIrG2A.png" /></figure><ul><li>It is a demo so we are not configuring logging but in the production environment, we should enable logging so we can have better visibility:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ra2NWla43jxcbocIg-ME7w.png" /></figure><ul><li>Don’t change anything from <strong>Select add-on</strong> or <strong>configure selected adds-on</strong> <strong>settings, </strong>just hit the next:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7vGHPoyb35mnz_AIzIyAAQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nHZfdcbEtoC1wevdpfHirA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2YNs41GBiup54BbNnr6Zpg.png" /></figure><ul><li>At last review all information and click on <strong>“create”. </strong>It will take some time around 15–20 minutes to create the cluster and resources within the cluster.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CfI6h-GBTLZXWglUoaJe5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tnYLZuz_CTTlDN3HLcA5hA.png" /></figure><p>Our first part of creating the cluster is done here. Till now we wait lets install and configure the <strong>Kubectl </strong>on our system<strong>.</strong></p><h3>2. <strong>Accessing the EKS cluster using kubectl:</strong></h3><p>To install and configure the kubectl tool follow the <a href="https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html">AWS installing kubectl guide</a>.</p><p><strong>We have some prerequisites for accessing the EKS cluster from our computer which is:</strong></p><ul><li><a href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html">AWS CLI is installed</a>.</li><li><a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html">AWS CLI Credentials are Configuration</a> (you can use user IAM user security credentials or AWS Security Token Service (STS) to perform the next steps).</li></ul><p>We need a <strong>kubectl (command line utility) tool </strong>to communicate with the Kubernetes API Server and we want to access it from our local machine so that’s why AWS CLI configuration is required which will allow only authorized users to access the AWS services.</p><p><strong>After configuring the kubectl and having AWS CLI configured you can check the status of the EKS cluster by using this command:</strong></p><pre>aws eks describe-cluster --region &lt;region-code&gt; --name &lt;my-cluster&gt; --query cluster.status</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*xaAj48t5coD5cd79dvpQBA.png" /></figure><p>The status is “<strong>ACTIVE</strong>” which means our cluster has been created successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DDRjnMbBxJQOaVYbYIEyuQ.png" /></figure><p><strong>Let’s configure our local machine to communicate with this cluster using the below command:</strong></p><pre>aws eks update-kubeconfig --region &lt;region-code&gt; --name &lt;my-cluster&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*Lxmx1BkPPqFSxuFByK-gJQ.png" /></figure><p><strong>Now our cluster has been configured in our local machine, let’s test it using this command:</strong></p><pre>kubectl get svc</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*y_4aJ73zndcKJmJgWW8wIg.png" /></figure><p>Here we are done with the setup to access our EKS cluster with our local machine. Now we will create the worker nodes to complete the setup of the EKS infrastructure.</p><h3><strong>3. Creating a Worker Node:</strong></h3><ul><li>Select the newly created cluster and navigate to the <strong>Compute Tab:</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZfE1y5HSedyEYgWvAS-24A.png" /></figure><ul><li>Scroll down to the <strong>Node Groups </strong>section and click the <strong>Add Node Group</strong> button:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sX4YWCHfy1cquAUWej8m7g.png" /></figure><ul><li>Give the name to the node group and we will require separate <strong>IAM Roles</strong> for worker nodes:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qMTNCN17AMlVjFlHOfmjLw.png" /></figure><ul><li>Create Role for Worker nodes same as before with the below configs and permissions:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7lLlhgy0aL5gTwc74ONmYQ.png" /></figure><ul><li>On the permission tab select these 3 permissions and after giving the same name to the role, hit <strong>“create role”</strong>:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VvwkiBwIqCQ7v0oUQU85uQ.png" /></figure><ul><li>Go back to the Node Group tab and select the role and hit next:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b74P4pSzYrSEVElaPFezsA.png" /></figure><ul><li>For demo purposes choose the smallest instance type and disk size:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Spxp4dvFhmgHr6RyQLFf4A.png" /></figure><ul><li>Set up the Node Group scaling policy on which basis AWS EKS will scale in or scale out. Here I am choosing the default ones:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PPxshok3BTTck7VvBvH7Lg.png" /></figure><ul><li>Leave the Networking configuration as default:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MDv7U__Dldz8ybVmdmQCfg.png" /></figure><ul><li>In the end, review the information and create node groups. It will take some time to create both nodes.</li></ul><p>We can check the live status of nodes as well via the below command:</p><pre>kubectl get nodes --watch</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*34SgasP6h8KdMQxMmrgx1Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SF17iR2RidU1Hh7sroTUSQ.png" /></figure><p>Now we have our 2 nodes ready for our k8-controller, and as a result, our EC2 instances also have been created for our worker nodes, let&#39;s check it out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*etuPCFClyZkLDVe5CPmJhA.png" /></figure><p><strong><em>Here I am done with Part — I of this blog where we needed to set up the infrastructure of Elastic Kubernetes Service.</em></strong> <a href="https://medium.com/@bhagiasheri24/ecr-image-deployment-on-eks-part-2-2b4c0b0411f2"><strong><em>In Part — II, I will cover how to do deployment on the EKS Cluster using an ECR image.</em></strong></a></p><blockquote><strong>Note: AWS EKS doesn’t come under the AWS Free Tier Services. If you are creating it for learning purposes then delete the cluster within 1 hour of cluster creation otherwise, you will be charged based on running clusters on an hourly basis.</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9fee25d9f423" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>