<?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 Saeid Bostandoust on Medium]]></title>
        <description><![CDATA[Stories by Saeid Bostandoust on Medium]]></description>
        <link>https://medium.com/@ssbostan?source=rss-4b112926931c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8gn4mLFkFCNwFPwpZw8LIA.jpeg</url>
            <title>Stories by Saeid Bostandoust on Medium</title>
            <link>https://medium.com/@ssbostan?source=rss-4b112926931c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 18 Jul 2026 22:03:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ssbostan/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 EKS — Part 1 — Deploy EKS Cluster Requirements]]></title>
            <link>https://itnext.io/aws-eks-part-1-deploy-eks-cluster-requirements-857e303aa533?source=rss-4b112926931c------2</link>
            <guid isPermaLink="false">https://medium.com/p/857e303aa533</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cluster]]></category>
            <category><![CDATA[aws-eks]]></category>
            <category><![CDATA[k8s]]></category>
            <dc:creator><![CDATA[Saeid Bostandoust]]></dc:creator>
            <pubDate>Mon, 18 Dec 2023 13:31:06 GMT</pubDate>
            <atom:updated>2023-12-18T17:07:30.338Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS EKS — Part 1 — Deploy EKS Cluster Requirements</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*E9HuAlzhCpUMyvD2bwRO8w.png" /></figure><p>We proudly announce that we will publish the most comprehensive FREE AWS EKS tutorial. In this series of articles, you will learn how to work deeply with AWS EKS and deploy, manage, upgrade, and operate EKS clusters through the command line “also planned for CloudFormation, Terraform, OpenTofu, Pulumi and Ansible”. EKS stands for Elastic Kubernetes Service and is the AWS-managed Kubernetes you can deploy and use with ease. Easily? Although deploying and managing EKS clusters is easier than On-premises Kubernetes deployments, it has its own challenges.</p><h3>Follow our social media:</h3><p><a href="https://www.linkedin.com/in/ssbostan">https://www.linkedin.com/in/ssbostan</a></p><p><a href="https://www.linkedin.com/company/kubedemy">https://www.linkedin.com/company/kubedemy</a></p><p><a href="https://www.youtube.com/@kubedemy">https://www.youtube.com/@kubedemy</a></p><p><a href="https://telegram.me/kubedemy">https://telegram.me/kubedemy</a></p><h3>Watch on YouTube:</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F7LvIes2HUTc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D7LvIes2HUTc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F7LvIes2HUTc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e2eec349b151ba848b8c53fa48461f6/href">https://medium.com/media/2e2eec349b151ba848b8c53fa48461f6/href</a></iframe><h3>EKS cluster pre-requirements:</h3><p>To deploy an EKS cluster, we need a couple of other AWS resources:</p><ul><li>An IAM user to deploy cluster and resources and be the cluster owner.</li><li>AWS CLI setup and configured to create required resources.</li><li>An AWS VPC in any EKS-supported region to act as the network infrastructure.</li><li>A couple of public and private subnets to deploy Kubernetes worker nodes.</li><li>An Internet Gateway to be able to connect to the internet from public subnets.</li><li>A NAT Gateway for private subnets to be able to access the internet.</li><li>A new Route Table and NAT Gateway route for private subnets.</li><li>An EC2 keypair to be able to connect to EC2 instances.</li></ul><h3>Step 1 — Create an IAM user:</h3><p>Connect to your AWS account with the root user and create a new IAM user for the next steps. We use this IAM user to create, deploy, manage, etc., in this article and all future articles. Never delete this IAM user, as it will be the owner of the EKS cluster.</p><p>IAM &gt; Users &gt; Add users &gt; Set username &gt; Set <strong>AdministratorAccess</strong> policy.</p><p>After creating the user, create an <strong>access key</strong> from the Security credentials.</p><p>Note: I set the <strong>AdministratorAccess</strong> policy to avoid challenging permissions. You must create an IAM principal with the least privileges to avoid security pitfalls. AWS IAM service and permissions will be explained in a separate thread.</p><h3>Step 2 — Setup AWS CLI:</h3><p>There are many ways to install and use AWS CLI; as we love containers, we run it inside one using the lovely Docker. You can also use other methods.</p><pre>docker run -d --name aws-cli --entrypoint sleep amazon/aws-cli infinity</pre><pre>docker exec -it aws-cli bash</pre><p>Now, we are inside the AWS CLI container.</p><h3>Step 3 — Configure AWS CLI and environment:</h3><p>To setup our environment, we use the previously created IAM user credentials.</p><pre>bash-4.2# aws configure<br>AWS Access Key ID [None]: YOUR ACCESS KEY HERE<br>AWS Secret Access Key [None]: YOUR SECRET KEY HERE<br>Default region name [None]: eu-west-2<br>Default output format [None]: json</pre><p>Note: You can use any EKS-supported region you want.</p><p>To confirm your configuration, run the following command:</p><pre>aws sts get-caller-identity</pre><p>The output should be something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/0*wciIunQ2SNarRU5Q.png" /></figure><p>Here is the architecture diagram of what we did in the previous steps:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/0*ChrxVU0ZY27-Up29.gif" /></figure><h3>Step 4 — Create VPC:</h3><p>Run the following command to create a new VPC in your region:</p><pre>bash-4.2# aws ec2 create-vpc \<br>  --cidr-block 10.0.0.0/16 \<br>  --tag-specifications &quot;ResourceType=vpc,Tags=[{Key=owner,Value=kubedemy}]&quot;</pre><pre>{<br>    &quot;Vpc&quot;: {<br>        &quot;CidrBlock&quot;: &quot;10.0.0.0/16&quot;,<br>        &quot;DhcpOptionsId&quot;: &quot;dopt-0c3ad00db38b27d36&quot;,<br>        &quot;State&quot;: &quot;pending&quot;,<br>        &quot;VpcId&quot;: &quot;vpc-09a71d02067cf835d&quot;,<br>        &quot;OwnerId&quot;: &quot;231144931069&quot;,<br>        &quot;InstanceTenancy&quot;: &quot;default&quot;,<br>        &quot;Ipv6CidrBlockAssociationSet&quot;: [],<br>        &quot;CidrBlockAssociationSet&quot;: [<br>            {<br>                &quot;AssociationId&quot;: &quot;vpc-cidr-assoc-0aa226721dfc1c806&quot;,<br>                &quot;CidrBlock&quot;: &quot;10.0.0.0/16&quot;,<br>                &quot;CidrBlockState&quot;: {<br>                    &quot;State&quot;: &quot;associated&quot;<br>                }<br>            }<br>        ],<br>        &quot;IsDefault&quot;: false,<br>        &quot;Tags&quot;: [<br>            {<br>                &quot;Key&quot;: &quot;owner&quot;,<br>                &quot;Value&quot;: &quot;kubedemy&quot;<br>            }<br>        ]<br>    }<br>}</pre><p>By running the aws ec2 create-vpc command, you create a new VPC, giving you the VPC ID and some information. We need VPC ID for further steps.</p><pre>aws ec2 describe-vpcs</pre><p>This command also shows you the list of available VPCs in this region.</p><p>Note: You can ignore this step if you already have a VPC in your active region. Just run aws ec2 describe-vpcs and find the VPC ID for further steps.</p><h3>Step 5 — Enable VPC DNS Hostnames feature:</h3><p>Kubernetes worker nodes join the cluster control plane using their DNS hostname, and the control plane verifies them in the same way. So, we must enable the <strong>DNS Hostnames</strong> feature of VPC to make it possible to setup the EKS cluster.</p><p>Replace the VPC ID with your own VPC ID from the last command.</p><pre>aws ec2 modify-vpc-attribute --vpc-id vpc-09a71d02067cf835d --enable-dns-hostnames</pre><h3>Step 6 — Create Public Subnets:</h3><p>In each <strong>Availability Zone</strong>, we need at least two subnets, one public and one private. You can ignore creating any of them, but I will create both public and private subnets for future articles and explain how we can setup clusters in both cases.</p><p>To see all availability zones in the active region, run the following command:</p><pre>aws ec2 describe-availability-zones</pre><p><strong>Setup public subnets, Internet gateway and route:</strong></p><p>Replace the VPC ID and Availability Zone name with your own.</p><pre>aws ec2 create-subnet \<br>  --vpc-id vpc-09a71d02067cf835d \<br>  --cidr-block 10.0.1.0/24 \<br>  --availability-zone eu-west-2a \<br>  --tag-specifications &quot;ResourceType=subnet,Tags=[{Key=owner,Value=kubedemy}]&quot;</pre><pre>aws ec2 create-subnet \<br>  --vpc-id vpc-09a71d02067cf835d \<br>  --cidr-block 10.0.2.0/24 \<br>  --availability-zone eu-west-2b \<br>  --tag-specifications &quot;ResourceType=subnet,Tags=[{Key=owner,Value=kubedemy}]&quot;</pre><pre>aws ec2 create-subnet \<br>  --vpc-id vpc-09a71d02067cf835d \<br>  --cidr-block 10.0.3.0/24 \<br>  --availability-zone eu-west-2c \<br>  --tag-specifications &quot;ResourceType=subnet,Tags=[{Key=owner,Value=kubedemy}]&quot;</pre><p>Running each command will show you the Subnet ID of the created subnet.</p><p>Important: To deploy worker nodes to a public subnet, the subnet must automatically assign a public IPv4 IP address to nodes. <strong>Without a public IP address, the process of joining worker nodes to the cluster will fail.</strong></p><p>To enable it, run the following command for each public subnet:</p><pre>aws ec2 modify-subnet-attribute --subnet-id subnet-0ff015478090c2174 --map-public-ip-on-launch</pre><pre>aws ec2 modify-subnet-attribute --subnet-id subnet-01b107cea804fdff1 --map-public-ip-on-launch</pre><pre>aws ec2 modify-subnet-attribute --subnet-id subnet-09b7d720aca170608 --map-public-ip-on-launch</pre><p>Now create an <strong>Internet Gateway</strong> using the following command:</p><pre>aws ec2 create-internet-gateway --tag-specifications &quot;ResourceType=internet-gateway,Tags=[{Key=owner,Value=kubedemy}]&quot;</pre><p>Assign it to your VPC using this command:</p><pre>aws ec2 attach-internet-gateway \<br>  --vpc-id vpc-09a71d02067cf835d \<br>  --internet-gateway-id igw-046c41e4bc7f0ad14</pre><p>Find the default route table ID and create a new route to the internet gateway:</p><pre>aws ec2 describe-route-tables</pre><pre>aws ec2 create-route \<br>  --route-table-id rtb-0c418972dc98d43ed \<br>  --destination-cidr-block 0.0.0.0/0 \<br>  --gateway-id igw-046c41e4bc7f0ad14</pre><p>If it returns <strong>True</strong>, it means everything is good.</p><h3>Step 7 — Create Private Subnets:</h3><p>AWS recommends deploying Kubernetes worker nodes in private subnets, and to access the internet, they must use <strong>NAT Gateway</strong> “for IPv4” and <strong>Egress-only Internet Gateway</strong> “for IPv6” Egress-only is free, but for NAT Gateway, you have to pay at least $1/day without any usage. You can ignore this step if you don’t want to pay for NAT Gateway, and you can come back to this step when I explain deploying clusters in Private subnets.</p><p><strong>Setup private subnets, NAT Gateway, Route table and route:</strong></p><pre>aws ec2 create-subnet \<br>  --vpc-id vpc-09a71d02067cf835d \<br>  --cidr-block 10.0.11.0/24 \<br>  --availability-zone eu-west-2a \<br>  --tag-specifications &quot;ResourceType=subnet,Tags=[{Key=owner,Value=kubedemy}]&quot;</pre><pre>aws ec2 create-subnet \<br>  --vpc-id vpc-09a71d02067cf835d \<br>  --cidr-block 10.0.12.0/24 \<br>  --availability-zone eu-west-2b \<br>  --tag-specifications &quot;ResourceType=subnet,Tags=[{Key=owner,Value=kubedemy}]&quot;</pre><pre>aws ec2 create-subnet \<br>  --vpc-id vpc-09a71d02067cf835d \<br>  --cidr-block 10.0.13.0/24 \<br>  --availability-zone eu-west-2c \<br>  --tag-specifications &quot;ResourceType=subnet,Tags=[{Key=owner,Value=kubedemy}]&quot;</pre><p>To create a new route table:</p><pre>aws ec2 create-route-table \<br>  --vpc-id vpc-09a71d02067cf835d \<br>  --tag-specifications &quot;ResourceType=route-table,Tags=[{Key=owner,Value=kubedemy}]&quot;</pre><p>Now associate the new route table to private subnets:</p><pre>aws ec2 associate-route-table \<br>  --route-table-id rtb-04e5f753ba648101f \<br>  --subnet-id subnet-02a9b470ef3111fd4</pre><pre>aws ec2 associate-route-table \<br>  --route-table-id rtb-04e5f753ba648101f \<br>  --subnet-id subnet-066e961abfc243923</pre><pre>aws ec2 associate-route-table \<br>  --route-table-id rtb-04e5f753ba648101f \<br>  --subnet-id subnet-0774243a62c6808aa</pre><p>Important: Now we have to create a NAT Gateway. NAT Gateway should be created in a public subnet with internet access through Internet Gateway. We have three public subnets in our example, and we can use one of them.</p><p>Before creating a NAT Gateway, we need an Elastic IP. To create one, run:</p><pre>aws ec2 allocate-address \<br>  --domain vpc \<br>  --tag-specifications &quot;ResourceType=elastic-ip,Tags=[{Key=owner,Value=kubedemy}]&quot;</pre><p>Now run the following command to create a NAT Gateway:</p><pre>aws ec2 create-nat-gateway \<br>  --allocation-id eipalloc-0c87f9d1007e5ed0a \<br>  --subnet-id subnet-0ff015478090c2174 \<br>  --tag-specifications &quot;ResourceType=natgateway,Tags=[{Key=owner,Value=kubedemy}]&quot; \<br>  --connectivity-type public</pre><p>Attention: AWS charges you for NAT Gateway and Elastic IP. Delete them after implementing this lab and recreate them in the next labs as needed.</p><p>To allow private subnets to connect to the internet, add the following route:</p><pre>aws ec2 create-route \<br>  --route-table-id rtb-04e5f753ba648101f \<br>  --destination-cidr-block 0.0.0.0/0 \<br>  --nat-gateway-id nat-0930f9f4426b9c43d</pre><p>If it returns <strong>True</strong>, it means everything is good.</p><p>Here is the architecture diagram of what we did in the previous steps:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QE7Ph2Jo3W7XPwPc.gif" /></figure><h3>Step 8 — Import SSH Key pair:</h3><p>Although we recommend not doing SSH to worker nodes and using the in-cluster method for debugging purposes, I will introduce some related things in the next articles. So, we create an SSH key on our local machine and import the public key into our AWS account. You can also create a keypair in the AWS Dashboard and download its private key.</p><p>To create a new key pair, run the following command:</p><pre>aws ec2 create-key-pair \<br>  --key-name kubedemy \<br>  --key-type ed25519 \<br>  --tag-specifications &quot;ResourceType=key-pair,Tags=[{Key=owner,Value=kubedemy}]&quot; \<br>  --key-format pem \<br>  --query &quot;KeyMaterial&quot; \<br>  --output text &gt; kubedemy.pem</pre><p>It creates a key pair and saves the private key into kubedemy.pem file.</p><h3>Conclusion:</h3><p>So far, we created all requirements to deploy EKS clusters in both public and private subnets. In the next articles, we will work on deploying the Kubernetes cluster.</p><p>If you like this series of articles, please share them and write your thoughts as comments here. Your feedback encourages me to complete this massively planned program. Just share them and provide feedback. I’ll make you an AWS EKS black belt.</p><p>Follow my LinkedIn <a href="https://www.linkedin.com/in/ssbostan">https://www.linkedin.com/in/ssbostan</a></p><p>Follow Kubedemy LinkedIn <a href="https://www.linkedin.com/company/kubedemy">https://www.linkedin.com/company/kubedemy</a></p><p>Follow Kubedemy Telegram <a href="https://telegram.me/kubedemy">https://telegram.me/kubedemy</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=857e303aa533" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/aws-eks-part-1-deploy-eks-cluster-requirements-857e303aa533">AWS EKS — Part 1 — Deploy EKS Cluster Requirements</a> was originally published in <a href="https://itnext.io">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS EKS Black Belt Course]]></title>
            <link>https://ssbostan.medium.com/aws-eks-black-belt-course-ce0540c2c791?source=rss-4b112926931c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce0540c2c791</guid>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[ek]]></category>
            <category><![CDATA[aws-eks]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Saeid Bostandoust]]></dc:creator>
            <pubDate>Thu, 12 Oct 2023 12:10:01 GMT</pubDate>
            <atom:updated>2024-01-29T15:18:44.252Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*SkBpRxQMESUOvOeMIutDtw.png" /></figure><p>Register at <a href="https://kubedemy.io/aws-eks-black-belt-course">https://kubedemy.io/aws-eks-black-belt-course</a></p><p>Hello and welcome to the most complete AWS EKS course, Black Belt Course.</p><p>This course is created for those who want to learn AWS EKS and Kubernetes in depth. AWS EKS is an AWS-managed Kubernetes service, which stands for Elastic Kubernetes Service. Many companies are looking to migrate their applications to Kubernetes, especially EKS, and because of that, it’s super important for all Cloud engineers, Platform engineers, DevOps engineers and Kubernetes engineers to have hands-on experience with EKS and Kubernetes. So, if you want to learn EKS, join this course for free.</p><p>The last update was on <strong>29 Jan 2023</strong> to help you find the latest changes.</p><h3>AWS EKS is super easy as it’s a managed service:</h3><p>Although EKS is a managed service, there are many topics you should learn before using EKS “also Kubernetes” to run your production workloads. Upgrading cluster, worker nodes, addons. Configuring storage, network, network policies, load balancers, ingress controller, and subnets. Managing costs, monitoring, logging, and application performance. Cluster security, network security, application security, supply chain security and many more topics that we will cover all of them in this course.</p><h3>Course program and materials:</h3><ul><li><strong>54 EKS-focused articles specially written for AWS EKS environments.</strong> <strong>(FREE)</strong></li><li>All related awscli commands to deploy and test scenarios. <strong>(FREE)</strong></li><li>Terraform codes to setup and deploy environments through automation. <strong>(FREE)</strong></li><li>Question and answer chat forum to support students. <strong>(FREE)</strong></li><li>Face-to-face online consultation meetings for companies and enterprises. (Paid)</li><li>Design and Implementation services for companies and enterprises. (Paid)</li><li>Troubleshooting sessions for companies and enterprises. (Paid)</li></ul><h3>Course details:</h3><p>The course starts on <strong>06 Nov 2023</strong> and ends on <strong>11 Nov 2024</strong>, and every article will be published at 9 a.m. UTC every Monday. We may continue the course for another year with new articles, which depends on participants’ and sponsors’ welcome.</p><h3>AWS EKS tutorial free registration:</h3><p><a href="https://kubedemy.io/ssbostan/aws-eks-black-belt-course">AWS EKS Black Belt Course | Kubedemy</a></p><h3>Become sponsor:</h3><p>We always welcome our sponsors, and we believe that together, we can build better communities and experiences. If you’re interested in supporting this course and promoting your products, please send a sponsoring request. Right now, we accept <strong>Credit sponsors</strong> and <strong>Content sponsors</strong>, explained in the following form:</p><p><a href="https://docs.google.com/forms/d/e/1FAIpQLSdLxonuxgwPSaPyhaJu2Lg383n4oPXM60-KCkCX-3BdEdMM9w/viewform?usp=sf_link">Become the AWS EKS Black Belt course sponsor</a></p><h3>AWS EKS Black Belt Course topics:</h3><p><a href="https://kubedemy.io/aws-eks-part-1-deploy-eks-cluster-requirements">AWS EKS — Part 1 — Deploy EKS cluster requirements</a></p><p><a href="https://kubedemy.io/aws-eks-part-2-deploy-cluster-control-plane">AWS EKS — Part 2 — Deploy managed cluster control plane</a></p><p><a href="https://kubedemy.io/aws-eks-part-3-deploy-worker-nodes-using-managed-nodegroups">AWS EKS — Part 3 — Deploy worker nodes using managed node groups</a></p><p><a href="https://kubedemy.io/aws-eks-part-4-deploy-worker-nodes-using-custom-launch-templates">AWS EKS — Part 4 — Deploy worker nodes using custom launch templates</a></p><p><a href="https://kubedemy.io/aws-eks-part-5-deploy-self-managed-worker-nodes">AWS EKS — Part 5 — Deploy self-managed worker nodes</a></p><p><a href="https://kubedemy.io/aws-eks-part-6-deploy-bottlerocket-workers-and-update-operator">AWS EKS — Part 6 — Deploy Bottlerocket worker nodes and update operator</a></p><p><a href="https://kubedemy.io/aws-eks-part-7-deploy-arm-based-kubernetes-worker-nodes">AWS EKS — Part 7 — Deploy ARM-based Kubernetes Worker nodes</a></p><p><a href="https://kubedemy.io/aws-eks-part-8-deploy-worker-nodes-using-spot-instances">AWS EKS — Part 8 — Deploy Worker nodes using Spot Instances</a></p><p><a href="https://kubedemy.io/aws-eks-part-9-deploy-worker-nodes-using-fargate-instances">AWS EKS — Part 9 — Deploy Worker nodes using Fargate Instances</a></p><p><a href="https://kubedemy.io/aws-eks-part-10-deploy-cluster-with-private-api-endpoint">AWS EKS — Part 10 — Deploy cluster with private API endpoint</a></p><p><a href="https://kubedemy.io/aws-eks-part-11-deploy-workers-in-private-subnets-behind-nat-gateway">AWS EKS — Part 11 — Deploy workers in private subnets behind the NAT gateway</a></p><p>AWS EKS — Part 12 — Deploy fully air-gapped EKS clusters without internet</p><p>AWS EKS — Part 13 — Setup IAM Roles for Service Accounts (IRSA)</p><p>AWS EKS — Part 14 — Restrict IMDS access to secure AWS account access</p><p>AWS EKS — Part 15 — Enable Secrets encryption at rest with AWS KMS Service</p><p>AWS EKS — Part 16 — Enable Cluster logging with AWS CloudWatch Service</p><p>AWS EKS — Part 17 — Kubernetes Authentication with AWS IAM Principal</p><p>AWS EKS — Part 18 — Kubernetes Authentication with OIDC and Kubelogin</p><p>AWS EKS — Part 19 — Deploy and manage Amazon EKS Cluster Addons</p><p>AWS EKS — Part 20 — Upgrade EKS Cluster and Worker nodes</p><p>AWS EKS — Part 21 — Delete EKS Cluster and dependent resources</p><p>AWS EKS — Part 22 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 23 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 24 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 25 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 26 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 27 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 28 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 29 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 30 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 31 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 32 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 33 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 34 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 35 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 36 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 37 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 38 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 39 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 40 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 41 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 42 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 43 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 44 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 45 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 46 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 47 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 48 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 49 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 50 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 51 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 52 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 53 — <em>The title is Hidden — Exposed Soon.</em></p><p>AWS EKS — Part 54 — <em>The title is Hidden — Exposed Soon.</em></p><h3>Course materials and license:</h3><p><a href="https://github.com/kubedemy/aws-eks-black-belt-course">https://github.com/kubedemy/aws-eks-black-belt-course</a></p><p>If you like this series of articles, please share them and write your thoughts as comments here. Your feedback encourages me to complete this massively planned program. Just share them and provide feedback. I’ll make you an AWS EKS black belt.</p><p>Follow my LinkedIn <a href="https://www.linkedin.com/in/ssbostan">https://www.linkedin.com/in/ssbostan</a></p><p>Follow Kubedemy LinkedIn <a href="https://www.linkedin.com/company/kubedemy">https://www.linkedin.com/company/kubedemy</a></p><p>Follow Kubedemy Telegram <a href="https://telegram.me/kubedemy">https://telegram.me/kubedemy</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce0540c2c791" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Hacks and Tricks — #8 Pod Preemption, Eviction and Priority classes]]></title>
            <link>https://itnext.io/kubernetes-hacks-and-tricks-8-pod-preemption-eviction-and-priority-classes-9ea8be74411f?source=rss-4b112926931c------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ea8be74411f</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubelet]]></category>
            <category><![CDATA[priorityclass]]></category>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[kube-scheduler]]></category>
            <dc:creator><![CDATA[Saeid Bostandoust]]></dc:creator>
            <pubDate>Mon, 17 Apr 2023 15:06:47 GMT</pubDate>
            <atom:updated>2023-04-17T15:20:56.839Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubernetes Hacks and Tricks — #8 Pod Preemption, Eviction and Priority classes</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*f9ubaQdtM76V2JxTim1qsw.png" /></figure><p>In the previous article, we learnt about QoS classes in Kubernetes and how Kubernetes evicts Pods if node resources are running out. Now it’s time to be familiar with the PriorityClass resource in Kubernetes. Imagine you have a bunch of Pods with the same QoS class in the worker node, and the worker node’s resources are running out! How should Kubernetes decide which Pod should be evicted to free up node resources? Here is where that PriorityClass comes into the picture. Priority class lets you prioritise your workloads and tell Kubernetes which ones are more important and in the time of node pressure, which ones should be evicted first.</p><p><strong>Read the previous article about Kubernetes QoS classes:</strong></p><p><a href="https://itnext.io/kubernetes-hacks-and-tricks-7-pod-and-container-resource-and-qos-classes-86e55c5bd47d">Kubernetes Hacks and Tricks — #7 Pod and Container Resource and QoS classes</a></p><p><strong>In Kubernetes, PriorityClass has two use cases:</strong></p><p>1- Helps <strong>kube-scheduler</strong> to evict low-priority Pods when a high-priority Pod is waiting in Pending mode in the queue due to lack of resources.</p><p>2- Helps <strong>kubelet</strong> to evict Pods when the node is under pressure and other high-priority Pods need more resources to do their job. Note that there is a hidden rule in this type of eviction.</p><h3>Default Kubernetes Priority classes:</h3><p>Kubernetes comes with two default “system” priority classes to save cluster and node critical workloads in pressure situation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*ATqO4kqFSSjUqryXENgWtQ.png" /></figure><p>Cluster-critical priority class should be used when the location of the application does not matter. For example Prometheus monitoring system.</p><p>Node-critical priority class should be used for all applications that need to be run on specific nodes only. For example Node-exporter, CSI node plugin, CNI node plugin, etc.</p><h3>Create your own PriorityClass:</h3><p>PriorityClass name cannot be started with system- as it is reserved for Kubernetes itself. Value can be -2147483648 to 1000000000. The higher value higher the priority. The <strong>default</strong> priority class is used for all the Pods that have not specified priorityClassName.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/39d85329756de321763eeae31a161970/href">https://medium.com/media/39d85329756de321763eeae31a161970/href</a></iframe><p>When <strong>preemptionPolicy</strong> is set to Never, the scheduler will not evict any other Pods to schedule pending Pods of this priority class.</p><h3>How to use PriorityClass:</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/86dea5e60556c82dbf59f1f02eb05e1b/href">https://medium.com/media/86dea5e60556c82dbf59f1f02eb05e1b/href</a></iframe><p>If you don’t assign any <strong>priorityClassName</strong> to the Pod, the global <strong>default</strong> priority class will be used for pod.</p><h3>Important note about node pressure eviction:</h3><p><em>This is the hidden rule!</em> <strong>kubelet</strong> node-pressure eviction does not evict Pods when their usage does not exceed their requests. If a Pod with lower priority is not exceeding its requests, it won’t be evicted. Another Pod with higher priority that exceeds its requests may be evicted.</p><h3>Conclusion and Best Practices:</h3><p>Understanding Kubernetes scheduling and the kubelet eviction process can help you deploy reliable and highly available workloads on Kubernetes. For every workload, you need to use proper QoS and Priority classes. For all cluster and node critical workloads, you have to specify system priority classes created by Kubernetes itself. Kubernetes has not defined any default priority class, and you need to create your default priority class.</p><p>If you liked it, like it.</p><p>Follow my LinkedIn <a href="https://www.linkedin.com/in/ssbostan">https://www.linkedin.com/in/ssbostan</a></p><p>Follow my Twitter <a href="https://twitter.com/saeidbostan">https://twitter.com/saeidbostan</a></p><p>Good luck.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ea8be74411f" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/kubernetes-hacks-and-tricks-8-pod-preemption-eviction-and-priority-classes-9ea8be74411f">Kubernetes Hacks and Tricks — #8 Pod Preemption, Eviction and Priority classes</a> was originally published in <a href="https://itnext.io">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Hacks and Tricks — #7 Pod and Container Resource and QoS classes]]></title>
            <link>https://itnext.io/kubernetes-hacks-and-tricks-7-pod-and-container-resource-and-qos-classes-86e55c5bd47d?source=rss-4b112926931c------2</link>
            <guid isPermaLink="false">https://medium.com/p/86e55c5bd47d</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[qos]]></category>
            <category><![CDATA[hacks]]></category>
            <dc:creator><![CDATA[Saeid Bostandoust]]></dc:creator>
            <pubDate>Thu, 30 Mar 2023 17:16:54 GMT</pubDate>
            <atom:updated>2023-03-30T17:40:43.911Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubernetes Hacks and Tricks — #7 Pod and Container Resource and QoS classes</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*FDBXdhk4lT1AQI8l530PSw.png" /></figure><p>You know how Kubernetes decide to find which Pods should be evicted if node resource is not enough or is running out? In this article, we’ll talk about this and introduce Kubernetes Quality of Service classes related to this topic.</p><h3>What is Node Pressure?</h3><p>Node pressure is a term that explains the worker node’s resources are running out. Pressure means something got limited on the worker node, which can be Memory, Storage, PID space, etc… When the worker node gets pressured, Kubelet tries to free up its resources, which means some Pods should be evicted on the node, meaning the application should go down and run somewhere else. Finally, it means you will experience some downtime in your system, and it’s a nightmare for everyone.</p><h3>Kubernetes Quality of Service(QoS) classes:</h3><p>Kubernetes comes with <strong>3</strong> default QoS classes which help Kubernetes determine which pods should be evicted first on rainy days. The possible QoS classes are <strong>Guaranteed</strong>, <strong>Burstable</strong> and <strong>BestEffort</strong>. When a Node runs out of resources, Kubernetes will first evict BestEffort Pods running on that Node, followed by Burstable and finally Guaranteed Pods.</p><h4>BestEffort QoS class:</h4><p>When you don’t specify any resources for containers within a Pod, the Pod will be run in this QoS class. This class has the minimum priority in the cluster, and the Pods of this class are the first candidate to be evicted when the node is under pressure.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8a9c19d02336ed914a30d7a8c52ff416/href">https://medium.com/media/8a9c19d02336ed914a30d7a8c52ff416/href</a></iframe><p><strong>BestEffort</strong> means containers can use resources as much as they can, and because you didn’t provide any <strong>requests</strong> and <strong>limits</strong>, there is no guarantee for them to be alive as you expect. They can use node resources if any resource is available, and they are the first target for eviction if the node is faced with pressure. They make their best effort, and you need to pray and hope they will be running as long as you expect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*posslrjowYCaEJOWUNnH2Q.png" /></figure><h4>Burstable QoS class:</h4><p>Burstable class is the one you provide requests and limits for all the containers in the Pod, but the amount of memory and CPU of requests is less than the limits. Kubernetes scheduler schedules Pods based on their resource <strong>requests</strong> and has nothing to do with limits. Resource <strong>limits</strong> get enforced when the Pod runs on the worker node, and if it tries to consume more than limits, Kubelet kills it. Still, there is another hidden fact about this type of QoS class! there is no guarantee that the worker node can provide resources up to Pod’s limits. If Pod get scheduled on a worker node “based on requests”, and the worker node resources go under pressure due to “lack of available physical resource”, and the container tries to consume more resources than requests “as it expects to use up to limits”, Kubelet may kill containers of this QoS class if some Pods with Guaranteed QoS classes need to consume more resources in that node.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/61c9cf770343de5a589f4fa70eee04bf/href">https://medium.com/media/61c9cf770343de5a589f4fa70eee04bf/href</a></iframe><p>So you need to be cautious and know what exactly you are doing in cluster and worker node and how much resources you need now and in the future. Note that if you set an inappropriate amount of resources, you may go overutilization and BOOOM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gUsXuf_tSDQ63zJGbRu7EA.png" /></figure><h4>Guaranteed QoS class:</h4><p>The best one for app, bad one for your pocket. When you provide both requests and limits with the same value, your Pod will run in the Guaranteed QoS class. It means it will be the last candidate evicted from the node. You should be aware of two important things. The first one is how much resources your Pod really needs, and the second one is how to spread your Pods across worker nodes to prevent node underutilization. Kubernetes scheduler schedules based on resource requests, and if you set requests and limits with the same values but less than Pod really needs, your Pod will be scheduled on the node, but it gets restarted with “Out Of Memory” kill status when it tries to consume more than limits. On the other hand, if you set more than what it needs, your node will go underutilization, and you should pay for what you do not use.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7576c5c2968a7628796f4d8acce83726/href">https://medium.com/media/7576c5c2968a7628796f4d8acce83726/href</a></iframe><p>To run Pods with Guaranteed QoS class, create a proper spread topology to avoid going underutilized, and run fair stress tests just like your real-world traffic on the application to find the right resource needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RAsnKJCnwZuiZ1WSMafgag.png" /></figure><h3>Conclusion:</h3><p><strong>BestEffort</strong> has the minimum priority and it’s the first candidate to be evicted from worker node. There is no guarantee that it will be run properly with adequate resources. It can get evicted anytime.</p><p><strong>Burstable</strong> has the second priority, and in the case of node pressure, it will be evicted after BestEffort containers. Setting the wrong amount of requests/limits can cause overutilization and significantly impact all of the running Pods on the node.</p><p><strong>Guaranteed</strong> has the last priority and will get evicted after Burstable pods. Setting an inappropriate amount of resources causes Pod getting into an infinity restart loop, node underutilization, or, if you set more than what you have, in Pending state.</p><p>Keep your eyes open for the following articles about spread topologies and priority classes to learn how you should deploy production-grade workloads in Kubernetes clusters.</p><p>If you liked it, like it.</p><p>Follow my LinkedIn <a href="https://www.linkedin.com/in/ssbostan">https://www.linkedin.com/in/ssbostan</a></p><p>Good luck.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86e55c5bd47d" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/kubernetes-hacks-and-tricks-7-pod-and-container-resource-and-qos-classes-86e55c5bd47d">Kubernetes Hacks and Tricks — #7 Pod and Container Resource and QoS classes</a> was originally published in <a href="https://itnext.io">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Hacks and Tricks — #6 Find Pods running from deprecated registry]]></title>
            <link>https://itnext.io/kubernetes-hacks-and-tricks-6-find-pods-running-from-deprecated-registry-34044996c858?source=rss-4b112926931c------2</link>
            <guid isPermaLink="false">https://medium.com/p/34044996c858</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[registry]]></category>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[image]]></category>
            <dc:creator><![CDATA[Saeid Bostandoust]]></dc:creator>
            <pubDate>Wed, 22 Mar 2023 23:45:20 GMT</pubDate>
            <atom:updated>2023-03-23T07:51:18.577Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubernetes Hacks and Tricks — #6 Find Pods running from deprecated registry</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*UStwuCAMhWWdM7YePBQitw.png" /></figure><p>As you know, recently, Kubernetes changed its main repository from <strong>k8s.gcr.io</strong> to <strong>registry.k8s.io</strong>, meaning you should update your manifests as soon as possible. In this note, I tell you how you can find running Pods using the legacy Kubernetes image registry.</p><p><a href="https://kubernetes.io/blog/2023/03/10/image-registry-redirect/">https://kubernetes.io/blog/2023/03/10/image-registry-redirect</a></p><p>The following command list all running Pods in your cluster, along with their namespaces and image address.</p><pre>kubectl get po -A -o jsonpath=&#39;{range .items[*]}{&quot;namespace=&quot;}{.metadata.namespace}{&quot; &quot;}{&quot;pod=&quot;}{.metadata.name}{&quot; &quot;}{range .spec.containers[*]}{&quot;image=&quot;}{.image}{&quot; &quot;}{end}{&quot;\n&quot;}{end}&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wVmKnbZmf3qtuM1WC6xsng.png" /></figure><p>Now, to find Pods using <strong>k8s.gcr.io </strong>you can grep the result.</p><pre>kubectl get po -A -o jsonpath=&#39;{range .items[*]}{&quot;namespace=&quot;}{.metadata.namespace}{&quot; &quot;}{&quot;pod=&quot;}{.metadata.name}{&quot; &quot;}{range .spec.containers[*]}{&quot;image=&quot;}{.image}{&quot; &quot;}{end}{&quot;\n&quot;}{end}&#39; | grep k8s.gcr.io</pre><p>After finding target Pods, you can describe them and find they are running by which Deployment, StatefulSet or DaemonSet, and update manifest to use new Kubernetes image registry.</p><p><strong>Important note:</strong><br>This change from the Kubernetes community has nothing to do with your applications, and in most cases, you need to update static Pods manifests from worker nodes. For example, Kube-apiserver Pod which runs directly by Kubelet on the worker node.</p><p><a href="https://kubernetes.io/docs/tasks/configure-pod-container/static-pod/">https://kubernetes.io/docs/tasks/configure-pod-container/static-pod</a></p><p>If you liked it, like it.</p><p>Follow my LinkedIn <a href="https://www.linkedin.com/in/ssbostan">https://www.linkedin.com/in/ssbostan</a></p><p>Good luck.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34044996c858" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/kubernetes-hacks-and-tricks-6-find-pods-running-from-deprecated-registry-34044996c858">Kubernetes Hacks and Tricks — #6 Find Pods running from deprecated registry</a> was originally published in <a href="https://itnext.io">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Hacks and Tricks — #5 Pod DNS Policy and DNS Config options]]></title>
            <link>https://itnext.io/kubernetes-hacks-and-tricks-5-pod-dns-policy-and-dns-config-options-c176f4a581c3?source=rss-4b112926931c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c176f4a581c3</guid>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[coredns]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[dns]]></category>
            <dc:creator><![CDATA[Saeid Bostandoust]]></dc:creator>
            <pubDate>Sat, 11 Mar 2023 23:05:24 GMT</pubDate>
            <atom:updated>2023-07-17T09:54:38.583Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubernetes Hacks and Tricks — #5 Pod DNS Policy and DNS Config options</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*g2rN5uUviP1dpvdIkyO5JA.png" /></figure><p>What really is <strong>dnsPolicy</strong> in Pod spec, and when should we change it? By setting the dnsPolicy option in Pod spec, you define how DNS requests should be resolved. If you want to resolve DNS requests with just the internal DNS server, or you want to use the internal DNS server first and then use upstream DNS, or resolve all of them using an external DNS server or something else, you can do it by configuring Pod’s dnsPolicy and dnsConfig options. In Kubernetes, DNS policy can be configured per Pod, which means you can customize the DNS resolving method for every Pod in your cluster.</p><p>Allowed values in dnsPolicy option:</p><ul><li>Default Pod inherits worker node’s DNS configuration.</li><li>None all DNS configurations are ignored and dnsConfig option will be used to configure Pod DNS configuration.</li><li>ClusterFirst use cluster DNS first, CoreDNS. If the DNS query does not match any domains in cluster DNS, forward it to upstream DNS servers.</li><li>ClusterFirstWithHostNet in the case of using hostNetwork it uses the cluster DNS server first and then forward unmatched queries to upstream DNS servers. Will be explained more in the following article.</li></ul><p>Although it seems <strong>Default</strong> should be the default, but <strong>ClusterFirst</strong> is the default option. So to speak, if you have not set this option, <strong>ClusterFirst </strong>will be used as the default value.</p><h4>ClusterFirst (real default value):</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dbf76f867a8fe40759e4ad0d3b6d8a74/href">https://medium.com/media/dbf76f867a8fe40759e4ad0d3b6d8a74/href</a></iframe><p>Test result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*lqEWUB6Fro1lOm1ujjh5_Q.png" /></figure><p>As you can see, the request was resolved by the cluster’s DNS server through 10.43.0.10 (CoreDNS IP address), and it used my cluster domain.</p><h4>Default (its name is just Default, but it’s not default):</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/841eb3aecd43ea81a3bf56169e5c609e/href">https://medium.com/media/841eb3aecd43ea81a3bf56169e5c609e/href</a></iframe><p>Test result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*EohaRRu7cA1XNcXWZQzSLw.png" /></figure><p>As you can see, it used my node’s DNS server to resolve the DNS query, and because of that, it couldn’t resolve it. Moreover, it used the worker node’s domain instead of the cluster domain.</p><h4>None (to customize DNS configuration):</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9f095651b6a54b0d0623f0cebeeec151/href">https://medium.com/media/9f095651b6a54b0d0623f0cebeeec151/href</a></iframe><p>Test result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*nLr4E3i1tuIxmUxyyvgtvg.png" /></figure><p>As you can see, it tried to resolve the specified address with our search list through the Google DNS server.</p><p><strong>Note:</strong> To understand how containers resolve domains, see /etc/resolve.conf inside the container for every configuration explained above.</p><p>If you liked it, like it.</p><p>Follow my LinkedIn <a href="https://www.linkedin.com/in/ssbostan">https://www.linkedin.com/in/ssbostan</a></p><p>Good luck.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c176f4a581c3" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/kubernetes-hacks-and-tricks-5-pod-dns-policy-and-dns-config-options-c176f4a581c3">Kubernetes Hacks and Tricks — #5 Pod DNS Policy and DNS Config options</a> was originally published in <a href="https://itnext.io">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jenkins Tutorial — Part 10 — Work with Git in Pipeline]]></title>
            <link>https://itnext.io/jenkins-tutorial-part-10-work-with-git-in-pipeline-b5e42f6d124b?source=rss-4b112926931c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5e42f6d124b</guid>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[jenkins-pipeline]]></category>
            <category><![CDATA[jenkinsfile]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[jenkins]]></category>
            <dc:creator><![CDATA[Saeid Bostandoust]]></dc:creator>
            <pubDate>Mon, 06 Mar 2023 01:53:11 GMT</pubDate>
            <atom:updated>2023-03-06T07:56:01.963Z</atom:updated>
            <content:encoded><![CDATA[<h3>Jenkins Tutorial — Part 10 — Work with Git in Pipeline</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*isD_dDi7u493JTm4ZudxOw.jpeg" /></figure><p>Long time no see! After a long time, I got a chance to release and continue the complete Jenkins tutorial. In this article, we will learn how to use Git in our pipelines. Using Git is a most important topic in CI/CD pipelines as we store everything in Git, our source codes and pipeline codes themselves. To work with Git, you need the Jenkins Git plugin. I’ve prepared everything you need in the following Jenkins stack. The following Jenkins stack is available for both Docker and Kubernetes environments.</p><ul><li><a href="https://github.com/ssbostan/jenkins-stack-kubernetes">GitHub - ssbostan/jenkins-stack-kubernetes: Scripts and manifests to deploy complete Jenkins on Kubernetes</a></li><li><a href="https://github.com/ssbostan/jenkins-stack-docker">GitHub - ssbostan/jenkins-stack-docker: Docker-compose version of jenkins-stack-kubernetes</a></li></ul><h3>Jenkins Pipeline in Git repository:</h3><p>When you’re about to create a new Jenkins job, <strong>pipeline</strong>, you can connect Jenkins to a specific Git repository to read your pipeline code, the Jenkinsfile. In the case of CI pipelines, your Jenkinsfile is along with your source code, and Jenkins will clone your Git repository, which consists of your application source code and Jenkinsfile. You need your source code in the Jenkins CI pipeline to be able to build it, test it, and release it. In CD pipelines, you may have multiple things like Kubernetes manifests, GitOps manifests, Ansible playbooks, Docker-compose files, Terraform codes, Pulumi codes, etc. along with your Jenkinsfile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vcjl95ieI-zKpp5EjiYEiQ.png" /></figure><p>In the Pipeline section you can configure:</p><ul><li>Git repository URL address</li><li>Credentials to clone private repository (User/Pass or SSH)</li><li>Target branch or Ref name</li><li>Script path, Jenkins pipeline file (Default: <strong>Jenkinsfile</strong>)</li></ul><p>It’s super easy, but what if you want to clone the Git repository inside your pipeline or commit and push something into Git repo using pipeline? Jenkins provides you with a couple of ways to clone a Git repository inside the pipeline. The straight forward way is to use the Git plugin.</p><h3>Clone Git repository in Jenkins Pipeline:</h3><pre>git(<br>    url: &quot;REPO_URL_OR_SSH_URI_ADDRESS&quot;,<br>    branch: &quot;REPO_BRANCH_NAME&quot;,<br>    credentialsId: &quot;REPO_CREDENTIAL_ID_IN_JENKINS&quot;,<br>    changelog: true,<br>    poll: true<br>)</pre><p>For public repositories, you don’t need to specify credentialsId option.</p><p>If poll option is set to true, repo will be polled for changes.</p><p>If changelog option is set to true, changelog will be computed.</p><p>Here is the full example of how to clone a Git repository:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2ae527229b79c246cf00ab72d472326f/href">https://medium.com/media/2ae527229b79c246cf00ab72d472326f/href</a></iframe><p><strong>Attention: </strong>If you read pipeline code from Git using <strong>Jenkinsfile</strong> “We always use this method”, you should use dir to go to another directory and clone the other repository to prevent conflict between the main repo and the newly cloned repo.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/517e24dd2e86f45e8767c3a9ae7ebb55/href">https://medium.com/media/517e24dd2e86f45e8767c3a9ae7ebb55/href</a></iframe><h3>Commit and Push to Git using Jenkins Pipeline:</h3><p>Now it’s time to commit something new and push it back to the Git repository. Why do we need it? In many cases, you may need to add, commit and push from your pipeline. For example, updating <strong>GitOps manifests</strong> after building the image of the new application version, or pushing <strong>terraform.tfplan</strong> file into artifact repo.</p><p>First you need to configure Git plugin:</p><p>Dashboard &gt; Manage Jenkins &gt; Configure System &gt; Git plugin</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oQkoVXAM27kNJeYM4J7WkQ.png" /></figure><p>To be able to push to the GitHub repository, you need to have a token. To create a token, go to Developer Settings in your GitHub account.</p><p>Then back to Jenkins and create a new Username/Password credential.</p><p>Manage Jenkins &gt; Credentials &gt; System &gt; Global credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IMPzZxAHHSiIVMh-NkjlZA.png" /></figure><p><strong>For GitHub, write TOKEN in the Password field.</strong></p><p>Now go to your pipeline, commit and push something to the Git repository. It doesn’t matter if you’ve cloned Git repository in the pipeline or Jenkins has cloned it because of Jenkinsfile. You just need a Git repository with .git directory and credentials to push to the origin.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4db7cf7a7ee6bf165a69afd030cd0845/href">https://medium.com/media/4db7cf7a7ee6bf165a69afd030cd0845/href</a></iframe><p>withCredentials is a pipeline step to inject credentials to being used by applications in its block. As you can see, I injected a gitUsernamePassword to be able to run git push command. I will explain it more in future articles.</p><p>If you are faced with this error, you should solve it by running git config command inside the Jenkins container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*horgpW6kR6FcfhlKb4dIhw.png" /></figure><pre>git config --global user.name &quot;Jenkins Pipeline&quot;<br>git config --global user.email &quot;jenkins@localhost&quot;</pre><p>Now, check your Git repository. You should be able to see a new commit pushed by Jenkins pipeline.</p><h3>Conclusion:</h3><p>Using Git repositories in CI/CD pipelines is a daily task you should learn well. In the following articles, we will work more with Git repositories as everything we have is stored in Git repositories. To be honest, I’m super busy these days, but I promise to spend more time writing new articles.</p><p>If you liked it, please like it.</p><p>Follow my LinkedIn <a href="https://www.linkedin.com/in/ssbostan">https://www.linkedin.com/in/ssbostan</a></p><p>Good luck.</p><p><a href="https://github.com/ssbostan/jenkins-tutorial">GitHub - ssbostan/jenkins-tutorial: The completest Jenkins tutorial, reference, awesome, examples</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5e42f6d124b" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/jenkins-tutorial-part-10-work-with-git-in-pipeline-b5e42f6d124b">Jenkins Tutorial — Part 10 — Work with Git in Pipeline</a> was originally published in <a href="https://itnext.io">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Hacks and Tricks — #4 Find worker node info from Pod spec info]]></title>
            <link>https://itnext.io/kubernetes-hacks-and-tricks-4-find-worker-node-info-from-pod-spec-info-f5f27b45248a?source=rss-4b112926931c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5f27b45248a</guid>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[cncf]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Saeid Bostandoust]]></dc:creator>
            <pubDate>Sat, 04 Mar 2023 21:21:44 GMT</pubDate>
            <atom:updated>2023-03-04T22:09:12.750Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubernetes Hacks and Tricks — #4 Find worker node info from Pod spec info</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*WW7NT4iQeMR12BM775GhjA.png" /></figure><p>In access-limited clusters where you don’t have access to cluster resources, you may need worker nodes’ info like worker node name, node IP address, etc. You can’t run kubectl get nodes in such clusters because the cluster admin has restricted your access to only particular namespaces and namespaced resources. This trick is for you if you are blocked in such a situation. First, you must run the following DaemonSet to ensure you have a Pod in every worker node to be able to find worker nodes’ info.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ec6c2a998d85cffa4b6bf39d90406d2b/href">https://medium.com/media/ec6c2a998d85cffa4b6bf39d90406d2b/href</a></iframe><p>After that, run the following command to show you all worker nodes’ names and IP addresses. Easier than you think.</p><pre>kubectl get pod -l app=test -o jsonpath=&#39;{range .items[*]}{.spec.nodeName}{&quot;\t&quot;}{.status.hostIP}{&quot;\n&quot;}{end}&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*OqoCiOM9NqYREJGn7K-Fwg.png" /></figure><p>That’s it. Short but practical. If you liked it, like it.</p><p>Follow my LinkedIn <a href="https://www.linkedin.com/in/ssbostan">https://www.linkedin.com/in/ssbostan</a></p><p>Good luck.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5f27b45248a" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/kubernetes-hacks-and-tricks-4-find-worker-node-info-from-pod-spec-info-f5f27b45248a">Kubernetes Hacks and Tricks — #4 Find worker node info from Pod spec info</a> was originally published in <a href="https://itnext.io">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Hacks and Tricks — #3 List all downloaded images on worker nodes]]></title>
            <link>https://itnext.io/kubernetes-hacks-and-tricks-3-list-all-downloaded-images-on-worker-nodes-fdcb45f9dcbc?source=rss-4b112926931c------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdcb45f9dcbc</guid>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[kubectl]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Saeid Bostandoust]]></dc:creator>
            <pubDate>Thu, 23 Feb 2023 23:02:28 GMT</pubDate>
            <atom:updated>2023-02-24T08:06:18.005Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubernetes Hacks and Tricks — #3 List all downloaded images on worker nodes</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*7dorwLhW7TBrSRR7YTC4qA.png" /></figure><p>Do you want to know which images are downloaded and available on your worker nodes? If yes, you need to run the following command.</p><pre>kubectl get nodes -o jsonpath=&#39;{range .items[*]}{.metadata.name}{&quot;\n&quot;}{range .status.images[*]}{&quot;\t&quot;}{.names[0]}{&quot;\n&quot;}{end}{end}&#39;</pre><p>This command list all Kubernetes nodes and their available images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F5FtizGss10nbgJihcDERg.png" /></figure><p>That’s it. Short but practical. If you liked it, like it.</p><p>Follow my LinkedIn <a href="https://www.linkedin.com/in/ssbostan">https://www.linkedin.com/in/ssbostan</a></p><p>Good luck.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdcb45f9dcbc" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/kubernetes-hacks-and-tricks-3-list-all-downloaded-images-on-worker-nodes-fdcb45f9dcbc">Kubernetes Hacks and Tricks — #3 List all downloaded images on worker nodes</a> was originally published in <a href="https://itnext.io">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Hacks and Tricks — #2 Optional ConfigMaps and Secrets in Pods]]></title>
            <link>https://itnext.io/kubernetes-hacks-and-tricks-2-optional-configmaps-and-secrets-in-pods-1a65d7495c9f?source=rss-4b112926931c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a65d7495c9f</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[tricks]]></category>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[hacks]]></category>
            <dc:creator><![CDATA[Saeid Bostandoust]]></dc:creator>
            <pubDate>Fri, 17 Feb 2023 22:23:22 GMT</pubDate>
            <atom:updated>2023-02-17T22:57:56.137Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubernetes Hacks and Tricks — #2 Optional ConfigMaps and Secrets in Pods</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*BAJsWiAVANbKmjtdpbEzrA.png" /></figure><p>In some applications, the application configurations are set by default in the codebase (hard-coded) and if you want to override them, you can provide your override values through environment variables. Sometimes and for some configurations, it doesn’t matter if the override values exist. However, you want to make sure the application runs without any issues. If ConfigMaps/Secrets are available, use them, and if there are no ConfigMaps/Secrets for the application, run the application with its default configuration. In such a case, Kubernetes provides us “optional” field for using ConfigMaps/Secrets as environment variables in Pods.</p><p>If you run the pod with a regular manifest and the ConfigMap/Secret does not exist, it will face with error.</p><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: optional-configmap-secret<br>spec:<br>  containers:<br>    - name: registry<br>      image: registry:latest<br>      envFrom:<br>        - configMapRef:<br>            name: registry-config<br>        - secretRef:<br>            name: registry-secret</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*bOZQ_cZwM_N1L7VZZFtIrg.png" /></figure><p>Now we can use the optional field to run the pod even if ConfigMap/Secret is not available to be used by pod container.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a1fc37e6fa227374749c8b3b250955f6/href">https://medium.com/media/a1fc37e6fa227374749c8b3b250955f6/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*WtringDU7f5gKOLU8_SbWA.png" /></figure><p>That’s it. You did it. if you liked it, like it.</p><p>Follow my LinkedIn <a href="https://www.linkedin.com/in/ssbostan">https://www.linkedin.com/in/ssbostan</a></p><p>Good luck.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a65d7495c9f" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/kubernetes-hacks-and-tricks-2-optional-configmaps-and-secrets-in-pods-1a65d7495c9f">Kubernetes Hacks and Tricks — #2 Optional ConfigMaps and Secrets in Pods</a> was originally published in <a href="https://itnext.io">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>