Tuesday, September 15, 2026

Managing Kubernetes Resources


kubectl: This is the command-line interface for interacting with Kubernetes clusters.


# list running Pods

kubectl get pods


# list running Services

kubectl get services


# list running Deployments

kubectl get deployments


# check the logs of a running Pod

kubectl logs <pod-name>

# To delete a Pod

kubectl delete pod <pod-name>

#The command aims to delete the deployment named nginx-deployment from your Kubernetes cluster, which will also terminate the pods managed by this deployment.

kubectl delete deployment nginx-deployment

# The command aims to provide detailed information about the nginx-deployment, such as its configuration, status, and events related to it.

kubectl describe deployment nginx-deployment

#
kubectl delete all --all

 


Sunday, September 13, 2026

Rules for Creating YAML file

 

  • YAML is case sensitive

  • The files should have .yaml as the extension

  • YAML does not allow the use of tabs while creating YAML files; spaces are allowed instead

Thursday, September 10, 2026

EKS Steps

Amazon Elastic Kubernetes Service (EKS) cluster involves creating the management console tools, the cluster control plane, worker nodes, and deploying an application.

https://www.youtube.com/watch?v=Stu8LybDHIE

1. Install Prerequisites

Install the AWS CLI to manage AWS services.
Install kubectl to run commands on Kubernetes clusters.
Install eksctl as a simple command-line tool for cluster creation.
Set up an active AWS account with administrator permissions.

2. Create an IAM Role for EKS

Open the IAM console in AWS.
Create a role for EKS and attach the AmazonEKSClusterPolicy permission.
This role allows EKS to manage resources on your behalf.

3. Create the EKS Cluster

Navigate to EKS in the AWS Management Console or use the command line.
Run eksctl create cluster or use the console wizard to specify your cluster name, region, and Kubernetes version.
Select your Virtual Private Cloud (VPC) and subnets.
Wait roughly 10 to 15 minutes for the control plane to provision.

4. Add Worker Node Groups

Go to your newly created cluster's compute tab.
Click Add node group.
Create an IAM role for nodes with policies like AmazonEKSWorkerNodePolicy, AmazonEC2ContainerRegistryReadOnly, and AmazonEKSCNIPolicy.
Pick your instance type (such as t2.medium) and define the minimum, maximum, and desired node counts.


5. Connect and Configure kubectl

Update your local or utility box configuration using the AWS CLI:
aws eks update-kubeconfig --region <region-code> --name <cluster-name>
Verify the connection by running kubectl get nodes to see your active worker instances.

6. Deploy Your Application
Create a deployment configuration file in YAML format.
Apply the configuration to the cluster using dev.to Application Guide command:
kubectl apply -f deployment.yaml
Expose your deployment as a service to access the running container.

Tuesday, September 8, 2026

What is Eksctl?

 eksctl is a command-line utility tool that automates and simplifies the process of creating, managing, and operating Amazon Elastic Kubernetes Service (Amazon EKS) clusters. Written in Go, eksctl provides a declarative syntax through YAML configurations and CLI commands to handle complex EKS cluster operations that would otherwise require multiple manual steps across different AWS services.

eksctl is particularly valuable for DevOps engineers, platform teams, and Kubernetes administrators who need to consistently deploy and manage EKS clusters at scale. It’s especially useful for organizations transitioning from self-managed Kubernetes to EKS, or those implementing infrastructure as code (IaC) practices, as it can be integrated into existing CI/CD pipelines and automation workflows. The tool abstracts away many of the complex interactions between AWS services required for EKS cluster setup, such as VPC configuration, IAM role creation, and security group management.

Key features of eksctl include the ability to create fully functional EKS clusters with a single command, support for custom networking configurations, automated node group management, and GitOps workflow integration. The tool manages cluster upgrades, scales node groups, and handles add-on management through a declarative approach. eksctl also provides advanced capabilities such as Fargate profile configuration, managed node group customization, and spot instance integration, while maintaining compatibility with other AWS tools and services through native AWS SDK integration.

Features

The features that are currently implemented are:

  • Create, get, list and delete clusters

  • Create, drain and delete nodegroups

  • Scale a nodegroup

  • Update a cluster

  • Use custom AMIs

  • Configure VPC Networking

  • Configure access to API endpoints

  • Support for GPU nodegroups

  • Spot instances and mixed instances

  • IAM Management and Add-on Policies

  • List cluster Cloudformation stacks

  • Install coredns

  • Write kubeconfig file for a cluster

System Management Commands

    sudo — Execute as Administrator

Run commands with elevated privileges when you need system-level access.

sudo yum update             # Update system packages
sudo systemctl restart nginx # Restart a service
sudo passwd username # Change user password

systemctl — Service Management

Control system services and daemons efficiently.

systemctl start apache2     # Start service
systemctl stop apache2 # Stop service
systemctl restart apache2 # Restart service
systemctl status apache2 # Check service status
systemctl enable apache2 # Enable on boot

yum — Package Manager (Amazon Linux 2)

Install, update, and manage software packages on your system.

yum update                  # Update all packages
yum install nginx # Install package
yum remove package-name # Remove package
yum search keyword # Search for package

VPC



A Virtual Private Cloud (VPC) is used to create a logically isolated, private network inside a public cloud where you can safely run servers, databases, and applications.

Think of it as your own virtual data center in the cloud, giving you full control over your security settings and network traffic.

Core Uses of a VPC
  • Network Isolation: Keeps your data and cloud resources separated from other customers on the same public cloud.
  • Traffic Control: Lets you decide which IP addresses can access your servers using custom firewalls, routing tables, and security rules
  • Subnet Segmentation:
    Divides your network into public subnets (for web pages facing the internet) and private subnets (for sensitive data like backend databases).
  • Hybrid Connectivity: Connects your secure cloud network directly to your physical corporate office or on-premises data center using a Virtual Private Network (VPN).
  • Multi-Tier Architectures: Powers complex apps by letting front-end, middle-tier, and back-end systems talk to each other safely behind closed doors. 

Kubernetes Cluster Setup on Amazon (EKS)

 https://medium.com/@subhasmitadas696/kubernetes-cluster-setup-on-amazon-eks-11506e462929


Agenda:

  • Setup an EC2 Instance to create a cluster
  • Setup kubectl
  • Setup eksctl
  • Create an IAM Role and attach it to the EC2 instance
  • Create your cluster and nodes
  • Create a Pod using Kubectl to Validate the Cluster
  • Deploying Nginx Container
  • Delete the EKS cluster

Click on the above link

Managing Kubernetes Resources

kubectl: This is the command-line interface for interacting with Kubernetes clusters. # list running Pods kubectl get pods # list running Se...