<?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 likhitha vemparala on Medium]]></title>
        <description><![CDATA[Stories by likhitha vemparala on Medium]]></description>
        <link>https://medium.com/@vllikhitha123?source=rss-9a6a8bbbeccc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Lto3ctjEnN9jHHQji1htVQ.jpeg</url>
            <title>Stories by likhitha vemparala on Medium</title>
            <link>https://medium.com/@vllikhitha123?source=rss-9a6a8bbbeccc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 16:16:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vllikhitha123/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[The Ultimate AWS Beginner Guide: Compute, Storage, Databases & Serverless(Practical guide included)]]></title>
            <link>https://medium.com/@vllikhitha123/the-ultimate-aws-beginner-guide-compute-storage-databases-serverless-practical-guide-included-8e9170ed7c27?source=rss-9a6a8bbbeccc------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e9170ed7c27</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[likhitha vemparala]]></dc:creator>
            <pubDate>Wed, 26 Aug 2026 08:31:43 GMT</pubDate>
            <atom:updated>2026-08-26T08:31:43.808Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*d0P9l6RAB2Ej4p1_1875aQ.jpeg" /></figure><p><strong>Concepts covered:</strong></p><ol><li>AWS Overview</li><li>EC2 (Compute Backbone)</li><li>S3 (Storage Backbone)</li><li>ECS (Elastic Container Service)</li><li>EKS (Elastic Kubernetes Service)</li><li>RDS (Relational Database Service)</li><li>DynamoDB (NoSQL Database)</li><li>Lambda (Serverless Compute)</li><li>AWS Hands-On Labs: End-to-End Practical Guide</li><li>Conclusion</li></ol><p><strong>1. Deep Dive: What is AWS?</strong></p><p><strong>I. AWS (Amazon Web Services)</strong></p><p>AWS is a <strong>global cloud computing platform</strong> that provides a collection of <strong>on-demand IT resources</strong> over the internet.<br> You can rent compute, storage, databases, analytics, networking, and many more services on a <strong>pay-as-you-go</strong> basis.</p><p>Instead of buying physical hardware and setting up data centers, AWS lets you <strong>use virtual infrastructure</strong> that can scale up or down automatically.</p><p><strong>II. AWS Core Components</strong></p><p>AWS is divided into multiple categories of services:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*DTTDAiIXRYWx81ErvrSOPQ.png" /><figcaption>Fig: AWS Categories</figcaption></figure><p><strong>III. AWS Global Infrastructure</strong></p><p>AWS operates in <strong>Regions</strong> and <strong>Availability Zones (AZs)</strong>:</p><ul><li><strong>Region:</strong> A physical location (e.g., us-east-1, ap-south-1) containing multiple data centers.</li><li><strong>Availability Zone:</strong> A separate data center inside a region.</li><li><strong>Edge Locations:</strong> Global CDN points (for caching and low-latency access).</li></ul><p>This distributed design ensures <strong>high availability</strong> and <strong>fault tolerance</strong>.</p><p><strong>2. Amazon EC2 (Elastic Compute Cloud)</strong></p><p><strong>I. Concept</strong></p><p>EC2 provides <strong>resizable compute capacity</strong> in the cloud — essentially, <strong>virtual machines</strong> (VMs) running on AWS’s infrastructure.</p><p>Each EC2 instance runs an <strong>Amazon Machine Image (AMI)</strong> (a preconfigured OS template) on a <strong>hypervisor layer</strong> called the <strong>Nitro System</strong>, which isolates your instance’s resources (CPU, RAM, storage, networking) securely from others.</p><p><strong>II. How It Works</strong></p><p><strong>When you launch an EC2 instance:</strong></p><ol><li>You pick an <strong>AMI</strong> (e.g., Ubuntu, Amazon Linux, Windows).</li><li>You choose an <strong>instance type</strong> (hardware size) — e.g., t3.micro, m5.large.</li><li>AWS allocates <strong>virtualized resources</strong> from a physical host machine.</li><li>You connect via SSH or RDP and run your workloads.</li></ol><p>Each EC2 runs inside your <strong>VPC (Virtual Private Cloud)</strong>, so you control its IPs, firewall (Security Groups), and network access.</p><p><strong>III. Key Features</strong></p><ul><li><strong>Elastic Scaling:</strong> Increase or decrease instance count as needed (Auto Scaling Groups).</li><li><strong>Elastic Load Balancing (ELB):</strong> Distribute traffic among EC2s.</li><li><strong>EBS (Elastic Block Store):</strong> Persistent storage for EC2.</li><li><strong>Snapshots:</strong> Backup EBS volumes for disaster recovery.</li></ul><p><strong>IV. Example Use Case</strong></p><p><strong>Hosting a web app:</strong></p><ul><li>EC2 for web server</li><li>S3 for static assets</li><li>RDS for database</li><li>CloudFront for CDN</li></ul><p><strong>3. Amazon S3 (Simple Storage Service)</strong></p><p><strong>I. Concept</strong></p><p>S3 is an <strong>object storage</strong> service — you store data as <em>objects</em> (files + metadata) inside <em>buckets</em>.</p><p>Unlike file systems (like EBS or local disks), S3 doesn’t use directories; it’s a <strong>flat storage</strong> system with key-based access.</p><p><strong>Each object has:</strong></p><ul><li><strong>Key:</strong> Name (path)</li><li><strong>Value:</strong> Data (file contents)</li><li><strong>Metadata:</strong> File info</li><li><strong>Version ID:</strong> If versioning is enabled</li></ul><p><strong>II. How It Works</strong></p><p><strong>When you upload an object:</strong></p><ol><li>You PUT the object into a <strong>bucket</strong>.</li><li>S3 stores it redundantly across multiple AZs.</li><li>You can access it via URL, API, or SDK.</li></ol><p>AWS S3 is built on a <strong>distributed storage system</strong> that replicates data to ensure <strong>99.999999999% (11 9’s)</strong> durability.</p><p><strong>III. Storage Classes</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*uFwDkUOuIeRcFC8yx98sfA.png" /><figcaption>Fig: AWS Storage classes</figcaption></figure><p><strong>IV. Security</strong></p><ul><li><strong>IAM Policies</strong>: Control access at the user/role level.</li><li><strong>Bucket Policies</strong>: Control access per bucket.</li><li><strong>Encryption:</strong> SSE-S3, SSE-KMS, or client-side encryption.</li></ul><p><strong>V. Example Use Cases</strong></p><ul><li>Website hosting (S3 static websites)</li><li>Data lake storage</li><li>Backup &amp; archiving</li><li>Storing ML datasets</li></ul><p><strong>4. Amazon ECS (Elastic Container Service)</strong></p><p><strong>I. Concept</strong></p><p>ECS is a <strong>container orchestration service</strong> for running Docker containers on AWS.<br> It removes the need to manage container scheduling, scaling, or networking manually.</p><p><strong>II. How It Works</strong></p><p><strong>ECS has three main components:</strong></p><ol><li><strong>Cluster:</strong> A logical group of compute resources (EC2 or Fargate).</li><li><strong>Task Definition:</strong> A JSON blueprint defining container images, ports, CPU/memory, and environment.</li><li><strong>Service:</strong> Keeps your desired number of running tasks and integrates with load balancers.</li></ol><p><strong>You can run ECS in two ways:</strong></p><ul><li><strong>ECS on EC2:</strong> You manage the EC2 instances.</li><li><strong>ECS on Fargate:</strong> Fully serverless; AWS runs containers for you.</li></ul><p><strong>III. Example Workflow</strong></p><ol><li>Push Docker image to <strong>ECR</strong> (Elastic Container Registry).</li><li>Define an ECS task with that image.</li><li>Create a service to keep N copies running.</li><li>Attach an <strong>Application Load Balancer</strong> to distribute traffic.</li></ol><p><strong>IV. Integration</strong></p><ul><li><strong>CloudWatch:</strong> Logging and metrics.</li><li><strong>IAM Roles:</strong> Granular access to other AWS services.</li><li><strong>Auto Scaling:</strong> Add/remove tasks automatically.</li></ul><p><strong>5. Amazon EKS (Elastic Kubernetes Service)</strong></p><p><strong>I. Concept</strong></p><p>EKS is a <strong>managed Kubernetes service</strong> that automates the control plane (API server, etcd, scheduler) setup.</p><p>You get a <strong>fully compliant Kubernetes cluster</strong> without needing to install or maintain Kubernetes manually.</p><p><strong>II. How It Works</strong></p><ol><li>You create an EKS cluster (control plane managed by AWS).</li><li>You add <strong>worker nodes</strong> (EC2 or Fargate).</li><li>Deploy your workloads using <strong>kubectl</strong> or Helm charts.</li><li>AWS integrates with VPC networking, IAM, and CloudWatch.</li></ol><p><strong>III. Architecture</strong></p><ul><li><strong>Control Plane:</strong> Managed by AWS; runs Kubernetes API, scheduler, etc.</li><li><strong>Data Plane:</strong> Your EC2 or Fargate nodes where pods run.</li><li><strong>Networking:</strong> AWS VPC CNI plugin provides each pod a VPC IP.</li></ul><p><strong>IV. Example Use Cases</strong></p><ul><li>Microservices with complex orchestration</li><li>Hybrid deployments</li><li>CI/CD pipelines (GitOps)</li><li>ML workloads (using EKS + GPU nodes)</li></ul><p><strong>6. Amazon RDS (Relational Database Service)</strong></p><p><strong>I. Concept</strong></p><p>RDS is a <strong>managed relational database service</strong> — AWS handles provisioning, patching, backups, and replication.</p><p>Supported engines:</p><ul><li>MySQL</li><li>PostgreSQL</li><li>MariaDB</li><li>Oracle</li><li>SQL Server</li><li>Aurora (AWS-optimized MySQL/PostgreSQL)</li></ul><p><strong>II. How It Works</strong></p><p>When you create an RDS instance:</p><ol><li>AWS provisions the DB engine on a virtual host.</li><li>Handles backups and replication automatically.</li><li>You connect via a standard endpoint (hostname + port).</li><li>AWS manages patching, failover, and scaling.</li></ol><p><strong>III. Storage &amp; HA</strong></p><ul><li><strong>Multi-AZ:</strong> Synchronous replication for high availability.</li><li><strong>Read Replicas:</strong> Asynchronous replication for read scalability.</li><li><strong>Snapshots:</strong> Point-in-time recovery.</li></ul><p><strong>IV. Example Use Cases</strong></p><ul><li>Web app backend databases</li><li>E-commerce product catalogs</li><li>Analytics and BI systems</li></ul><p><strong>7. Amazon DynamoDB (NoSQL)</strong></p><p><strong>I. Concept</strong></p><p>DynamoDB is a <strong>serverless key-value and document database</strong> designed for <strong>massive scale and low latency</strong> (&lt;10ms).</p><p>It’s fully managed — no servers, patching, or scaling to handle.</p><p><strong>II. How It Works</strong></p><ul><li>Data is stored in <strong>tables</strong> (not relational).</li><li>Each item has a <strong>Primary Key</strong> (Partition Key or Partition + Sort Key).</li><li>DynamoDB automatically partitions data based on key values.</li><li>Data is stored across multiple AZs for durability.</li></ul><p><strong>III. Performance</strong></p><ul><li><strong>On-demand capacity:</strong> Scales instantly based on traffic.</li><li><strong>Provisioned mode:</strong> You predefine read/write throughput.</li><li><strong>DAX:</strong> In-memory cache for even faster access.</li></ul><p><strong>IV. Example Use Cases</strong></p><ul><li>Session storage</li><li>IoT device data</li><li>Leaderboards</li><li>E-commerce carts</li></ul><p><strong>8. AWS Lambda (Serverless Functions)</strong></p><p><strong>I. Concept</strong></p><p>Lambda is <strong>event-driven compute</strong> — you run code in response to events without managing servers.</p><p><strong>You upload a function (code) and define:</strong></p><ul><li><strong>Runtime:</strong> e.g., Python, Node.js, Go</li><li><strong>Trigger:</strong> e.g., S3 upload, API Gateway call, DynamoDB stream</li></ul><p><strong>Lambda handles:</strong></p><ul><li>Provisioning compute</li><li>Scaling up automatically</li><li>Running your code securely</li><li>Charging only for execution time</li></ul><p><strong>II. Lifecycle</strong></p><ol><li>Event triggers the function.</li><li>AWS spins up a <strong>containerized runtime</strong>.</li><li>Function executes with your logic.</li><li>Resources are released when done.</li></ol><p><strong>III. Integrations</strong></p><ul><li><strong>S3:</strong> Trigger on file upload.</li><li><strong>DynamoDB Streams:</strong> Trigger on table changes.</li><li><strong>API Gateway:</strong> Build REST APIs.</li><li><strong>Step Functions:</strong> Build workflows.</li></ul><p><strong>IV. Example Use Cases</strong></p><ul><li>Serverless APIs</li><li>Data transformation (ETL)</li><li>Real-time notifications</li><li>Image processing</li></ul><p><strong>9. AWS Hands-On Labs: End-to-End Practical Guide</strong></p><p><strong>Prerequisites</strong></p><p><strong>Before you begin:</strong></p><ol><li><strong>Create an AWS Account</strong> (<a href="https://aws.amazon.com/free/">https://aws.amazon.com/free/</a>)</li><li><strong>Install AWS CLI</strong></li><li>pip install awscli</li><li>aws configure — Enter your Access Key, Secret Key, Region (e.g., us-east-1), and output format (json).</li><li><strong>Install Docker &amp; kubectl</strong> (for ECS/EKS labs)</li><li><strong>Install eksctl</strong> (for EKS cluster creation)</li><li>brew install eksctl # macOS</li><li>choco install eksctl # Windows</li></ol><p><strong>LAB 1 — Amazon EC2 (Compute)</strong></p><p><strong>I. Goal</strong></p><p>Launch a Linux web server (Apache) using EC2.</p><p><strong>II. Steps</strong></p><ol><li><strong>Launch an Instance</strong></li></ol><ul><li>Go to <strong>AWS Console → EC2 → Launch Instance</strong></li><li>Name: my-web-server</li><li>AMI: Amazon Linux 2</li><li>Instance type: t2.micro (Free Tier)</li><li>Create a key pair (my-key.pem)</li><li>Open ports: 22 (SSH), 80 (HTTP)</li><li>Click <strong>Launch</strong></li></ul><p><strong>2. SSH into EC2</strong></p><p>ssh -i my-key.pem ec2-user@&lt;public-ip&gt;</p><p><strong>3. Install Apache</strong></p><p>sudo yum update -y</p><p>sudo yum install -y httpd</p><p>sudo systemctl start httpd</p><p>sudo systemctl enable httpd</p><p><strong>4. Create Web Page</strong></p><p>echo “&lt;h1&gt;Hello from my EC2 Web Server&lt;/h1&gt;” | sudo tee /var/www/html/index.html</p><p><strong>5. Access via Browser</strong></p><p>http://&lt;public-ip&gt;</p><p>You’ll see your page.</p><p><strong>LAB 2 — Amazon S3 (Object Storage)</strong></p><p><strong>I. Goal</strong></p><p>Create an S3 bucket, upload files, and host a static website.</p><p><strong>II. Steps</strong></p><ol><li><strong>Create Bucket</strong></li></ol><p>aws s3 mb s3://my-demo-bucket-&lt;your-unique-id&gt;</p><p><strong>2. Upload a File</strong></p><p>echo “Hello, S3 World!” &gt; hello.txt</p><p>aws s3 cp hello.txt s3://my-demo-bucket-&lt;id&gt;/</p><p><strong>3. Enable Static Website Hosting</strong><br> In Console:</p><ul><li>Go to <strong>S3 → your bucket → Properties → Static website hosting</strong></li><li>Enable hosting → Index document: index.html</li></ul><p><strong>4. Upload Web Page</strong></p><p>echo “&lt;h2&gt;My S3 Website&lt;/h2&gt;” &gt; index.html</p><p>aws s3 cp index.html s3://my-demo-bucket-&lt;id&gt;/</p><p><strong>5. Make Public (Optional for testing)</strong></p><p>aws s3api put-bucket-policy — bucket my-demo-bucket-&lt;id&gt; — policy file://policy.json</p><p><strong>6. Access Site</strong><br> You’ll get a URL like: http://my-demo-bucket-&lt;id&gt;.s3-website-us-east-1.amazonaws.com</p><p><strong>LAB 3 — Amazon ECS (Container Orchestration)</strong></p><p><strong>I. Goal</strong></p><p>Deploy a simple web app (Docker container) using ECS + Fargate.</p><p><strong>II. Steps</strong></p><ol><li><strong>Create Docker App</strong></li></ol><p>mkdir ecs-lab &amp;&amp; cd ecs-lab</p><p>echo “FROM nginx:alpine” &gt; Dockerfile</p><p>echo “&lt;h1&gt;Hello ECS&lt;/h1&gt;” &gt; index.html</p><p>echo “COPY index.html /usr/share/nginx/html/index.html” &gt;&gt; Dockerfile</p><p>docker build -t ecs-lab .</p><p><strong>2. Push to ECR</strong></p><p>aws ecr create-repository — repository-name ecs-lab</p><p>ACCOUNT_ID=$(aws sts get-caller-identity — query Account — output text)</p><p>docker tag ecs-lab:latest $ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/ecs-lab:latest</p><p>aws ecr get-login-password | docker login — username AWS — password-stdin $ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com</p><p>docker push $ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/ecs-lab:latest</p><p><strong>3. Create ECS Cluster (Fargate)</strong></p><ul><li>Go to <strong>ECS → Clusters → Create Cluster</strong></li><li>Choose <strong>Fargate</strong></li></ul><p><strong>4. Create Task Definition</strong></p><ul><li>Image: your ECR image URL</li><li>Port: 80</li><li>Memory: 512MB, CPU: 0.25 vCPU</li></ul><p><strong>5. Create Service</strong></p><ul><li>Launch type: Fargate</li><li>Desired tasks: 1</li><li>Attach an Application Load Balancer</li><li>Deploy</li></ul><p><strong>6. Access via Load Balancer DNS</strong><br> You’ll see “Hello ECS”.</p><p><strong>LAB 4 — Amazon EKS (Kubernetes)</strong></p><p><strong>I. Goal</strong></p><p>Deploy a Nginx pod on a managed Kubernetes cluster.</p><p><strong>II. Steps</strong></p><ol><li><strong>Create EKS Cluster</strong></li></ol><p>eksctl create cluster — name eks-lab — region us-east-1 — nodes 2</p><p><strong>2. Verify Connection</strong></p><p>kubectl get nodes</p><p><strong>3. Deploy Nginx</strong></p><p>kubectl create deployment nginx — image=nginx</p><p>kubectl expose deployment nginx — port=80 — type=LoadBalancer</p><p><strong>4. Get External IP</strong></p><p>kubectl get svc</p><p><strong>5. Access Nginx</strong><br> Visit the external IP in your browser — you’ll see the default Nginx page.</p><p><strong>LAB 5 — Amazon RDS (Relational Database)</strong></p><p><strong>I. Goal</strong></p><p>Launch a managed MySQL DB and connect to it.</p><p><strong>II. Steps</strong></p><ol><li>Go to <strong>RDS → Create Database</strong></li></ol><ul><li>Engine: MySQL</li><li>Template: Free tier</li><li>DB Identifier: mydb</li><li>Username: admin</li><li>Password: &lt;your-password&gt;</li><li>Public access: Yes (for lab)</li><li>Launch DB</li></ul><p>2. Once available, note the <strong>endpoint</strong> under Connectivity.</p><p><strong>3. Connect via EC2</strong><br> SSH into your EC2 instance and install MySQL client:</p><p>sudo yum install -y mysql</p><p>mysql -h &lt;rds-endpoint&gt; -u admin -p</p><p><strong>4. Create Table</strong></p><p>CREATE DATABASE company;</p><p>USE company;</p><p>CREATE TABLE employees (id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(50));</p><p>INSERT INTO employees (name) VALUES (‘Alice’), (‘Bob’);</p><p>SELECT * FROM employees;</p><p><strong>LAB 6 — DynamoDB (NoSQL)</strong></p><p><strong>I. Goal</strong></p><p>Create a DynamoDB table and store/retrieve data.</p><p><strong>II. Steps</strong></p><ol><li><strong>Create Table</strong></li></ol><p>aws dynamodb create-table \</p><p>— table-name Users \</p><p>— attribute-definitions AttributeName=UserID,AttributeType=S \</p><p>— key-schema AttributeName=UserID,KeyType=HASH \</p><p>— billing-mode PAY_PER_REQUEST</p><p><strong>2. Insert Data</strong></p><p>aws dynamodb put-item \</p><p>— table-name Users \</p><p>— item ‘{“UserID”: {“S”: “U100”}, “Name”: {“S”: “Alice”}, “Age”: {“N”: “25”}}’</p><p><strong>3. Retrieve Data</strong></p><p>aws dynamodb get-item \</p><p>— table-name Users \</p><p>— key ‘{“UserID”: {“S”: “U100”}}’</p><p><strong>4. Scan All Data</strong></p><p>aws dynamodb scan — table-name Users</p><p><strong>LAB 7 — AWS Lambda (Serverless)</strong></p><p><strong>I. Goal</strong></p><p>Create a Lambda function that responds with “Hello from Lambda”.</p><p><strong>II. Steps</strong></p><ol><li><strong>Create Function Code</strong></li></ol><p>mkdir lambda-lab &amp;&amp; cd lambda-lab</p><p>echo ‘def lambda_handler(event, context): return {“message”: “Hello from Lambda!”}’ &gt; lambda_function.py</p><p>zip function.zip lambda_function.py</p><p><strong>2. Create IAM Role</strong><br> In AWS Console:</p><ul><li>IAM → Roles → Create Role → Lambda → Attach AWSLambdaBasicExecutionRole</li></ul><p><strong>3. Create Lambda Function</strong></p><p>aws lambda create-function \</p><p>— function-name HelloLambda \</p><p>— runtime python3.9 \</p><p>— role arn:aws:iam::&lt;account-id&gt;:role/&lt;lambda-role&gt; \</p><p>— handler lambda_function.lambda_handler \</p><p>— zip-file fileb://function.zip</p><p><strong>4. Invoke Lambda</strong></p><p>aws lambda invoke — function-name HelloLambda — payload ‘{}’ response.json</p><p>cat response.json</p><p>You’ll get:</p><p>{“message”: “Hello from Lambda!”}</p><p><strong>5. Optional Trigger</strong></p><ul><li>Add <strong>API Gateway Trigger</strong> to expose it as a REST API endpoint.</li></ul><p><strong>11. Conclusion</strong></p><p>And with that, you now have a solid foundation across the essential AWS services. Keep exploring, keep experimenting, and let AWS work its magic — without surprising your billing dashboard!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e9170ed7c27" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding basics of XML]]></title>
            <link>https://medium.com/@vllikhitha123/understanding-basics-of-xml-0a4304fa6e3e?source=rss-9a6a8bbbeccc------2</link>
            <guid isPermaLink="false">https://medium.com/p/0a4304fa6e3e</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[xml]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[xml-schema]]></category>
            <dc:creator><![CDATA[likhitha vemparala]]></dc:creator>
            <pubDate>Wed, 12 Aug 2026 04:37:30 GMT</pubDate>
            <atom:updated>2026-08-12T04:37:30.560Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*fQjOFmLXLDo1i5qujWcpbw.png" /></figure><p><strong>Concepts Covered:</strong></p><p>1. What is XML</p><p>2. Key Features of XML</p><p>3. XML Structure</p><p>4. XML Syntax rules</p><p>5. Example of a Complete XML Document</p><p>6. XML vs HTML</p><p>7. Advantages of XML</p><p>8. Disadvantages of XML</p><p>9. XML Validation</p><p>10. Common XML use cases</p><p>11. Conclusion</p><p><strong>1. What is XML?</strong></p><p><strong>XML (eXtensible Markup Language)</strong> is a markup language designed to store, transport, and structure data in a readable format for both humans and machines. It is widely used for data exchange between systems, web services, configuration files, and more.</p><p><strong>Key Points:</strong></p><ul><li>XML is <strong>text-based</strong>.</li><li>Unlike HTML, XML <strong>does not define how data looks</strong>, only what the data is.</li><li>XML is <strong>self-descriptive</strong>, meaning the tags describe the data they enclose.</li></ul><p><strong>2. Key Features of XML</strong></p><ol><li><strong>Extensible</strong> — You can define your own tags.</li><li><strong>Structured and Hierarchical</strong> — Data is stored in a tree-like structure.</li><li><strong>Platform Independent</strong> — Can be used across different systems.</li><li><strong>Human-readable</strong> — Plain text makes it readable for humans.</li><li><strong>Supports Unicode</strong> — Can store data in any language.</li><li><strong>Self-descriptive</strong> — Tags explain the meaning of the data.</li><li><strong>Used in many standards</strong> — SOAP, RSS, XHTML, SVG, and more.</li></ol><p><strong>3. XML Structure</strong></p><p>An XML document has a hierarchical structure consisting of:</p><ol><li><strong>XML Declaration (Optional)</strong></li><li>&lt;?xml version=”1.0&quot; encoding=”UTF-8&quot;?&gt;</li></ol><ul><li>version — XML version (usually 1.0)</li><li>encoding — Character encoding (UTF-8 is standard)</li><li>standalone (optional) — Indicates if the XML relies on external resources.</li></ul><p><strong>3. Root Element</strong></p><ul><li>Every XML document must have exactly <strong>one root element</strong> that contains all other elements.</li></ul><p>&lt;company&gt;</p><p>…</p><p>&lt;/company&gt;</p><p><strong>4. Child Elements</strong></p><ul><li>Nested inside the root element.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/227/1*AGsHud-Js5eLib8ieP0zHw.png" /><figcaption>Fig: Example for a child element</figcaption></figure><p><strong>5. Attributes</strong></p><ul><li>Provide additional information about elements.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/268/1*iWbquqjEtj-GZaEFDfyJ7w.png" /><figcaption>Fig: Example for Attributes</figcaption></figure><p><strong>6. Text Content</strong></p><ul><li>The data stored within elements.</li></ul><p>&lt;name&gt;John&lt;/name&gt;</p><p><strong>7. Comments</strong></p><ul><li>Used for documentation.</li></ul><p>&lt;! — This is a comment →</p><p><strong>4. XML Syntax Rules</strong></p><ol><li><strong>Case-sensitive</strong></li></ol><p>&lt;Name&gt;John&lt;/Name&gt; &lt;! — Correct →</p><p>&lt;name&gt;John&lt;/Name&gt; &lt;! — Incorrect →</p><p><strong>2. Proper Nesting</strong></p><p>Elements must be properly nested and closed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*bM7K6s_BWppwMedE8USecQ.png" /><figcaption>Fig: Example for proper nesting</figcaption></figure><p><strong>3. Single Root Element</strong></p><ul><li>Only one root element is allowed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/324/1*f9huelEViV3H2Ld0hiXr8w.png" /><figcaption>Fig: Single root element</figcaption></figure><p><strong>4. Quoted Attribute Values</strong></p><p>&lt;employee id=”101&quot;&gt;John&lt;/employee&gt; &lt;! — Correct →</p><p>&lt;employee id=101&gt;John&lt;/employee&gt; &lt;! — Incorrect →</p><p><strong>5. No Overlapping Tags</strong></p><ul><li>Elements cannot overlap.</li></ul><p>&lt;a&gt;&lt;b&gt;&lt;/a&gt;&lt;/b&gt; &lt;! — Incorrect →</p><p><strong>5. Example of a Complete XML Document</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*WOaX-DfrfGPJZlxXZ9BFkg.png" /><figcaption>Fig: Example XML document</figcaption></figure><p><strong>6. XML vs HTML</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*zRiG2XXvI6rDHIu1OuJMZQ.png" /><figcaption>Fig: XML vs HTML</figcaption></figure><p><strong>7. Advantages of XML</strong></p><ol><li>Platform-independent and widely supported.</li><li>Flexible and extensible.</li><li>Facilitate data sharing between different systems.</li><li>Easy to validate using DTD (Document Type Definition) or XML Schema.</li><li>Supports Unicode (multilingual data).</li></ol><p><strong>8. Disadvantages of XML</strong></p><ol><li>Verbose and can increase file size.</li><li>Slower to parse compared to binary formats like JSON.</li><li>Requires strict syntax rules.</li><li>More complex than simpler formats for small datasets.</li></ol><p><strong>9. XML Validation</strong></p><ol><li><strong>Well-formed XML</strong> — Follows XML syntax rules.</li><li><strong>Valid XML</strong> — Conforms to a DTD or XML Schema (XSD).</li></ol><ul><li><strong>DTD Example</strong>:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*uJh4cUHNIWQm5i4SC7P7lw.png" /></figure><ul><li><strong>XSD Example:</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*VQ3XTr87IB9GiRrkc63f8A.png" /></figure><p><strong>10. Common XML Use Cases</strong></p><ul><li>Web services (SOAP, REST with XML payload)</li><li>Configuration files (e.g., .xml for software settings)</li><li>Data storage and exchange (RSS feeds, Atom feeds)</li><li>Document formats (XHTML, Office Open XML)</li><li>Metadata description (SVG, MusicXML)</li></ul><p><strong>11. Conclusion</strong></p><p>XML is still a useful technology for storing, sharing, and configuring structured data. Even with the rise of JSON, XML remains widely used in enterprise applications and legacy systems. Understanding its basics is therefore still valuable for developers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0a4304fa6e3e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Decoding ISO 20022: The Modern Standard Transforming Global Payments]]></title>
            <link>https://medium.com/@vllikhitha123/decoding-iso-20022-the-modern-standard-transforming-global-payments-841abdcbf62b?source=rss-9a6a8bbbeccc------2</link>
            <guid isPermaLink="false">https://medium.com/p/841abdcbf62b</guid>
            <category><![CDATA[payments]]></category>
            <category><![CDATA[iso20022]]></category>
            <dc:creator><![CDATA[likhitha vemparala]]></dc:creator>
            <pubDate>Wed, 12 Aug 2026 04:25:08 GMT</pubDate>
            <atom:updated>2026-08-12T04:25:08.913Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*E4peskCC3utWbGvL0nOvbA.png" /></figure><p><strong>Concepts Covered:</strong></p><p>1. Executive Summary</p><p>2. Background and rationale</p><p>3. ISO20022 Design principles</p><p>4. Message Structure</p><p>5. Implementation in Payments</p><p>6. Data Governance and Versioning</p><p>7. Benefits of ISO20022 in Payments</p><p>8. Implementation considerations</p><p>9. ISO 20022 Resources</p><p>10. Conclusion</p><p><strong>1. Executive Summary</strong></p><p>ISO 20022 is the global standard for financial messaging that provides a common platform for developing messages using a unified modelling methodology, a central data dictionary, and consistent business semantics. It replaces legacy standards such as SWIFT MT and domestic proprietary formats with a more flexible and structured XML-based (and now JSON-compatible) syntax.</p><p>For payment systems, ISO 20022 enables richer data, better interoperability, and improved automation across banks, corporates, and market infrastructures. The standard is being adopted globally — including in SWIFT CBPR+, TARGET2, Fedwire, CHAPS, and India’s upcoming ISO 20022-aligned payment infrastructures.</p><p><strong>2. Background and Rationale</strong></p><p>The financial industry historically relied on fragmented messaging formats (e.g., SWIFT MT, proprietary domestic formats). These were efficient for their time but limited in:</p><ul><li><strong>Data richness</strong> — limited fields and ambiguity.</li><li><strong>Cross-system compatibility</strong> — inconsistent field names and meanings.</li><li><strong>Automation potential</strong> — weak data semantics made straight-through processing (STP) difficult.</li></ul><p>ISO 20022 addresses these limitations by offering:</p><ol><li>A <strong>single methodology</strong> for defining all financial messages.</li><li>A <strong>common data dictionary</strong> ensuring semantic consistency.</li><li>A <strong>repository of business components</strong> reusable across domains.</li><li><strong>Extensible syntax mapping</strong> — XML, ASN.1, and JSON.</li></ol><p><strong>3. ISO 20022 Design Principles</strong></p><p><strong>3.1 Modelling Methodology</strong></p><p>ISO 20022 adopts a <em>model-driven</em> approach using the Unified Modelling Language (UML).</p><ul><li><strong>Business Layer:</strong> Captures processes and concepts in financial operations (e.g., payment initiation, clearing, settlement).</li><li><strong>Logical Layer:</strong> Defines business components, message components, and data types.</li><li><strong>Physical Layer:</strong> Generates syntax-specific message schemas (commonly XML).</li></ul><p><strong>3.2 Central Data Dictionary</strong></p><p>The ISO 20022 Data Dictionary provides standard definitions of business elements such as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*_kIf2Lxd_otkmMkfmi2Faw.png" /><figcaption>Fig: ISO20022 concepts</figcaption></figure><p>This dictionary ensures that the same data element means the same thing across all message sets and domains.</p><p><strong>3.3 Syntax Neutrality</strong></p><p>Although most current implementations use <strong>XML</strong>, ISO 20022 is syntax-independent. Message definitions can be expressed in XML, ASN.1, or JSON.<br> The standard separates business semantics from syntax, allowing easier future migration to new technologies (e.g., APIs).</p><p><strong>4. Message Structure</strong></p><p>ISO 20022 messages follow a well-defined structure, typically represented as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*-oGDS11a_p76oaQeV2uevg.png" /><figcaption>Fig: ISO20022 Message Structure</figcaption></figure><p><strong>Key Elements:</strong></p><ul><li><strong>Document Root:</strong> Identifies the message type and version (e.g., pain.001.001.09).</li><li><strong>Business Message Identifier:</strong> Follows format {BusinessArea}.{MessageIdentifier}.{Variant}.{Version}.</li><li>Example: pacs.008.001.10 = Payments Clearing and Settlement (Credit Transfer).</li></ul><p><strong>4.1 Common Message Families</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*BZfJNnW5oCnHo5A0O8c49A.png" /><figcaption>Fig: Common Message families</figcaption></figure><p><strong>4.2 Example: Credit Transfer</strong></p><p><strong>Message: pacs.008.001.10</strong></p><ul><li><strong>Purpose:</strong> Interbank FI to FI Customer Credit Transfer.</li><li><strong>Key Fields:</strong></li><li>IntrBkSttlmAmt — amount settled between banks.</li><li>Cdtr / Dbtr — creditor/debtor identification.</li><li>RmtInf — remittance information (supports unstructured and structured formats).</li></ul><p><strong>5. Implementation in Payments</strong></p><p><strong>5.1 Migration from SWIFT MT to ISO 20022</strong></p><p>Global payment systems are moving from SWIFT MT categories 1, 2, and 9 to ISO 20022 (CBPR+).</p><ul><li><strong>Timeline:</strong> Coexistence period from 2023–2025.</li><li><strong>Strategy:</strong> Map legacy MT fields to ISO 20022 elements using SWIFT’s translation rules.</li><li><strong>Impact:</strong> Systems must upgrade interfaces, databases, and reconciliation logic to support structured data.</li></ul><p><strong>5.2 Domestic Payment Systems</strong></p><p>Examples of ISO 20022 adoption:</p><ul><li><strong>TARGET2 (EU):</strong> Full migration completed 2023.</li><li><strong>Fedwire/CHIPS (US):</strong> Migration 2025–2026.</li><li><strong>NPP (Australia), RTGS (India — planned):</strong> ISO 20022-based formats.</li></ul><p><strong>5.3 Integration with APIs</strong></p><p>Modern payment infrastructures increasingly expose <strong>RESTful APIs</strong> that use JSON representations of ISO 20022 data models.</p><ul><li>ISO 20022 provides mapping rules from XML → JSON.</li><li>Example: pain.001 payload can be exposed as JSON fields in API requests.</li><li>ISO white paper <em>“ISO 20022 and Web APIs: Best Practices”</em> (2025) recommends:</li><li>Keep semantic integrity of message elements.</li><li>Reuse canonical identifiers (e.g., EndToEndId).</li><li>Avoid flattening nested structures.</li></ul><p><strong>6. Data Governance and Versioning</strong></p><p>Each message and data component has a version controlled by the <strong>ISO 20022 Registration Authority (SWIFT)</strong>.</p><ul><li><strong>Versioning model:</strong> {variant}.{version} (e.g., pacs.008.001.10).</li><li><strong>Change management:</strong></li><li>Business justifications for new or modified messages are submitted to the Registration Authority.</li><li>Approved messages are published in the <strong>ISO 20022 Message Catalogue</strong>.</li><li><strong>Local Flavours (Market Practice):</strong></li><li>Communities can create local variants with defined usage rules (e.g., CBPR+, HVPS+, NPP).</li></ul><p><strong>7. Benefits of ISO 20022 in Payments</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*DYJjQsQkhEW3f79ShNzr4Q.png" /><figcaption>Fig: Benefits of ISO20022 in Payments</figcaption></figure><p><strong>8. Implementation Considerations</strong></p><ol><li><strong>Message Mapping:</strong> Identify existing MT/proprietary message fields and map them to ISO 20022 equivalents.</li><li><strong>Data Model Upgrade:</strong> Expand databases to accommodate longer, structured fields.</li><li><strong>Validation Tools:</strong> Use XML schema (XSD) or JSON Schema validation for conformance.</li><li><strong>End-to-End Testing:</strong> Include message exchange between customer, bank, and clearing systems.</li><li><strong>Operational Readiness:</strong> Train staff on new data attributes and migration impacts.</li><li><strong>Security:</strong> Maintain message integrity and authentication (e.g., PKI, digital signatures).</li></ol><p><strong>9. ISO 20022 Resources</strong></p><ul><li><strong>Official Standard:</strong> <a href="https://www.iso20022.org/">www.iso20022.org</a> — core documentation, catalogue, schemas.</li><li><strong>Message Catalogue:</strong> <a href="https://www.iso20022.org/catalogue-messages">iso20022.org/catalogue-messages</a> — XML schemas &amp; message definition reports.</li><li><strong>Best Practices White Paper:</strong> <em>ISO 20022 and Web APIs: Implementation Best Practices (2025)</em>.</li><li><strong>Community Guides:</strong></li><li>SWIFT CBPR+ Implementation Guidelines.</li><li>HVPS+ (High-Value Payment System) Usage Guidelines.</li><li>NPP (Australia) and ECB TARGET2 Implementation Guides.</li><li><strong>Learning Material:</strong> <a href="https://iso20022.com/">iso20022.com</a> and <a href="https://iso20022ref.com/">iso20022ref.com</a>.</li></ul><p><strong>10. Conclusion</strong></p><p>ISO 20022 is not just a new message format — it represents a <strong>semantic model for financial data</strong>. For payment systems, it enables interoperability, data-rich automation, and regulatory compliance across global networks.</p><p>Organizations adopting ISO 20022 should treat it as a <strong>data transformation project</strong> rather than a simple message migration. Proper data modelling, validation, and integration with APIs are critical success factors.</p><p>With most major infrastructures migrating by 2025–2026, implementing ISO 20022-compliant payment systems is now essential for maintaining cross-border compatibility and future-proofing financial services.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=841abdcbf62b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making Art in Small Spaces: How a Desk Corner Can Spark Your Creativity]]></title>
            <link>https://medium.com/@vllikhitha123/making-art-in-small-spaces-how-a-desk-corner-can-spark-your-creativity-5bc5bfe24831?source=rss-9a6a8bbbeccc------2</link>
            <guid isPermaLink="false">https://medium.com/p/5bc5bfe24831</guid>
            <category><![CDATA[workspace]]></category>
            <category><![CDATA[creativity]]></category>
            <dc:creator><![CDATA[likhitha vemparala]]></dc:creator>
            <pubDate>Sat, 01 Aug 2026 13:28:49 GMT</pubDate>
            <atom:updated>2026-08-01T13:28:49.975Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*IAamvumHbMTtOWzsB0fzrg.avif" /></figure><p>Creativity doesn’t live in grand spaces — it lives in corners, nooks, and the tiny pockets of time we carve out for ourselves.</p><p>Even a <strong>small desk corner</strong> can become a playground for imagination, a place where colors, textures, and ideas collide. And if you’re staring at the same screens, cables, and gadgets day after day, turning that corner into a creative oasis can transform how you feel, how you work, and even how you see the world.</p><h3>Why Small Spaces Are Secretly Perfect for Creativity</h3><p>Constraints aren’t limitations — they’re invitations. When you only have a little room to work with:</p><ul><li>Your brain becomes inventive. You figure out clever ways to make things fit.</li><li>Every tiny creation feels like a victory.</li><li>You learn to <strong>focus on what matters</strong>, not what you think should be perfect.</li></ul><p>And the best part? Your tech gadgets — your laptop, headphones, cables, or desk lamp — aren’t obstacles. They can be part of the canvas, part of your art. A glowing LED strip, a painted laptop stand, or a quirky cable wrap can turn your workstation into a personal gallery.</p><h3>Step-by-Step Crafts to Try Today</h3><p>Here’s how to bring your tiny desk corner to life with hands-on projects. Each category has <strong>1–2 crafts you can make in 10–20 minutes</strong>.</p><h3>1. Desktop “Mood Corners”</h3><p><strong>Mini Zen Tray</strong><br><strong>Materials:</strong> Small tray, sand, tiny pebbles, small figurine or origami.<br><strong>Steps:</strong></p><ol><li>Fill the tray with a thin layer of sand.</li><li>Place 2–3 pebbles in a pleasing arrangement.</li><li>Add a tiny origami figure, small plant, or figurine.</li><li>Optional: Draw patterns in the sand with a stick or finger.</li></ol><p><strong>Mood Cards</strong><br><strong>Materials:</strong> Cardstock or thick paper, pens, markers.<br><strong>Steps:</strong></p><ol><li>Cut paper into small cards (3×3 inches).</li><li>Write a mood word or positive phrase on each card.</li><li>Decorate with doodles or colors.</li><li>Shuffle and display a card each day.</li></ol><h3>2. Cable Couture</h3><p><strong>Thread-Wrapped Cables</strong><br><strong>Materials:</strong> Earphones, charging cables, embroidery thread, tape/glue.<br><strong>Steps:</strong></p><ol><li>Secure the thread at the start of your cable.</li><li>Wrap tightly along the cable.</li><li>Tie off and secure with a small dot of glue.</li><li>Optional: Add a charm at the plug end.</li></ol><p><strong>Clay Cable Holder</strong><br><strong>Materials:</strong> Air-dry clay.<br><strong>Steps:</strong></p><ol><li>Roll clay into a small cylinder or animal shape.</li><li>Press a groove to hold cables.</li><li>Let dry.</li><li>Place on your desk and thread cables through.</li></ol><h3>3. Miniature DIY Gadgets</h3><p><strong>Cardboard Laptop Stand</strong><br><strong>Materials:</strong> Cardboard, scissors, ruler, tape, markers/paint.<br><strong>Steps:</strong></p><ol><li>Cut two identical L-shaped pieces.</li><li>Attach with tape to form a stable “X.”</li><li>Place your laptop on top.</li><li>Decorate with paint, markers, or stickers.</li></ol><p><strong>Decorative Pen Holder</strong><br><strong>Materials:</strong> Empty tin can, scrap paper, glue, markers.<br><strong>Steps:</strong></p><ol><li>Wrap the can with decorative paper.</li><li>Glue in place.</li><li>Add doodles, paint, or washi tape accents.</li><li>Use for pens or small tools.</li></ol><h3>4. Tiny Interactive Art</h3><p><strong>Mini Flipbook</strong><br><strong>Materials:</strong> Sticky notes, pen/marker.<br><strong>Steps:</strong></p><ol><li>Stack 10–20 sticky notes.</li><li>Draw a simple animation (like a bouncing ball).</li><li>Flip notes quickly to see movement.</li></ol><p><strong>Origami Story Characters</strong><br><strong>Materials:</strong> Paper, markers.<br><strong>Steps:</strong></p><ol><li>Fold small origami figures (cranes, boats, cats).</li><li>Decorate with simple eyes, patterns, or color.</li><li>Arrange on your desk to tell a little story.</li></ol><h3>5. Nature Meets Workspace</h3><p><strong>Succulent in a Painted Mug</strong><br><strong>Materials:</strong> Teacup/mug, small succulent, soil, paint/markers.<br><strong>Steps:</strong></p><ol><li>Decorate the mug.</li><li>Fill with gravel, then soil.</li><li>Plant the succulent.</li><li>Water lightly and place on your desk.</li></ol><p><strong>Pressed Leaf Decor</strong><br><strong>Materials:</strong> Leaves, paper, tape/glue.<br><strong>Steps:</strong></p><ol><li>Press leaves for 24–48 hours.</li><li>Glue or tape onto a notebook or small card.</li><li>Display on your desk or in a tiny frame.</li></ol><h3>Mini Creativity Toolkit</h3><ul><li><strong>Everyday Materials:</strong> Scrap paper, sticky notes, washi tape, old notebooks, modeling clay, jars.</li><li><strong>Tiny Tech Decor:</strong> LED strips, cardboard stands, mini cable organizers, charms.</li><li><strong>Nature Touches:</strong> Succulents, pebbles, shells, dried flowers.</li><li><strong>Simple Tools:</strong> Scissors, glue, rulers, pencils, erasers.</li><li><strong>Optional Boosters:</strong> Tiny notebooks, origami templates, motivational sticky notes, keepsakes.</li></ul><p>✨ <strong>Pro tip:</strong> Start with one or two items and experiment over a week. Watch your space transform.</p><h3>🛠 AI + Craft Toolkit: Boost Your Creativity</h3><p>If you want a <strong>digital twist</strong> to your crafts, these AI tools help <strong>design, visualize, and personalize projects</strong>:</p><ol><li><strong>DALL·E / MidJourney / Leonardo AI:</strong> Generate patterns, textures, or miniature art to print.</li><li><strong>Canva AI:</strong> Create desk cards, mini story jars, or pixel art templates.</li><li><strong>Figma + AI Plugins:</strong> Plan desk layouts or design interactive paper crafts digitally.</li><li><strong>Remove.bg / Image Editing Tools:</strong> Turn photos of leaves, doodles, or small objects into printables.</li></ol><p>✨ <strong>Tip:</strong> Use AI as a <strong>design assistant, not a replacement</strong>. Generate, visualize, then craft — it’s the magic combo.</p><h3>Challenge: Transform Your Desk in a Week</h3><ol><li>Pick <strong>one corner</strong> of your desk.</li><li>Add <strong>one handmade object</strong> — an origami, a painted jar, a tiny plant.</li><li>Observe how it feels. Adjust tomorrow, add another touch.</li></ol><p>By the end of the week, your corner will <strong>tell a story — yours</strong>.</p><h3>Final Thought</h3><p>Creativity isn’t about perfection, big spaces, or expensive supplies. It’s about <strong>turning ordinary corners into places of play, reflection, and experimentation</strong>.</p><p>A wobbly origami crane. A hand-decorated pen holder. A tiny plant in a painted mug.</p><p>Start small. Start today. Let your desk corner be the place where <strong>your imagination comes alive</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5bc5bfe24831" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Redis Cache with Spring Boot: A Simple Beginner Guide]]></title>
            <link>https://medium.com/@vllikhitha123/redis-cache-with-spring-boot-a-simple-beginner-guide-efa85f32fcbc?source=rss-9a6a8bbbeccc------2</link>
            <guid isPermaLink="false">https://medium.com/p/efa85f32fcbc</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[redis]]></category>
            <dc:creator><![CDATA[likhitha vemparala]]></dc:creator>
            <pubDate>Fri, 27 Mar 2026 11:33:13 GMT</pubDate>
            <atom:updated>2026-03-27T11:33:13.038Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*so2xIV9UunlbrCx_j6Uf_Q.jpeg" /></figure><p><strong>Concepts covered:</strong></p><ol><li>Caching</li><li>How caching works in Spring boot</li><li>What is Redis</li><li>What Redis cache means</li><li>Why use Redis with Spring Boot</li><li>How to integrate Redis with Spring Boot (with example code)</li><li>Visualize Redis cache data</li><li>References</li><li>Conclusion</li></ol><p><strong>1. Caching</strong></p><p><strong>I. Definition</strong></p><p><strong>Caching</strong> is the process of <strong>storing frequently accessed data in a temporary storage (cache)</strong> so it can be retrieved faster the next time it’s needed.</p><p>Think of caching like:</p><p>“Keeping a copy of something you use often in your desk drawer, instead of going to the storage room every time.”</p><p><strong>II. How It Works</strong></p><p>Let’s say your app fetches user data from a database:</p><ol><li>The first time you call /user/1, your app fetches from the <strong>database</strong> (slow but accurate).</li><li>It <strong>stores that result in cache</strong> (like Redis or in-memory).</li><li>The next time someone calls /user/1, your app checks the <strong>cache first</strong> — if the data is still valid, it returns it instantly, without touching the DB.</li></ol><p>This drastically improves performance and reduces load.</p><p><strong>III. Why Do We Need Caching?</strong></p><p>Caching solves <strong>three big problems</strong> in modern applications:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*Gya98Pny55E8WntLG60aXg.png" /><figcaption>Fig: How caching solves problems</figcaption></figure><p><strong>IV. Real-World Examples</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*3R7DD42QSl_2z-YDlc9jKQ.png" /><figcaption>Fig: Real world examples</figcaption></figure><p><strong>V. Types of Caching</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*JdOkhGTtYRyKyigFPHefFQ.png" /><figcaption>Fig: Caching types</figcaption></figure><p><strong>VI. How Caching Fits in Your System</strong></p><p>A simplified flow:</p><p>Client → Spring Boot → Cache → Database</p><ol><li>Spring Boot checks <strong>cache first</strong></li><li>If data found → returns it</li><li>If not → fetches from <strong>DB</strong>, stores it in <strong>cache</strong>, returns to user</li></ol><p>This pattern is called <strong>Cache-Aside</strong> (used by default in Spring Cache).</p><p><strong>2. How caching works in Spring boot</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*zRvlPTv7bkDWsfeHkTHLvA.png" /><figcaption>Fig: Cache in spring boot</figcaption></figure><p><strong>3. What is Redis?</strong></p><p><strong>Redis</strong> (Remote Dictionary Server) is an <strong>in-memory data structure store</strong>.<br> It’s extremely fast because data is stored in <strong>RAM</strong>, not on disk.</p><p>Redis can be used as:</p><ul><li>A <strong>cache</strong> (to temporarily store data and reduce database load)</li><li>A <strong>message broker</strong></li><li>A <strong>session store</strong></li><li>A <strong>NoSQL database</strong></li></ul><p>Common data structures in Redis:</p><ul><li>String</li><li>Hash</li><li>List</li><li>Set</li><li>Sorted Set</li></ul><p><strong>4. What is Redis Cache?</strong></p><p>A <strong>cache</strong> is a temporary data store that keeps frequently used data in memory.<br> Redis is often used as a cache layer <strong>in front of a database</strong> to make applications faster.</p><p><strong>Benefits:</strong></p><p><strong>1. Reduces database load:</strong><br> Because frequently accessed data is served from Redis, the number of queries hitting the main database decreases significantly — improving overall system performance and scalability.</p><p><strong>2. Improves response time:</strong><br> Redis stores data in memory (RAM), so fetching from Redis is much faster than fetching from disk-based databases — leading to low-latency responses for end users.</p><p><strong>3.</strong> <strong>Increases scalability and availability:</strong><br> With Redis handling a large portion of read requests, your application can handle more users concurrently without overloading the backend database.</p><p><strong>4. Supports data expiration:</strong><br> You can set a time-to-live (TTL) on cached data so outdated or stale information is automatically removed and refreshed when needed.</p><p><strong>Example:</strong></p><p>Let’s say your Spring Boot app fetches user data from a database.</p><ul><li>Normally: Every time you call getUserById(1), it hits the database.</li><li>With Redis Cache:</li><li>The first call fetches from DB and stores the result in Redis.</li><li>The next calls fetch directly from Redis (much faster).</li></ul><p><strong>5. Why use Redis with Spring Boot?</strong></p><p>Spring Boot provides built-in support for caching using:</p><ul><li>Annotations like @Cacheable, @CachePut, @CacheEvict are used.</li><li>Configuration can be made through spring-boot-starter-cache.</li><li>Support for Redis via dependency spring-boot-starter-data-redis.</li><li>Spring Boot makes it very easy to integrate Redis — you just add the dependency, enable caching with @EnableCaching, and Spring automatically handles the caching logic behind the scenes.</li><li>Combined with Spring Boot, it can significantly boost application performance and handle large-scale workloads efficiently.</li><li>Spring’s caching abstraction works hand-in-hand with Redis to automatically store, update, and evict cached data using simple annotations — reducing boilerplate code and improving maintainability.</li><li>Redis allows your cache to be shared across multiple instances of a Spring Boot application, making it ideal for microservices and cloud environments.</li></ul><p><strong>6. Redis Cache with Spring Boot</strong></p><p>Let’s walk through an example.</p><p><strong>Step 1: Add Dependencies (Maven)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*xjd5UX85bvae9vw5MLHgfA.png" /><figcaption>Fig: Maven dependencies</figcaption></figure><p><strong>Step 2: Application Properties</strong></p><p><strong>Configure Redis connection:</strong></p><p>spring.application.name=redis-demo</p><p>server.port=8080</p><p>spring.data.redis.host=localhost</p><p>spring.data.redis.port=6379</p><p>(Assumes Redis is running locally — you can use Docker or install Redis manually.)</p><p><strong>To run redis using Docker Desktop:</strong></p><p>· To start Redis using Docker Desktop:</p><p>docker run — name redis -p 6379:6379 -d redis</p><p>· Verify redis is running:</p><p>docker ps</p><p>· To stop redis:</p><p>docker stop redis , to start again — docker start redis</p><p><strong>To use Redis manually:</strong></p><p>· Download Redis from Microsoft archive (unofficial):<br> <a href="https://github.com/microsoftarchive/redis/releases">https://github.com/microsoftarchive/redis/releases</a></p><p>· Extract the zip file and run redis-server.exe, you will see the redis will be started on port 6379.</p><p>· Open a separate command prompt to run redis-cli.exe to test: redis-cli.exe ping //output:PONG</p><p><strong>Step 3: Enable Caching</strong></p><p>In your main Spring Boot application class:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1IUSh0mxFx3QyjbhXits2Q.png" /><figcaption>Fig: Main class</figcaption></figure><p><strong>Step 4: Create a Simple Service Using Cache</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mFNcmYPWU-w6WPcRiU428A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YYuG_W9h9inK-YMS7yeTZA.png" /></figure><p><strong>Step 5: Create a Controller</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kAOHlumV-t_zCS5mopI23w.png" /></figure><p><strong>Step 6: Test It</strong></p><p>Run the app and open your postman or use curl:</p><p>curl <a href="http://localhost:8080/users/getUser/1">http://localhost:8080/users/getUser/1</a></p><p>✅ <strong>First call:</strong> Takes ~3 seconds (data fetched from DB and cached).<br>✅ <strong>Second call:</strong> Instant! (data fetched from Redis).</p><p><strong>Note</strong>: Add security config class for your APIs to work.</p><p><strong>7. Visualize Redis cache data</strong></p><p>We’ll explore <strong>two easy options</strong>:</p><ol><li><strong>Using Redis CLI</strong> (simple terminal)</li><li><strong>Using Redis Insight GUI</strong> (beautiful visual dashboard)</li></ol><p><strong>Option 1: Inspect Redis Cache via Redis CLI</strong></p><p>Since Redis is already running in your Docker Compose setup, you can connect directly from your terminal.</p><p><strong>Step 1. Enter the Redis container:</strong></p><p>docker exec -it redis-server redis-cli</p><p><strong>Step 2. Check all keys:</strong></p><p>keys *</p><p>You’ll likely see something like:</p><p>1) “users::1”</p><p>That’s your cached entry created by:</p><p>@Cacheable(value = “users”, key = “#id”)</p><p>It combines the cache name (users) and the key (1).</p><p><strong>Step 3. Get the cached value:</strong></p><p>get “users::1”</p><p>Depending on Spring’s serialization, it might look like:</p><p>“\xac\xed\x00\x05t\x00\x06User_1”</p><p>That’s because Spring uses <strong>Java serialization</strong> by default.</p><p><strong>Option 2: Visualize with RedisInsight GUI</strong></p><p><a href="https://redis.io/insight/">RedisInsight</a> is a free visual tool from Redis that lets you explore keys, values, and metrics interactively.</p><p><strong>Step 1. Download and Run RedisInsight</strong></p><p>You can either:</p><ul><li>Download from the <a href="https://redis.io/insight/">RedisInsight website</a>, <strong>or</strong></li><li>Run it via Docker:</li></ul><p>docker run -d \</p><p>— name redis-insight \</p><p>-p 5540:5540 \</p><p>redis/redisinsight:latest</p><p><strong>Step 2. Open the Dashboard</strong></p><p>Go to <a href="http://localhost:5540/">http://localhost:5540</a> in your browser.</p><p><strong>Step 3. Connect to Redis</strong></p><ul><li>Click <strong>“Add Redis Database”</strong></li><li>Host: redis</li><li>Port: 6379</li><li>(If you’re running Redis locally, use localhost:6379)</li></ul><p><strong>Step 4. View Cached Data</strong></p><p>You’ll see:</p><ul><li>Keys like users::1</li><li>TTL (time-to-live)</li><li>Values (you can expand and view the JSON)</li></ul><p><strong>Step 5. Bonus Tips</strong></p><p><strong>See Key Expiration</strong></p><p>ttl “users::1”</p><p>Output example:</p><p>(integer) 600</p><p>→ means the key will expire in 600 seconds (10 minutes).</p><p><strong>Delete a Cached Key</strong></p><p>del “users::1”</p><p><strong>View Memory Usage</strong></p><p>info memory</p><p><strong>8. References</strong></p><p>· Visit official website — <a href="https://www.redis.io/">https://www.redis.io</a></p><p>· Geeks for Geeks — <a href="https://www.geeksforgeeks.org/system-design/redis-cache/">https://www.geeksforgeeks.org/system-design/redis-cache/</a></p><p>· Aws — <a href="https://docs.aws.amazon.com/whitepapers/latest/database-caching-strategies-using-redis/additional-caching-with-redis.html">https://docs.aws.amazon.com/whitepapers/latest/database-caching-strategies-using-redis/additional-caching-with-redis.html</a></p><p><strong>9. Conclusion</strong></p><p>With Redis caching, your app goes from “loading…loading…” to “here you go!” in record time. It’s like giving your backend a cup of coffee: faster, more alert, and ready to handle whatever traffic comes its way. So, cache smart, code smarter, and let Redis do the heavy lifting!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=efa85f32fcbc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kafka vs RabbitMQ: Which one to Choose?]]></title>
            <link>https://medium.com/@vllikhitha123/kafka-vs-rabbitmq-which-one-to-choose-a5642555236c?source=rss-9a6a8bbbeccc------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5642555236c</guid>
            <category><![CDATA[rabbitmq]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[apache-kafka]]></category>
            <dc:creator><![CDATA[likhitha vemparala]]></dc:creator>
            <pubDate>Mon, 01 Dec 2025 07:09:48 GMT</pubDate>
            <atom:updated>2025-12-01T08:23:01.572Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*ZBYD-xEpngQ20vFtQcwtjg.jpeg" /></figure><p>If you’re building microservices, handling real-time data, or designing anything remotely distributed, you’ve probably heard the names <strong>Kafka</strong> and <strong>RabbitMQ</strong> more times than you’ve heard your own.</p><p>And then comes the big question — the one that architects whisper about at 2 AM while staring at logs and doubting:</p><p><strong>“Which one should I use?”</strong></p><p>Don’t worry.</p><p>Let’s talk like real humans who build real systems that sometimes break.</p><h3>1. What RabbitMQ Actually Is ?</h3><p>RabbitMQ is a <strong>traditional message broker</strong>.<br>It takes your message, finds the right queue for it, stores it safely, and hands it off to the consumer like a professional mail courier.</p><p>Why do developers love RabbitMQ?</p><ul><li>It guarantees delivery.</li><li>It gracefully handles retries, dead letters, and priority queues.</li><li>Its routing system is ridiculously flexible.</li><li>It’s easy to set up, easy to learn, and plays well with microservices.</li></ul><p>RabbitMQ is ideal for systems where <strong>every message matters</strong> and can’t just disappear into the void.</p><h3>2. What Kafka Is ?</h3><p>Kafka is not just a message broker.<br>It is an <strong>event streaming platform</strong>.</p><p>Here’s what makes Kafka special:</p><ul><li>It handles millions of events per second without breaking a sweat.</li><li>It stores events for hours, days, or forever — your choice.</li><li>Consumers can replay events whenever they want.</li><li>It’s built for distributed, large-scale, real-time systems.</li></ul><p>If your application needs to <strong>stream</strong>, <strong>analyze</strong>, <strong>replay</strong>, or <strong>pipeline data</strong>, Kafka becomes your best friend.</p><h3>3. Architecture Explained</h3><h4>RabbitMQ Architecture</h4><p>RabbitMQ uses this flow:</p><p><strong>Producer → Exchange → Queue → Consumer</strong></p><ul><li>The <strong>exchange</strong> decides where messages go.</li><li>The <strong>queue</strong> stores them safely.</li><li>The <strong>consumer</strong> takes them when ready.</li></ul><p>It’s built for <strong>message delivery</strong>, <strong>acknowledgements</strong>, and <strong>tight control</strong> over who gets what.</p><h4>Kafka Architecture</h4><p>Kafka’s architecture works differently:</p><p><strong>Producer → Topic → Partition → Consumer Group</strong></p><ul><li>Messages are stored in <strong>topics</strong>, split across <strong>partitions</strong>.</li><li>Consumers read at their own pace.</li><li>Kafka keeps messages for a set retention period — even after they’re read.</li></ul><p>It’s optimized for speed, parallelism, and replay.</p><h3>4. When You Should Choose Kafka (Real-Life Examples)</h3><p>Use Kafka when your system behaves like this:</p><h4>✔ “We receive a ton of events per second.”</h4><p>Clickstreams, IoT sensors, financial trades — Kafka loves firehose-level data.</p><h4>✔ “We want to process data in real time.”</h4><p>Dashboards, fraud detection, recommendation engines.</p><h4>✔ “We might need to reprocess old messages.”</h4><p>Kafka stores history — RabbitMQ doesn’t.</p><h4>✔ “We have many consumers reading the same data.”</h4><p>Kafka allows multiple consumer groups replaying independently.</p><p>If your system feels like a river of continuous events flowing endlessly — Kafka is the best choice.</p><h3>5. When You Should Choose RabbitMQ (Real-Life Examples)</h3><p>Use RabbitMQ when your system behaves like this:</p><h4>✔ “I need to route messages intelligently.”</h4><p>Email goes here, SMS goes there, notifications somewhere else?<br> RabbitMQ is routing royalty.</p><h4>✔ “I want guaranteed delivery — no matter what.”</h4><p>E-commerce, banking, billing — RabbitMQ won’t lose your messages.</p><h4>✔ “My tasks must be processed exactly once.”</h4><p>Think job queues, background workers, workflows.</p><h4>✔ “My microservices need simple, reliable communication.”</h4><p>RabbitMQ is the perfect “glue” between services.</p><p>If your system feels like a workplace with tasks needing careful handling — RabbitMQ is your best choice.</p><h3>6. So… Which One Should YOU Use?</h3><p>Choose RabbitMQ if:</p><ul><li>You’re working with microservices.</li><li>You need smart routing.</li><li>You want task queues or background workers.</li><li>You need strict message delivery guarantees.</li></ul><p>Choose Kafka if:</p><ul><li>You’re dealing with high-volume events.</li><li>You need streaming, analytics, or real-time dashboards.</li><li>You want event replay.</li><li>You’re building large-scale distributed systems.</li></ul><p>Many companies use <strong>both</strong>.</p><p>Kafka for event streaming.<br>RabbitMQ for microservice communication.</p><p>Together, they’re unstoppable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5642555236c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beginners RabbitMQ + Spring boot guide]]></title>
            <link>https://medium.com/@vllikhitha123/beginners-rabbitmq-spring-boot-guide-37cea04bd609?source=rss-9a6a8bbbeccc------2</link>
            <guid isPermaLink="false">https://medium.com/p/37cea04bd609</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[rabbitmq]]></category>
            <dc:creator><![CDATA[likhitha vemparala]]></dc:creator>
            <pubDate>Mon, 01 Dec 2025 07:07:24 GMT</pubDate>
            <atom:updated>2025-12-01T07:08:12.243Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*XREy3WdBDRxpnI2l5JuL0Q.webp" /></figure><p>In this world, applications must communicate reliably, even when parts of the system fail or go offline. That’s exactly the job of RabbitMQ — a powerful, flexible, and battle-tested message broker used by companies across finance, e-commerce, logistics, and cloud infrastructure.</p><p>In this guide, we’ll walk through what RabbitMQ is, why developers trust it, how it works internally, and how you can build your first app with RabbitMQ and Spring Boot.</p><h3>1. Introduction</h3><p>RabbitMQ is an open-source <strong>message broker</strong> designed to help applications communicate by sending messages through queues. Instead of services talking directly to each other, they communicate indirectly via RabbitMQ, creating a more resilient, decoupled, and manageable system.</p><p>It supports multiple messaging patterns — work queues, publish/subscribe, topic-based routing, and more — which makes it suitable for a wide range of real-world needs.</p><h3>2. Why RabbitMQ?</h3><p>RabbitMQ is widely adopted because it simplifies distributed communication while guaranteeing message safety. Here’s why engineers love it:</p><ul><li><strong>Reliable Message Delivery:</strong> Ensures messages are never lost, even if consumers fail.</li><li><strong>Flexible Routing:</strong> Exchanges allow advanced message routing using keys or patterns.</li><li><strong>Protocol Support:</strong> Works with AMQP, MQTT, STOMP, WebSockets, and more.</li><li><strong>Language Agnostic:</strong> Supports Java, Go, Python, Node.js, and any language with a client library.</li><li><strong>Battle-Tested:</strong> Trusted in mission-critical systems for over a decade.</li><li><strong>Easy to Monitor:</strong> Includes a powerful management dashboard.</li><li><strong>Rich Plugin Ecosystem:</strong> Authentication, federation, sharding, delayed messages, etc.</li></ul><p>If your system requires predictability, durability, and control over message flow, RabbitMQ is an excellent fit.</p><h3>3. Core Concepts</h3><p>Before diving into the architecture, let’s decode RabbitMQ’s essential components.</p><h4>Producer</h4><p>An application that <em>sends</em> messages.</p><h4>Exchange</h4><p>Receives messages from producers and decides where they should go.</p><p>Types of exchanges:</p><ul><li><strong>Direct</strong></li><li><strong>Topic</strong></li><li><strong>Fanout</strong></li><li><strong>Headers</strong></li></ul><h4>Queue</h4><p>Stores messages until consumers process them. Queues are durable, reliable, and can hold millions of messages.</p><h4>Binding</h4><p>A connection linking exchanges to queues, defining routing rules.</p><h4>Routing Key</h4><p>A label producers attach to messages to guide routing.</p><h4>Consumer</h4><p>An application that <em>receives and processes</em> messages from a queue.</p><h4>Acknowledgements</h4><p>Consumers confirm when messages are successfully processed. If not acknowledged, RabbitMQ re-delivers them.</p><h3>4. RabbitMQ Architecture Overview (Detailed)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HoAG-7IhLaXShPJG-g9kvA.png" /></figure><p>RabbitMQ uses a <strong>broker-based architecture</strong>, acting as a central hub for message exchange. Instead of producers and consumers communicating directly, the broker takes full responsibility for receiving, routing, storing, and delivering messages safely.</p><h4>a. Producer (Sender Application)</h4><p>A producer publishes messages to an <strong>exchange</strong>. It never interacts with queues directly.<br>Example: OrderService publishes “order.created” messages.</p><h4>b. Exchange (Message Router)</h4><p>The exchange decides where the message should go based on routing rules.</p><p><strong>Types of exchanges:</strong></p><ul><li><strong>Direct Exchange:</strong> Exact routing key match</li><li><strong>Topic Exchange:</strong> Wildcard patterns (order.*, user.#)</li><li><strong>Fanout Exchange:</strong> Broadcast to all queues</li><li><strong>Headers Exchange:</strong> Routes based on message header attributes</li></ul><p>Exchanges <strong>do not store messages</strong> — they only route.</p><h4>c. Queue (Message Storage Component)</h4><p>Once an exchange routes a message, it lands in one or more queues.<br>Queues:</p><ul><li>Hold messages until consumers fetch them</li><li>Can be durable (persist through restarts)</li><li>Support priorities, TTL, and maximum length</li></ul><p>RabbitMQ ensures queues can handle large backlogs safely.</p><h4>d. Binding (Exchange → Queue Link)</h4><p>A binding defines rules describing <strong>how messages flow</strong> from an exchange into a queue.</p><p>Example:<br>Queue: invoiceQueue<br>Exchange: billingExchange<br>Routing key: invoice.created</p><p>Only messages tagged with that routing key go into that queue.</p><h4>e. Consumer (Receiver Application)</h4><p>Consumers read messages from queues and process them.<br>They may run one at a time or scale horizontally (multiple consumers handling the same queue).</p><h4>f. Acknowledgements (ACK/NACK)</h4><p>After processing, consumers send:</p><ul><li><strong>ACK</strong> → “Message handled successfully”</li><li><strong>NACK</strong> or failure → Message is requeued for retry</li></ul><p>This guarantees message safety and prevents data loss.</p><h4>g. Dead Letter Exchange (DLX)</h4><p>If a message:</p><ul><li>Expires</li><li>Fails repeatedly</li><li>Is rejected</li><li>Exceeds queue limits</li></ul><p>…it gets moved to a <strong>dead-letter queue</strong> for debugging or compensating workflows.</p><h4>h. Clustering &amp; High Availability</h4><p>RabbitMQ nodes can join together into a cluster. Benefits:</p><ul><li>Load distribution</li><li>High availability</li><li>Failover in case of crashes</li><li>Quorum queues or mirrored queues for redundancy</li></ul><p>This architecture makes RabbitMQ robust even under heavy load.</p><h3>5. How to Install RabbitMQ on Windows</h3><p>RabbitMQ requires the <strong>Erlang Runtime Environment</strong>, so installation happens in two steps.</p><h4>Step 1 — Install Erlang</h4><ol><li>Download the Windows installer from the official Erlang page.</li><li>Run the installer and use default settings.</li><li>Verify installation:</li></ol><ul><li>erl</li></ul><p>If the Erlang shell opens, it’s installed correctly.</p><h4>Step 2 — Install RabbitMQ</h4><ol><li>Download RabbitMQ for Windows (.exe) from the official website.</li><li>Run the installer.</li><li>After installation, open <strong>Services</strong> in Windows and start:</li><li><strong>RabbitMQ Server</strong></li></ol><h4>Step 3 — Enable Management Dashboard</h4><p>Run this in PowerShell (Admin):</p><pre>rabbitmq-plugins enable rabbitmq_management</pre><p>Access the UI here:</p><pre>http://localhost:15672</pre><p>Default login: guest / guest</p><h3>6. Demo App Design — RabbitMQ + Spring Boot</h3><p>Let’s outline a simple producer–consumer app using Spring Boot.</p><h4>Architecture Flow</h4><pre>Spring Boot Producer  <br>   → RabbitMQ Exchange  <br>       → Queue  <br>           → Spring Boot Consumer</pre><h4>Dependencies (pom.xml)</h4><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;<br>    &lt;artifactId&gt;spring-boot-starter-amqp&lt;/artifactId&gt;<br>&lt;/dependency&gt;</pre><h4>Configuration</h4><pre>@Configuration<br>public class RabbitConfig {</pre><pre>    public static final String QUEUE = &quot;demoQueue&quot;;<br>    public static final String EXCHANGE = &quot;demoExchange&quot;;<br>    public static final String ROUTING_KEY = &quot;demo.key&quot;;</pre><pre>    @Bean<br>    Queue queue() {<br>        return new Queue(QUEUE, true);<br>    }</pre><pre>    @Bean<br>    DirectExchange exchange() {<br>        return new DirectExchange(EXCHANGE);<br>    }</pre><pre>    @Bean<br>    Binding binding() {<br>        return BindingBuilder.bind(queue())<br>            .to(exchange())<br>            .with(ROUTING_KEY);<br>    }<br>}</pre><h4>Producer</h4><pre>@Autowired<br>private AmqpTemplate template;</pre><pre>public void sendMessage(String msg) {<br>    template.convertAndSend(RabbitConfig.EXCHANGE,<br>                            RabbitConfig.ROUTING_KEY,<br>                            msg);<br>}</pre><h4>Consumer</h4><pre>@RabbitListener(queues = RabbitConfig.QUEUE)<br>public void receive(String message) {<br>    System.out.println(&quot;Received: &quot; + message);<br>}</pre><p>This is a basic simple workflow to create event-driven microservices using RabbitMQ.</p><h3>7. Conclusion</h3><p>RabbitMQ stays cool, grabs every message, files it neatly into a queue, and hands it off to the right service like a Zen postal worker.</p><p>Whether you’re building a small notification system or a massive distributed application, RabbitMQ is the teammate you’ll want handling the messages — because it never forgets, never panics, and doesn’t ghost your services!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37cea04bd609" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beginners Kafka + Spring Boot Guide]]></title>
            <link>https://medium.com/@vllikhitha123/beginners-kafka-spring-boot-guide-63242b7a1619?source=rss-9a6a8bbbeccc------2</link>
            <guid isPermaLink="false">https://medium.com/p/63242b7a1619</guid>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[java8]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[likhitha vemparala]]></dc:creator>
            <pubDate>Thu, 20 Nov 2025 09:36:29 GMT</pubDate>
            <atom:updated>2025-11-20T09:42:41.336Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rlB6gciSh4nXgF94Snm4pA.jpeg" /></figure><p><strong>Concepts Covered:</strong></p><ol><li>Introduction</li></ol><p>2. Why Kafka</p><p>3. Core Concepts</p><p>4. Kafka Architecture overview</p><p>5. Key features of Kafka</p><p>6. How to install Kafka</p><p>7. Demo App design — Kafka + Spring boot</p><p>8. Conclusion</p><p><strong>1. Introduction</strong></p><p>Apache Kafka is a <strong>distributed event streaming platform</strong> used for building real-time data pipelines and streaming applications. It allows the <strong>publishing, storing, and processing of streams of records</strong> in a fault-tolerant and scalable way.</p><p><strong>Kafka is designed for:</strong></p><ul><li><strong>High throughput</strong>: Handle millions of messages per second.</li><li><strong>Scalability</strong>: Horizontally scalable across multiple servers.</li><li><strong>Durability</strong>: Persist messages reliably on disk.</li><li><strong>Fault tolerance</strong>: Automatically handles server failures.</li></ul><p><strong>2. Why Kafka?</strong></p><p>Apache Kafka is powerful because it lets systems move data instantly, reliably, and at massive scale — all while staying surprisingly simple to understand. With just a few core ideas like producers, consumers, and topics, beginners can quickly grasp how messages flow through an application.</p><p>At the same time, Kafka’s ability to handle millions of events per second, recover from failures, and connect seamlessly with modern data tools makes it a favorite for experienced engineers building real-time, event-driven systems. It’s this rare combination of simplicity, speed, and strength that makes Kafka stand out.</p><p><strong>3. Core Concepts</strong></p><p><strong>3.1 Producer</strong></p><p>A <strong>Producer</strong> is an application that <strong>writes data (messages) to Kafka topics</strong>.</p><ul><li>Sends messages to a <strong>specific topic</strong>.</li><li>Can choose which <strong>partition</strong> to send a message to.</li><li>Ensures messages are <strong>serialized</strong> before sending.</li></ul><p><strong>Key Properties:</strong></p><ul><li>acks — controls message durability.</li><li>key — determines partitioning of messages.</li><li>batch.size — allows sending messages in batches for efficiency.</li></ul><p><strong>3.2 Consumer</strong></p><p>A <strong>Consumer</strong> reads messages from Kafka topics.</p><ul><li>Consumers can work individually or in <strong>consumer groups</strong>.</li><li>Kafka guarantees <strong>message ordering within a partition</strong>.</li><li>Supports <strong>offset management</strong> to track consumed messages.</li></ul><p><strong>Key Concepts:</strong></p><ul><li><strong>Consumer Group</strong>: A group of consumers that share the reading of messages in a topic.</li><li><strong>Offset</strong>: A unique identifier of a message in a partition. Consumers can commit offsets to track progress.</li></ul><p><strong>3.3 Topic</strong></p><p>A <strong>Topic</strong> is a <strong>category or feed name</strong> where messages are published.</p><ul><li>Topics are <strong>logically divided into partitions</strong> for scalability.</li><li>Messages in a topic are <strong>ordered by partition</strong>.</li></ul><p><strong>Key Properties:</strong></p><ul><li><strong>Partitions</strong>: Enable parallelism; each message in a partition has a sequential offset.</li><li><strong>Replication</strong>: Ensures fault tolerance by duplicating partitions across brokers.</li></ul><p><strong>3.4 Partition</strong></p><p>A <strong>Partition</strong> is an <strong>ordered, immutable sequence of messages</strong> within a topic.</p><ul><li>Each message is assigned an <strong>offset</strong>.</li><li>Allows <strong>horizontal scaling</strong>: multiple consumers can read from different partitions in parallel.</li><li>Supports <strong>message ordering</strong> only within a single partition.</li></ul><p><strong>3.5 Broker</strong></p><p>A <strong>Broker</strong> is a Kafka server that stores data and serves clients.</p><ul><li>Handles <strong>producers</strong>, <strong>consumers</strong>, and <strong>replication</strong>.</li><li>A <strong>Kafka cluster</strong> consists of multiple brokers.</li><li>Brokers are identified by a <strong>unique broker ID</strong>.</li></ul><p><strong>3.6 Cluster</strong></p><p>A <strong>Kafka Cluster</strong> is a group of brokers working together.</p><ul><li>Provides <strong>high availability</strong> via replication.</li><li>Managed by <strong>ZooKeeper</strong> (in Kafka versions &lt; 2.8) or <strong>KRaft mode</strong> (Kafka Raft Metadata mode in newer versions).</li></ul><p><strong>3.7 Zookeeper / KRaft</strong></p><ul><li><strong>Zookeeper</strong>: Coordinates Kafka brokers, manages metadata, leader election, and cluster configuration.</li><li><strong>KRaft Mode</strong>: Removes dependency on Zookeeper and uses Kafka’s internal Raft consensus for metadata management (from Kafka 2.8+).</li></ul><p><strong>3.8 Replication</strong></p><ul><li>Ensures <strong>fault tolerance</strong> by duplicating partitions across multiple brokers.</li><li>Each partition has:</li><li><strong>Leader</strong>: Handles all read/write operations.</li><li><strong>Followers</strong>: Replicate leader data.</li><li>If the leader fails, a follower is elected as the new leader.</li></ul><p><strong>3.9 Offset</strong></p><ul><li>Unique identifier of a message in a partition.</li><li>Consumers use offsets to <strong>track progress</strong>.</li><li>Can be <strong>committed automatically or manually</strong>.</li></ul><p><strong>3.10 Message</strong></p><ul><li>The <strong>basic unit of data</strong> in Kafka.</li><li>Composed of:</li><li><strong>Key</strong> (optional) — used for partitioning.</li><li><strong>Value</strong> — the actual data.</li><li><strong>Timestamp</strong> — indicates message creation time.</li><li><strong>Headers</strong> — optional metadata.</li></ul><p><strong>3.11 Stream Processing</strong></p><p>Kafka supports <strong>real-time data processing</strong> using:</p><ul><li><strong>Kafka Streams</strong>: Lightweight Java library for building applications.</li><li><strong>KSQL / ksqlDB</strong>: SQL-like interface for real-time stream processing.</li></ul><p><strong>4. Kafka Architecture Overview</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Vw-DlfUHZElMz5tlYgzQw.webp" /><figcaption>Fig: Kafka Architecture</figcaption></figure><ul><li>Producers send messages to <strong>topics</strong> in brokers.</li><li>Brokers handle <strong>partitioning, replication, and storage</strong>.</li><li>Consumers read messages from <strong>topics</strong> and commit offsets.</li><li><strong>ZooKeeper/KRaft</strong> manages cluster metadata and leader election.</li></ul><p><strong>5. Key Features of Kafka</strong></p><ol><li><strong>Durability</strong>: Messages persisted on disk with configurable retention.</li><li><strong>Scalability</strong>: Partitioning allows horizontal scaling.</li><li><strong>Fault Tolerance</strong>: Automatic failover using replication.</li><li><strong>High Throughput</strong>: Optimized for large-scale messaging.</li><li><strong>Real-time Processing</strong>: Supports streaming applications and analytics.</li></ol><p><strong>6. How to install Kafka</strong></p><ol><li><strong>Download</strong> the latest Kafka ZIP file.</li><li><strong>Extract</strong> the contents and place the folder in the <strong>C: drive</strong>.</li><li><strong>Add Kafka’s bin folder to the system PATH variable</strong>: C:\kafka\bin.</li><li>Also, ensure C:\Windows\System32\wbem is included in the PATH, then save and close the environment variables.</li><li><strong>Modify Kafka configuration</strong>:</li></ol><ul><li>Navigate to C:\kafka\config and open <strong>server.properties</strong>. Update the log directory:</li><li>log.dirs=C:/kafka/kafka-logs</li></ul><p><strong>6. Configure Zookeeper</strong>:</p><ul><li>In the same config folder, open <strong>zookeeper.properties</strong> and set the data directory:</li><li>dataDir=C:/kafka/zookeeper-data</li></ul><p><strong>7. Demo App design — Kafka + Spring boot</strong></p><p>We’ll build a <strong>Spring Boot app</strong> with:</p><ul><li><strong>Producer</strong> → sends messages to a Kafka topic</li><li><strong>Consumer</strong> → listens and logs those messages</li></ul><p><strong>7.1 Tech stack</strong></p><ul><li>Spring Boot 3+</li><li>Spring Kafka</li><li>Java 17</li><li>Maven</li></ul><p><strong>7.2 Project Structure</strong></p><p>kafka/</p><p>├─ src/main/java/com/springboot/kafka/</p><p>│ ├─ KafkaApplication.java</p><p>│ ├─ config/KafkaTopicConfig.java</p><p>│ ├─ producer/MessageProducer.java</p><p>│ ├─ consumer/MessageConsumer.java</p><p>│ └─ controller/MessageController.java</p><p>├─ src/main/resources/</p><p>│ └─ application.properties</p><p>└─ pom.xml</p><p><strong>I. pom.xml</strong></p><p>Add this dependency in your project’s pom.xml:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*eMLj51sGXyK9SGDLHBVTsQ.png" /><figcaption>Fig: Spring Kafka Dependency</figcaption></figure><p><strong>II. application.properties</strong></p><p>Add this properties in your application.properties file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_A7vPCFG0IUmbBLhTTYKzQ.png" /><figcaption>Fig: Kafka properties</figcaption></figure><p><strong>III. KafkaTopicConfig.java</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oefffw4i6nUttOLwdg8--Q.png" /></figure><p><strong>IV. MessageProducer.java</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ip4mvSL9p5h4QTQT3b0Clw.png" /></figure><p><strong>V. MessageConsumer.java</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4TWIh6YQxf3jt4YCfxLD0A.png" /></figure><p><strong>VI. MessageController.java</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i90CqstQcRxjFokt0_5bcQ.png" /></figure><p><strong>VII. KafkaDemoApplication.java</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u4r3277tJ9t74lcvberHXA.png" /></figure><p><strong>7.3 Run it!</strong></p><ol><li>Start <strong>Zookeeper</strong>:</li></ol><p>In a command prompt run this command:</p><p>.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties</p><p>2. Start <strong>Kafka broker</strong>:</p><p>Open another command prompt and run this command:</p><p>.\bin\windows\kafka-server-start.bat .\config\server.properties</p><p>3. Run your <strong>Spring Boot app</strong></p><p>4. Test sending a message in <strong>Postman</strong>:</p><p>POST “http://localhost:8080/api/messages?message=HelloKafka&quot;</p><p>5. You’ll see:</p><p>📥 Sending message: HelloKafka — in Spring boot app logs</p><p>✅ Message sent: HelloKafka — in Postman</p><p>📥 Received message: HelloKafka — in Spring boot app logs</p><p><strong>8. Conclusion</strong></p><p>By combining Kafka’s robust messaging capabilities with Spring Boot’s streamlined development model, organizations can deliver real-time solutions with greater efficiency and clarity. As you continue exploring this integration, you’ll find it well-suited for modern architectures and high-performance systems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63242b7a1619" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker Basics for Modern Developers]]></title>
            <link>https://medium.com/@vllikhitha123/your-all-in-one-docker-handbook-an-in-depth-guide-for-modern-developers-c91f9b07a4e4?source=rss-9a6a8bbbeccc------2</link>
            <guid isPermaLink="false">https://medium.com/p/c91f9b07a4e4</guid>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[likhitha vemparala]]></dc:creator>
            <pubDate>Tue, 18 Nov 2025 06:21:56 GMT</pubDate>
            <atom:updated>2025-11-19T09:24:32.784Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*1rbZuK6CayCKc9deIylEqg.png" /></figure><p><strong>Concepts Covered:</strong></p><p>1. What is Docker</p><p>2. Why Docker</p><p>3. Key concepts</p><p>4. Docker Architecture</p><p>5. Containers vs Virtual machines</p><p>6. Important Docker concepts</p><p>7. Docker Registries and repositories</p><p>8. Docker file — Building custom images</p><p>9. Building and Running containers</p><p>10. Common Docker commands</p><p>11. Port Binding</p><p>12. Managing Persistent Data</p><p>13. Docker Networking</p><p>14. Multistage builds</p><p>15. Docker compose</p><p>16. Best Practices</p><p>17. Real-world docker example</p><p>18. Conclusion</p><p><strong>1. What is Docker?</strong></p><p><strong>Docker</strong> is a <strong>platform for containerizing applications</strong> — it allows you to package your app’s <strong>code, dependencies, libraries, and configurations</strong> together into a portable <strong>container</strong>.<br> This ensures your application runs <strong>consistently across all environments</strong> — whether development, testing, or production.</p><p><strong>2. Why Docker?</strong></p><ul><li>Works the same across all environments (solves “works on my machine” issue).</li><li>Lightweight and faster than virtual machines.</li><li>Enables easy scaling and deployment.</li><li>Isolates applications for better security and reliability.</li></ul><p><strong>3. Key Concepts</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*dv6FvFYtWozeBc7xyQ5nBA.png" /><figcaption>Fig: Key concepts overview</figcaption></figure><p><strong>4. Docker Architecture</strong></p><p>Docker follows a <strong>client–server architecture</strong>:</p><ul><li><strong>Docker Client (CLI)</strong> → sends commands (docker build, docker run)</li><li><strong>Docker Daemon (Server)</strong> → runs on host, manages images &amp; containers</li><li><strong>Docker Registry</strong> → stores Docker images (e.g., Docker Hub, ECR)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*cPflE4XjRD-JptwBGN2RIA.gif" /><figcaption>Fig: Docker Architecture</figcaption></figure><p><strong>5. Containers vs Virtual Machines</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*NY2y2zoj8Ae14fqs4UhIAw.png" /><figcaption>Fig: Feature comparison for Container and Virtual machine</figcaption></figure><p><strong>6. Important Docker Components</strong></p><p><strong>1. Docker Image</strong></p><ul><li>Read-only template used to create containers.</li><li>Can be based on a minimal image (like alpine, ubuntu, or node).</li><li>Stored locally or in registries.</li></ul><p><strong>2. Docker Container</strong></p><ul><li>A live, running instance of an image.</li><li>Can be started, stopped, deleted, or restarted.</li><li>Containers are <strong>ephemeral</strong> (data lost on deletion unless persisted via volumes).</li></ul><p><strong>3. Docker Volume</strong></p><ul><li>Used for <strong>data persistence</strong> beyond container lifecycle.</li><li>Example:</li><li>docker run -v myvolume:/data myapp</li></ul><p>Here, /data is a path inside the container mapped to a Docker-managed volume named myvolume.</p><p><strong>7. Docker Registries &amp; Repositories</strong></p><ul><li><strong>Registry</strong> = Service to store images (e.g., Docker Hub, AWS ECR, GCR, Nexus).</li><li><strong>Repository</strong> = Collection of related images (different versions via tags).</li></ul><p><strong>Public vs Private Registries:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*dsAu-9AwG8GyPXI_EUR9GQ.png" /><figcaption>Fig: A Comparison b/w public and private registries</figcaption></figure><p><strong>8. Docker file — Building Custom Images</strong></p><p>A <strong>Docker file</strong> defines the steps to build an image.</p><p><strong>Example:</strong></p><p># Base image</p><p>FROM node:19-alpine</p><p># Copy application files</p><p>COPY package.json /app/</p><p>COPY src /app/</p><p># Set working directory</p><p>WORKDIR /app</p><p># Install dependencies</p><p>RUN npm install</p><p># Command to run the application</p><p>CMD [“node”, “server.js”]</p><p><strong>Common Instructions</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*vECHooSSSZlU6D-raraoIw.png" /><figcaption>Fig: Common instructions of Docker image</figcaption></figure><p><strong>9. Building and Running Containers</strong></p><p><strong>1️⃣ Build the Image</strong></p><p>docker build -t myapp:1.0 .</p><p><strong>2️⃣ Run the Container</strong></p><p>docker run -d -p 8080:3000 — name mycontainer myapp:1.0</p><p><strong>Explanation:</strong></p><ul><li>-d → Run in background (detached)</li><li>-p → Bind host port to container port</li><li>— name → Give custom name to container</li></ul><p>Now you can access the app at <a href="http://localhost:8080/"><strong>http://localhost:8080</strong></a></p><p><strong>10. Common Docker Commands</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*_5tt5Yj_eqI6eOEWp9Lsfw.png" /><figcaption>Fog: Common Docker commands</figcaption></figure><p><strong>11. Port Binding</strong></p><p>Containers are isolated; to access them externally, we <strong>bind container ports to host ports</strong>.</p><p><strong>Example:</strong></p><p>docker run -d -p 8080:6379 redis</p><ul><li>6379 → Redis container port</li><li>8080 → Host port</li><li>Access via: localhost:8080</li></ul><p><strong>12. Managing Persistent Data (Volumes &amp; Bind Mounts)</strong></p><p><strong>Docker Volumes:</strong></p><ul><li>Managed by Docker.</li><li>Persist data even after container deletion.</li></ul><p>docker volume create mydata</p><p>docker run -v mydata:/var/lib/mysql mysql</p><p><strong>Bind Mounts:</strong></p><ul><li>Directly link a host directory to container.</li><li>Useful for development (live code updates).</li></ul><p>docker run -v $(pwd):/app node</p><p><strong>13. Docker Networking</strong></p><p>Docker provides isolated networks for containers to communicate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*o0cZHir9UIofUsE9uv7x5g.png" /><figcaption>Fig: Docker network types</figcaption></figure><p><strong>Example:</strong></p><p>docker network create mynetwork</p><p>docker run — network mynetwork — name app1 myapp</p><p>docker run — network mynetwork — name app2 myapp</p><p>Now, app1 can reach app2 using <a href="http://app2:port.">http://app2:port.</a></p><p><strong>14. Multi-Stage Builds (Reduce Image Size)</strong></p><p><strong>Example for building smaller images:</strong></p><p># Stage 1: Build</p><p>FROM node:19-alpine AS builder</p><p>WORKDIR /app</p><p>COPY . .</p><p>RUN npm install &amp;&amp; npm run build</p><p># Stage 2: Production</p><p>FROM nginx:alpine</p><p>COPY — from=builder /app/build /usr/share/nginx/html</p><p>✅ Keeps final image minimal (only includes built app, not dependencies or build tools).</p><p><strong>15. Docker Compose (for Multi-Container Apps)</strong></p><p><strong>Docker Compose</strong> allows you to define and manage multi-container applications using a docker-compose.yml file.</p><p><strong>Example:</strong></p><p>version: “3”</p><p>services:</p><p>web:</p><p>build: .</p><p>ports:</p><p>- “8080:3000”</p><p>redis:</p><p>image: redis:alpine</p><p><strong>Run:</strong></p><p>docker compose up</p><p><strong>16. Best Practices</strong></p><ul><li>Use <strong>small base images</strong> (alpine, slim variants).</li><li>Use .dockerignore to exclude unnecessary files (like .git, node_modules).</li><li>Combine multiple commands in a single RUN to reduce layers.</li><li>Use <strong>multi-stage builds</strong> for optimized final images.</li><li>Keep containers <strong>stateless</strong> (use volumes for persistent data).</li></ul><p><strong>17. Real-World Docker Lab Example</strong></p><p>Below is a <strong>complete hands-on example project</strong> you can actually build and run to understand how everything works together.</p><p><strong>🧠 “Node.js + Redis Web App”</strong></p><p><strong>I. Scenario</strong></p><p>You’re building a small <strong>Node.js web app</strong> that counts how many times a page has been visited.<br> The app uses <strong>Redis</strong> as a database to store the count.</p><p>We’ll:</p><ul><li>Containerize both <strong>Node.js</strong> and <strong>Redis</strong></li><li>Connect them using a <strong>Docker network</strong></li><li>Use <strong>volumes</strong> for Redis data persistence</li><li>Expose the app via <strong>port binding</strong></li><li>Manage both services using <strong>Docker Compose</strong></li></ul><p><strong>II. Project Structure</strong></p><p>docker-lab/</p><p>├── app/</p><p>│ ├── server.js</p><p>│ ├── package.json</p><p>│ └── Dockerfile</p><p>└── docker-compose.yml</p><p><strong>Step 1 — Create the Node.js Application</strong></p><p><strong>File:</strong> app/server.js</p><p>const express = require(“express”);</p><p>const redis = require(“redis”);</p><p>// Create Redis client using container name as host</p><p>const client = redis.createClient({ host: “redis-server”, port: 6379 });</p><p>const app = express();</p><p>client.on(“error”, (err) =&gt; console.error(“Redis error”, err));</p><p>let countKey = “pageviews”;</p><p>app.get(“/”, async (req, res) =&gt; {</p><p>try {</p><p>client.incr(countKey, (err, count) =&gt; {</p><p>if (err) res.send(“Error connecting to Redis”);</p><p>else res.send(`&lt;h1&gt;Page viewed ${count} times!&lt;/h1&gt;`);</p><p>});</p><p>} catch (err) {</p><p>res.send(“Error: “ + err.message);</p><p>}</p><p>});</p><p>app.listen(8080, () =&gt; console.log(“App running on port 8080”));</p><p><strong>File:</strong> app/package.json</p><p>{</p><p>“name”: “docker-lab-app”,</p><p>“version”: “1.0.0”,</p><p>“main”: “server.js”,</p><p>“dependencies”: {</p><p>“express”: “⁴.18.2”,</p><p>“redis”: “⁴.6.5”</p><p>}</p><p>}</p><p><strong>Step 2 — Create the Dockerfile for the App</strong></p><p><strong>File:</strong> app/Dockerfile</p><p># Step 1: Choose base image</p><p>FROM node:19-alpine</p><p># Step 2: Create app directory inside container</p><p>WORKDIR /usr/src/app</p><p># Step 3: Copy dependencies first for caching</p><p>COPY package.json ./</p><p># Step 4: Install dependencies</p><p>RUN npm install</p><p># Step 5: Copy app source code</p><p>COPY . .</p><p># Step 6: Expose port</p><p>EXPOSE 8080</p><p># Step 7: Start the app</p><p>CMD [“node”, “server.js”]</p><p><strong>Step 3 — Create docker-compose.yml</strong></p><p>This file defines both services (web + redis), sets up networking, and handles volume persistence.</p><p><strong>File:</strong> docker-compose.yml</p><p>version: “3.8”</p><p>services:</p><p>web:</p><p>build: ./app</p><p>ports:</p><p>- “8080:8080”</p><p>depends_on:</p><p>- redis-server</p><p>networks:</p><p>- app-network</p><p>redis-server:</p><p>image: redis:alpine</p><p>ports:</p><p>- “6379:6379”</p><p>volumes:</p><p>- redis_data:/data</p><p>networks:</p><p>- app-network</p><p>networks:</p><p>app-network:</p><p>driver: bridge</p><p>volumes:</p><p>redis_data:</p><p><strong>Step 4 — Build and Run the Application</strong></p><p>Open a terminal in your docker-lab directory and run:</p><p>docker compose up — build</p><p><strong>What happens here:</strong></p><ul><li>Builds the Node.js image from the Dockerfile</li><li>Pulls Redis image from Docker Hub</li><li>Creates a Docker network (app-network)</li><li>Starts both containers</li><li>Binds host port 8080 → container port 8080</li></ul><p><strong>Step 5 — Test the App</strong></p><p>Open your browser and visit:</p><p>👉 <a href="http://localhost:8080/">http://localhost:8080</a></p><p>You should see something like:</p><p><strong>Page viewed 1 times!</strong></p><p>Refresh — the count should increase (Redis stores it).</p><p><strong>Step 6 — Verify Containers, Images, and Volumes</strong></p><p><strong>Check running containers</strong></p><p>docker ps</p><p><strong>Check created images</strong></p><p>docker images</p><p><strong>Check Docker network</strong></p><p>docker network ls</p><p><strong>Check Redis volume persistence</strong></p><p>docker volume ls</p><p>Stop and restart:</p><p>docker compose down</p><p>docker compose up</p><p>👉 Redis data persists because of the redis_data volume.</p><p><strong>Step 7 — Clean Up</strong></p><p>When done:</p><p>docker compose down -v</p><p>(-v removes volumes too)</p><p><strong>III. Concepts Covered in This Lab</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*yVy-3K0gaqoBUJvbQ4OF0w.png" /><figcaption>Fig: Various concepts implemented</figcaption></figure><p><strong>18. Conclusion</strong></p><p>And there you have it — Docker in all its containerized glory! 🎉 If you’ve made it this far, congrats: you’re officially one step closer to container wizardry. Just remember, every great app deserves its own cozy little container home. So go on, spin up those images, ship your code, and let Docker do the heavy lifting. Happy container adventures! 🐳✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c91f9b07a4e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Practical Guide to Kubernetes and Helm]]></title>
            <link>https://medium.com/@vllikhitha123/a-practical-guide-to-kubernetes-and-helm-0cbfaa209ebb?source=rss-9a6a8bbbeccc------2</link>
            <guid isPermaLink="false">https://medium.com/p/0cbfaa209ebb</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[helm]]></category>
            <dc:creator><![CDATA[likhitha vemparala]]></dc:creator>
            <pubDate>Fri, 14 Nov 2025 06:09:01 GMT</pubDate>
            <atom:updated>2025-11-14T06:51:15.814Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*1S29WiynsvCPDranUAY6SA.png" /></figure><p><strong>Concepts covered:</strong></p><p>1. Introduction</p><p>2. Docker vs Kubernetes</p><p>3. Kubernetes Architecture</p><p>4. Architecture Diagram</p><p>5. Kubernetes Terminology</p><p>6. Core Kubernetes Objects</p><p>7. Kubernetes Autoscaling</p><p>8. Taints and Tolerations</p><p>9. Kubernetes Affinity and Node Affinity</p><p>10. Monitoring and Debugging</p><p>11. Kubernetes Security Concepts</p><p>12. Full stack deployment example</p><p>13. Helm</p><p>14. References and resources</p><p>15. Conclusion</p><p>Note: The YAML snippets provided are meant for visualization. Make sure to apply proper YAML indentation when implementing them in real configurations.</p><p><strong>1. Introduction</strong></p><p><strong>Kubernetes</strong> is an open-source platform for automating deployment, scaling, and management of containerized applications. It abstracts infrastructure complexity and provides a unified API to manage workloads across clusters.</p><p><strong>Why Kubernetes?</strong></p><ul><li><strong>Scalability</strong>: Automatically adjusts resources based on traffic.</li><li><strong>Self-healing</strong>: Detects and replaces failed containers.</li><li><strong>Declarative configuration</strong>: Define desired state using YAML manifests.</li><li><strong>Portability</strong>: Works across cloud providers and on-premises.</li></ul><p><strong>2. Docker vs Kubernetes</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*kTsJAsmdMM0jWJoXwO790w.png" /><figcaption>Fig: Docker vs Kubernetes</figcaption></figure><p><strong>3. Kubernetes Architecture</strong></p><p><strong>Cluster Overview</strong></p><p>A Kubernetes cluster consists of:</p><ul><li><strong>Master Node (Control Plane)</strong>: Manages the cluster.</li><li><strong>Worker Nodes</strong>: Where containers are deployed.</li><li><strong>Cluster</strong>: A group of nodes working together for high availability.</li></ul><p><strong>Master Node Components</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*KjATk6MrNYWfrAjg6n0blQ.png" /><figcaption>Fig: Master node components</figcaption></figure><p><strong>Worker Node Components</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*RcbMZrYtKvllhkx9ArbW5A.png" /><figcaption>Fig: Worker node components</figcaption></figure><p><strong>4. Architecture Diagram (K8s Cluster)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*0nkEXp52Zdc_DAhK7Ko2dQ.png" /><figcaption>Fig: Depicting k8s cluster</figcaption></figure><p><strong>5. Kubernetes Terminology</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*mCWhZ1WQORQ4q_lN9So9Fw.png" /><figcaption>Fig: k8s terminology</figcaption></figure><p><strong>6. Core Kubernetes Objects</strong></p><p><strong>1. Pods</strong></p><p><strong>I. Definition</strong></p><p>A <strong>Pod</strong> is the <strong>smallest deployable unit in Kubernetes</strong>. Think of a pod as a wrapper around <strong>one or more containers</strong> that:</p><ul><li>Share the same <strong>network namespace</strong> (same IP address and port space)</li><li>Share <strong>storage volumes</strong> if defined</li><li>Are always scheduled together on the <strong>same node</strong></li></ul><p>💡 In simple terms, a Pod is <strong>one or more containers running together with shared resources</strong>.</p><p><strong>II. Why Pods?</strong></p><ul><li><strong>Grouping Containers</strong>: Some applications require multiple containers to run together (sidecar pattern).</li><li><strong>Shared Networking</strong>: Containers in a Pod communicate with localhost.</li><li><strong>Shared Storage</strong>: Containers can access the same volumes.</li><li><strong>Scheduling Unit</strong>: Kubernetes schedules Pods (not individual containers) to nodes.</li></ul><p>· A Pod has several important parts:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*qjPAWsoYgdGn5ktixZH6XQ.png" /><figcaption>Fig: Describing a pod system</figcaption></figure><p><strong>III. Types of Pods</strong></p><ol><li><strong>Single-container Pod</strong>: Most common. A Pod with <strong>only one container</strong>.</li><li><strong>Multi-container Pod</strong>: Less common. Containers are tightly coupled and need to communicate or share storage.</li></ol><ul><li><strong>Sidecar pattern</strong>: Logging or monitoring agent container running alongside the main app container.</li><li><strong>Ambassador pattern</strong>: Proxy container that handles communication to external services.</li><li><strong>Adapter pattern</strong>: Converts output of one container to a format another container can use.</li></ul><p><strong>IV. Pod Lifecycle</strong></p><p>A Pod goes through several states:</p><ol><li><strong>Pending</strong>: Pod is accepted but not yet scheduled.</li><li><strong>Running</strong>: Pod is scheduled and containers are running.</li><li><strong>Succeeded</strong>: Pod finished its task and exited successfully (usually for Jobs).</li><li><strong>Failed</strong>: Pod finished execution but some containers failed.</li><li><strong>Unknown</strong>: Kubernetes cannot determine Pod state (rare).</li></ol><p><strong>V. Pod Networking</strong></p><ul><li>Each Pod gets a <strong>unique IP address</strong>.</li><li>Containers in the same Pod share <strong>localhost</strong> networking.</li><li>Communication across Pods is usually done via <strong>Services</strong> (ClusterIP, NodePort, LoadBalancer).</li></ul><p><strong>VI. Pod YAML Example</strong></p><p><strong>Example 1: Single-container Pod</strong></p><p>apiVersion: v1</p><p>kind: Pod</p><p>metadata:</p><p>name: nginx-pod</p><p>labels:</p><p>app: nginx</p><p>spec:</p><p>containers:</p><p>- name: nginx-container</p><p>image: nginx:1.21</p><p>ports:</p><p>- containerPort: 80</p><p><strong>Explanation</strong>:</p><ul><li>metadata.name: Pod name is nginx-pod.</li><li>containers: One container nginx-container using the nginx:1.21 image.</li><li>ports: Exposes container port 80.</li></ul><p><strong>Example 2: Multi-container Pod (Sidecar Pattern)</strong></p><p>apiVersion: v1</p><p>kind: Pod</p><p>metadata:</p><p>name: webapp-pod</p><p>spec:</p><p>containers:</p><p>- name: main-app</p><p>image: my-web-app:latest</p><p>ports:</p><p>- containerPort: 8080</p><p>- name: log-agent</p><p>image: fluentd:latest</p><p>volumeMounts:</p><p>- name: log-volume</p><p>mountPath: /var/log/app</p><p>volumes:</p><p>- name: log-volume</p><p>emptyDir: {}</p><p><strong>Explanation</strong>:</p><ul><li>main-app container runs the application.</li><li>log-agent container collects logs from the shared volume /var/log/app.</li><li>emptyDir volume is a temporary storage shared between containers in the Pod.</li></ul><p><strong>VII. Commands to Work with Pods</strong></p><p><strong># Create a Pod</strong></p><p>kubectl apply -f pod.yaml</p><p><strong># Get Pod info</strong></p><p>kubectl get pods</p><p>kubectl describe pod nginx-pod</p><p><strong># Get Pod logs</strong></p><p>kubectl logs nginx-pod</p><p><strong># Execute a command inside a Pod</strong></p><p>kubectl exec -it nginx-pod — /bin/bash</p><p><strong># Delete a Pod</strong></p><p>kubectl delete pod nginx-pod</p><p><strong>2. ReplicaSet</strong></p><p><strong>I. Definition</strong></p><p>A <strong>ReplicaSet (RS</strong>) is a Kubernetes object that ensures a specified number of pod replicas are running at any given time.</p><p>💡 Think of it as a <strong>guardian</strong> that constantly monitors Pods and creates or deletes them to match the desired replica count.</p><p><strong>II. Why ReplicaSets?</strong></p><ul><li><strong>High Availability</strong>: Ensures a minimum number of Pods are always running.</li><li><strong>Self-healing</strong>: Replaces failed or deleted Pods automatically.</li><li><strong>Scalability</strong>: Easy to scale Pods up or down.</li><li><strong>Label-based Selection</strong>: Uses labels to manage Pods, making it dynamic and flexible.</li></ul><p><strong>III. ReplicaSet Anatomy</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*HPqFpVsjUxZRtWiWkUFjDg.png" /><figcaption>Fig: Replicaset anatomy</figcaption></figure><p><strong>IV. How ReplicaSets Work</strong></p><ol><li>You define the <strong>number of replicas</strong> you want.</li><li>Kubernetes continuously monitors the Pod count.</li><li>If Pods fail or are deleted:</li></ol><ul><li><strong>Extra Pods</strong> → Deleted to match the desired count.</li><li><strong>Missing Pods</strong> → Created automatically.</li></ul><p>4. Use <strong>labels</strong> to identify which Pods belong to the ReplicaSet.</p><p><strong>V. ReplicaSet vs Deployment</strong></p><ul><li><strong>ReplicaSet</strong>:</li><li>Ensures desired Pod count.</li><li>Does not manage updates or rollbacks.</li><li><strong>Deployment</strong>:</li><li>Manages ReplicaSets.</li><li>Supports rolling updates and rollbacks.</li></ul><p>💡 Typically, you <strong>create ReplicaSets via Deployments</strong>, rather than directly managing them.</p><p><strong>VI. ReplicaSet YAML Example</strong></p><p><strong>Example: Basic ReplicaSet</strong></p><p>apiVersion: apps/v1</p><p>kind: ReplicaSet</p><p>metadata:</p><p>name: nginx-replicaset</p><p>labels:</p><p>app: nginx</p><p>spec:</p><p>replicas: 3</p><p>selector:</p><p>matchLabels:</p><p>app: nginx</p><p>template:</p><p>metadata:</p><p>labels:</p><p>app: nginx</p><p>spec:</p><p>containers:</p><p>- name: nginx-container</p><p>image: nginx:1.21</p><p>ports:</p><p>- containerPort: 80</p><p><strong>Explanation</strong>:</p><ul><li>replicas: 3 → Ensure 3 Pods are running.</li><li>selector.matchLabels → Select Pods with label app: nginx.</li><li>template → Defines Pod specification (metadata + container info).</li></ul><p><strong>VII. Commands to Work with ReplicaSets</strong></p><p><strong># Create a ReplicaSet</strong></p><p>kubectl apply -f replicaset.yaml</p><p><strong># Get all ReplicaSets</strong></p><p>kubectl get rs</p><p><strong># Describe a ReplicaSet</strong></p><p>kubectl describe rs nginx-replicaset</p><p><strong># Scale a ReplicaSet</strong></p><p>kubectl scale rs nginx-replicaset — replicas=5</p><p><strong># Delete a ReplicaSet</strong></p><p>kubectl delete rs nginx-replicaset</p><p><strong>3. Deployment</strong></p><p><strong>I. Definition</strong></p><p>A <strong>Deployment</strong> is a <strong>Kubernetes object that manages ReplicaSets and Pods</strong> to ensure your application runs reliably and can be updated safely.</p><p>💡 Think of a Deployment as a <strong>manager</strong> for ReplicaSets that provides <strong>scaling, rolling updates, and rollback capabilities</strong>.</p><p><strong>II. Why Deployments?</strong></p><ul><li><strong>Declarative Updates</strong>: You define the desired state; Kubernetes ensures it matches.</li><li><strong>Rolling Updates</strong>: Upgrade applications without downtime.</li><li><strong>Rollback</strong>: Revert to previous versions if something goes wrong.</li><li><strong>Scaling</strong>: Easily scale Pods up or down.</li><li><strong>Self-healing</strong>: Automatically replaces failed Pods.</li></ul><p><strong>III. Deployment Anatomy</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*Mkd2E7PCfAs7qKoB7_eZdg.png" /><figcaption>Fig: Deployment Anatomy</figcaption></figure><p><strong>IV. How Deployments Work</strong></p><ol><li>You define a Deployment YAML with a <strong>Pod template and replica count</strong>.</li><li>Kubernetes creates a <strong>ReplicaSet</strong> automatically based on the template.</li><li>The ReplicaSet ensures the <strong>desired number of Pods</strong> are running.</li><li>During updates:</li></ol><ul><li><strong>RollingUpdate</strong>: Gradually replaces old Pods with new Pods.</li><li><strong>Recreate</strong>: Deletes all old Pods and creates new ones at once.</li></ul><ol><li>You can <strong>rollback</strong> to previous Deployment versions if needed.</li></ol><p><strong>V. Deployment YAML Example</strong></p><p><strong>Example: Basic Deployment</strong></p><p>apiVersion: apps/v1</p><p>kind: Deployment</p><p>metadata:</p><p>name: nginx-deployment</p><p>labels:</p><p>app: nginx</p><p>spec:</p><p>replicas: 3</p><p>selector:</p><p>matchLabels:</p><p>app: nginx</p><p>template:</p><p>metadata:</p><p>labels:</p><p>app: nginx</p><p>spec:</p><p>containers:</p><p>- name: nginx-container</p><p>image: nginx:1.21</p><p>ports:</p><p>- containerPort: 80</p><p>strategy:</p><p>type: RollingUpdate</p><p>rollingUpdate:</p><p>maxSurge: 1</p><p>maxUnavailable: 1</p><p><strong>Explanation:</strong></p><ul><li>replicas: 3 → Ensure 3 Pods are running.</li><li>selector.matchLabels → Select Pods labeled app: nginx.</li><li>template → Defines Pod spec.</li><li>strategy.RollingUpdate → Update one Pod at a time (maxSurge=1, maxUnavailable=1) to avoid downtime.</li></ul><p><strong>VI. Deployment Commands</strong></p><p><strong># Create a Deployment</strong></p><p>kubectl apply -f deployment.yaml</p><p><strong># Get all Deployments</strong></p><p>kubectl get deployments</p><p><strong># Describe a Deployment</strong></p><p>kubectl describe deployment nginx-deployment</p><p><strong># Update Deployment image</strong></p><p>kubectl set image deployment/nginx-deployment nginx-container=nginx:1.22</p><p><strong># Rollback Deployment</strong></p><p>kubectl rollout undo deployment/nginx-deployment</p><p><strong># Check rollout status</strong></p><p>kubectl rollout status deployment/nginx-deployment</p><p><strong># Scale Deployment</strong></p><p>kubectl scale deployment nginx-deployment — replicas=5</p><p><strong># Delete Deployment</strong></p><p>kubectl delete deployment nginx-deployment</p><p><strong>4. Services</strong></p><p><strong>I. Definition</strong></p><p>A <strong>Service</strong> in Kubernetes is an <strong>abstraction that defines a logical set of Pods and a policy to access them</strong>.</p><p>💡 Think of a Service as a <strong>stable endpoint (IP and DNS) for accessing Pods</strong>, which may change dynamically.</p><p><strong>II. Why Services?</strong></p><ul><li>Pods are <strong>ephemeral</strong>: Their IP addresses can change when they are recreated.</li><li>Services provide a <strong>stable IP address and DNS name</strong> to access Pods.</li><li>Enable <strong>communication between Pods</strong> or between external users and Pods.</li><li>Load balance traffic to multiple Pod replicas.</li></ul><p><strong>III. Service Anatomy</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*D-g4J6e5743NIi2lwXuBKw.png" /><figcaption>Fig: Service Anatomy</figcaption></figure><p><strong>IV. Types of Services</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*74QesrgCUTxQSCySSvAi1Q.png" /><figcaption>Fig: Types of Services</figcaption></figure><p><strong>V. How Services Work</strong></p><ol><li>A Service uses a <strong>selector</strong> to identify the Pods it should route traffic to.</li><li>Traffic sent to the Service’s IP is <strong>load balanced</strong> across all selected Pods.</li><li>Services maintain <strong>stable endpoints</strong>, even if Pods are replaced or rescheduled.</li><li>Optional <strong>Ingress</strong> can route external traffic to Services with advanced rules.</li></ol><p><strong>VI. Service YAML Examples</strong></p><p><strong>Example 1: ClusterIP Service (Default)</strong></p><p>apiVersion: v1</p><p>kind: Service</p><p>metadata:</p><p>name: nginx-service</p><p>spec:</p><p>selector:</p><p>app: nginx</p><p>ports:</p><p>- protocol: TCP</p><p>port: 80</p><p>targetPort: 80</p><p><strong>Explanation:</strong></p><ul><li>selector → Targets Pods labeled app: nginx.</li><li>port → Exposes port 80 on the Service.</li><li>targetPort → Forwards traffic to Pod container port 80.</li><li>Default type is ClusterIP.</li></ul><p><strong>Example 2: NodePort Service</strong></p><p>apiVersion: v1</p><p>kind: Service</p><p>metadata:</p><p>name: nginx-nodeport</p><p>spec:</p><p>type: NodePort</p><p>selector:</p><p>app: nginx</p><p>ports:</p><p>- port: 80</p><p>targetPort: 80</p><p>nodePort: 30007</p><p><strong>Explanation:</strong></p><ul><li>Exposes Service on <strong>port 30007</strong> on each Node.</li><li>External users can access the app via NodeIP:30007.</li></ul><p><strong>Example 3: LoadBalancer Service (Cloud)</strong></p><p>apiVersion: v1</p><p>kind: Service</p><p>metadata:</p><p>name: nginx-loadbalancer</p><p>spec:</p><p>type: LoadBalancer</p><p>selector:</p><p>app: nginx</p><p>ports:</p><p>- port: 80</p><p>targetPort: 80</p><p><strong>Explanation:</strong></p><ul><li>Creates a cloud provider load balancer automatically.</li><li>Traffic is distributed across all Pods matched by the selector.</li></ul><p><strong>VII. Commands to Work with Services</strong></p><p><strong># Create a Service</strong></p><p>kubectl apply -f service.yaml</p><p><strong># Get all Services</strong></p><p>kubectl get services</p><p><strong># Describe a Service</strong></p><p>kubectl describe service nginx-service</p><p><strong># Access NodePort Service</strong></p><p>minikube service nginx-nodeport — url</p><p><strong># Delete a Service</strong></p><p>kubectl delete service nginx-service</p><p><strong>5. ConfigMaps &amp; Secrets</strong></p><p><strong>I. Definition — Config Maps</strong></p><p>A <strong>ConfigMap</strong> is a <strong>Kubernetes object used to store non-sensitive configuration data</strong> for Pods.</p><p>💡 Think of ConfigMaps as a <strong>key-value store for application settings</strong>, separate from container images, which makes apps <strong>configurable and portable</strong>.</p><p><strong>II. Why ConfigMaps?</strong></p><ul><li>Decouples configuration from container images.</li><li>Allows updating configuration <strong>without rebuilding images</strong>.</li><li>Provides <strong>flexibility</strong> for environment-specific settings (dev, test, prod).</li><li>Can be mounted as <strong>files or environment variables</strong> inside Pods.</li></ul><p><strong>III. ConfigMap Anatomy</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*WiHGf7TPpYcB8LhlqeFSEA.png" /><figcaption>Fig: Config map Anatomy</figcaption></figure><p><strong>IV. ConfigMap YAML Example</strong></p><p><strong>Example: ConfigMap as key-value pairs</strong></p><p>apiVersion: v1</p><p>kind: ConfigMap</p><p>metadata:</p><p>name: app-config</p><p>data:</p><p>APP_ENV: “production”</p><p>LOG_LEVEL: “info”</p><p><strong>Usage in Pod as environment variables:</strong></p><p>apiVersion: v1</p><p>kind: Pod</p><p>metadata:</p><p>name: app-pod</p><p>spec:</p><p>containers:</p><p>- name: app-container</p><p>image: myapp:1.0</p><p>envFrom:</p><p>- configMapRef:</p><p>name: app-config</p><p><strong>I. Definition — Secrets</strong></p><p>A <strong>Secret</strong> is a Kubernetes object used to store sensitive information like passwords, tokens, or keys.</p><p>💡 <strong>Secrets</strong> ensure sensitive data is not exposed in plain text in Pods or configuration files.</p><p><strong>II. Why Secrets?</strong></p><ul><li>Avoid storing sensitive data in <strong>Docker images or ConfigMaps</strong>.</li><li>Kubernetes encodes secrets in <strong>Base64</strong> (not fully encrypted by default).</li><li>Can be used as <strong>environment variables, mounted volumes, or Kubernetes service accounts</strong>.</li></ul><p><strong>III. Secret Anatomy</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*0tjonO0rbTeg2LG0ZBXshw.png" /><figcaption>Fig: Secret Anatomy</figcaption></figure><p><strong>IV. Secret YAML Example</strong></p><p><strong>Example: Opaque Secret</strong></p><p>apiVersion: v1</p><p>kind: Secret</p><p>metadata:</p><p>name: db-secret</p><p>type: Opaque</p><p>data:</p><p>DB_USERNAME: bXl1c2Vy # Base64 for ‘myuser’</p><p>DB_PASSWORD: c2VjdXJl # Base64 for ‘secure’</p><p><strong>Usage in Pod as environment variables:</strong></p><p>apiVersion: v1</p><p>kind: Pod</p><p>metadata:</p><p>name: db-pod</p><p>spec:</p><p>containers:</p><p>- name: db-container</p><p>image: myapp:1.0</p><p>env:</p><p>- name: DB_USERNAME</p><p>valueFrom:</p><p>secretKeyRef:</p><p>name: db-secret</p><p>key: DB_USERNAME</p><p>- name: DB_PASSWORD</p><p>valueFrom:</p><p>secretKeyRef:</p><p>name: db-secret</p><p>key: DB_PASSWORD</p><p><strong>V. Commands for ConfigMaps &amp; Secrets</strong></p><p><strong># ConfigMap</strong></p><p>kubectl create configmap app-config — from-literal=APP_ENV=production — from-literal=LOG_LEVEL=info</p><p>kubectl get configmaps</p><p>kubectl describe configmap app-config</p><p>kubectl delete configmap app-config</p><p><strong># Secret</strong></p><p>kubectl create secret generic db-secret — from-literal=DB_USERNAME=myuser — from-literal=DB_PASSWORD=secure</p><p>kubectl get secrets</p><p>kubectl describe secret db-secret</p><p>kubectl delete secret db-secret</p><p><strong>6. Namespaces</strong></p><p><strong>I. Definition</strong></p><p>Namespace is a <strong>virtual cluster within a Kubernetes cluster</strong> that provides <strong>logical separation of resources</strong>.</p><p>💡 Think of Namespaces as <strong>folders for organizing Kubernetes objects</strong>, like Pods, Services, and Deployments, within the same cluster.</p><p><strong>II. Why Namespaces?</strong></p><ul><li><strong>Resource isolation</strong>: Separate environments like dev, test, and prod.</li><li><strong>Access control</strong>: Apply Role-Based Access Control (RBAC) per namespace.</li><li><strong>Resource quotas</strong>: Limit CPU, memory, or number of resources per namespace.</li><li><strong>Avoid name conflicts</strong>: Multiple teams can use the same object names without collision.</li></ul><p><strong>III. Namespace Anatomy</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*1NsEzDiohzqdGUDV2YuzSA.png" /><figcaption>Fig: Namespace Anatomy</figcaption></figure><p><strong>IV. Default Namespaces in Kubernetes</strong></p><p>Kubernetes creates some namespaces by default:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*D3Cj0me2bBIrQ3RdfJ_ytw.png" /><figcaption>Fig: Purpose of various namespaces</figcaption></figure><p><strong>V. Namespace YAML Example</strong></p><p><strong>Example: Create a Namespace</strong></p><p>apiVersion: v1</p><p>kind: Namespace</p><p>metadata:</p><p>name: dev-environment</p><p>labels:</p><p>environment: dev</p><p><strong>Explanation:</strong></p><ul><li>metadata.name → Name of the namespace (dev-environment).</li><li>labels → Can be used to organize or select namespaces.</li></ul><p><strong>Using Namespace in Resources</strong></p><p>apiVersion: v1</p><p>kind: Pod</p><p>metadata:</p><p>name: nginx-pod</p><p>namespace: dev-environment</p><p>spec:</p><p>containers:</p><p>- name: nginx-container</p><p>image: nginx</p><p><strong>VI. Commands to Work with Namespaces</strong></p><p><strong># Create a Namespace</strong></p><p>kubectl apply -f namespace.yaml</p><p>kubectl create namespace dev-environment</p><p><strong># List all Namespaces</strong></p><p>kubectl get namespaces</p><p><strong># View details of a Namespace</strong></p><p>kubectl describe namespace dev-environment</p><p><strong># Set default namespace for kubectl context</strong></p><p>kubectl config set-context — current — namespace=dev-environment</p><p><strong># Delete a Namespace</strong></p><p>kubectl delete namespace dev-environment</p><p><strong>7. StatefulSets</strong></p><p><strong>I. Definition</strong></p><p>A <strong>StatefulSet</strong> is a <strong>Kubernetes controller used to manage stateful applications</strong>. Unlike Deployments, which are ideal for stateless apps, StatefulSets provide <strong>stable, unique identities and persistent storage</strong> for Pods.</p><p>💡 Think of StatefulSets as <strong>Deployments for applications that require persistence and ordered deployment</strong>, such as databases.</p><p><strong>II. Why StatefulSets?</strong></p><ul><li><strong>Stable network identity</strong>: Each Pod gets a unique, predictable name (pod-0, pod-1, etc.).</li><li><strong>Stable storage</strong>: PersistentVolumes are retained even if Pods are rescheduled.</li><li><strong>Ordered deployment and scaling</strong>: Pods are created, updated, and deleted in a specific order.</li><li><strong>Perfect for stateful apps</strong>: Databases, queues, caches, and clustered applications.</li></ul><p><strong>III. StatefulSet Anatomy</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*RBT_73ZHWdU3tRFpJOl2tQ.png" /><figcaption>Fig: StatefulSet Anatomy</figcaption></figure><p><strong>IV. Key Features</strong></p><ol><li><strong>Stable Pod Names</strong>: Pods get predictable names like app-0, app-1.</li><li><strong>Ordered Deployment &amp; Scaling</strong>: Pods are created in sequence and terminated in reverse order.</li><li><strong>Persistent Storage</strong>: Each Pod gets its own PersistentVolume using volumeClaimTemplates.</li><li><strong>Rolling Updates</strong>: StatefulSets update Pods one at a time, ensuring continuity.</li></ol><p><strong>V. StatefulSet YAML Example</strong></p><p><strong>Example: StatefulSet for Nginx</strong></p><p>apiVersion: apps/v1</p><p>kind: StatefulSet</p><p>metadata:</p><p>name: web</p><p>spec:</p><p>serviceName: “nginx”</p><p>replicas: 3</p><p>selector:</p><p>matchLabels:</p><p>app: nginx</p><p>template:</p><p>metadata:</p><p>labels:</p><p>app: nginx</p><p>spec:</p><p>containers:</p><p>- name: nginx</p><p>image: nginx:1.21</p><p>ports:</p><p>- containerPort: 80</p><p>volumeMounts:</p><p>- name: www</p><p>mountPath: /usr/share/nginx/html</p><p>volumeClaimTemplates:</p><p>- metadata:</p><p>name: www</p><p>spec:</p><p>accessModes: [ “ReadWriteOnce” ]</p><p>resources:</p><p>requests:</p><p>storage: 1Gi</p><p><strong>Explanation:</strong></p><ul><li>serviceName → Name of the Headless Service that governs network identity.</li><li>replicas → Number of Pods to run (3 Pods here).</li><li>volumeClaimTemplates → Each Pod gets <strong>its own PersistentVolume</strong>.</li><li>Pods are named web-0, web-1, web-2.</li></ul><p><strong>VI. Commands to Work with StatefulSets</strong></p><p><strong># Create StatefulSet</strong></p><p>kubectl apply -f statefulset.yaml</p><p><strong># List StatefulSets</strong></p><p>kubectl get statefulsets</p><p><strong># Describe StatefulSet</strong></p><p>kubectl describe statefulset web</p><p><strong># List Pods created by StatefulSet</strong></p><p>kubectl get pods -l app=nginx</p><p><strong># Delete StatefulSet (PVCs remain)</strong></p><p>kubectl delete statefulset web</p><p><strong>8. DaemonSets</strong></p><p><strong>I. Definition</strong></p><p>A <strong>DaemonSet</strong> is a <strong>Kubernetes controller that ensures a specific Pod runs on all (or selected) nodes</strong> in a cluster.</p><p>💡 Think of DaemonSets as <strong>cluster-wide background agents</strong>, such as log collectors or monitoring tools, that must run on every node.</p><p><strong>II. Why DaemonSets?</strong></p><ul><li><strong>Cluster-wide deployment</strong>: Ensures one copy of a Pod per node automatically.</li><li><strong>Automatic scaling</strong>: New nodes automatically get the DaemonSet Pods.</li><li><strong>Operational tasks</strong>: Ideal for <strong>node monitoring, log collection, networking, or security agents</strong>.</li><li><strong>Resource management</strong>: Can limit deployment to specific nodes using node selectors or affinity.</li></ul><p><strong>III. DaemonSet Anatomy</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*LhEr7kSe_VcVMQNAnfZhVQ.png" /><figcaption>Fig: DaemonSet Anatomy</figcaption></figure><p><strong>IV. Key Features</strong></p><ol><li><strong>One Pod per node</strong>: Ensures cluster-wide coverage.</li><li><strong>Automatic on new nodes</strong>: DaemonSet Pods are scheduled on new nodes automatically.</li><li><strong>Flexible targeting</strong>: Can use <strong>nodeSelector, nodeAffinity, or taints/tolerations</strong> to select nodes.</li><li><strong>Rolling updates</strong>: Supports rolling updates with the updateStrategy field.</li></ol><p><strong>V. DaemonSet YAML Example</strong></p><p><strong>Example: DaemonSet for a Node Logging Agent</strong></p><p>apiVersion: apps/v1</p><p>kind: DaemonSet</p><p>metadata:</p><p>name: node-logger</p><p>namespace: kube-system</p><p>spec:</p><p>selector:</p><p>matchLabels:</p><p>name: node-logger</p><p>template:</p><p>metadata:</p><p>labels:</p><p>name: node-logger</p><p>spec:</p><p>containers:</p><p>- name: logger</p><p>image: fluentd:latest</p><p>resources:</p><p>limits:</p><p>memory: 200Mi</p><p>cpu: 100m</p><p>volumeMounts:</p><p>- name: varlog</p><p>mountPath: /var/log</p><p>volumes:</p><p>- name: varlog</p><p>hostPath:</p><p>path: /var/log</p><p><strong>Explanation:</strong></p><ul><li>Ensures a <strong>Fluentd logging agent runs on all nodes</strong>.</li><li>Mounts <strong>host /var/log directory</strong> to collect logs.</li><li>Pods automatically appear on <strong>all current and future nodes</strong>.</li></ul><p><strong>VI. Commands to Work with DaemonSets</strong></p><p><strong># Create a DaemonSet</strong></p><p>kubectl apply -f daemonset.yaml</p><p><strong># List DaemonSets</strong></p><p>kubectl get daemonsets -A</p><p><strong># Describe a DaemonSet</strong></p><p>kubectl describe daemonset node-logger -n kube-system</p><p><strong># Delete a DaemonSet</strong></p><p>kubectl delete daemonset node-logger -n kube-system</p><p><strong>9. Jobs &amp; CronJobs</strong></p><p><strong>I. Definition: Job</strong></p><p>A <strong>Job</strong> is a Kubernetes resource used to <strong>run a batch task or process to completion</strong>.</p><p>💡 Think of a Job as a <strong>one-time task runner</strong> that ensures a Pod executes successfully, retries on failure, and then stops.</p><p><strong>II. Why Jobs?</strong></p><ul><li><strong>Guaranteed completion</strong>: Kubernetes retries the Pod until it succeeds.</li><li><strong>Batch processing</strong>: Ideal for scripts, data processing, and database migrations.</li><li><strong>Parallel execution</strong>: Supports multiple Pods running in parallel for faster processing.</li><li><strong>Automatic cleanup</strong>: Can delete Pods after completion to save resources.</li></ul><p><strong>III. Job Anatomy</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*u0Qwhh8j51VBd8kWdu3IEw.png" /><figcaption>Fig: Job Anatomy</figcaption></figure><p><strong>IV. Job YAML Example</strong></p><p><strong>Example: Simple Job</strong></p><p>apiVersion: batch/v1</p><p>kind: Job</p><p>metadata:</p><p>name: hello-job</p><p>spec:</p><p>completions: 1</p><p>parallelism: 1</p><p>backoffLimit: 3</p><p>template:</p><p>metadata:</p><p>name: hello-job-pod</p><p>spec:</p><p>containers:</p><p>- name: hello</p><p>image: busybox</p><p>command: [“echo”, “Hello Kubernetes!”]</p><p>restartPolicy: OnFailure</p><p><strong>Explanation:</strong></p><ul><li>Runs a <strong>single Pod</strong> (hello-job-pod) that prints “Hello Kubernetes!”.</li><li>Retries up to <strong>3 times</strong> if it fails (backoffLimit).</li><li>Completes once (completions: 1).</li></ul><p><strong>I. Definition — Cron Job</strong></p><p>A <strong>CronJob</strong> is a Kubernetes resource that <strong>runs Jobs on a scheduled basis</strong>, similar to a Linux cron job.</p><p>💡 Think of a CronJob as <strong>automated, recurring batch tasks</strong>.</p><p><strong>II. Why CronJobs?</strong></p><ul><li><strong>Scheduled execution</strong>: Run Jobs at specific times (daily, hourly, minutely).</li><li><strong>Automation</strong>: Automatically triggers tasks without manual intervention.</li><li><strong>Retries &amp; history</strong>: Can track past Jobs and manage concurrency.</li></ul><p><strong>III. CronJob Anatomy</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*DnuCDu89fswCZc-UqPDTwg.png" /><figcaption>Fig: Cron Job Anatomy</figcaption></figure><p><strong>IV. CronJob YAML Example</strong></p><p><strong>Example: Daily Backup CronJob</strong></p><p>apiVersion: batch/v1</p><p>kind: CronJob</p><p>metadata:</p><p>name: daily-backup</p><p>spec:</p><p>schedule: “0 2 * * *” # Runs at 2 AM every day</p><p>concurrencyPolicy: Forbid</p><p>successfulJobsHistoryLimit: 3</p><p>failedJobsHistoryLimit: 1</p><p>jobTemplate:</p><p>spec:</p><p>template:</p><p>spec:</p><p>containers:</p><p>- name: backup</p><p>image: busybox</p><p>command: [“echo”, “Performing daily backup…”]</p><p>restartPolicy: OnFailure</p><p><strong>Explanation:</strong></p><ul><li>Runs a Job at <strong>2 AM daily</strong>.</li><li><strong>ConcurrencyPolicy: Forbid</strong> prevents overlapping runs.</li><li>Keeps <strong>last 3 successful Jobs</strong> and <strong>1 failed Job</strong>.</li><li>Each Job runs a Pod that prints a backup message.</li></ul><p><strong>V. Commands to Work with Jobs &amp; CronJobs</strong></p><p><strong># Jobs</strong></p><p>kubectl apply -f job.yaml</p><p>kubectl get jobs</p><p>kubectl describe job hello-job</p><p>kubectl delete job hello-job</p><p><strong># CronJobs</strong></p><p>kubectl apply -f cronjob.yaml</p><p>kubectl get cronjobs</p><p>kubectl describe cronjob daily-backup</p><p>kubectl delete cronjob daily-backup</p><p><strong>10. Persistent Volumes &amp; Persistent Volume Claims</strong></p><p><strong>I. Definition</strong></p><p>In Kubernetes, <strong>Pods are ephemeral</strong>, meaning data in a Pod is lost if the Pod is deleted. To persist data beyond Pod lifecycles, Kubernetes provides:</p><ul><li><strong>PersistentVolume (PV):</strong> A piece of storage in the cluster provisioned by an admin or dynamically by Kubernetes.</li><li><strong>PersistentVolumeClaim (PVC):</strong> A request for storage by a user. Pods use PVCs to mount PVs.</li></ul><p>💡 Think of <strong>PV as the storage resource</strong> and <strong>PVC as the claim/request to use it</strong>.</p><p><strong>II. Why PV &amp; PVC?</strong></p><ul><li><strong>Persistent storage</strong> for stateful applications (databases, file servers).</li><li><strong>Decouples storage and workloads</strong>: Developers don’t need to know where storage resides.</li><li><strong>Supports dynamic provisioning</strong>: Automatically provisions storage based on PVC requests.</li><li><strong>Works with multiple storage backends</strong>: Cloud storage, NFS, local disks, iSCSI, etc.</li></ul><p><strong>III. PersistentVolume (PV) Anatomy</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*IzqneMv7wVBshHDpZ1mNJg.png" /><figcaption>Fig: Persistent Volume Anatomy</figcaption></figure><p><strong>IV. PersistentVolumeClaim (PVC) Anatomy</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*dgRGuiupi5dHKLVr7Fiovg.png" /><figcaption>Fig: Persistent Volume Claim Anatomy</figcaption></figure><p><strong>V. PV YAML Example</strong></p><p><strong>Example: Static PV (NFS)</strong></p><p>apiVersion: v1</p><p>kind: PersistentVolume</p><p>metadata:</p><p>name: pv-nfs</p><p>spec:</p><p>capacity:</p><p>storage: 5Gi</p><p>accessModes:</p><p>- ReadWriteMany</p><p>persistentVolumeReclaimPolicy: Retain</p><p>nfs:</p><p>path: /srv/nfs</p><p>server: 192.168.1.100</p><p><strong>Explanation:</strong></p><ul><li>5Gi storage available.</li><li>Accessible <strong>read/write by multiple Pods</strong> (ReadWriteMany).</li><li>PV will be <strong>retained</strong> after release (Retain).</li><li>Uses <strong>NFS backend</strong>.</li></ul><p><strong>VI. PVC YAML Example</strong></p><p><strong>Example: Request Storage from PV</strong></p><p>apiVersion: v1</p><p>kind: PersistentVolumeClaim</p><p>metadata:</p><p>name: pvc-nfs</p><p>spec:</p><p>accessModes:</p><p>- ReadWriteMany</p><p>resources:</p><p>requests:</p><p>storage: 5Gi</p><p>storageClassName: “”</p><p><strong>Explanation:</strong></p><ul><li>Requests <strong>5Gi storage</strong>.</li><li>Must be <strong>read/write accessible by multiple Pods</strong>.</li><li>storageClassName: “” ensures it binds to manually created PVs.</li></ul><p><strong>VII. Commands to Work with PV &amp; PVC</strong></p><p><strong># List PVs</strong></p><p>kubectl get pv</p><p><strong># List PVCs</strong></p><p>kubectl get pvc</p><p><strong># Describe PV/PVC</strong></p><p>kubectl describe pv pv-nfs</p><p>kubectl describe pvc pvc-nfs</p><p><strong># Delete PV/PVC</strong></p><p>kubectl delete pvc pvc-nfs</p><p>kubectl delete pv pv-nfs</p><p><strong>11. Ingress</strong></p><p><strong>I. Definition</strong></p><p><strong>Ingress</strong> is a Kubernetes resource that <strong>manages external access to services</strong> in a cluster, typically HTTP/HTTPS traffic.</p><p>💡 Think of Ingress as a <strong>smart gateway</strong> that routes requests from outside the cluster to the correct internal services.</p><p><strong>II. Why Ingress?</strong></p><ul><li><strong>Centralized routing</strong>: Manage access for multiple services with a single resource.</li><li><strong>Path-based routing</strong>: Route requests based on URL paths.</li><li><strong>Host-based routing</strong>: Route requests based on the domain/hostname.</li><li><strong>TLS/SSL termination</strong>: Secure traffic with HTTPS without modifying services.</li><li><strong>Reduces NodePort/LoadBalancer overhead</strong>: No need to expose every service externally.</li></ul><p><strong>III. Ingress Anatomy</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*nFjYTBwcmBUe9ITJX0PLwg.png" /><figcaption>Fig: Ingress Anatomy</figcaption></figure><p><strong>IV. Ingress Controllers</strong></p><p>Kubernetes <strong>Ingress does not work alone</strong>. It requires an <strong>Ingress Controller</strong>, which is a pod that implements the rules defined in Ingress resources.</p><p><strong>Popular Ingress Controllers:</strong></p><ul><li><strong>NGINX Ingress Controller</strong> — Most common, flexible, widely used.</li><li><strong>Traefik</strong> — Supports modern features and dynamic routing.</li><li><strong>HAProxy</strong> — High performance, enterprise-grade load balancer.</li><li><strong>Istio/Contour</strong> — For advanced service mesh integration.</li></ul><p>💡 Ingress is the <strong>rule</strong>, and Ingress Controller is the <strong>engine that enforces it</strong>.</p><p><strong>V. Ingress YAML Example</strong></p><p><strong>Example: Path-Based Routing</strong></p><p>apiVersion: networking.k8s.io/v1</p><p>kind: Ingress</p><p>metadata:</p><p>name: myapp-ingress</p><p>annotations:</p><p>nginx.ingress.kubernetes.io/rewrite-target: /</p><p>spec:</p><p>rules:</p><p>- host: myapp.example.com</p><p>http:</p><p>paths:</p><p>- path: /frontend</p><p>pathType: Prefix</p><p>backend:</p><p>service:</p><p>name: frontend-service</p><p>port:</p><p>number: 80</p><p>- path: /backend</p><p>pathType: Prefix</p><p>backend:</p><p>service:</p><p>name: backend-service</p><p>port:</p><p>number: 80</p><p><strong>Explanation:</strong></p><ul><li>Routes requests to <strong>frontend-service</strong> if URL starts with /frontend.</li><li>Routes requests to <strong>backend-service</strong> if URL starts with /backend.</li><li>Hostname myapp.example.com defines which traffic to route.</li><li>Uses annotation to <strong>rewrite URL path</strong> for backend compatibility.</li></ul><p><strong>VI. Ingress YAML Example with TLS</strong></p><p>apiVersion: networking.k8s.io/v1</p><p>kind: Ingress</p><p>metadata:</p><p>name: secure-ingress</p><p>spec:</p><p>tls:</p><p>- hosts:</p><p>- myapp.example.com</p><p>secretName: myapp-tls</p><p>rules:</p><p>- host: myapp.example.com</p><p>http:</p><p>paths:</p><p>- path: /</p><p>pathType: Prefix</p><p>backend:</p><p>service:</p><p>name: frontend-service</p><p>port:</p><p>number: 80</p><p><strong>Explanation:</strong></p><ul><li>Uses <strong>TLS certificate stored in secret myapp-tls</strong>.</li><li>Encrypts traffic with HTTPS.</li><li>Routes all requests to frontend-service.</li></ul><p><strong>VII. Commands to Work with Ingress</strong></p><p><strong># List Ingress resources</strong></p><p>kubectl get ingress</p><p><strong># Describe Ingress for details</strong></p><p>kubectl describe ingress myapp-ingress</p><p><strong># Delete Ingress</strong></p><p>kubectl delete ingress myapp-ingress</p><p><strong># Test routing (if Minikube is used)</strong></p><p>minikube tunnel</p><p>curl <a href="http://myapp.example.com/frontend">http://myapp.example.com/frontend</a></p><p><strong>7. Kubernetes Autoscaling</strong></p><p>Kubernetes <strong>Autoscaling</strong> enables your workloads and clusters to automatically <strong>adjust resources based on demand</strong>.<br> It ensures that applications stay responsive under load while optimizing resource usage and cost.</p><p><strong>I. Types of Autoscaling</strong></p><p>There are three major types of autoscaling in Kubernetes:</p><ol><li><strong>Horizontal Pod Autoscaler (HPA)</strong></li><li><strong>Vertical Pod Autoscaler (VPA)</strong></li><li><strong>Cluster Autoscaler (CA)</strong></li></ol><p><strong>1. Horizontal Pod Autoscaler (HPA)</strong></p><p>The <strong>Horizontal Pod Autoscaler</strong> automatically increases or decreases the <strong>number of pod replicas</strong> in a Deployment, ReplicaSet, or StatefulSet based on observed <strong>CPU, memory, or custom metrics</strong>.</p><p>💡 <strong>Scaling horizontally</strong> means adding or removing Pod replicas.</p><p><strong>How It Works</strong></p><ul><li>HPA periodically checks resource usage metrics (like CPU or memory).</li><li>It compares them to the target utilization defined in the HPA configuration.</li><li>If usage exceeds the target, it increases Pod replicas.</li><li>If usage drops below the target, it reduces Pod replicas.</li></ul><p><strong>Prerequisites</strong></p><ul><li>Metrics Server must be installed to collect resource metrics.</li><li>kubectl apply -f <a href="https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml">https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml</a></li></ul><p><strong>Example: HPA YAML</strong></p><p>apiVersion: autoscaling/v2</p><p>kind: HorizontalPodAutoscaler</p><p>metadata:</p><p>name: myapp-hpa</p><p>namespace: default</p><p>spec:</p><p>scaleTargetRef:</p><p>apiVersion: apps/v1</p><p>kind: Deployment</p><p>name: myapp-deployment</p><p>minReplicas: 2</p><p>maxReplicas: 10</p><p>metrics:</p><p>- type: Resource</p><p>resource:</p><p>name: cpu</p><p>target:</p><p>type: Utilization</p><p>averageUtilization: 50</p><p><strong>Explanation:</strong></p><ul><li>Monitors CPU usage of myapp-deployment.</li><li>If CPU &gt; 50%, adds replicas.</li><li>Keeps replicas between <strong>2 and 10</strong>.</li></ul><p><strong>Create and Verify HPA</strong></p><p>kubectl apply -f hpa.yaml</p><p>kubectl get hpa</p><p><strong>Output Example:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*uJzAtl4TsmzzhufgDR6ihw.png" /><figcaption><em>The HPA has scaled your app to 4 replicas because CPU utilization exceeded 50%.</em></figcaption></figure><p><strong>Simulate Load (for Testing)</strong></p><p>kubectl run -it load-generator — image=busybox /bin/sh</p><p># Inside the shell:</p><p>while true; do wget -q -O- <a href="http://myapp-service;/">http://myapp-service;</a> done</p><p>Watch autoscaling in action:</p><p>kubectl get hpa -w</p><p><strong>2. Vertical Pod Autoscaler (VPA)</strong></p><p>The <strong>Vertical Pod Autoscaler</strong> automatically <strong>adjusts CPU and memory requests/limits</strong> for your Pods.</p><p>💡 <strong>Scaling vertically</strong> means giving Pods <strong>more or fewer resources</strong>, not changing their count.</p><p><strong>Use Cases</strong></p><ul><li>For workloads with unpredictable or changing resource requirements.</li><li>When scaling out horizontally is not possible (e.g., stateful apps).</li></ul><p><strong>Example: VPA YAML</strong></p><p>apiVersion: autoscaling.k8s.io/v1</p><p>kind: VerticalPodAutoscaler</p><p>metadata:</p><p>name: backend-vpa</p><p>spec:</p><p>targetRef:</p><p>apiVersion: apps/v1</p><p>kind: Deployment</p><p>name: backend-deployment</p><p>updatePolicy:</p><p>updateMode: “Auto”</p><p><strong>Explanation:</strong></p><ul><li>Monitors the backend-deployment and recommends or automatically applies CPU/memory adjustments.</li><li>updateMode: Auto means VPA will automatically modify Pod resource requests.</li></ul><p><strong>Update Modes</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*UwJAMlfX8-SoNwMOrO1eVA.png" /><figcaption>Fig: Update Modes</figcaption></figure><p><strong>View VPA Recommendations</strong></p><p>kubectl describe vpa backend-vpa</p><p>Output example:</p><p>Recommendation:</p><p>Container Recommendations:</p><p>Container Name: backend</p><p>Target:</p><p>cpu: 400m</p><p>memory: 512Mi</p><p><em>VPA suggested increasing CPU to 400 millicores and memory to 512Mi.</em></p><p><strong>3. Cluster Autoscaler (CA)</strong></p><p>The <strong>Cluster Autoscaler</strong> automatically <strong>adds or removes worker nodes</strong> in your cluster based on pending Pods.</p><p>💡 It works at the <strong>infrastructure level</strong>, scaling the entire cluster.</p><p><strong>How It Works</strong></p><ul><li>When Pods cannot be scheduled due to insufficient resources → new node is added.</li><li>When nodes are underutilized and their Pods can move elsewhere → nodes are removed.</li></ul><p><strong>Example (GKE / EKS / AKS)</strong></p><p>Cluster Autoscaler is typically managed by your <strong>cloud provider</strong>:</p><ul><li><strong>GKE</strong>: Enabled in the node pool configuration.</li><li><strong>EKS</strong>: Installed using AWS Cluster Autoscaler Helm chart.</li><li><strong>AKS</strong>: Enabled in Azure Portal or CLI.</li></ul><p><strong>Example Command (GKE):</strong></p><p>gcloud container clusters update my-cluster \</p><p>— enable-autoscaling — min-nodes 1 — max-nodes 5 \</p><p>— node-pool default-pool</p><p><em>Cluster Autoscaler scales nodes automatically based on Pod scheduling needs.</em></p><p><strong>II. Combining Autoscalers</strong></p><p>You can use all three together for full elasticity:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*FMPk2c4ReQMpv5sUBK1OoA.png" /><figcaption>Fig: Different Autoscalers</figcaption></figure><p><strong>Example:</strong><br> If traffic increases → HPA adds more Pods → Cluster Autoscaler adds new nodes → VPA adjusts Pod resource limits.</p><p><strong>III. Best Practices</strong></p><p>✅ Always install <strong>Metrics Server</strong> for HPA and VPA.<br> ✅ Set <strong>reasonable min/max replicas</strong> to prevent resource thrashing.<br> ✅ Use <strong>custom metrics</strong> (via Prometheus Adapter) for advanced scaling.<br> ✅ Avoid running HPA and VPA on the same Deployment unless well configured.<br> ✅ Enable <strong>Cluster Autoscaler</strong> for dynamic node management in cloud clusters.<br> ✅ Regularly <strong>monitor scaling events</strong> using kubectl get hpa and metrics dashboards.</p><p><strong>IV. Summary</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*YycWKVAlxQOy32kjro3-fg.png" /></figure><p><strong>8.</strong> <strong>Taints and Tolerations</strong></p><p><strong>I. Definition</strong></p><p><strong>Taints</strong> and <strong>Tolerations</strong> work together to control which <strong>Pods can be scheduled on which Nodes</strong> in a Kubernetes cluster.</p><p>They ensure that <strong>certain Pods are restricted to specific Nodes</strong> or that <strong>some Nodes repel Pods</strong> unless explicitly allowed.</p><p><strong>II. Why Use Taints &amp; Tolerations?</strong></p><ul><li>To <strong>reserve nodes</strong> for specific workloads (e.g., GPU nodes).</li><li>To <strong>prevent regular workloads</strong> from running on infrastructure nodes.</li><li>To <strong>isolate environments</strong> (e.g., production vs. development).</li><li>To <strong>ensure critical Pods</strong> run only on suitable nodes.</li></ul><p><strong>III. Taints: Applied on Nodes</strong></p><p>You use a taint to <strong>mark a Node</strong> with a condition that controls which Pods can be scheduled there.</p><p><strong>Syntax</strong></p><p>kubectl taint nodes &lt;node-name&gt; key=value:effect</p><p><strong>Effects:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*hGbLR9F3TC7KrPuD3bxblw.png" /><figcaption>Fig: Effects of Taints when applied on Nodes</figcaption></figure><p><strong>Example: Apply a Taint to a Node</strong></p><p>kubectl taint nodes node1 env=prod:NoSchedule</p><p>This means: Only Pods with a matching toleration for env=prod can run on node1.</p><p><strong>IV: Tolerations: Applied on Pods</strong></p><p>A <strong>toleration</strong> allows a Pod to be scheduled on a Node <strong>with a matching taint</strong>.</p><p><strong>Example: Pod with a Toleration</strong></p><p>apiVersion: v1</p><p>kind: Pod</p><p>metadata:</p><p>name: frontend-pod</p><p>spec:</p><p>tolerations:</p><p>- key: “env”</p><p>operator: “Equal”</p><p>value: “prod”</p><p>effect: “NoSchedule”</p><p>containers:</p><p>- name: frontend</p><p>image: nginx</p><p><strong>Explanation:</strong></p><ul><li>This Pod can tolerate the taint env=prod:NoSchedule.</li><li>It will be eligible to run on nodes with that taint.</li></ul><p><strong>V. Example Scenario</strong></p><p>Let’s understand with a real-world example.</p><p><strong>Step 1: Taint a Node</strong></p><p>kubectl taint nodes worker-node1 special=true:NoSchedule</p><p>This node is now <em>reserved</em> for specific Pods.</p><p><strong>Step 2: Deploy a Pod with Matching Toleration</strong></p><p>apiVersion: v1</p><p>kind: Pod</p><p>metadata:</p><p>name: special-backend</p><p>spec:</p><p>tolerations:</p><p>- key: “special”</p><p>operator: “Equal”</p><p>value: “true”</p><p>effect: “NoSchedule”</p><p>containers:</p><p>- name: backend</p><p>image: myapp/backend:v1</p><p>This Pod <strong>can</strong> be scheduled on worker-node1.</p><p><strong>Step 3: Deploy a Pod Without Toleration</strong></p><p>apiVersion: v1</p><p>kind: Pod</p><p>metadata:</p><p>name: normal-frontend</p><p>spec:</p><p>containers:</p><p>- name: frontend</p><p>image: nginx</p><p>This Pod <strong>cannot</strong> be scheduled on worker-node1 because it doesn’t tolerate the taint.</p><p><strong>VI. Removing a Taint</strong></p><p>To remove a taint from a node:</p><p>kubectl taint nodes node1 env=prod:NoSchedule-</p><p>(Notice the trailing — which removes the taint.)</p><p><strong>VII. Best Practices</strong></p><p>✅ Use <strong>taints</strong> on special-purpose nodes (like GPU or high-memory).<br> ✅ Always define <strong>tolerations</strong> explicitly for Pods that need special nodes.<br> ✅ Avoid excessive taints — they can make scheduling complex.<br> ✅ Use <strong>NoExecute</strong> for evicting non-critical Pods during maintenance.<br> ✅ Combine <strong>affinity</strong> + <strong>tolerations</strong> for strong scheduling strategies.</p><p><strong>9. Kubernetes Affinity &amp; Node Affinity</strong></p><p>Kubernetes <strong>Affinity</strong> and <strong>Node Affinity</strong> are <strong>advanced scheduling mechanisms</strong> that control <strong>how Pods are placed on Nodes</strong> based on <strong>rules and relationships</strong>.</p><p>They allow you to define <strong>where Pods should (or should not) run</strong>, giving you fine-grained control over Pod distribution, performance, and fault tolerance.</p><p><strong>I. What is Affinity in Kubernetes?</strong></p><p>Affinity defines <strong>rules for pod placement</strong>. It tells the Kubernetes scheduler:</p><ul><li>Which <strong>nodes</strong> a Pod prefers or requires.</li><li>Which <strong>other Pods</strong> it prefers to run <strong>with</strong> or <strong>away from</strong>.</li></ul><p>💡 <strong>In short:</strong></p><p>“Affinity” = attraction (Pods prefer or require certain Nodes or Pods).<br> “Anti-Affinity” = repulsion (Pods avoid certain Nodes or Pods).</p><p><strong>II. Types of Affinity</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*WCRBicIJkJiG9Tt9AfMvgg.png" /><figcaption>Fig: Types of Affinity</figcaption></figure><p><strong>III. Node Affinity</strong></p><p>Node Affinity is like an enhanced version of nodeSelector — it allows <strong>more complex matching rules</strong> and <strong>soft/hard requirements</strong> for where Pods can run.</p><p><strong>Syntax</strong></p><p>affinity:</p><p>nodeAffinity:</p><p>requiredDuringSchedulingIgnoredDuringExecution:</p><p>nodeSelectorTerms:</p><p>- matchExpressions:</p><p>- key: &lt;label-key&gt;</p><p>operator: In</p><p>values:</p><p>- &lt;label-value&gt;</p><p><strong>Example: Required Node Affinity</strong></p><p>apiVersion: v1</p><p>kind: Pod</p><p>metadata:</p><p>name: backend-pod</p><p>spec:</p><p>affinity:</p><p>nodeAffinity:</p><p>requiredDuringSchedulingIgnoredDuringExecution:</p><p>nodeSelectorTerms:</p><p>- matchExpressions:</p><p>- key: env</p><p>operator: In</p><p>values:</p><p>- production</p><p>containers:</p><p>- name: backend</p><p>image: nginx</p><p><strong>Explanation:</strong></p><ul><li>The Pod will <strong>only</strong> be scheduled on Nodes with label env=production.</li><li>This is a <strong>hard rule</strong> — the Pod won’t start unless a matching Node exists.</li></ul><p><strong>Example: Preferred Node Affinity</strong></p><p>apiVersion: v1</p><p>kind: Pod</p><p>metadata:</p><p>name: frontend-pod</p><p>spec:</p><p>affinity:</p><p>nodeAffinity:</p><p>preferredDuringSchedulingIgnoredDuringExecution:</p><p>- weight: 1</p><p>preference:</p><p>matchExpressions:</p><p>- key: region</p><p>operator: In</p><p>values:</p><p>- us-east-1</p><p>containers:</p><p>- name: frontend</p><p>image: nginx</p><p><strong>Explanation:</strong></p><ul><li>The Pod <strong>prefers</strong> to run on a Node labeled region=us-east-1.</li><li>If none are available, it can still be scheduled elsewhere.</li><li>This is a <strong>soft rule</strong> (a preference, not a requirement).</li></ul><p><strong>IV. Pod Affinity</strong></p><p><strong>Pod Affinity</strong> lets you schedule Pods to <strong>run close to other Pods</strong>, typically on the same Node, zone, or region.</p><p>Useful when Pods communicate frequently and benefit from low network latency.</p><p><strong>Example: Pod Affinity (Same Node as Another Pod)</strong></p><p>apiVersion: apps/v1</p><p>kind: Deployment</p><p>metadata:</p><p>name: app-with-affinity</p><p>spec:</p><p>replicas: 2</p><p>selector:</p><p>matchLabels:</p><p>app: frontend</p><p>template:</p><p>metadata:</p><p>labels:</p><p>app: frontend</p><p>spec:</p><p>affinity:</p><p>podAffinity:</p><p>requiredDuringSchedulingIgnoredDuringExecution:</p><p>- labelSelector:</p><p>matchExpressions:</p><p>- key: app</p><p>operator: In</p><p>values:</p><p>- backend</p><p>topologyKey: “kubernetes.io/hostname”</p><p>containers:</p><p>- name: frontend</p><p>image: nginx</p><p><strong>Explanation:</strong></p><ul><li>Schedules frontend Pods on <strong>the same Node</strong> as backend Pods.</li><li>topologyKey: “kubernetes.io/hostname” means “within the same Node”.</li></ul><p><strong>V. Pod Anti-Affinity</strong></p><p><strong>Pod Anti-Affinity</strong> ensures Pods <strong>do not run on the same Node</strong> as other specified Pods.</p><p>Useful for <strong>high availability (HA)</strong> — to spread Pods across Nodes or zones.</p><p><strong>Example: Pod Anti-Affinity (Avoid Same Node)</strong></p><p>apiVersion: apps/v1</p><p>kind: Deployment</p><p>metadata:</p><p>name: web-deployment</p><p>spec:</p><p>replicas: 3</p><p>selector:</p><p>matchLabels:</p><p>app: web</p><p>template:</p><p>metadata:</p><p>labels:</p><p>app: web</p><p>spec:</p><p>affinity:</p><p>podAntiAffinity:</p><p>requiredDuringSchedulingIgnoredDuringExecution:</p><p>- labelSelector:</p><p>matchExpressions:</p><p>- key: app</p><p>operator: In</p><p>values:</p><p>- web</p><p>topologyKey: “kubernetes.io/hostname”</p><p>containers:</p><p>- name: web</p><p>image: nginx</p><p><strong>Explanation:</strong></p><ul><li>Ensures that <strong>each replica</strong> of the web app runs on a <strong>different Node</strong>.</li><li>Increases resilience by avoiding multiple Pods of the same app on one Node.</li></ul><p><strong>VI. Operators in Match Expressions</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*07URpC5FGExuQwKcaKhRuA.png" /><figcaption>Fig: Operators in Match Expressions</figcaption></figure><p><strong>VII. Comparison: NodeSelector vs Node Affinity</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*jYkyGo20ycYE7rtB6n1Y7A.png" /><figcaption>Fig: Node Selector vs Node Affinity</figcaption></figure><p>💡 <em>Node Affinity is the advanced version of NodeSelector.</em></p><p><strong>VIII. Combining Affinity with Taints &amp; Tolerations</strong></p><p>You can combine <strong>Affinity</strong> with <strong>Taints and Tolerations</strong> for more precise scheduling:</p><ul><li>Use <strong>Taints</strong> to repel all Pods except those that tolerate it.</li><li>Use <strong>Node Affinity</strong> to <strong>prefer or require</strong> Pods to run on certain labeled Nodes.</li></ul><p><strong>Example:</strong></p><p>affinity:</p><p>nodeAffinity:</p><p>requiredDuringSchedulingIgnoredDuringExecution:</p><p>nodeSelectorTerms:</p><p>- matchExpressions:</p><p>- key: gpu</p><p>operator: In</p><p>values:</p><p>- “true”</p><p>tolerations:</p><p>- key: “gpu”</p><p>operator: “Equal”</p><p>value: “true”</p><p>effect: “NoSchedule”</p><p><em>Only GPU-tolerant Pods are scheduled on GPU nodes.</em></p><p><strong>IX. Best Practices</strong></p><p><strong>✅</strong>Use <strong>Node Affinity</strong> for node-level control (e.g., hardware, region).</p><p><strong>✅</strong>Use <strong>Pod Affinity/Anti-Affinity</strong> for workload placement (e.g., redundancy, performance).</p><p><strong>✅</strong>Always define <strong>topologyKey</strong> — common values:</p><ul><li>kubernetes.io/hostname → Node-level</li><li>topology.kubernetes.io/zone → Zone-level</li><li>topology.kubernetes.io/region → Region-level</li></ul><p><strong>✅</strong>Combine <strong>Affinity + Tolerations</strong> for complex scheduling policies.</p><p><strong>✅</strong>Use <strong>Anti-Affinity</strong> to improve <strong>high availability</strong> and <strong>fault tolerance</strong>.</p><p><strong>X. Summary</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*FdNrNxf8UWM1m1NvpNTG6g.png" /></figure><p><strong>10. Monitoring &amp; Debugging</strong></p><p><strong>I. Definition</strong></p><p>Monitoring and debugging are essential to ensure that your applications run reliably and efficiently in a Kubernetes cluster. Kubernetes provides built-in tools and configurations to help you inspect, troubleshoot, and automatically recover from issues.</p><p><strong>II. Inspect Pod Details</strong></p><p>kubectl describe pod &lt;pod-name&gt;</p><p><strong>Purpose:</strong></p><ul><li>Displays detailed information about a specific Pod.</li><li>Includes events, conditions, node details, container status, and networking info.</li></ul><p><strong>III. View Logs from a Pod</strong></p><p>kubectl logs &lt;pod-name&gt;</p><p><strong>Purpose:</strong></p><ul><li>Shows logs from the application running inside a Pod.</li><li>Helps diagnose runtime issues, crashes, or misconfigurations.</li></ul><p><strong>IV. Check Cluster-Wide Health</strong></p><p>kubectl get all -n &lt;namespace&gt;</p><p><strong>Purpose:</strong></p><ul><li>Lists all resources (Pods, Services, Deployments, etc.) in a namespace.</li><li>Useful for verifying if all components are running correctly.</li></ul><p><strong>V. Using Probes in YAML for Health Checks</strong></p><p>Kubernetes provides two types of <strong>probes</strong> to monitor container health:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*2L1vfAIjYGsPpcUFsfVj4Q.png" /><figcaption>Fig: Probe types and its purpose</figcaption></figure><p><strong>VI. Other Useful Debugging Commands</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*UH8TQUDo11XX7STZ6k1FDw.png" /><figcaption>Fig: Debugging Commands</figcaption></figure><p><strong>VII. Integrating Monitoring Tools</strong></p><p>While kubectl commands help with manual debugging, production-grade clusters should include monitoring tools:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*XrZbaj8MHfJi5XMtSvrvTw.png" /><figcaption>Fig: Monitoring tools</figcaption></figure><p>💡 Use <strong>Prometheus</strong> for metrics and <strong>Grafana</strong> for visualization to gain deep insights into application and cluster health.</p><p><strong>VIII. Best Practices</strong></p><p>✅ Always define <strong>liveness</strong> and <strong>readiness probes</strong> in your Pod specifications.<br> ✅ Monitor <strong>Pod logs</strong> and <strong>events</strong> regularly.<br> ✅ Use <strong>resource limits</strong> (CPU &amp; memory) to avoid node overloading.<br> ✅ Integrate <strong>Prometheus/Grafana</strong> for continuous metrics monitoring.<br> ✅ Enable <strong>audit logging</strong> to track API activities.</p><p><strong>11. Kubernetes Security Concepts</strong></p><p><strong>1.</strong> <strong>RBAC</strong></p><p><strong>I. Definition</strong></p><p><strong>RBAC</strong> is a mechanism to <strong>control API access</strong> in Kubernetes by defining <strong>roles</strong> and <strong>bindings</strong>.</p><p><strong>II. Key Concepts</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*fwsN-XDA_flu4W7QYGYoHA.png" /><figcaption>Fig: RBAC terms</figcaption></figure><p><strong>III. Example: Role &amp; RoleBinding</strong></p><p>apiVersion: rbac.authorization.k8s.io/v1</p><p>kind: Role</p><p>metadata:</p><p>namespace: dev</p><p>name: pod-reader</p><p>rules:</p><p>- apiGroups: [“”]</p><p>resources: [“pods”]</p><p>verbs: [“get”, “watch”, “list”]</p><p>— -</p><p>apiVersion: rbac.authorization.k8s.io/v1</p><p>kind: RoleBinding</p><p>metadata:</p><p>name: read-pods</p><p>namespace: dev</p><p>subjects:</p><p>- kind: User</p><p>name: alice</p><p>apiGroup: rbac.authorization.k8s.io</p><p>roleRef:</p><p>kind: Role</p><p>name: pod-reader</p><p>apiGroup: rbac.authorization.k8s.io</p><p><strong>Explanation:</strong></p><p>· User alice can <strong>read pods</strong> in the dev namespace.</p><p>· RBAC enforces the <strong>principle of least privilege</strong>.</p><p><strong>1.</strong> <strong>Service Accounts</strong></p><p><strong>I. Definition</strong></p><p><strong>Service Accounts</strong> provide an <strong>identity for pods</strong> to interact with the Kubernetes API.</p><p>· Every pod runs under a <strong>service account</strong> (default or custom).</p><p>· Grants permissions defined by <strong>RoleBindings</strong> or <strong>ClusterRoleBindings</strong>.</p><p>· Can be used to give applications <strong>limited access</strong> to cluster resources.</p><p>II. <strong>Example: Service Account</strong></p><p>apiVersion: v1</p><p>kind: ServiceAccount</p><p>metadata:</p><p>name: myapp-sa</p><p>namespace: dev</p><p>Bind Service Account to Role</p><p>apiVersion: rbac.authorization.k8s.io/v1</p><p>kind: RoleBinding</p><p>metadata:</p><p>name: myapp-sa-binding</p><p>namespace: dev</p><p>subjects:</p><p>- kind: ServiceAccount</p><p>name: myapp-sa</p><p>namespace: dev</p><p>roleRef:</p><p>kind: Role</p><p>name: pod-reader</p><p>apiGroup: rbac.authorization.k8s.io</p><p><strong>Explanation:</strong></p><p>· Pods using myapp-sa can only <strong>read pods in the dev namespace</strong>.</p><p>· Useful for controlling <strong>app-level access</strong> without using user credentials.</p><ol><li><strong>Network Policies</strong></li></ol><p><strong>I. Definition</strong></p><p><strong>Network Policies</strong> control <strong>traffic between pods</strong>. They define <strong>who can communicate with whom</strong> inside the cluster.</p><p><strong>II. Key Concepts</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*ESeMYvdcUy1mwaUvSoZeoA.png" /><figcaption>FIg: Network Policies key concepts</figcaption></figure><p><strong>III. Example: Restrict Ingress to a Pod</strong></p><p>apiVersion: networking.k8s.io/v1</p><p>kind: NetworkPolicy</p><p>metadata:</p><p>name: allow-frontend</p><p>namespace: dev</p><p>spec:</p><p>podSelector:</p><p>matchLabels:</p><p>app: backend</p><p>policyTypes:</p><p>- Ingress</p><p>ingress:</p><p>- from:</p><p>- podSelector:</p><p>matchLabels:</p><p>app: frontend</p><p><strong>Explanation:</strong></p><p>· Only pods labeled app=frontend can access backend pods.</p><p>· All other traffic is denied by default.</p><p>· Ensures <strong>segmentation and security between microservices</strong>.</p><ol><li><strong>Secrets</strong></li></ol><p><strong>I. Definition</strong></p><p><strong>Secrets</strong> store <strong>sensitive information</strong> such as passwords, API keys, or TLS certificates securely.</p><p>· Encoded in <strong>base64</strong>, not plain text.</p><p>· Can be <strong>mounted as volumes</strong> or <strong>injected as environment variables</strong>.</p><p>· Protects credentials from being exposed in pod manifests.</p><p><strong>II. Example: Secret</strong></p><p>apiVersion: v1</p><p>kind: Secret</p><p>metadata:</p><p>name: db-credentials</p><p>type: Opaque</p><p>data:</p><p>username: YWRtaW4= # base64 encoded ‘admin’</p><p>password: MWYyZDFlMmU2N2Rm # base64 encoded ‘1f2d1e2e67df’</p><p><strong>5. Best Practices for Kubernetes Security</strong></p><p>✅Use <strong>RBAC</strong> to implement <strong>least privilege</strong>.</p><p>✅Use <strong>service accounts</strong> for pods instead of user credentials.</p><p>✅Implement <strong>network policies</strong> to isolate microservices.</p><p>✅Store sensitive data in <strong>Secrets</strong>, never in ConfigMaps or pod specs.</p><p>✅Enable <strong>audit logging</strong> to monitor API access.</p><p>✅Rotate <strong>credentials and secrets</strong> regularly.</p><p>✅Use <strong>TLS for all internal and external communications</strong>.</p><p><strong>12. Full- Stack Deployment Example</strong></p><p>A <strong>full-stack Kubernetes deployment</strong> typically includes a <strong>frontend</strong>, <strong>backend</strong>, and sometimes a <strong>database</strong>, all running as separate <strong>Deployments</strong> and connected via <strong>Services</strong>. This setup can be used to deploy a web application, microservices system, or any multi-tier architecture.</p><p><strong>I. Build Docker Images</strong></p><p>Before deploying your application on Kubernetes, containerize your code using Docker.</p><p><strong>Example: Frontend (React App)</strong></p><p># Inside your frontend project directory</p><p>docker build -t your-dockerhub-username/frontend-app:v1 .</p><p><strong>Example: Backend (Node.js API)</strong></p><p># Inside your backend project directory</p><p>docker build -t your-dockerhub-username/backend-api:v1 .</p><p><strong>Verify Images</strong></p><p>docker images</p><p><em>Both frontend and backend Docker images are now ready to be pushed.</em></p><p><strong>II. Push Images to a Container Registry</strong></p><p>You can use any registry like <strong>Docker Hub</strong>, <strong>Amazon ECR</strong>, or <strong>Google Container Registry</strong>.</p><p><strong>Example: Push to Docker Hub</strong></p><p><strong># Log in to Docker Hub</strong></p><p>docker login</p><p><strong># Push images</strong></p><p>docker push your-dockerhub-username/frontend-app:v1</p><p>docker push your-dockerhub-username/backend-api:v1</p><p><em>Your Kubernetes cluster will later pull these images from the registry.</em></p><p><strong>III. Create Kubernetes Manifests</strong></p><p>Now, define your Kubernetes manifests for <strong>Namespaces</strong>, <strong>Deployments</strong>, <strong>Services</strong>, and optionally <strong>Ingress</strong> for routing external traffic.</p><p><strong>(a) Namespace — namespace.yaml</strong></p><p>apiVersion: v1</p><p>kind: Namespace</p><p>metadata:</p><p>name: fullstack-app</p><p><em>Organizes all your application components under a single logical namespace.</em></p><p><strong>(b) Backend Deployment — backend-deployment.yaml</strong></p><p>apiVersion: apps/v1</p><p>kind: Deployment</p><p>metadata:</p><p>name: backend-deployment</p><p>namespace: fullstack-app</p><p>spec:</p><p>replicas: 2</p><p>selector:</p><p>matchLabels:</p><p>app: backend</p><p>template:</p><p>metadata:</p><p>labels:</p><p>app: backend</p><p>spec:</p><p>containers:</p><p>- name: backend</p><p>image: your-dockerhub-username/backend-api:v1</p><p>ports:</p><p>- containerPort: 5000</p><p>env:</p><p>- name: MONGO_URL</p><p>value: “mongodb://mongo-service:27017/mydb”</p><p><strong>© Backend Service — backend-service.yaml</strong></p><p>apiVersion: v1</p><p>kind: Service</p><p>metadata:</p><p>name: backend-service</p><p>namespace: fullstack-app</p><p>spec:</p><p>selector:</p><p>app: backend</p><p>ports:</p><p>- protocol: TCP</p><p>port: 5000</p><p>targetPort: 5000</p><p>type: ClusterIP</p><p><em>Exposes the backend internally to other services (like the frontend).</em></p><p><strong>(d) Frontend Deployment — frontend-deployment.yaml</strong></p><p>apiVersion: apps/v1</p><p>kind: Deployment</p><p>metadata:</p><p>name: frontend-deployment</p><p>namespace: fullstack-app</p><p>spec:</p><p>replicas: 2</p><p>selector:</p><p>matchLabels:</p><p>app: frontend</p><p>template:</p><p>metadata:</p><p>labels:</p><p>app: frontend</p><p>spec:</p><p>containers:</p><p>- name: frontend</p><p>image: your-dockerhub-username/frontend-app:v1</p><p>ports:</p><p>- containerPort: 80</p><p>env:</p><p>- name: REACT_APP_API_URL</p><p>value: “http://backend-service:5000&quot;</p><p><strong>(e) Frontend Service — frontend-service.yaml</strong></p><p>apiVersion: v1</p><p>kind: Service</p><p>metadata:</p><p>name: frontend-service</p><p>namespace: fullstack-app</p><p>spec:</p><p>selector:</p><p>app: frontend</p><p>ports:</p><p>- protocol: TCP</p><p>port: 80</p><p>targetPort: 80</p><p>nodePort: 30080</p><p>type: NodePort</p><p><em>Exposes the frontend externally using NodePort (accessible via http://&lt;node-ip&gt;:30080).</em></p><p><strong>(f) Optional Ingress — ingress.yaml</strong></p><p>apiVersion: networking.k8s.io/v1</p><p>kind: Ingress</p><p>metadata:</p><p>name: fullstack-ingress</p><p>namespace: fullstack-app</p><p>annotations:</p><p>kubernetes.io/ingress.class: nginx</p><p>spec:</p><p>rules:</p><p>- host: myapp.local</p><p>http:</p><p>paths:</p><p>- path: /</p><p>pathType: Prefix</p><p>backend:</p><p>service:</p><p>name: frontend-service</p><p>port:</p><p>number: 80</p><p><em>Ingress routes HTTP traffic to the frontend service based on hostname (myapp.local).</em></p><p><strong>IV. Apply All Manifests</strong></p><p>Once all YAML files are ready, apply them to your cluster in order:</p><p>kubectl apply -f namespace.yaml</p><p>kubectl apply -f backend-deployment.yaml</p><p>kubectl apply -f backend-service.yaml</p><p>kubectl apply -f frontend-deployment.yaml</p><p>kubectl apply -f frontend-service.yaml</p><p>kubectl apply -f ingress.yaml</p><p>This will create:</p><ul><li>Namespace: fullstack-app</li><li>Deployments: frontend &amp; backend</li><li>Services: frontend-service, backend-service</li><li>Ingress (optional): fullstack-ingress</li></ul><p><strong>V. Verification</strong></p><p><strong># Check all resources</strong></p><p>kubectl get all -n fullstack-app</p><p><strong># Check logs</strong></p><p>kubectl logs -n fullstack-app -l app=backend</p><p>kubectl logs -n fullstack-app -l app=frontend</p><p><strong># Access the frontend</strong></p><p>minikube service frontend-service -n fullstack-app</p><p>If using Ingress with Minikube:</p><p>minikube addons enable ingress</p><p>kubectl get ingress -n fullstack-app</p><p>Then add an entry in your /etc/hosts:</p><p>127.0.0.1 myapp.local</p><p>Access via → <a href="http://myapp.local/">http://myapp.local</a></p><p><strong>VI. Summary</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*QeqtDfb7jxkkIwW6JwxnNQ.png" /></figure><p>💡 <em>This full-stack setup demonstrates a complete workflow — from Docker image creation to Kubernetes deployment, networking, and scaling.</em></p><p><strong>13. Helm</strong></p><p><strong>I. Definition</strong></p><p><strong>Helm</strong> is a <strong>package manager for Kubernetes</strong>. It helps you <strong>define, install, and manage Kubernetes applications</strong> using reusable templates called <strong>charts</strong>.</p><p>💡 Think of Helm as <strong>apt/yum for Kubernetes</strong>: it simplifies deploying complex apps with a single command.</p><p><strong>II. Why Helm?</strong></p><ul><li><strong>Simplifies deployment</strong>: Deploy multi-component applications using one chart.</li><li><strong>Version control</strong>: Manage app versions, rollbacks, and upgrades.</li><li><strong>Reusable templates</strong>: Create customizable Kubernetes manifests.</li><li><strong>Parameterization</strong>: Easily configure apps using values files.</li><li><strong>Community charts</strong>: Use existing charts from Helm repositories for popular apps (e.g., MySQL, Nginx, Prometheus).</li></ul><p><strong>III. Helm Architecture Components</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*Ved9hD2v4ZomiSO6WplP7Q.png" /><figcaption>Fig: Helm Architecture components</figcaption></figure><p><strong>IV. Helm Terminology</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*R0xEodOzyxvpKWvk1lNFsA.png" /><figcaption>Fig: Helm Terminology</figcaption></figure><p><strong>V. Installing Helm</strong></p><p><strong># Download and install Helm (Linux example)</strong></p><p>curl <a href="https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3">https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3</a> | bash</p><p><strong># Verify installation</strong></p><p>helm version</p><p><strong>VI. Adding a Helm Repository</strong></p><p><strong># Add official stable Helm repository</strong></p><p>helm repo add stable <a href="https://charts.helm.sh/stable">https://charts.helm.sh/stable</a></p><p><strong># Update repo to fetch latest charts</strong></p><p>helm repo update</p><p><strong># Search charts</strong></p><p>helm search repo nginx</p><p><strong>VII. Installing an Application via Helm</strong></p><p><strong># Install Nginx from stable repository</strong></p><p>helm install my-nginx stable/nginx-ingress</p><p><strong>Explanation:</strong></p><ul><li>my-nginx → Name of the release.</li><li>stable/nginx-ingress → Chart to install.</li><li>Helm automatically creates required <strong>deployments, services, configmaps, and ingress</strong>.</li></ul><p><strong>VIII. Customizing Charts with Values</strong></p><p><strong># values.yaml</strong></p><p>replicaCount: 3</p><p>service:</p><p>type: NodePort</p><p>port: 30080</p><p><strong># Install Helm chart with custom values</strong></p><p>helm install my-nginx stable/nginx-ingress -f values.yaml</p><p><strong>Explanation:</strong></p><ul><li>Customize the number of replicas, ports, and other configurations.</li><li>Makes deployments reusable and environment-specific.</li></ul><p><strong>IX. Managing Releases</strong></p><p><strong># List installed Helm releases</strong></p><p>helm list</p><p><strong># Upgrade a release</strong></p><p>helm upgrade my-nginx stable/nginx-ingress -f values.yaml</p><p><strong># Rollback a release</strong></p><p>helm rollback my-nginx 1</p><p><strong># Uninstall a release</strong></p><p>helm uninstall my-nginx</p><p><strong>X. Creating Your Own Helm Chart</strong></p><p><strong># Create new Helm chart</strong></p><p>helm create myapp</p><p><strong># Directory structure</strong></p><p># myapp/</p><p># ├── Chart.yaml # Chart metadata</p><p># ├── values.yaml # Default configuration</p><p># ├── templates/ # Kubernetes manifests templates</p><p>· Edit templates using <strong>Go templating syntax</strong> to inject variables from values.yaml.</p><p>· Deploy using helm install myapp ./myapp.</p><p><strong>XI. Helm Demo</strong></p><p><strong># Folder structure</strong></p><p>mychart/</p><p>├── Chart.yaml</p><p>├── values.yaml</p><p>└── templates/</p><p>├── deployment.yaml</p><p>└── service.yaml</p><p><strong># Chart.yaml</strong></p><p>apiVersion: v2</p><p>name: mychart</p><p>description: A simple NGINX Helm chart</p><p>version: 0.1.0</p><p>appVersion: “1.21.0”</p><p><strong># values.yaml</strong></p><p>replicaCount: 2</p><p>image:</p><p>repository: nginx</p><p>tag: “1.21.0”</p><p>pullPolicy: IfNotPresent</p><p>service:</p><p>type: ClusterIP</p><p>port: 80</p><p><strong># templates/deployment.yaml</strong></p><p>apiVersion: apps/v1</p><p>kind: Deployment</p><p>metadata:</p><p>name: {{ .Release.Name }}-deployment</p><p>labels:</p><p>app: {{ .Chart.Name }}</p><p>spec:</p><p>replicas: {{ .Values.replicaCount }}</p><p>selector:</p><p>matchLabels:</p><p>app: {{ .Chart.Name }}</p><p>template:</p><p>metadata:</p><p>labels:</p><p>app: {{ .Chart.Name }}</p><p>spec:</p><p>containers:</p><p>- name: nginx</p><p>image: “{{ .Values.image.repository }}:{{ .Values.image.tag }}”</p><p>imagePullPolicy: {{ .Values.image.pullPolicy }}</p><p>ports:</p><p>- containerPort: 80</p><p><strong># templates/service.yaml</strong></p><p>apiVersion: v1</p><p>kind: Service</p><p>metadata:</p><p>name: {{ .Release.Name }}-service</p><p>labels:</p><p>app: {{ .Chart.Name }}</p><p>spec:</p><p>type: {{ .Values.service.type }}</p><p>selector:</p><p>app: {{ .Chart.Name }}</p><p>ports:</p><p>- protocol: TCP</p><p>port: {{ .Values.service.port }}</p><p>targetPort: 80</p><p><strong># To deploy it</strong></p><p>helm install my-nginx ./mychart</p><p><strong>Explanation:</strong></p><ul><li>Uses values.yaml for configuration (so you can easily override settings per environment)</li><li>Templating ({{ .Values.* }}) makes the chart reusable and maintainable</li><li>Keeps chart metadata (Chart.yaml) separate from templates</li></ul><p><strong>14. References &amp; Resources</strong></p><ul><li><a href="https://kubernetes.io/docs/">Kubernetes Official Documentation</a></li><li><a href="https://artifacthub.io/">Helm Charts</a></li><li><a href="https://minikube.sigs.k8s.io/docs/">Minikube</a></li><li>Troubleshooting:</li><li>Use kubectl describe and kubectl logs.</li><li>Validate YAML: kubectl apply — dry-run=client -f file.yaml</li></ul><p><strong>15. Conclusion</strong></p><p>In summary, Kubernetes lays the foundation for robust container orchestration, and Helm enhances it with easy, repeatable, and version-controlled deployments. Together, they simplify the complexity of cloud-native operations and empower teams to deliver high-quality applications with confidence and speed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0cbfaa209ebb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>