<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Mohammed Nasser</title>
    <description>The latest articles on Forem by Mohammed Nasser (@mohamednasser018).</description>
    <link>https://forem.com/mohamednasser018</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1113868%2Ff07420ad-e599-4211-b528-54346bdbc963.png</url>
      <title>Forem: Mohammed Nasser</title>
      <link>https://forem.com/mohamednasser018</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mohamednasser018"/>
    <language>en</language>
    <item>
      <title>AWS EBS Root Volume Resize: Bypassing the 6-Hour Modification Limit</title>
      <dc:creator>Mohammed Nasser</dc:creator>
      <pubDate>Sun, 19 Oct 2025 10:25:40 +0000</pubDate>
      <link>https://forem.com/mohamednasser018/aws-ebs-root-volume-resize-bypassing-the-6-hour-modification-limit-1k9c</link>
      <guid>https://forem.com/mohamednasser018/aws-ebs-root-volume-resize-bypassing-the-6-hour-modification-limit-1k9c</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5v8io5rjw2vp5qgpddvw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5v8io5rjw2vp5qgpddvw.png" alt=" " width="686" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem: Hit the Wall with EBS Modification Limits
&lt;/h2&gt;

&lt;p&gt;If you're working with AWS EBS volumes, you've likely encountered this frustrating error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You've reached the maximum modification rate per volume limit. 
Wait at least 6 hours between modifications per EBS volume.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;AWS enforces a hard limit of &lt;strong&gt;8 modification requests per EBS volume within a 6-hour period&lt;/strong&gt;. This is not a soft limit you can request to increase—it's a platform-wide restriction designed to protect volume integrity during modifications.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why This Limitation Exists
&lt;/h3&gt;

&lt;p&gt;EBS volume modifications involve complex backend operations including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data migration across storage clusters&lt;/li&gt;
&lt;li&gt;Performance tier adjustments&lt;/li&gt;
&lt;li&gt;Volume optimization processes&lt;/li&gt;
&lt;li&gt;Consistency checks and validation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rapid successive modifications could compromise data integrity, which is why AWS enforces this cooling-off period.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Challenge: Root Volumes Cannot Be Detached
&lt;/h2&gt;

&lt;p&gt;Unlike data volumes, &lt;strong&gt;root volumes have special restrictions&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;They cannot be detached from a running instance&lt;/li&gt;
&lt;li&gt;They cannot be detached even when the instance is stopped&lt;/li&gt;
&lt;li&gt;The root volume must remain attached for the instance to exist&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This means the traditional workaround of creating a new volume and swapping it won't work for root volumes through simple detach/attach operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: Replace Root Volume with Snapshots
&lt;/h2&gt;

&lt;p&gt;AWS provides a built-in feature specifically designed for this scenario: &lt;strong&gt;Replace Root Volume&lt;/strong&gt;. This feature allows you to swap the root volume while preserving the instance configuration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Architecture Overview
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Original Setup:
Instance (i-xxx) → Root Volume (vol-xxx, 100GB)

Our Goal:
Instance (i-xxx) → New Root Volume (vol-yyy, 600GB)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step-by-Step Implementation Guide
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;AWS CLI configured with appropriate permissions&lt;/li&gt;
&lt;li&gt;EC2 instance with root volume requiring expansion&lt;/li&gt;
&lt;li&gt;Sufficient EBS snapshot storage quota&lt;/li&gt;
&lt;li&gt;IAM permissions for &lt;code&gt;ec2:CreateSnapshot&lt;/code&gt;, &lt;code&gt;ec2:CreateReplaceRootVolumeTask&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Phase 1: Create Snapshot
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Stop the Instance (Optional but Recommended)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For data consistency, stop the instance before creating a snapshot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Stop the instance&lt;/span&gt;
aws ec2 stop-instances &lt;span class="nt"&gt;--instance-ids&lt;/span&gt; i-0f387817b12e5c240

&lt;span class="c"&gt;# Wait for instance to stop&lt;/span&gt;
aws ec2 &lt;span class="nb"&gt;wait &lt;/span&gt;instance-stopped &lt;span class="nt"&gt;--instance-ids&lt;/span&gt; i-0f387817b12e5c240
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Create EBS Snapshot&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Via AWS Console:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to &lt;strong&gt;EC2 → Volumes&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select the root volume (e.g., &lt;code&gt;vol-09c2ea1110361f103&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Actions → Create snapshot&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Add description: "Increase VM to 600GB"&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create snapshot&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Via AWS CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ec2 create-snapshot &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--volume-id&lt;/span&gt; vol-09c2ea1110361f103 &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--description&lt;/span&gt; &lt;span class="s2"&gt;"Increase VM to 600GB"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Monitor Snapshot Progress&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Snapshot creation is asynchronous and can take several hours depending on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Volume size&lt;/li&gt;
&lt;li&gt;Amount of changed data since last snapshot&lt;/li&gt;
&lt;li&gt;Current AWS infrastructure load&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check snapshot status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ec2 describe-snapshots &lt;span class="nt"&gt;--snapshot-ids&lt;/span&gt; snap-040f3724f6e46e4f0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: You can start the instance and continue normal operations during snapshot creation. The snapshot captures a point-in-time copy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Phase 2: Replace Root Volume
&lt;/h3&gt;

&lt;p&gt;Once the snapshot status shows &lt;strong&gt;"completed"&lt;/strong&gt;, proceed with root volume replacement.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Initiate Replace Root Volume Task&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Via AWS Console:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to &lt;strong&gt;EC2 → Instances&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select your instance&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Actions → Monitor and troubleshoot → Replace root volume&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Snapshot&lt;/strong&gt; option&lt;/li&gt;
&lt;li&gt;Choose your snapshot (&lt;code&gt;snap-040f3724f6e46e4f0&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Replace root volume&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Via AWS CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ec2 create-replace-root-volume-task &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--instance-id&lt;/span&gt; i-0f387817b12e5c240 &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--snapshot-id&lt;/span&gt; snap-040f3724f6e46e4f0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 5: Monitor Replacement Task&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check task status&lt;/span&gt;
aws ec2 describe-replace-root-volume-tasks &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--filters&lt;/span&gt; &lt;span class="s2"&gt;"Name=instance-id,Values=i-0f387817b12e5c240"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wait for status to show &lt;strong&gt;"succeeded"&lt;/strong&gt; before proceeding.&lt;/p&gt;

&lt;h3&gt;
  
  
  Phase 3: Modify Volume Size
&lt;/h3&gt;

&lt;p&gt;After successful root volume replacement, you'll have a new volume ID attached to your instance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Modify the New Volume to 600GB&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Via AWS Console:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;strong&gt;EC2 → Instances → Storage tab&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click on the new volume ID&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Actions → Modify volume&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Change &lt;strong&gt;Size&lt;/strong&gt; from 100 to &lt;strong&gt;600 GiB&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Modify → Yes&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Via AWS CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Get the new volume ID&lt;/span&gt;
&lt;span class="nv"&gt;NEW_VOLUME_ID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;aws ec2 describe-instances &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--instance-ids&lt;/span&gt; i-0f387817b12e5c240 &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--query&lt;/span&gt; &lt;span class="s1"&gt;'Reservations[0].Instances[0].BlockDeviceMappings[?DeviceName==`/dev/xvda`].Ebs.VolumeId'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--output&lt;/span&gt; text&lt;span class="si"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;# Modify the volume&lt;/span&gt;
aws ec2 modify-volume &lt;span class="nt"&gt;--volume-id&lt;/span&gt; &lt;span class="nv"&gt;$NEW_VOLUME_ID&lt;/span&gt; &lt;span class="nt"&gt;--size&lt;/span&gt; 600
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 7: Wait for Optimization&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Monitor modification progress&lt;/span&gt;
aws ec2 describe-volumes-modifications &lt;span class="nt"&gt;--volume-ids&lt;/span&gt; &lt;span class="nv"&gt;$NEW_VOLUME_ID&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wait for the modification state to reach &lt;strong&gt;"optimizing"&lt;/strong&gt; or &lt;strong&gt;"completed"&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Phase 4: Extend Filesystem Inside the OS
&lt;/h3&gt;

&lt;p&gt;The critical final step that many forget: &lt;strong&gt;AWS has resized the volume, but the OS filesystem doesn't know about the extra space yet.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 8: SSH into Your Instance&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-i&lt;/span&gt; your-key.pem ec2-user@&amp;lt;instance-public-ip&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 9: Verify Current Disk Layout&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check block devices&lt;/span&gt;
lsblk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME          SIZE  TYPE MOUNTPOINTS
nvme0n1       600G  disk
└─nvme0n1p1   100G  part /
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice: Disk = 600G, but partition = 100G&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 10: Extend the Partition&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Extend partition 1 to use all available space&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;growpart /dev/nvme0n1 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lsblk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you should see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME          SIZE  TYPE MOUNTPOINTS
nvme0n1       600G  disk
└─nvme0n1p1   600G  part /
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 11: Check Filesystem Type&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-T&lt;/span&gt; /
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output will show either &lt;code&gt;xfs&lt;/code&gt; or &lt;code&gt;ext4&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 12: Extend the Filesystem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For &lt;strong&gt;XFS&lt;/strong&gt; (Amazon Linux 2, Amazon Linux 2023, RHEL 8+):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;xfs_growfs &lt;span class="nt"&gt;-d&lt;/span&gt; /
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For &lt;strong&gt;ext4&lt;/strong&gt; (Ubuntu, Debian, older Amazon Linux):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;resize2fs /dev/nvme0n1p1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 13: Verify Final Size&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt; /
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p1  600G   59G  541G  10% /
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🎉 &lt;strong&gt;Success!&lt;/strong&gt; Your root volume is now 600GB.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting Common Issues
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Issue 1: Snapshot Stuck at 0% or Low Progress
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Causes:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multiple concurrent snapshots on the same volume&lt;/li&gt;
&lt;li&gt;High I/O operations during snapshot creation&lt;/li&gt;
&lt;li&gt;Large amount of changed data since last snapshot&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Wait patiently—snapshots can take hours for large volumes&lt;/li&gt;
&lt;li&gt;Reduce I/O operations during snapshot creation&lt;/li&gt;
&lt;li&gt;Check for other running snapshots: &lt;code&gt;aws ec2 describe-snapshots --owner-id self --filters "Name=volume-id,Values=vol-xxx"&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Issue 2: Cannot Detach Root Volume
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Error:&lt;/strong&gt; &lt;code&gt;Unable to detach root volume 'vol-xxx' from instance 'i-xxx'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Don't detach! Use the Replace Root Volume method instead (covered in this guide).&lt;/p&gt;

&lt;h3&gt;
  
  
  Issue 3: Filesystem Not Expanding
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt; &lt;code&gt;df -h&lt;/code&gt; still shows old size after &lt;code&gt;growpart&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensure you ran the correct filesystem resize command (xfs_growfs vs resize2fs)&lt;/li&gt;
&lt;li&gt;Check if the partition actually expanded: &lt;code&gt;lsblk&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;For NVMe devices, use &lt;code&gt;/dev/nvme0n1p1&lt;/code&gt; not &lt;code&gt;/dev/xvda1&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Reboot if necessary: &lt;code&gt;sudo reboot&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Issue 4: Replace Root Volume Task Failed
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Common causes:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Snapshot not completed&lt;/li&gt;
&lt;li&gt;Incorrect snapshot ID&lt;/li&gt;
&lt;li&gt;Insufficient permissions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Verify snapshot is completed&lt;/span&gt;
aws ec2 describe-snapshots &lt;span class="nt"&gt;--snapshot-ids&lt;/span&gt; snap-xxx

&lt;span class="c"&gt;# Check IAM permissions&lt;/span&gt;
aws iam simulate-principal-policy &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--policy-source-arn&lt;/span&gt; arn:aws:iam::ACCOUNT:user/USERNAME &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--action-names&lt;/span&gt; ec2:CreateReplaceRootVolumeTask
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Best Practices and Optimization
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Batch Modifications
&lt;/h3&gt;

&lt;p&gt;Combine multiple changes in a single modification request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws ec2 modify-volume &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--volume-id&lt;/span&gt; vol-xxx &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--size&lt;/span&gt; 600 &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--volume-type&lt;/span&gt; gp3 &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--iops&lt;/span&gt; 4000 &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--throughput&lt;/span&gt; 250
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Use CloudWatch Alarms
&lt;/h3&gt;

&lt;p&gt;Set up proactive monitoring:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws cloudwatch put-metric-alarm &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--alarm-name&lt;/span&gt; &lt;span class="s2"&gt;"EBS-Volume-Usage-High"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--alarm-description&lt;/span&gt; &lt;span class="s2"&gt;"Alert when EBS volume reaches 80%"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--metric-name&lt;/span&gt; DiskSpaceUtilization &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--namespace&lt;/span&gt; CWAgent &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--statistic&lt;/span&gt; Average &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--period&lt;/span&gt; 300 &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--threshold&lt;/span&gt; 80 &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--comparison-operator&lt;/span&gt; GreaterThanThreshold
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Implement Lifecycle Policies
&lt;/h3&gt;

&lt;p&gt;Automate snapshot management:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"PolicyDetails"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ResourceTypes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"VOLUME"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"TargetTags"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Key"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Backup"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Daily"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Schedules"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"DailySnapshot"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"CreateRule"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"Interval"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"IntervalUnit"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"HOURS"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"Times"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"03:00"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"RetainRule"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"Count"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Document Your Infrastructure
&lt;/h3&gt;

&lt;p&gt;Create runbooks for emergency situations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Emergency volume resize runbook&lt;/span&gt;
&lt;span class="c"&gt;# 1. Create snapshot: snap-xxx&lt;/span&gt;
&lt;span class="c"&gt;# 2. Replace root volume with snapshot&lt;/span&gt;
&lt;span class="c"&gt;# 3. Modify new volume to required size&lt;/span&gt;
&lt;span class="c"&gt;# 4. Extend filesystem inside OS&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5. Test in Non-Production First
&lt;/h3&gt;

&lt;p&gt;Always validate the complete workflow in a test environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Create test instance from production AMI&lt;/span&gt;
aws ec2 run-instances &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--image-id&lt;/span&gt; ami-xxx &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--instance-type&lt;/span&gt; t3.micro &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--tag-specifications&lt;/span&gt; &lt;span class="s1"&gt;'ResourceType=instance,Tags=[{Key=Environment,Value=test}]'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Performance Considerations
&lt;/h2&gt;

&lt;h3&gt;
  
  
  During Snapshot Creation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;I/O performance may be slightly degraded (typically &amp;lt; 5%)&lt;/li&gt;
&lt;li&gt;Snapshots are incremental after the first full snapshot&lt;/li&gt;
&lt;li&gt;First snapshot takes longest; subsequent snapshots are faster&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  During Volume Modification
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Performance degradation during "optimizing" state&lt;/li&gt;
&lt;li&gt;Can take hours to days for large volumes&lt;/li&gt;
&lt;li&gt;Monitor with: &lt;code&gt;aws ec2 describe-volumes-modifications&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  After Modification
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Full performance restoration once optimization completes&lt;/li&gt;
&lt;li&gt;No reboot required for size changes&lt;/li&gt;
&lt;li&gt;Type/IOPS changes may benefit from reboot&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cost Implications
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Snapshot Storage Costs
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Charged at &lt;strong&gt;$0.05 per GB-month&lt;/strong&gt; (us-east-1)&lt;/li&gt;
&lt;li&gt;Incremental snapshots only store changed blocks&lt;/li&gt;
&lt;li&gt;Snapshots can be copied to cheaper storage tiers&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example Cost Calculation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Volume: 600 GB
Changed data: 50 GB
Snapshot cost: 50 GB × $0.05 = $2.50/month
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Cost Optimization Tips
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Delete old snapshots regularly&lt;/li&gt;
&lt;li&gt;Use Amazon Data Lifecycle Manager&lt;/li&gt;
&lt;li&gt;Enable EBS Fast Snapshot Restore only when needed ($0.75/hour per AZ)&lt;/li&gt;
&lt;li&gt;Consider snapshot archiving for long-term retention&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Automation with Terraform
&lt;/h2&gt;

&lt;p&gt;Automate this process in your IaC:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_ebs_snapshot"&lt;/span&gt; &lt;span class="s2"&gt;"root_volume_backup"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;volume_id&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;example&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;root_block_device&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;volume_id&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Root volume snapshot for resize"&lt;/span&gt;

  &lt;span class="nx"&gt;tags&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;Name&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"root-volume-snapshot"&lt;/span&gt;
    &lt;span class="nx"&gt;Purpose&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"resize"&lt;/span&gt;
    &lt;span class="nx"&gt;Environment&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;environment&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_ebs_volume"&lt;/span&gt; &lt;span class="s2"&gt;"expanded_root"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;availability_zone&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;example&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;availability_zone&lt;/span&gt;
  &lt;span class="nx"&gt;size&lt;/span&gt;             &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;600&lt;/span&gt;
  &lt;span class="nx"&gt;snapshot_id&lt;/span&gt;      &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_ebs_snapshot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;root_volume_backup&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
  &lt;span class="nx"&gt;type&lt;/span&gt;             &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"gp3"&lt;/span&gt;

  &lt;span class="nx"&gt;tags&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;Name&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"expanded-root-volume"&lt;/span&gt;
    &lt;span class="nx"&gt;Environment&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;environment&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The EBS 6-hour modification limit can be a significant blocker for urgent infrastructure changes. The Replace Root Volume feature provides a reliable workaround that allows you to:&lt;/p&gt;

&lt;p&gt;✅ Bypass modification rate limits&lt;br&gt;&lt;br&gt;
✅ Maintain instance configuration&lt;br&gt;&lt;br&gt;
✅ Minimize downtime&lt;br&gt;&lt;br&gt;
✅ Preserve data integrity  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Takeaways:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Root volumes cannot be detached—use Replace Root Volume instead&lt;/li&gt;
&lt;li&gt;Always create snapshots before major changes&lt;/li&gt;
&lt;li&gt;Remember to extend the filesystem inside the OS&lt;/li&gt;
&lt;li&gt;Plan modifications to avoid hitting rate limits&lt;/li&gt;
&lt;li&gt;Implement monitoring to catch issues early&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By following this guide, you can confidently resize root volumes even when facing AWS's modification limits. The process, while involving several steps, is reliable and production-safe when executed carefully.&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/modify-volume.html" rel="noopener noreferrer"&gt;AWS EBS Volume Modification Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/replace-root.html" rel="noopener noreferrer"&gt;Replace Root Volume Feature&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-snapshots.html" rel="noopener noreferrer"&gt;EBS Snapshot Best Practices&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/cli/latest/reference/ec2/" rel="noopener noreferrer"&gt;AWS CLI Reference&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




</description>
      <category>aws</category>
      <category>devops</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Kubernetes Troubleshooting 2025</title>
      <dc:creator>Mohammed Nasser</dc:creator>
      <pubDate>Mon, 06 Oct 2025 17:02:41 +0000</pubDate>
      <link>https://forem.com/mohamednasser018/kubernetes-troubleshooting-2025-5h9e</link>
      <guid>https://forem.com/mohamednasser018/kubernetes-troubleshooting-2025-5h9e</guid>
      <description>&lt;h1&gt;
  
  
  Kubernetes Troubleshooting Guide for Application Developers
&lt;/h1&gt;

&lt;h2&gt;
  
  
  1. Inspecting Resources 🛠️
&lt;/h2&gt;

&lt;h3&gt;
  
  
  General Information 📋
&lt;/h3&gt;

&lt;p&gt;Get an overview of all resources across namespaces:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get all &lt;span class="nt"&gt;-A&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Checking Deployment Details 🔍
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Get Full YAML Configuration&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get &lt;span class="nt"&gt;-n&lt;/span&gt; uat deployments.apps uat-deployment &lt;span class="nt"&gt;-o&lt;/span&gt; yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Check Replica Count&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get &lt;span class="nt"&gt;-n&lt;/span&gt; uat deployments.apps uat-deployment &lt;span class="nt"&gt;-o&lt;/span&gt; yaml | &lt;span class="nb"&gt;grep &lt;/span&gt;replicas
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Search for Specific Deployments&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get deployments &lt;span class="nt"&gt;--all-namespaces&lt;/span&gt; | &lt;span class="nb"&gt;grep &lt;/span&gt;frontend
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;View Labels&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get &lt;span class="nt"&gt;-n&lt;/span&gt; uat deployments.apps uat-deployment &lt;span class="nt"&gt;-o&lt;/span&gt; yaml | &lt;span class="nb"&gt;grep &lt;/span&gt;labels &lt;span class="nt"&gt;-A5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Get Replica Count in JSON Format&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get &lt;span class="nt"&gt;-n&lt;/span&gt; uat deployments.apps uat-deployment &lt;span class="nt"&gt;-o&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;jsonpath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'{.spec.replicas}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Check Containers&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get &lt;span class="nt"&gt;-n&lt;/span&gt; uat deployments.apps uat-deployment &lt;span class="nt"&gt;-o&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;jsonpath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'{.spec.template.spec.containers}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Get Pods on Specific Node&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get pods &lt;span class="nt"&gt;--all-namespaces&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; wide &lt;span class="nt"&gt;--field-selector&lt;/span&gt; spec.nodeName&lt;span class="o"&gt;=&lt;/span&gt;node01
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Describing Nodes and Pods 🏗️
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Get Node Details&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl describe node node01
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Describe a Specific Pod&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl describe &lt;span class="nt"&gt;-n&lt;/span&gt; uat pod/uat-pod
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Viewing Events 📅
&lt;/h2&gt;

&lt;p&gt;Events provide crucial information about what's happening in your cluster:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl events &lt;span class="nt"&gt;-n&lt;/span&gt; uat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Checking Logs 📜
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Basic Log Commands
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Get Logs for a Deployment&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl logs &lt;span class="nt"&gt;-n&lt;/span&gt; uat deployments/uat-deployment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Logs for All Containers in a Deployment&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl logs &lt;span class="nt"&gt;-n&lt;/span&gt; uat deployments/uat-deployment &lt;span class="nt"&gt;--all-containers&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Save Logs to File&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl logs &lt;span class="nt"&gt;-n&lt;/span&gt; app deployments/frontend &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; logs.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Logs for a Specific Container&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl logs &lt;span class="nt"&gt;-n&lt;/span&gt; uat deployments/uat-deployment &lt;span class="nt"&gt;-c&lt;/span&gt; uat-container01
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Advanced Log Options
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Logs Based on Label&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl logs &lt;span class="nt"&gt;-n&lt;/span&gt; uat &lt;span class="nt"&gt;-l&lt;/span&gt; &lt;span class="nv"&gt;app&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;uat-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Logs with Timestamps&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl logs &lt;span class="nt"&gt;-n&lt;/span&gt; uat uat-pod &lt;span class="nt"&gt;--timestamps&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Save Timestamped Logs to File&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl logs &lt;span class="nt"&gt;-n&lt;/span&gt; app myapp &lt;span class="nt"&gt;--timestamps&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; timestamps.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Time-Based Log Filtering&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl logs nginx &lt;span class="nt"&gt;--since&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;10s    &lt;span class="c"&gt;# Last 10 seconds&lt;/span&gt;
kubectl logs nginx &lt;span class="nt"&gt;--since&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1h     &lt;span class="c"&gt;# Last hour&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Follow Logs in Real-Time&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl logs nginx &lt;span class="nt"&gt;-f&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Executing Commands Inside Containers 🖥️
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;List Files in Container&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl &lt;span class="nb"&gt;exec&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; uat nginx &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Read a File&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl &lt;span class="nb"&gt;exec&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; uat nginx &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nb"&gt;cat&lt;/span&gt; /usr/share/nginx/html/index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Open Interactive Bash Shell&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl &lt;span class="nb"&gt;exec&lt;/span&gt; &lt;span class="nt"&gt;-it&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; uat nginx &lt;span class="nt"&gt;--&lt;/span&gt; /bin/bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  6. Port Forwarding 🔀
&lt;/h2&gt;

&lt;p&gt;Forward local port to service port for testing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl port-forward &lt;span class="nt"&gt;-n&lt;/span&gt; uat svc/uat-svc 8000:80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This forwards local port 8000 to service port 80.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Authentication and Authorization 🔑
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Check Current User
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl auth &lt;span class="nb"&gt;whoami&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Check Permissions
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Check Your Own Permissions&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl auth can-i list pods &lt;span class="nt"&gt;-n&lt;/span&gt; uat
kubectl auth can-i get pods &lt;span class="nt"&gt;-n&lt;/span&gt; uat
kubectl auth can-i update pods &lt;span class="nt"&gt;-n&lt;/span&gt; uat
kubectl auth can-i patch pods &lt;span class="nt"&gt;-n&lt;/span&gt; uat
kubectl auth can-i delete pods &lt;span class="nt"&gt;-n&lt;/span&gt; uat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Check Permissions as Another User&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl auth can-i get pods &lt;span class="nt"&gt;--as&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;jane &lt;span class="nt"&gt;--v&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Check Service Account Permissions&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl auth can-i delete pods &lt;span class="nt"&gt;--as&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;system:serviceaccount:default:default
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  8. Resource Utilization 📊
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Node Resources
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Get Node Details&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get nodes &lt;span class="nt"&gt;-o&lt;/span&gt; wide
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;View Node Resource Usage&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl top nodes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Pod Resources
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Get Pods in Namespace&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get pods &lt;span class="nt"&gt;-n&lt;/span&gt; uat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;View Pod Resource Usage&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl top pods &lt;span class="nt"&gt;-n&lt;/span&gt; uat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  9. Explaining Kubernetes Objects 📖
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;explain&lt;/code&gt; command provides documentation about Kubernetes resources:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Explain Pod Resource&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl explain pods
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explain Pod Specifications&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl explain pods.spec
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explain Security Settings (Recursive)&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl explain pods.spec.securityContext &lt;span class="nt"&gt;--recursive&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  10. Debugging 🛠️
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Compare Configuration Changes
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl diff &lt;span class="nt"&gt;-f&lt;/span&gt; nginx.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Debug a Running Pod
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl debug &lt;span class="nt"&gt;-it&lt;/span&gt; nginx-pod &lt;span class="nt"&gt;--image&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;busybox &lt;span class="nt"&gt;--target&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Copy and Debug a Pod
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl debug nginx-pod &lt;span class="nt"&gt;--image&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;busybox &lt;span class="nt"&gt;-it&lt;/span&gt; &lt;span class="nt"&gt;--copy-to&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;debugging-pod &lt;span class="nt"&gt;--share-processes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  11. Common Issues and Fixes 🚨
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ImagePullBackOff Error ❗
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: Pod cannot pull the container image from the registry.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Diagnosis&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Describe the pod and check the events section to find the reason&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Possible Causes&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;❌ &lt;strong&gt;Incorrect image name&lt;/strong&gt;: Verify the image name in your deployment YAML&lt;/li&gt;
&lt;li&gt;🔑 &lt;strong&gt;Missing imagePullSecrets&lt;/strong&gt;: Results in 401 authentication error&lt;/li&gt;
&lt;li&gt;🏷️ &lt;strong&gt;Incorrect image tag&lt;/strong&gt;: Check if the specified tag exists&lt;/li&gt;
&lt;li&gt;🌐 &lt;strong&gt;Cluster cannot resolve registry hostname&lt;/strong&gt;: Check DNS and network connectivity&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Fix&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl describe pod &amp;lt;pod-name&amp;gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;namespace&amp;gt;
&lt;span class="c"&gt;# Check Events section for detailed error&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  CrashLoopBackOff Error 🔄
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: Container keeps crashing and Kubernetes restarts it repeatedly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Indicators&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;restartPolicy&lt;/code&gt; in pod YAML is set to &lt;code&gt;Always&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Exit Code Analysis&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Exit Code 1&lt;/strong&gt;: Application error (check application logs)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exit Code 137&lt;/strong&gt;: Possible liveness probe failure or OOM kill&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exit Code 127&lt;/strong&gt;: Trying to access a non-existent file or command&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Other Causes&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📂 &lt;strong&gt;Volume mount issues&lt;/strong&gt;: Check if volumes are properly mounted&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Fix&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl logs &amp;lt;pod-name&amp;gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;namespace&amp;gt; &lt;span class="nt"&gt;--previous&lt;/span&gt;
kubectl describe pod &amp;lt;pod-name&amp;gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;namespace&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Pending Pods ⏳
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: Pods are stuck in the Pending state and not being scheduled.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common Causes&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;⚡ &lt;strong&gt;Insufficient resources on nodes&lt;/strong&gt;: Not enough CPU/memory available&lt;/li&gt;
&lt;li&gt;🔍 &lt;strong&gt;Node selector mismatch&lt;/strong&gt;: Pod's nodeSelector doesn't match any node labels&lt;/li&gt;
&lt;li&gt;🚫 &lt;strong&gt;Taints and tolerations&lt;/strong&gt;: Nodes are tainted and pod lacks required tolerations&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Fix&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl describe pod &amp;lt;pod-name&amp;gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;namespace&amp;gt;
&lt;span class="c"&gt;# Check Events section for scheduling failures&lt;/span&gt;

&lt;span class="c"&gt;# Add label to node if needed&lt;/span&gt;
kubectl label nodes &amp;lt;node-name&amp;gt; &amp;lt;label-key&amp;gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;label-value&amp;gt;

&lt;span class="c"&gt;# Check node capacity&lt;/span&gt;
kubectl describe nodes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Missing Pods ❓
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: Expected pods are not running.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Possible Causes&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;🚧 &lt;strong&gt;Pod quota exceeded&lt;/strong&gt;: Namespace has reached its resource quota&lt;/li&gt;
&lt;li&gt;🔑 &lt;strong&gt;Service account missing in deployment&lt;/strong&gt;: Required service account doesn't exist&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Fix&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check events for quota issues&lt;/span&gt;
kubectl get events &lt;span class="nt"&gt;-n&lt;/span&gt; uat

&lt;span class="c"&gt;# Create missing service account&lt;/span&gt;
kubectl create sa service-account-uat &lt;span class="nt"&gt;-n&lt;/span&gt; uat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Schrodinger's Deployment 🐱
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: Multiple deployments sharing common selectors causing pod management issues.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Using common selectors like &lt;code&gt;version=1&lt;/code&gt; across multiple deployments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check affected pods&lt;/span&gt;
kubectl get pods &lt;span class="nt"&gt;-l&lt;/span&gt; &lt;span class="nv"&gt;version&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1

&lt;span class="c"&gt;# Verify endpoints&lt;/span&gt;
kubectl get endpoints

&lt;span class="c"&gt;# Use unique selectors for each deployment&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  CreateContainerError / CreateContainerConfigError ⚙️
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;CreateContainerConfigError&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔍 Missing Secret&lt;/li&gt;
&lt;li&gt;🔍 Missing ConfigMap&lt;/li&gt;
&lt;li&gt;🔍 Missing environment variable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;CreateContainerError&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;❌ Missing entrypoint or command&lt;/li&gt;
&lt;li&gt;❌ Invalid container configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Fix&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl describe pod &amp;lt;pod-name&amp;gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;namespace&amp;gt;
&lt;span class="c"&gt;# Check Events section for specific error&lt;/span&gt;

&lt;span class="c"&gt;# Verify ConfigMap exists&lt;/span&gt;
kubectl get configmap &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;namespace&amp;gt;

&lt;span class="c"&gt;# Verify Secret exists&lt;/span&gt;
kubectl get secret &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;namespace&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Config Out of Date 🔄
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: ConfigMap or Secret changes not reflected in running pods.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cause&lt;/strong&gt;: ConfigMaps and Secrets are mounted at pod creation time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Option 1: Rollout restart&lt;/span&gt;
kubectl rollout restart deployment/&amp;lt;deployment-name&amp;gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;namespace&amp;gt;

&lt;span class="c"&gt;# Option 2: Use reloader controller&lt;/span&gt;
&lt;span class="c"&gt;# Install and configure reloader to automatically restart pods on config changes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Endless Terminating State ♾️
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: Pod stuck in Terminating state.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Possible Causes&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Finalizer preventing deletion&lt;/li&gt;
&lt;li&gt;Node where pod was running is unavailable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Fix&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Force delete the pod&lt;/span&gt;
kubectl delete pod &amp;lt;pod-name&amp;gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;namespace&amp;gt; &lt;span class="nt"&gt;--force&lt;/span&gt; &lt;span class="nt"&gt;--grace-period&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0

&lt;span class="c"&gt;# Check for finalizers&lt;/span&gt;
kubectl get pod &amp;lt;pod-name&amp;gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;namespace&amp;gt; &lt;span class="nt"&gt;-o&lt;/span&gt; yaml | &lt;span class="nb"&gt;grep &lt;/span&gt;finalizers &lt;span class="nt"&gt;-A5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Field Immutability 🔒
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: Cannot update certain fields after resource creation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Metadata fields like &lt;code&gt;matchLabels&lt;/code&gt; cannot be changed directly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# ❌ Delete and re-create the deployment&lt;/span&gt;
kubectl delete deployment &amp;lt;deployment-name&amp;gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;namespace&amp;gt;
kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; &amp;lt;deployment-file&amp;gt;.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  EnableServiceLinks Issue 🔄
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: Too many environment variables created for services.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: By default, Kubernetes creates environment variables for all services.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;enableServiceLinks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Network Policy Issues 🌐
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: Pods cannot communicate due to network policies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Diagnosis&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Check network policies&lt;/span&gt;
kubectl get netpol &lt;span class="nt"&gt;-n&lt;/span&gt; uat

&lt;span class="c"&gt;# Describe network policy&lt;/span&gt;
kubectl describe netpol &amp;lt;policy-name&amp;gt; &lt;span class="nt"&gt;-n&lt;/span&gt; uat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Verify&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ingress rules (incoming traffic)&lt;/li&gt;
&lt;li&gt;Egress rules (outgoing traffic)&lt;/li&gt;
&lt;li&gt;Pod selectors&lt;/li&gt;
&lt;li&gt;Namespace selectors&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Multi-Attach Volume Error 💾
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;: Volume cannot be attached to multiple pods on different nodes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Quick Fix&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Scale down to 0&lt;/span&gt;
kubectl scale deployment/&amp;lt;deployment-name&amp;gt; &lt;span class="nt"&gt;--replicas&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0 &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;namespace&amp;gt;

&lt;span class="c"&gt;# Scale back to 1&lt;/span&gt;
kubectl scale deployment/&amp;lt;deployment-name&amp;gt; &lt;span class="nt"&gt;--replicas&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;namespace&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Recommended Fix&lt;/strong&gt;: Use &lt;code&gt;Recreate&lt;/code&gt; strategy in deployment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;strategy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Recreate&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Persistent Volume Access Modes&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ &lt;strong&gt;RWO (ReadWriteOnce)&lt;/strong&gt;: Volume can be mounted as read-write by a single node&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;RWX (ReadWriteMany)&lt;/strong&gt;: Volume can be mounted as read-write by multiple nodes&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;ROX (ReadOnlyMany)&lt;/strong&gt;: Volume can be mounted as read-only by multiple nodes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Check PV Access Mode&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get pv
kubectl describe pv &amp;lt;pv-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Quick Reference Cheat Sheet
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Most Used Commands
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Get resources&lt;/span&gt;
kubectl get pods &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;namespace&amp;gt;
kubectl get all &lt;span class="nt"&gt;-A&lt;/span&gt;

&lt;span class="c"&gt;# Describe resources&lt;/span&gt;
kubectl describe pod &amp;lt;pod-name&amp;gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;namespace&amp;gt;
kubectl describe node &amp;lt;node-name&amp;gt;

&lt;span class="c"&gt;# View logs&lt;/span&gt;
kubectl logs &amp;lt;pod-name&amp;gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;namespace&amp;gt;
kubectl logs &lt;span class="nt"&gt;-f&lt;/span&gt; &amp;lt;pod-name&amp;gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;namespace&amp;gt;

&lt;span class="c"&gt;# Execute commands&lt;/span&gt;
kubectl &lt;span class="nb"&gt;exec&lt;/span&gt; &lt;span class="nt"&gt;-it&lt;/span&gt; &amp;lt;pod-name&amp;gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;namespace&amp;gt; &lt;span class="nt"&gt;--&lt;/span&gt; /bin/bash

&lt;span class="c"&gt;# Events&lt;/span&gt;
kubectl get events &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;namespace&amp;gt; &lt;span class="nt"&gt;--sort-by&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'.lastTimestamp'&lt;/span&gt;

&lt;span class="c"&gt;# Resource usage&lt;/span&gt;
kubectl top nodes
kubectl top pods &lt;span class="nt"&gt;-n&lt;/span&gt; &amp;lt;namespace&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Debugging Workflow
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Check pod status: &lt;code&gt;kubectl get pods&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Describe pod: &lt;code&gt;kubectl describe pod &amp;lt;pod-name&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Check events: &lt;code&gt;kubectl get events&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;View logs: &lt;code&gt;kubectl logs &amp;lt;pod-name&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Check resource usage: &lt;code&gt;kubectl top pod &amp;lt;pod-name&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Exec into container: &lt;code&gt;kubectl exec -it &amp;lt;pod-name&amp;gt; -- /bin/bash&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;strong&gt;Document Version&lt;/strong&gt;: 1.0&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Last Updated&lt;/strong&gt;: October 2025&lt;/p&gt;

</description>
      <category>devops</category>
      <category>softwaredevelopment</category>
      <category>kubernetes</category>
      <category>containers</category>
    </item>
    <item>
      <title>CKA (Certified Kubernetes Administrator) Study Guide 2025</title>
      <dc:creator>Mohammed Nasser</dc:creator>
      <pubDate>Mon, 06 Oct 2025 15:52:20 +0000</pubDate>
      <link>https://forem.com/mohamednasser018/cka-certified-kubernetes-administrator-study-guide-2025-3790</link>
      <guid>https://forem.com/mohamednasser018/cka-certified-kubernetes-administrator-study-guide-2025-3790</guid>
      <description>&lt;h1&gt;
  
  
  CKA (Certified Kubernetes Administrator) Study Guide
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Part 1: Core Components &amp;amp; Scheduling
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. ETCD
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Default Port&lt;/strong&gt;: &lt;code&gt;2379&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Version Differences
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;ETCD v2 Commands&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;etcdctl &lt;span class="nb"&gt;set &lt;/span&gt;key1 value1
etcdctl get key1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;ETCD v3 Commands&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;ETCDCTL_API&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3
etcdctl put key1 value1
etcdctl get key1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Accessing ETCD in Kubernetes
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl &lt;span class="nb"&gt;exec &lt;/span&gt;etcd-controlplane &lt;span class="nt"&gt;-n&lt;/span&gt; kube-system &lt;span class="nt"&gt;--&lt;/span&gt; sh &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"ETCDCTL_API=3 etcdctl get / --prefix --keys-only --limit=10 &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;
  --cacert /etc/kubernetes/pki/etcd/ca.crt &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;
  --cert /etc/kubernetes/pki/etcd/server.crt &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;
  --key /etc/kubernetes/pki/etcd/server.key"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  2. Pods &amp;amp; Deployments
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Imperative vs. Declarative Commands
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Generate YAML without Creating Resource&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl run nginx &lt;span class="nt"&gt;--image&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;nginx &lt;span class="nt"&gt;--dry-run&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;client &lt;span class="nt"&gt;-o&lt;/span&gt; yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Create Deployment&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl create deployment nginx &lt;span class="nt"&gt;--image&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Generate Deployment YAML&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl create deployment nginx &lt;span class="nt"&gt;--image&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;nginx &lt;span class="nt"&gt;--dry-run&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;client &lt;span class="nt"&gt;-o&lt;/span&gt; yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Scale Deployment&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl scale deployment nginx &lt;span class="nt"&gt;--replicas&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Edit Running ReplicaSet&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl edit replicaset &amp;lt;rs-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  ReplicaSet vs. ReplicationController
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Key Difference&lt;/strong&gt;: ReplicaSet supports selector matching (&lt;code&gt;matchLabels&lt;/code&gt;), while ReplicationController does not.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Services
&lt;/h3&gt;

&lt;h4&gt;
  
  
  ClusterIP Service
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl expose pod redis &lt;span class="nt"&gt;--port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;6379 &lt;span class="nt"&gt;--name&lt;/span&gt; redis-service &lt;span class="nt"&gt;--dry-run&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;client &lt;span class="nt"&gt;-o&lt;/span&gt; yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  NodePort Service
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl expose pod nginx &lt;span class="nt"&gt;--type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;NodePort &lt;span class="nt"&gt;--port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;80 &lt;span class="nt"&gt;--name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;nginx-service &lt;span class="nt"&gt;--dry-run&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;client &lt;span class="nt"&gt;-o&lt;/span&gt; yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Imperative Service Creation
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl create service nodeport nginx &lt;span class="nt"&gt;--tcp&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;80:80 &lt;span class="nt"&gt;--node-port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;30080 &lt;span class="nt"&gt;--dry-run&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;client &lt;span class="nt"&gt;-o&lt;/span&gt; yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  4. Scheduling &amp;amp; Affinity
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Manual Scheduling
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Method 1&lt;/strong&gt;: Use &lt;code&gt;nodeName&lt;/code&gt; in Pod definition&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;nodeName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;node01&lt;/span&gt;
  &lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Method 2&lt;/strong&gt;: Use &lt;code&gt;pod-binding-definition.yaml&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Labels &amp;amp; Selectors
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Get Pods with Multiple Selectors&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl get pods &lt;span class="nt"&gt;--selector&lt;/span&gt; &lt;span class="nb"&gt;env&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;dev,bu&lt;span class="o"&gt;=&lt;/span&gt;finance
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Taints &amp;amp; Tolerations
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Taint a Node&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl taint nodes node1 &lt;span class="nv"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;value:NoSchedule
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Pod Tolerations Example&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;tolerations&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;spray"&lt;/span&gt;
  &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;mortein"&lt;/span&gt;
  &lt;span class="na"&gt;effect&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;NoSchedule"&lt;/span&gt;
  &lt;span class="na"&gt;operator&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Equal"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Node Affinity
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;affinity&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;nodeAffinity&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;requiredDuringSchedulingIgnoredDuringExecution&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;nodeSelectorTerms&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;matchExpressions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;color&lt;/span&gt;
          &lt;span class="na"&gt;operator&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;In&lt;/span&gt;
          &lt;span class="na"&gt;values&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;blue&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Affinity Types&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;requiredDuringSchedulingIgnoredDuringExecution&lt;/code&gt; - Hard requirement&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;preferredDuringSchedulingIgnoredDuringExecution&lt;/code&gt; - Soft requirement&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  5. Resource Management
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Requests &amp;amp; Limits
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Pod Definition Example&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;requests&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;cpu&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;100m"&lt;/span&gt;
    &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;256Mi"&lt;/span&gt;
  &lt;span class="na"&gt;limits&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;cpu&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;500m"&lt;/span&gt;
    &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;1Gi"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  LimitRange (CPU &amp;amp; Memory Constraints)
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;LimitRange&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;cpu-limit-range&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;limits&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;default&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;cpu&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;500m"&lt;/span&gt;
      &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;512Mi"&lt;/span&gt;
    &lt;span class="na"&gt;defaultRequest&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;cpu&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;100m"&lt;/span&gt;
      &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;256Mi"&lt;/span&gt;
    &lt;span class="na"&gt;max&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;cpu&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;1"&lt;/span&gt;
      &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;1Gi"&lt;/span&gt;
    &lt;span class="na"&gt;min&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;cpu&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;100m"&lt;/span&gt;
      &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;128Mi"&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Container&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Resource Quotas
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Restrict Namespace Resource Usage&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ResourceQuota&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mem-cpu-quota&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dev&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;hard&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;requests.cpu&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;1"&lt;/span&gt;
    &lt;span class="na"&gt;requests.memory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;1Gi&lt;/span&gt;
    &lt;span class="na"&gt;limits.cpu&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;2"&lt;/span&gt;
    &lt;span class="na"&gt;limits.memory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;2Gi&lt;/span&gt;
    &lt;span class="na"&gt;pods&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;10"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  6. DaemonSets &amp;amp; Static Pods
&lt;/h3&gt;

&lt;h4&gt;
  
  
  DaemonSet Example
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;apps/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;DaemonSet&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;fluentd&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;kube-system&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;fluentd&lt;/span&gt;
  &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;fluentd&lt;/span&gt;
    &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;fluentd&lt;/span&gt;
        &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;fluentd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Use Case&lt;/strong&gt;: Deploy one pod per node (monitoring agents, log collectors, etc.)&lt;/p&gt;

&lt;h4&gt;
  
  
  Static Pods
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Location&lt;/strong&gt;: &lt;code&gt;/etc/kubernetes/manifests/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example (busybox.yaml)&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Pod&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;static-busybox&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;busybox&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;busybox&lt;/span&gt;
    &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sleep"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;1000"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Key Characteristics&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Managed directly by kubelet on a specific node&lt;/li&gt;
&lt;li&gt;Not managed by kube-apiserver&lt;/li&gt;
&lt;li&gt;Mirror pods appear in kubectl output&lt;/li&gt;
&lt;li&gt;Control plane components often run as static pods&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  7. Custom Schedulers
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Deploy Custom Scheduler
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Pod&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-scheduler&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;kube-system&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;/usr/local/bin/kube-scheduler&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;--config=/etc/kubernetes/my-scheduler-config.yaml&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;k8s.gcr.io/kube-scheduler:v1.22.0&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;kube-second-scheduler&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Use Custom Scheduler in Pod
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Pod&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;schedulerName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-scheduler&lt;/span&gt;
  &lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  8. Admission Controllers &amp;amp; Webhooks
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Check Enabled Admission Controllers
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl &lt;span class="nb"&gt;exec &lt;/span&gt;kube-apiserver-controlplane &lt;span class="nt"&gt;-n&lt;/span&gt; kube-system &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  kube-apiserver &lt;span class="nt"&gt;-h&lt;/span&gt; | &lt;span class="nb"&gt;grep &lt;/span&gt;enable-admission-plugins
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Mutating Webhook Example
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;admissionregistration.k8s.io/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;MutatingWebhookConfiguration&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;demo-webhook&lt;/span&gt;
&lt;span class="na"&gt;webhooks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;webhook-server.webhook-demo.svc&lt;/span&gt;
  &lt;span class="na"&gt;clientConfig&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;service&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;webhook-server&lt;/span&gt;
      &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;webhook-demo&lt;/span&gt;
      &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/mutate"&lt;/span&gt;
    &lt;span class="na"&gt;caBundle&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;&amp;lt;base64-encoded-ca-cert&amp;gt;&lt;/span&gt;
  &lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;operations&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;CREATE"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;apiGroups&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;apiVersions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;v1"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;pods"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;admissionReviewVersions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;v1"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;v1beta1"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;sideEffects&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;None&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Common Admission Controllers&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;NamespaceLifecycle&lt;/code&gt; - Prevents operations in terminating namespaces&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;LimitRanger&lt;/code&gt; - Enforces LimitRange constraints&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ResourceQuota&lt;/code&gt; - Enforces resource quotas&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;PodSecurityPolicy&lt;/code&gt; - Controls pod security settings&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;DefaultStorageClass&lt;/code&gt; - Sets default storage class&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Part 2: Operations &amp;amp; Advanced Topics
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Monitoring &amp;amp; Metrics
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Metrics Server
&lt;/h4&gt;

&lt;p&gt;In-memory monitoring solution for CPU/Memory metrics.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deploy Metrics Server&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Commands&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl top nodes    &lt;span class="c"&gt;# Show node resource usage&lt;/span&gt;
kubectl top pods     &lt;span class="c"&gt;# Show pod resource usage&lt;/span&gt;
kubectl top pods &lt;span class="nt"&gt;-n&lt;/span&gt; kube-system &lt;span class="nt"&gt;--sort-by&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;memory
kubectl top pods &lt;span class="nt"&gt;-n&lt;/span&gt; kube-system &lt;span class="nt"&gt;--sort-by&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;cpu
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Logging
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# View logs&lt;/span&gt;
kubectl logs &amp;lt;pod-name&amp;gt;

&lt;span class="c"&gt;# Stream logs (multi-container pods)&lt;/span&gt;
kubectl logs &lt;span class="nt"&gt;-f&lt;/span&gt; &amp;lt;pod-name&amp;gt; &lt;span class="nt"&gt;-c&lt;/span&gt; &amp;lt;container&amp;gt;

&lt;span class="c"&gt;# View previous container logs&lt;/span&gt;
kubectl logs &amp;lt;pod-name&amp;gt; &lt;span class="nt"&gt;--previous&lt;/span&gt;

&lt;span class="c"&gt;# Tail last N lines&lt;/span&gt;
kubectl logs &amp;lt;pod-name&amp;gt; &lt;span class="nt"&gt;--tail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  2. Deployment Strategies
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Strategy Types
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;RollingUpdate&lt;/strong&gt; (Default):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;strategy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;RollingUpdate&lt;/span&gt;
    &lt;span class="na"&gt;rollingUpdate&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;maxSurge&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;25%&lt;/span&gt;       &lt;span class="c1"&gt;# Extra pods allowed during update&lt;/span&gt;
      &lt;span class="na"&gt;maxUnavailable&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;25%&lt;/span&gt;  &lt;span class="c1"&gt;# Max unavailable pods during update&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Recreate&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;strategy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Recreate&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Image Updates
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Update image&lt;/span&gt;
kubectl &lt;span class="nb"&gt;set &lt;/span&gt;image deployment/myapp &lt;span class="nv"&gt;nginx&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;nginx:1.25

&lt;span class="c"&gt;# Manual edit&lt;/span&gt;
kubectl edit deployment/myapp

&lt;span class="c"&gt;# Rollback to previous version&lt;/span&gt;
kubectl rollout undo deployment/myapp

&lt;span class="c"&gt;# Check rollout status&lt;/span&gt;
kubectl rollout status deployment/myapp

&lt;span class="c"&gt;# View rollout history&lt;/span&gt;
kubectl rollout &lt;span class="nb"&gt;history &lt;/span&gt;deployment/myapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  3. Container Configuration
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Command vs Args
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu&lt;/span&gt;
  &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu&lt;/span&gt;
  &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sleep"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;      &lt;span class="c1"&gt;# Overrides ENTRYPOINT&lt;/span&gt;
  &lt;span class="na"&gt;args&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;5000"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;          &lt;span class="c1"&gt;# Overrides CMD&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Equivalents&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;command&lt;/code&gt; = Dockerfile &lt;code&gt;ENTRYPOINT&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;args&lt;/code&gt; = Dockerfile &lt;code&gt;CMD&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4. ConfigMaps &amp;amp; Secrets
&lt;/h3&gt;

&lt;h4&gt;
  
  
  ConfigMaps
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Imperative Creation&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# From literals&lt;/span&gt;
kubectl create configmap app-config &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--from-literal&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;APP_COLOR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;blue &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--from-literal&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;APP_MODE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;prod

&lt;span class="c"&gt;# From file&lt;/span&gt;
kubectl create configmap app-config &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--from-file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;config.properties
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Declarative Usage&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# As environment variable&lt;/span&gt;
&lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;APP_COLOR&lt;/span&gt;
  &lt;span class="na"&gt;valueFrom&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;configMapKeyRef&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;app-config&lt;/span&gt;
      &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;APP_COLOR&lt;/span&gt;

&lt;span class="c1"&gt;# As volume&lt;/span&gt;
&lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;config-volume&lt;/span&gt;
  &lt;span class="na"&gt;configMap&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;app-config&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Secrets
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Create Secret&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl create secret generic db-secret &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--from-literal&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;DB_HOST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;mysql &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--from-literal&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;DB_PASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;admin123
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Base64 Encoding&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="s2"&gt;"secret"&lt;/span&gt; | &lt;span class="nb"&gt;base64&lt;/span&gt;       &lt;span class="c"&gt;# Encode: c2VjcmV0&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"c2VjcmV0"&lt;/span&gt; | &lt;span class="nb"&gt;base64&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt;    &lt;span class="c"&gt;# Decode: secret&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Mounting Secrets&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# As environment variables&lt;/span&gt;
&lt;span class="na"&gt;envFrom&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;secretRef&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;db-secret&lt;/span&gt;

&lt;span class="c1"&gt;# As volume&lt;/span&gt;
&lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;secret-volume&lt;/span&gt;
  &lt;span class="na"&gt;secret&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;secretName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;db-secret&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  5. Multi-Container Pods
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Sidecar Pattern
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;app&lt;/span&gt;
  &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx&lt;/span&gt;
  &lt;span class="na"&gt;volumeMounts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;log-volume&lt;/span&gt;
    &lt;span class="na"&gt;mountPath&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/var/log/nginx&lt;/span&gt;

&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;log-collector&lt;/span&gt;
  &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;fluentd&lt;/span&gt;
  &lt;span class="na"&gt;volumeMounts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;log-volume&lt;/span&gt;
    &lt;span class="na"&gt;mountPath&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/var/log/nginx&lt;/span&gt;

&lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;log-volume&lt;/span&gt;
  &lt;span class="na"&gt;emptyDir&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Init Containers
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;initContainers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;init-db&lt;/span&gt;
  &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;busybox&lt;/span&gt;
  &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;sh'&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;-c'&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;until&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;nslookup&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;db-service;&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;do&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;echo&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;waiting&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;for&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;db;&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;sleep&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;2;&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;done'&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;app&lt;/span&gt;
  &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Key Characteristics&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run before app containers&lt;/li&gt;
&lt;li&gt;Run sequentially (one at a time)&lt;/li&gt;
&lt;li&gt;Must complete successfully before app containers start&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  6. Autoscaling
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Horizontal Pod Autoscaler (HPA)
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Imperative&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl autoscale deployment/myapp &lt;span class="nt"&gt;--cpu-percent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;50 &lt;span class="nt"&gt;--min&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2 &lt;span class="nt"&gt;--max&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Declarative&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;autoscaling/v2&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;HorizontalPodAutoscaler&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;myapp-hpa&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;scaleTargetRef&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;apps/v1&lt;/span&gt;
    &lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deployment&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;myapp&lt;/span&gt;
  &lt;span class="na"&gt;minReplicas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
  &lt;span class="na"&gt;maxReplicas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;
  &lt;span class="na"&gt;metrics&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Resource&lt;/span&gt;
    &lt;span class="na"&gt;resource&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;cpu&lt;/span&gt;
      &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Utilization&lt;/span&gt;
        &lt;span class="na"&gt;averageUtilization&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Resource&lt;/span&gt;
    &lt;span class="na"&gt;resource&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;memory&lt;/span&gt;
      &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Utilization&lt;/span&gt;
        &lt;span class="na"&gt;averageUtilization&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;70&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Vertical Pod Autoscaler (VPA)
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;autoscaling.k8s.io/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;VerticalPodAutoscaler&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;myapp-vpa&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;targetRef&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;apps/v1"&lt;/span&gt;
    &lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deployment&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;myapp&lt;/span&gt;
  &lt;span class="na"&gt;updatePolicy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;updateMode&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Auto"&lt;/span&gt;  &lt;span class="c1"&gt;# Options: Off, Initial, Recreate, Auto&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Key Differences
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;HPA&lt;/th&gt;
&lt;th&gt;VPA&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Scales&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Pod count (horizontal)&lt;/td&gt;
&lt;td&gt;Resource requests/limits (vertical)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Triggers&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;CPU/Memory metrics&lt;/td&gt;
&lt;td&gt;Resource utilization over time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Use Case&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Handle variable load&lt;/td&gt;
&lt;td&gt;Optimize resource allocation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Requires Restart&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes (for most modes)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  7. Cluster Maintenance
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Node Operations
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Drain Node&lt;/strong&gt; (Safe maintenance):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl drain node01 &lt;span class="nt"&gt;--ignore-daemonsets&lt;/span&gt; &lt;span class="nt"&gt;--delete-emptydir-data&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Cordon Node&lt;/strong&gt; (Mark unschedulable):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl cordon node01
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Uncordon Node&lt;/strong&gt; (Allow scheduling):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl uncordon node01
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Upgrade Workflow
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;1. Upgrade Control Plane&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Update kubeadm&lt;/span&gt;
apt-get update
apt-get &lt;span class="nb"&gt;install &lt;/span&gt;&lt;span class="nv"&gt;kubeadm&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1.28.0-00

&lt;span class="c"&gt;# Check upgrade plan&lt;/span&gt;
kubeadm upgrade plan

&lt;span class="c"&gt;# Apply upgrade&lt;/span&gt;
kubeadm upgrade apply v1.28.0

&lt;span class="c"&gt;# Upgrade kubelet and kubectl&lt;/span&gt;
apt-get &lt;span class="nb"&gt;install &lt;/span&gt;&lt;span class="nv"&gt;kubelet&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1.28.0-00 &lt;span class="nv"&gt;kubectl&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1.28.0-00
systemctl daemon-reload
systemctl restart kubelet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Upgrade Worker Nodes&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# On worker node&lt;/span&gt;
kubeadm upgrade node

&lt;span class="c"&gt;# Upgrade kubelet&lt;/span&gt;
apt-get &lt;span class="nb"&gt;install &lt;/span&gt;&lt;span class="nv"&gt;kubelet&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1.28.0-00
systemctl daemon-reload
systemctl restart kubelet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Upgrade Process&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Drain the node&lt;/li&gt;
&lt;li&gt;Upgrade kubeadm&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;kubeadm upgrade&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Upgrade kubelet and kubectl&lt;/li&gt;
&lt;li&gt;Restart kubelet&lt;/li&gt;
&lt;li&gt;Uncordon the node&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Quick Reference
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Essential Commands
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Cluster Information&lt;/span&gt;
kubectl cluster-info
kubectl get nodes
kubectl get componentstatuses

&lt;span class="c"&gt;# Resource Management&lt;/span&gt;
kubectl get all &lt;span class="nt"&gt;-A&lt;/span&gt;
kubectl get pods &lt;span class="nt"&gt;-o&lt;/span&gt; wide
kubectl describe pod &amp;lt;pod-name&amp;gt;
kubectl delete pod &amp;lt;pod-name&amp;gt; &lt;span class="nt"&gt;--grace-period&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0 &lt;span class="nt"&gt;--force&lt;/span&gt;

&lt;span class="c"&gt;# Configuration&lt;/span&gt;
kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; &amp;lt;file.yaml&amp;gt;
kubectl delete &lt;span class="nt"&gt;-f&lt;/span&gt; &amp;lt;file.yaml&amp;gt;
kubectl edit &amp;lt;resource&amp;gt; &amp;lt;name&amp;gt;

&lt;span class="c"&gt;# Debugging&lt;/span&gt;
kubectl logs &amp;lt;pod-name&amp;gt;
kubectl &lt;span class="nb"&gt;exec&lt;/span&gt; &lt;span class="nt"&gt;-it&lt;/span&gt; &amp;lt;pod-name&amp;gt; &lt;span class="nt"&gt;--&lt;/span&gt; /bin/bash
kubectl port-forward &amp;lt;pod-name&amp;gt; 8080:80

&lt;span class="c"&gt;# Performance&lt;/span&gt;
kubectl top nodes
kubectl top pods
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  YAML Templates
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Basic Pod&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Pod&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-pod&lt;/span&gt;
  &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;myapp&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx:1.21&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;containerPort&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Basic Deployment&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;apps/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deployment&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-deployment&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;replicas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
  &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;myapp&lt;/span&gt;
  &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;app&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;myapp&lt;/span&gt;
    &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx&lt;/span&gt;
        &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nginx:1.21&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Part 1
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ETCD v3&lt;/strong&gt; is the current standard&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ReplicaSets&lt;/strong&gt; are preferred over ReplicationControllers due to selector flexibility&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Taints/Tolerations&lt;/strong&gt; restrict nodes, &lt;strong&gt;Node Affinity&lt;/strong&gt; attracts pods&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Static Pods&lt;/strong&gt; are managed by kubelet directly, not the API server&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom Schedulers&lt;/strong&gt; allow advanced scheduling logic&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Admission Webhooks&lt;/strong&gt; enforce policies at resource creation time&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Part 2
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Metrics Server&lt;/strong&gt; is required for &lt;code&gt;kubectl top&lt;/code&gt; and HPA functionality&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RollingUpdate&lt;/strong&gt; is the default deployment strategy (25% surge/unavailable)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ConfigMaps/Secrets&lt;/strong&gt; can be mounted as environment variables or volumes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HPA&lt;/strong&gt; scales pods horizontally based on metrics&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;VPA&lt;/strong&gt; adjusts resource requests/limits vertically&lt;/li&gt;
&lt;li&gt;Always &lt;strong&gt;drain nodes&lt;/strong&gt; before maintenance, &lt;strong&gt;uncordon&lt;/strong&gt; afterward&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Exam Tips
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Use imperative commands&lt;/strong&gt; with &lt;code&gt;--dry-run=client -o yaml&lt;/code&gt; to generate YAML templates quickly&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Practice kubectl shortcuts&lt;/strong&gt;: &lt;code&gt;po&lt;/code&gt; (pods), &lt;code&gt;svc&lt;/code&gt; (services), &lt;code&gt;deploy&lt;/code&gt; (deployments), &lt;code&gt;ns&lt;/code&gt; (namespaces)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bookmark Kubernetes documentation&lt;/strong&gt; - you can reference it during the exam&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Master YAML indentation&lt;/strong&gt; - use 2 spaces, never tabs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Know the exam environment&lt;/strong&gt; - Practice with vim/nano and tmux&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Time management&lt;/strong&gt; - Flag difficult questions and return later&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verify your changes&lt;/strong&gt; - Always check resources after creating/modifying them&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;strong&gt;Document Version&lt;/strong&gt;: 1.0&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Last Updated&lt;/strong&gt;: October 2025&lt;br&gt;
Mohamed Nasser Mohamed &lt;br&gt;
&lt;a href="https://www.linkedin.com/in/mohamednasser8/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/mohamednasser8/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cka</category>
      <category>kubernetes</category>
      <category>devops</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>Nginx For Beginners</title>
      <dc:creator>Mohammed Nasser</dc:creator>
      <pubDate>Wed, 16 Apr 2025 17:13:33 +0000</pubDate>
      <link>https://forem.com/mohamednasser018/nginx-to-beginners-55h7</link>
      <guid>https://forem.com/mohamednasser018/nginx-to-beginners-55h7</guid>
      <description>&lt;p&gt;Nginx is a powerful and widely used open-source web server that has gained popularity &lt;br&gt;
due to its high performance, stability, rich feature set, simple configuration, and low &lt;br&gt;
resource consumption. Beyond serving static content like traditional web servers, Nginx &lt;br&gt;
excels as a reverse proxy, load balancer, HTTP cache, and mail proxy. Its event-driven &lt;br&gt;
architecture allows it to handle a large number of concurrent connections efficiently.&lt;br&gt;
Nginx Request Handling&lt;br&gt;
The process of how Nginx handles a client request can be broken down as follows:&lt;br&gt;
Request: A client (e.g., a web browser) sends a request to the Nginx server.&lt;br&gt;
Master Process: The Nginx server has a master process that is responsible for reading the &lt;br&gt;
configuration and managing worker processes.&lt;br&gt;
Event Loop: The master process creates and manages multiple worker processes. Each worker process &lt;br&gt;
contains an event loop. This event loop efficiently manages multiple client connections within a single &lt;br&gt;
process, using non-blocking I/O operations.&lt;br&gt;
Worker Process: When a request comes in, it is picked up and processed by one of the worker &lt;br&gt;
processes within its event loop.&lt;br&gt;
Response: After processing the request (which might involve serving static content, proxying to another &lt;br&gt;
server, etc.), the worker process sends the response back to the client.&lt;br&gt;
Nginx Use Cases&lt;br&gt;
Nginx is versatile and can be employed in various scenarios:&lt;br&gt;
Load Balancer: Nginx can distribute incoming client requests across multiple backend servers. This &lt;br&gt;
improves performance, scalability, and reliability by preventing any single server from being overwhelmed. &lt;br&gt;
Source mentions the upstream directive, which is fundamental to configuring Nginx as a load balancer.&lt;br&gt;
Reverse Proxy: In this role, Nginx acts as an intermediary for requests from clients seeking resources &lt;br&gt;
from one or more servers. The client sends the request to the Nginx server, which then forwards the request &lt;br&gt;
to the appropriate backend server. The backend server's response is then sent back to the client by Nginx. &lt;br&gt;
This can enhance security, provide SSL termination, and improve performance through caching. Source &lt;br&gt;
explicitly lists "reversy proxy" as a use case.&lt;br&gt;
Forward Proxy: While less commonly configured for this primary purpose than tools like Squid, Nginx &lt;br&gt;
can also act as a forward proxy, allowing clients on a private network to connect to servers on the internet &lt;br&gt;
through it. Source lists "forward proxy" as a use case.&lt;br&gt;
Caching: Nginx can cache responses from backend servers, serving subsequent identical requests &lt;br&gt;
directly. This reduces the load on backend servers and improves response times for clients. Source &lt;br&gt;
discusses "nginx caching server" and related directives like proxy cach dir, proxy cach key, and proxy cach &lt;br&gt;
vaild.&lt;br&gt;
Nginx Installation&lt;br&gt;
Installation methods vary depending on the operating system (e.g., using package managers like apt on &lt;br&gt;
Debian/Ubuntu or yum on CentOS/RHEL).&lt;br&gt;
Important Nginx Directories&lt;br&gt;
Understanding the key directories used by Nginx is crucial for configuration and management:&lt;br&gt;
/etc/nginx/nginx.conf: This is the main configuration file for Nginx. It includes global settings and &lt;br&gt;
directives, and often references other configuration files.&lt;br&gt;
/etc/nginx/sites-available/: This directory typically contains configuration files for individual &lt;br&gt;
websites or applications hosted on the server. These files define virtual host settings.&lt;br&gt;
/etc/nginx/sites-enabled/: This directory contains symbolic links to the configuration files in sitesavailable that are currently active. Nginx only loads the configurations of the files that are linked here. The &lt;br&gt;
command ln -s /etc/nginx/site-available/helloworld /etc/nginx/sites-enabled demonstrates how to &lt;br&gt;
enable a site configuration by creating a symbolic link.&lt;br&gt;
/etc/nginx/conf.d/: This directory often contains additional configuration snippets that can be &lt;br&gt;
included in the main nginx.conf or within server block configurations. For example, source mentions &lt;br&gt;
/etc/nginx/conf.d/.htpasswd as a file to set basic authentication.&lt;br&gt;
/var/www/: This is a common root directory for web content. However, the actual location for website &lt;br&gt;
files is defined in the server block configuration.&lt;br&gt;
/etc/nginx/mime.types: This file defines the MIME types that Nginx uses to determine the ContentType header for responses based on file extensions.&lt;br&gt;
/etc/nginx/nginx.pid: This file stores the process ID (PID) of the Nginx master process.&lt;br&gt;
/var/log/nginx/: This directory is where Nginx access logs (recording client requests) and error logs&lt;br&gt;
(recording any issues encountered) are typically stored. Source mentions "logs and log format options" &lt;br&gt;
under monitoring and troubleshooting.&lt;br&gt;
Nginx Commands&lt;br&gt;
These are some essential Nginx commands for managing the server:&lt;br&gt;
nginx -h: Displays help information about the Nginx command-line options.&lt;br&gt;
nginx -v: Shows the Nginx version.&lt;br&gt;
nginx -V: Shows the Nginx version and configuration arguments that were used during the build &lt;br&gt;
process. This can be useful for determining compiled-in modules.&lt;br&gt;
nginx -t: Tests the Nginx configuration files for syntax errors. It's crucial to run this command before &lt;br&gt;
reloading or restarting Nginx.&lt;br&gt;
nginx -T: Similar to -t, but it also dumps the entire Nginx configuration as seen by the server. This is &lt;br&gt;
useful for debugging.&lt;br&gt;
nginx -s stop: Forcefully stops the Nginx server immediately.&lt;br&gt;
nginx -s quit: Gracefully stops the Nginx server. It waits for worker processes to finish processing &lt;br&gt;
current requests before exiting.&lt;br&gt;
nginx -s reload: Reloads the Nginx configuration without interrupting the processing of current &lt;br&gt;
requests. The master process re-reads the configuration files and starts new worker processes with the &lt;br&gt;
updated configuration while the old ones finish their work.&lt;br&gt;
nginx -s reopen: Reopens the log files. This is useful after log rotation.&lt;br&gt;
systemctl restart nginx: Restarts the Nginx service (if managed by systemd). This typically involves &lt;br&gt;
stopping and then starting the Nginx server.&lt;br&gt;
systemctl start nginx: Starts the Nginx service.&lt;br&gt;
systemctl reload nginx: Reloads the Nginx configuration (if managed by systemd), similar to nginx &lt;br&gt;
-s reload.&lt;br&gt;
systemctl status nginx: Shows the current status of the Nginx service (active, inactive, failed, etc.).&lt;br&gt;
curl and its Options&lt;br&gt;
curl is a command-line tool used for transferring data with URLs. It's often used to interact with web &lt;br&gt;
servers, including Nginx, for testing and debugging. &lt;br&gt;
curl --header "Host: nasser.com" localhost: This command sends an HTTP request to localhost (the local &lt;br&gt;
machine) and includes a custom Host header with the value nasser.com. The Host header is crucial for &lt;br&gt;
name-based virtual hosting, allowing a single IP address to serve multiple websites. Nginx uses this header &lt;br&gt;
to determine which server block should handle the request.&lt;br&gt;
curl -sI -H "Host: example1.com" &lt;a href="http://localhost:" rel="noopener noreferrer"&gt;http://localhost:&lt;/a&gt; This command also sends an HTTP request to &lt;br&gt;
localhost. &lt;br&gt;
-s: This option makes curl silent; it won't display progress meters or error messages unless something goes &lt;br&gt;
wrong.&lt;br&gt;
-I: This option tells curl to only retrieve the HTTP headers of the response, without the actual content.&lt;br&gt;
-H "Host: example1.com": This again sets a custom Host header to example1.com, useful for testing &lt;br&gt;
virtual host configurations.&lt;br&gt;
curl -k --head &lt;a href="https://example.com:" rel="noopener noreferrer"&gt;https://example.com:&lt;/a&gt; This command interacts with the HTTPS version of example.com. &lt;br&gt;
-k: This option tells curl to disable SSL certificate verification. This is generally not recommended for &lt;br&gt;
production environments but can be useful for testing with self-signed certificates or when troubleshooting &lt;br&gt;
SSL/TLS issues. Source mentions "ssl vs tls" and creating certs.&lt;br&gt;
--head: This option is similar to -I and requests only the HTTP headers of the response.&lt;br&gt;
Nginx Return Rule (Redirects)&lt;/p&gt;

&lt;p&gt;The return directive in Nginx allows you to stop processing the current request and send a specified status &lt;br&gt;
code and optional URL to the client. This is commonly used for redirects:&lt;br&gt;
location / { return 301 https://$host$request_uri; }: This configuration within a server block will &lt;br&gt;
redirect all requests (/) to the HTTPS version of the same URL. &lt;br&gt;
301: This is the HTTP status code for a permanent redirect. It indicates that the requested resource has &lt;br&gt;
moved permanently to the new URL.&lt;br&gt;
https://: This specifies the new protocol for the redirect.&lt;br&gt;
$host: This is an Nginx built-in variable that holds the value of the Host header in the client request.&lt;br&gt;
$request_uri: This is another Nginx built-in variable that contains the full original request URI&lt;br&gt;
(including the path and query string).&lt;br&gt;
return 301: This is an incomplete return directive as it's missing a URL. It would likely result in an error &lt;br&gt;
or unexpected behavior.&lt;br&gt;
Status Codes: These are codes sent by the server to the client indicating the outcome of the request. &lt;br&gt;
Source lists a few: &lt;br&gt;
301 Moved Permanently: This status code is used in Nginx with the return directive to permanently &lt;br&gt;
redirect a request to a new URI. For example, return 301 https://$host$request_uri; will permanently &lt;br&gt;
redirect HTTP requests to their HTTPS counterparts.&lt;br&gt;
404 Not Found: This status code indicates that the server cannot find the requested resource. In Nginx, &lt;br&gt;
you can explicitly return a 404 error using =404 within the try_files directive in a location block if none of &lt;br&gt;
the specified files or directories are found.&lt;br&gt;
200 OK: This is a standard HTTP status code that signifies the request has been successful. While not &lt;br&gt;
extensively detailed in the sources, its mention implies that Nginx returns this code when a request is &lt;br&gt;
successfully processed and the requested content is served.&lt;br&gt;
302 Found (Moved Temporarily): This status code indicates that the requested resource has been &lt;br&gt;
temporarily moved to a different URI. The client should continue to use the original URI for future &lt;br&gt;
requests. This specific status code is not explicitly mentioned in the provided sources in the context of &lt;br&gt;
Nginx.&lt;br&gt;
401 Unauthorized: This status code indicates that the client request has not been completed because it &lt;br&gt;
lacks valid authentication credentials for the requested resource. The sources discuss basic &lt;br&gt;
authentication in Nginx using the auth_basic and auth_basic_user_file directives. If a client tries to access &lt;br&gt;
content protected by basic authentication without providing the correct credentials, the server would &lt;br&gt;
typically respond with a 401 status code (though this specific code is not explicitly stated in the &lt;br&gt;
authentication sections)&lt;br&gt;
.403 Forbidden: This status code indicates that the server understands the request but refuses to &lt;br&gt;
authorize it. The sources mention blocking traffic based on IPs or IP ranges using the http_access &lt;/p&gt;

&lt;p&gt;module. If a client whose IP is denied tries to access the server, Nginx would likely return a 403 Forbidden&lt;br&gt;
status code (although this is not explicitly stated in the http_access section).&lt;br&gt;
500 Internal Server Error: This is a generic error response indicating that the server encountered an &lt;br&gt;
unexpected condition that prevented it from fulfilling the request. The provided sources do not specifically &lt;br&gt;
detail scenarios within Nginx configurations that would directly lead to a 500 error. This type of error &lt;br&gt;
often arises from issues in the server's configuration or problems with the application being served.&lt;br&gt;
502 Bad Gateway: This status code indicates that the server, while acting as a gateway or proxy, received &lt;br&gt;
an invalid response from an upstream server it accessed to fulfill the request. The sources mention &lt;br&gt;
Nginx as a reverse proxy and the directive pass-proxy (likely a typo for proxy_pass). In a reverse proxy &lt;br&gt;
setup, if Nginx cannot establish a connection with a backend server or receives an invalid response from it, &lt;br&gt;
it might return a 502 Bad Gateway error to the client.&lt;br&gt;
503 Service Unavailable: This status code indicates that the server is temporarily unable to handle the &lt;br&gt;
request. This could be due to the server being overloaded, under maintenance, or temporarily unavailable &lt;br&gt;
for other reasons. The sources discuss rate limiting, and while exceeding rate limits results in a 429 Too &lt;br&gt;
Many Requests status code, a server experiencing very high traffic might also return a 503 Service &lt;br&gt;
Unavailable status code to new requests as it's temporarily overloaded.&lt;br&gt;
Rewrite Directive&lt;br&gt;
The rewrite directive in Nginx allows you to modify the request URI based on regular expressions. It's a &lt;br&gt;
powerful tool for URL manipulation. Source mentions:&lt;br&gt;
server { rewriter }: This indicates that rewrite directives are typically placed within a server block to &lt;br&gt;
apply to requests handled by that virtual host. However, rewrite directives can also be used within location &lt;br&gt;
blocks.&lt;br&gt;
REGEX: This refers to regular expressions, which are patterns used to match strings. rewrite directives &lt;br&gt;
use regular expressions to match parts of the request URI and can then replace or modify them.&lt;br&gt;
Nginx as Load Balancer&lt;br&gt;
Nginx can function as a load balancer to distribute traffic to multiple backend servers:&lt;br&gt;
upstream: This directive in the nginx.conf file is used to define a group of backend servers that Nginx &lt;br&gt;
will distribute requests to. You can specify the IP addresses and ports of these servers, as well as load &lt;br&gt;
balancing methods.&lt;br&gt;
pass-proxy: This seems to be a shorthand for proxy_pass, which is a directive used within a location &lt;br&gt;
block to forward requests to the backend servers defined in an upstream block. For example:&lt;br&gt;
upstream backend {&lt;br&gt;
 server backend1.example.com;&lt;br&gt;
server backend2.example.com;&lt;/p&gt;

&lt;p&gt;}&lt;br&gt;
server {&lt;br&gt;
 location /app/ {&lt;br&gt;
 proxy_pass &lt;a href="http://backend" rel="noopener noreferrer"&gt;http://backend&lt;/a&gt;;&lt;br&gt;
 }&lt;br&gt;
}&lt;br&gt;
In this example, requests to /app/ will be forwarded to either backend1.example.com or &lt;br&gt;
backend2.example.com based on the load balancing method configured in the upstream block.&lt;br&gt;
SSL vs TLS&lt;br&gt;
SSL (Secure Sockets Layer) and TLS (Transport Layer Security) are cryptographic protocols designed &lt;br&gt;
to provide secure communication over a network. TLS is the successor to SSL, and while the term "SSL" is &lt;br&gt;
still often used, most modern systems use TLS. They encrypt data exchanged between a client and a server, &lt;br&gt;
ensuring confidentiality and integrity.&lt;br&gt;
Create cert using mkcert and certbot: These are tools used to obtain and manage SSL/TLS certificates. &lt;br&gt;
mkcert: A simple tool for creating locally trusted development certificates.&lt;br&gt;
Certbot: A widely used, free, and open-source tool provided by the Electronic Frontier Foundation (EFF) &lt;br&gt;
for automating the process of obtaining and installing Let's Encrypt certificates, which are trusted by most &lt;br&gt;
web browsers.&lt;br&gt;
HTTP Headers&lt;br&gt;
HTTP headers are key-value pairs that carry additional information about the HTTP request and response. &lt;br&gt;
They are essential for communication between clients and servers. Source categorizes HTTP headers:&lt;br&gt;
General Header: These headers apply to both request and response messages (e.g., Cache-Control, &lt;br&gt;
Connection).&lt;br&gt;
Request Header: These headers provide information about the client making the request (e.g., User-Agent, &lt;br&gt;
Accept-Language, Host).&lt;br&gt;
Response Header: These headers provide information about the server's response (e.g., Server, ContentType, Content-Length).&lt;br&gt;
Security Header: These headers help enhance the security of web applications by providing instructions to &lt;br&gt;
the browser (e.g., Strict-Transport-Security, X-Frame-Options, Content-Security-Policy).&lt;br&gt;
Authentication Header: These headers are used for client-server authentication (e.g., Authorization, &lt;br&gt;
WWW-Authenticate). Source and discuss basic authentication. &lt;br&gt;
Caching Header: These headers control how responses are cached by clients and proxies (e.g., CacheControl, Expires, ETag). Source mentions caching-related directives.&lt;/p&gt;

&lt;p&gt;CORS Header (Cross-Origin Resource Sharing): These headers control whether a web page running &lt;br&gt;
under one domain can request resources from another domain (e.g., Access-Control-Allow-Origin).&lt;br&gt;
Proxy Header: These headers provide information when requests and responses pass through proxies (e.g., &lt;br&gt;
X-Forwarded-For, X-Forwarded-Proto). Source mentions proxy set header x-proxy-cache &lt;br&gt;
$upstream_cache_status.&lt;br&gt;
Custom Header: Applications can define their own custom headers to exchange specific information.&lt;br&gt;
Nginx Built-in Variable&lt;br&gt;
Nginx provides a rich set of built-in variables that contain information about the server, the request, and &lt;br&gt;
the connection. These variables can be used in Nginx configuration to make it more dynamic and flexible, &lt;br&gt;
for example, when setting headers or in log_format directives. Source mentions using them with headers. &lt;br&gt;
For example, $host and $request_uri were used in the return directive example.&lt;br&gt;
add_header vs. proxy_set_header&lt;br&gt;
Both add_header and proxy_set_header directives are used to manipulate HTTP headers, but they operate &lt;br&gt;
in different contexts:&lt;br&gt;
add_header: This directive adds a header to the HTTP response that Nginx sends directly to the client. &lt;br&gt;
It is typically used within http, server, or location blocks. Source provides examples of using add_header to &lt;br&gt;
set security headers like Strict-Transport-Security, X-Frame-Options, Content-Security-Policy, and &lt;br&gt;
Referrer-Policy. The index directive in source (index index.html index.htm index.nginx-debian.html;) &lt;br&gt;
specifies the default files to serve if a directory is requested.&lt;br&gt;
proxy_set_header: This directive sets or modifies a header that Nginx sends to a backend server when &lt;br&gt;
acting as a reverse proxy. It is typically used within location blocks that are configured with proxy_pass. &lt;br&gt;
Source shows an example: proxy set header x-proxy-cache $upstream_cache_status. This header informs &lt;br&gt;
the backend server about the cache status of the request.&lt;br&gt;
Nginx Basic Authentication&lt;br&gt;
Nginx allows you to implement basic HTTP authentication to restrict access to certain parts of your &lt;br&gt;
website. It's important to note, as mentioned in source, that basic authentication is not recommended for &lt;br&gt;
external access websites due to its lack of strong security. HTTPS should always be used in conjunction &lt;br&gt;
with basic authentication.&lt;br&gt;
There are two main options for setting up basic authentication:&lt;br&gt;
Option 1: htpasswd utility: This utility (usually provided by Apache HTTP Server utils) is used to create &lt;br&gt;
and manage password files in a specific format that Nginx can understand. Source shows the command &lt;br&gt;
sudo htpasswd -c /etc/nginx/conf.d/.htpasswd admin, which creates a new password file (-c) at the &lt;br&gt;
specified path and adds the user admin. You will be prompted to enter a password for this user. The configuration in /etc/nginx/confi.d/ (likely a typo and should be /etc/nginx/conf.d/ or within a server or &lt;br&gt;
location block in nginx.conf or a linked site configuration) would then use these credentials:&lt;br&gt;
auth_basic "Restricted Content";&lt;br&gt;
auth_basic_user_file /etc/nginx/conf.d/.htpasswd;&lt;br&gt;
auth_basic "Restricted Content"; sets the authentication realm (the message displayed in the login dialog), &lt;br&gt;
and auth_basic_user_file /etc/nginx/conf.d/.htpasswd; specifies the path to the password file.&lt;br&gt;
Option 2: openssl utility: You can also use openssl commands to create password hashes that Nginx can &lt;br&gt;
use. The specific commands and file format would need to be configured appropriately in Nginx.&lt;br&gt;
Blocking Traffic&lt;br&gt;
Nginx provides ways to block unwanted traffic based on IP addresses, bots, or network traffic:&lt;br&gt;
http_access module: This Nginx module allows you to allow or deny access based on client IP &lt;br&gt;
addresses or IP address ranges. You can use the allow and deny directives within http, server, or location &lt;br&gt;
blocks. For example:&lt;br&gt;
location /admin {&lt;br&gt;
 allow 192.168.1.0/24; # Allow access from this IP range&lt;br&gt;
 deny all; # Deny access from all other IPs&lt;br&gt;
}&lt;br&gt;
fail2ban: This is a separate intrusion prevention software framework that can monitor log files (like &lt;br&gt;
Nginx access or error logs) for suspicious activity, such as repeated authentication failures, bad bots, or &lt;br&gt;
excessive requests, and automatically block the offending IP addresses by updating firewall rules.&lt;br&gt;
sudo fail2ban-client status nginx-http-auth: This command checks the status of the nginx-http-auth &lt;br&gt;
jail in Fail2ban, which is likely configured to monitor Nginx logs for authentication failures.&lt;br&gt;
/etc/fail2ban/jail.local: This is a configuration file for Fail2ban where you can define and enable jails for &lt;br&gt;
different services, including Nginx.&lt;br&gt;
/etc/fail2ban/filter.d/: This directory contains filter definitions used by Fail2ban to identify patterns of &lt;br&gt;
malicious activity in log files. You can find nginx-http-auth.conf (or similar) here, as well as other filters.&lt;br&gt;
fail2ban-client unban ip your_ip: If an IP address has been blocked by Fail2ban and you need to unblock &lt;br&gt;
it, you can use this command, replacing your_ip with the actual IP address.&lt;br&gt;
Performance&lt;br&gt;
Optimizing Nginx performance is crucial for handling high traffic and providing a good user experience:&lt;br&gt;
Rate Limiting: This technique is used to control the number of requests a client can make within a &lt;br&gt;
specific time period. This can help protect your server from denial-of-service (DoS) attacks and prevent &lt;br&gt;
abusive usage. &lt;br&gt;
Request Rate Limiting: Limits the number of HTTP requests. Source shows an example: &lt;/p&gt;

&lt;p&gt;limit_req_zone $binary_remote_addr zone=limit_per_ip:10m rate=10r/s;&lt;br&gt;
limit_req_status 429;&lt;br&gt;
server {&lt;br&gt;
 location /api/ {&lt;br&gt;
 limit_req zone=limit_per_ip;&lt;br&gt;
 limit_req_status 429; # Set the status code for rejected requests&lt;br&gt;
 # ...&lt;br&gt;
 }&lt;br&gt;
}&lt;br&gt;
limit_req_zone defines a shared memory zone (limit_per_ip of 10MB) to store the state of request rates for &lt;br&gt;
each IP address ($binary_remote_addr). The rate=10r/s specifies a limit of 10 requests per second. &lt;br&gt;
limit_req zone=limit_per_ip; applies this limit to the /api/ location. limit_req_status 429; sets the "Too &lt;br&gt;
Many Requests" status code for when the limit is exceeded.&lt;br&gt;
Connection Rate Limiting: Limits the number of concurrent connections from a single IP address. Source &lt;br&gt;
provides an example: &lt;br&gt;
limit_conn_zone $binary_remote_addr zone=conn_per_ip:10m;&lt;br&gt;
server {&lt;br&gt;
 location / {&lt;br&gt;
 limit_conn conn_per_ip 10;&lt;br&gt;
 try_files $uri $uri/ =404;&lt;br&gt;
 }&lt;br&gt;
}&lt;br&gt;
limit_conn_zone defines a shared memory zone (conn_per_ip of 10MB) to track the number of connections &lt;br&gt;
per IP. limit_conn conn_per_ip 10; limits the number of concurrent connections from a single IP to 10 for &lt;br&gt;
the / location.&lt;br&gt;
Apache Benchmark (ab): This is a command-line tool used for benchmarking HTTP servers. The &lt;br&gt;
example ab -n 1000 &lt;a href="https://example.com/" rel="noopener noreferrer"&gt;https://example.com/&lt;/a&gt; sends 1000 requests (-n 1000) to the specified URL to test its &lt;br&gt;
performance.&lt;br&gt;
Request Rate Limiting: Limits the number of HTTP requests. Source shows an example: &lt;/p&gt;

&lt;p&gt;limit_req_zone $binary_remote_addr zone=limit_per_ip:10m rate=10r/s;&lt;br&gt;
limit_req_status 429;&lt;br&gt;
server {&lt;br&gt;
 location /api/ {&lt;br&gt;
 limit_req zone=limit_per_ip;&lt;br&gt;
 limit_req_status 429; # Set the status code for rejected requests&lt;br&gt;
 # ...&lt;br&gt;
 }&lt;br&gt;
}&lt;br&gt;
limit_req_zone defines a shared memory zone (limit_per_ip of 10MB) to store the state of request rates for &lt;br&gt;
each IP address ($binary_remote_addr). The rate=10r/s specifies a limit of 10 requests per second. &lt;br&gt;
limit_req zone=limit_per_ip; applies this limit to the /api/ location. limit_req_status 429; sets the "Too &lt;br&gt;
Many Requests" status code for when the limit is exceeded.&lt;br&gt;
Connection Rate Limiting: Limits the number of concurrent connections from a single IP address. Source &lt;br&gt;
provides an example: &lt;br&gt;
limit_conn_zone $binary_remote_addr zone=conn_per_ip:10m;&lt;br&gt;
server {&lt;br&gt;
 location / {&lt;br&gt;
 limit_conn conn_per_ip 10;&lt;br&gt;
 try_files $uri $uri/ =404;&lt;br&gt;
 }&lt;br&gt;
}&lt;br&gt;
limit_conn_zone defines a shared memory zone (conn_per_ip of 10MB) to track the number of connections &lt;br&gt;
per IP. limit_conn conn_per_ip 10; limits the number of concurrent connections from a single IP to 10 for &lt;br&gt;
the / location.&lt;br&gt;
Apache Benchmark (ab): This is a command-line tool used for benchmarking HTTP servers. The &lt;br&gt;
example ab -n 1000 &lt;a href="https://example.com/" rel="noopener noreferrer"&gt;https://example.com/&lt;/a&gt; sends 1000 requests (-n 1000) to the specified URL to test its &lt;br&gt;
performance.&lt;br&gt;
Method 1: gzip: This is the standard and widely supported compression method in Nginx. You can &lt;br&gt;
configure gzip compression using directives like gzip on;, gzip_types text/plain application/xml ...;, and &lt;br&gt;
gzip_comp_level.&lt;br&gt;
Method 2: brotli: If supported (e.g., with the ngx_brotli module or in Nginx Plus), brotli can offer better &lt;br&gt;
compression ratios than gzip.&lt;br&gt;
Keepalive: HTTP keepalive (or persistent connections) allows multiple HTTP requests and responses &lt;br&gt;
to be sent over the same TCP connection, reducing the overhead of establishing new connections for each &lt;br&gt;
request. HTTP/1.1 uses keepalive by default. &lt;br&gt;
HTTP versions and how use http v1.1 to you config and why use this not v1: HTTP/1.1 is the widely &lt;br&gt;
used version that supports keepalive by default. You generally don't need to explicitly "configure" &lt;br&gt;
HTTP/1.1 in Nginx unless you need to restrict to an older version for specific reasons (which is rare). &lt;br&gt;
HTTP/1.0, by default, did not have keepalive, requiring a Connection: keep-alive header for persistent &lt;br&gt;
connections. HTTP/1.1 offers performance advantages due to keepalive and other improvements.&lt;br&gt;
sendfile: This is a Linux kernel feature that allows the operating system to efficiently copy data from a &lt;br&gt;
file directly to a socket without the need for the data to be copied into user-space memory first. Enabling &lt;br&gt;
sendfile on; in Nginx can improve performance when serving static files.&lt;br&gt;
tcp_nopush: This TCP option, when enabled (tcp_nopush on; in Nginx), delays sending small packets of &lt;br&gt;
data, waiting until a full-sized packet is ready or a certain timeout occurs. This can reduce network &lt;br&gt;
congestion and improve performance in some cases.&lt;br&gt;
Monitoring and Troubleshooting&lt;br&gt;
Effective monitoring and troubleshooting are essential for maintaining a healthy Nginx server:&lt;br&gt;
Logs and log format options: Nginx generates access logs (recording details of client requests) and error &lt;br&gt;
logs (recording any issues encountered). You can configure the format of these logs using the log_format &lt;br&gt;
directive in the http block of your nginx.conf file. This allows you to customize the information recorded in &lt;br&gt;
the logs. Directives like access_log and error_log specify the paths and formats of these log files. Regularly &lt;br&gt;
reviewing these logs is crucial for identifying and resolving issues.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>development</category>
      <category>devops</category>
      <category>nginx</category>
    </item>
    <item>
      <title>Set Up DeepSeek on Huawei Cloud with Docker and Open WebUI</title>
      <dc:creator>Mohammed Nasser</dc:creator>
      <pubDate>Sat, 15 Feb 2025 15:34:44 +0000</pubDate>
      <link>https://forem.com/mohamednasser018/set-up-deepseek-on-huawei-cloud-with-docker-and-open-webui-1p37</link>
      <guid>https://forem.com/mohamednasser018/set-up-deepseek-on-huawei-cloud-with-docker-and-open-webui-1p37</guid>
      <description>&lt;h2&gt;
  
  
  Step 1: Log in to Huawei Cloud Console
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt; Log in to your Huawei Cloud account.&lt;/li&gt;
&lt;li&gt; In the Services List, search for VPC and select the VPC Service.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh7u3r51eybceywzt5xk6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh7u3r51eybceywzt5xk6.png" alt=" " width="538" height="262"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fthqv7lfg3lo4y29cqhys.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fthqv7lfg3lo4y29cqhys.png" alt=" " width="538" height="121"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Create a VPC
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt; On the VPC console page, click Create.&lt;/li&gt;
&lt;li&gt; Fill in the VPC Name and Subnet Name.&lt;/li&gt;
&lt;li&gt; Click Create Now to create the VPC.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvje8yg1owyqcx60j0rcy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvje8yg1owyqcx60j0rcy.png" alt=" " width="538" height="262"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Create an ECS Instance
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt; Return to the Huawei Cloud console and search for ECS.&lt;/li&gt;
&lt;li&gt; Click Buy ECS.&lt;/li&gt;
&lt;li&gt; Choose the specifications for your instance and click Submit.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F35hd9bzd14j4vdl8sfwy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F35hd9bzd14j4vdl8sfwy.png" alt=" " width="538" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj6q32wy4z60ob4u8gde8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj6q32wy4z60ob4u8gde8.png" alt=" " width="538" height="235"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5x6hqxes59lwpawqn032.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5x6hqxes59lwpawqn032.png" alt=" " width="538" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9rp2sqwjnx89bbqvq1go.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9rp2sqwjnx89bbqvq1go.png" alt=" " width="538" height="295"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqqqi4sks6uymi6jv63b7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqqqi4sks6uymi6jv63b7.png" alt=" " width="538" height="295"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyjvst3s8v50on6bovyjl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyjvst3s8v50on6bovyjl.png" alt=" " width="538" height="295"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Create a Security Group
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt; Click Create Security Group.&lt;/li&gt;
&lt;li&gt; Add inbound rules for ports:
o   22 for SSH
o   80 for HTTP
o   8080 for alternative HTTP
o   (You can modify these rules later if needed).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftosmcjsuqu5zr0170zqr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftosmcjsuqu5zr0170zqr.png" alt=" " width="538" height="256"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcmrd2gl23n7x8ndy6eac.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcmrd2gl23n7x8ndy6eac.png" alt=" " width="538" height="245"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Filaopa3fuc31r98omvfv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Filaopa3fuc31r98omvfv.png" alt=" " width="538" height="244"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Create a Key Pair
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt; Click Create Key Pair to generate a key pair for connecting to your ECS instance.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxkvvg38kksr57og2n4sx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxkvvg38kksr57og2n4sx.png" alt=" " width="538" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4j9pg3k2gdoelrsfoasf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4j9pg3k2gdoelrsfoasf.png" alt=" " width="538" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcz5168bdcmvfgn6mdw4j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcz5168bdcmvfgn6mdw4j.png" alt=" " width="538" height="249"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Retrieve the ECS Public IP and Connect via CLI
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt; Go to the ECS Console and locate your instance.&lt;/li&gt;
&lt;li&gt; Copy the Public IP address of your ECS instance.&lt;/li&gt;
&lt;li&gt; Use a CLI tool like MobaXterm, PuTTY, or any SSH client to connect to your ECS instance:
o   Open your SSH client.
o   Enter the Public IP of your ECS instance.
o   Use the Key Pair you created earlier for authentication.
o   Log in as the default user root .
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flsyf3nq94djj1ora260i.png" alt=" " width="538" height="209"&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvyn75qvpwwelazrcp6kt.png" alt=" " width="538" height="262"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftq2rtm19ew72i3psff0a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftq2rtm19ew72i3psff0a.png" alt=" " width="538" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: Install Docker on the ECS Instance
&lt;/h2&gt;

&lt;p&gt;Run the following commands in your ECS instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release &amp;amp;&amp;amp; echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list &amp;gt; /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2s26rgc9x2nn4y0sagr8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2s26rgc9x2nn4y0sagr8.png" alt=" " width="538" height="295"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fymggnbxntf3tmtky1nxw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fymggnbxntf3tmtky1nxw.png" alt=" " width="538" height="283"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1p0doji992bejxfj7ksi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1p0doji992bejxfj7ksi.png" alt=" " width="538" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 8: Pull and Run Ollama Image
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt; Pull the Ollama Docker image:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker pull ollama/ollama
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F71dtbr36o5r1u2eknfnt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F71dtbr36o5r1u2eknfnt.png" alt=" " width="538" height="278"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the Ollama container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flwari8e8nxzbsas9niqs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flwari8e8nxzbsas9niqs.png" alt=" " width="538" height="302"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose the DeepSeek Module:&lt;br&gt;
Visit the Ollama Library and search for the DeepSeek model.&lt;br&gt;
Select the model you want to use (e.g., deepseek-r1:7b).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fos79sejykdmc2tz5dn6d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fos79sejykdmc2tz5dn6d.png" alt=" " width="538" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the Ollama container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9j7idkqjfx2u43zwihvo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9j7idkqjfx2u43zwihvo.png" alt=" " width="538" height="55"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw9d02msw0589jhzrrjez.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw9d02msw0589jhzrrjez.png" alt=" " width="538" height="55"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Chat with DeepSeek. Type &lt;code&gt;/bye&lt;/code&gt; to exit.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fev0211rdzotk2q0ekcl9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fev0211rdzotk2q0ekcl9.png" alt=" " width="538" height="302"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 9: Set Up Open WebUI
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt; Run the Open WebUI container:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway –v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl8fjife9hktz64rz5iai.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl8fjife9hktz64rz5iai.png" alt=" " width="538" height="164"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9g8mziuds01o6sz6gvzk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9g8mziuds01o6sz6gvzk.png" alt=" " width="538" height="186"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go to the ECS page and modify the security group to add inbound rules for ports 11434 and 3000.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F752x3h4ll9ygzsgr3d91.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F752x3h4ll9ygzsgr3d91.png" alt=" " width="538" height="226"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8vi604f53dfzqodu953s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8vi604f53dfzqodu953s.png" alt=" " width="538" height="230"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzpv5euiaxs57wjxhjx8i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzpv5euiaxs57wjxhjx8i.png" alt=" " width="538" height="215"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb3jw6lxh00i5v0qtda32.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb3jw6lxh00i5v0qtda32.png" alt=" " width="537" height="278"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 10: Access Open WebUI
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt; Copy the Public IP of your ECS instance.&lt;/li&gt;
&lt;li&gt; Open a browser and navigate to http://:3000.&lt;/li&gt;
&lt;li&gt; Click Get Started, then create an account with your name, email, and password.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3uv88vc77yz1mlpgcxgb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3uv88vc77yz1mlpgcxgb.png" alt=" " width="537" height="295"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fasawztznnz9qzyyu2lyv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fasawztznnz9qzyyu2lyv.png" alt=" " width="538" height="219"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 11: Start Chatting
&lt;/h2&gt;

&lt;p&gt;You can now chat with DeepSeek using the Open WebUI interface.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flqjlk5pwlkzultrdxgk9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flqjlk5pwlkzultrdxgk9.png" alt=" " width="538" height="222"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foyf22e75xprh0gg110ad.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foyf22e75xprh0gg110ad.png" alt=" " width="538" height="302"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>deepseek</category>
      <category>cloud</category>
      <category>devops</category>
    </item>
    <item>
      <title>The Power of AWS Services</title>
      <dc:creator>Mohammed Nasser</dc:creator>
      <pubDate>Sun, 29 Dec 2024 13:14:40 +0000</pubDate>
      <link>https://forem.com/mohamednasser018/the-power-of-aws-services-a-developers-guide-mec</link>
      <guid>https://forem.com/mohamednasser018/the-power-of-aws-services-a-developers-guide-mec</guid>
      <description>&lt;h1&gt;
  
  
  Unlocking the Power of AWS Services: A Developer's Perspective
&lt;/h1&gt;

&lt;p&gt;Cloud computing has transformed the way businesses and developers build, deploy, and manage applications. Among the industry leaders, &lt;strong&gt;Amazon Web Services (AWS)&lt;/strong&gt; has established itself as a pioneer with a broad and robust ecosystem of services. Whether you're a seasoned developer or just starting, AWS offers tools and resources to streamline development and enhance productivity.&lt;/p&gt;

&lt;p&gt;Here’s a categorized breakdown of the major AWS services and their significance for developers:&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;1. Compute&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Compute services are the backbone of AWS, providing scalable infrastructure to host and run applications. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;EC2 (Elastic Compute Cloud):&lt;/strong&gt; Virtual servers that allow you to configure, secure, and scale resources for any workload.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lambda:&lt;/strong&gt; A serverless compute service for running code without provisioning servers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Elastic Beanstalk:&lt;/strong&gt; A Platform-as-a-Service (PaaS) offering to deploy and scale web applications effortlessly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ECS (Elastic Container Service):&lt;/strong&gt; A fully managed container orchestration service for running Docker containers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;EKS (Elastic Kubernetes Service):&lt;/strong&gt; A managed Kubernetes service for containerized applications.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;2. Storage&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;AWS provides versatile and cost-efficient storage solutions to meet various needs.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;S3 (Simple Storage Service):&lt;/strong&gt; Object storage designed for data durability and availability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;EBS (Elastic Block Store):&lt;/strong&gt; Block storage for EC2 instances, ideal for databases and file systems.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Glacier:&lt;/strong&gt; Archival storage for long-term data retention at low cost.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FSx:&lt;/strong&gt; Managed file storage for Windows and Lustre file systems.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage Gateway:&lt;/strong&gt; A hybrid storage service enabling on-premises applications to use AWS cloud storage.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;3. Databases&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;AWS caters to a variety of database needs, from relational to NoSQL.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;RDS (Relational Database Service):&lt;/strong&gt; Managed relational databases like MySQL, PostgreSQL, and SQL Server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DynamoDB:&lt;/strong&gt; A fully managed NoSQL database for high-performance applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Redshift:&lt;/strong&gt; A data warehouse for running complex queries and analytics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Aurora:&lt;/strong&gt; A high-performance relational database compatible with MySQL and PostgreSQL.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ElastiCache:&lt;/strong&gt; An in-memory data store for caching and real-time applications.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;4. Networking &amp;amp; Content Delivery&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Reliable networking and global content delivery are key to modern applications.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;VPC (Virtual Private Cloud):&lt;/strong&gt; Customizable virtual networks for AWS resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Route 53:&lt;/strong&gt; A scalable domain name system (DNS) for routing users to applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CloudFront:&lt;/strong&gt; A content delivery network (CDN) to serve content with low latency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API Gateway:&lt;/strong&gt; A service for creating, deploying, and managing secure APIs.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;5. Security, Identity, &amp;amp; Compliance&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;AWS prioritizes security with dedicated services to safeguard resources.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;IAM (Identity and Access Management):&lt;/strong&gt; Manage access to AWS services and resources securely.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cognito:&lt;/strong&gt; Authentication, authorization, and user management for web and mobile apps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GuardDuty:&lt;/strong&gt; Intelligent threat detection to protect AWS accounts and workloads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shield:&lt;/strong&gt; Managed DDoS protection for web applications.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;6. Machine Learning&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;AWS empowers developers with AI and ML tools for innovative solutions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SageMaker:&lt;/strong&gt; A comprehensive service for building, training, and deploying machine learning models.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rekognition:&lt;/strong&gt; Image and video analysis for object detection and facial recognition.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Comprehend:&lt;/strong&gt; A natural language processing service to extract insights from text.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;7. Analytics&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Data-driven decision-making is facilitated by AWS’s powerful analytics services.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;EMR (Elastic MapReduce):&lt;/strong&gt; A big data platform for processing large datasets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Kinesis:&lt;/strong&gt; A real-time data streaming service for analytics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Athena:&lt;/strong&gt; An interactive query service to analyze data in S3 using SQL.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;QuickSight:&lt;/strong&gt; A BI tool for creating dashboards and visualizations.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;8. Developer Tools&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;AWS streamlines development workflows with integrated tools.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CodeCommit:&lt;/strong&gt; A secure and scalable version control service.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CodeBuild:&lt;/strong&gt; A continuous integration service for compiling source code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CodeDeploy:&lt;/strong&gt; Automates application deployment to various environments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CodePipeline:&lt;/strong&gt; Orchestrates continuous delivery pipelines for rapid updates.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;9. Management &amp;amp; Governance&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Efficient resource management is essential for stability and compliance.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CloudWatch:&lt;/strong&gt; A monitoring and observability service for AWS resources and applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CloudTrail:&lt;/strong&gt; Tracks user activity and API calls for auditing and compliance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS Config:&lt;/strong&gt; Ensures compliance by tracking resource configurations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Systems Manager:&lt;/strong&gt; A unified interface for operational management.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;10. Application Integration&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;AWS simplifies application communication and integration.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SQS (Simple Queue Service):&lt;/strong&gt; A fully managed message queuing service.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SNS (Simple Notification Service):&lt;/strong&gt; A pub/sub messaging service for notifications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step Functions:&lt;/strong&gt; A visual workflow service to orchestrate microservices.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;EventBridge:&lt;/strong&gt; A serverless event bus for connecting applications and services.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Why AWS for Developers?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;AWS provides developers with unparalleled flexibility and scalability. From compute power and database management to AI capabilities and developer tools, AWS enables rapid application development and deployment while reducing operational overhead.&lt;/p&gt;

&lt;p&gt;Embrace the power of AWS to unlock new possibilities, streamline your workflows, and build the applications of tomorrow!&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/mohamednasser8" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/mohamednasser8&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>cloudcomputing</category>
      <category>cloudnative</category>
    </item>
    <item>
      <title>Solving the Locked Questions Issue in Exam Topics</title>
      <dc:creator>Mohammed Nasser</dc:creator>
      <pubDate>Mon, 23 Dec 2024 09:52:34 +0000</pubDate>
      <link>https://forem.com/mohamednasser018/solving-the-locked-questions-issue-in-exam-topics-11ff</link>
      <guid>https://forem.com/mohamednasser018/solving-the-locked-questions-issue-in-exam-topics-11ff</guid>
      <description>&lt;p&gt;Exam preparation platforms like Exam Topics often provide a limited number of free questions before asking users to pay for access to additional ones. This can be frustrating, especially when you’re trying to explore and practice a large number of questions to better prepare for your certification.  &lt;/p&gt;

&lt;p&gt;To address this challenge, we’ve developed a simple yet effective solution that allows you to access locked questions more efficiently, saving you time and effort.  &lt;/p&gt;

&lt;h4&gt;
  
  
  About the Project
&lt;/h4&gt;

&lt;p&gt;This project is designed to automate the process of accessing and organizing questions from Exam Topics or similar platforms. It simplifies searching for specific exam questions, enabling users to focus on studying rather than spending extra time navigating restrictions.  &lt;/p&gt;

&lt;p&gt;You can find the application and its source code on GitHub, allowing you to modify and improve it based on your requirements. This open-source approach ensures transparency and encourages collaboration.  &lt;/p&gt;

&lt;h4&gt;
  
  
  Features
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Customizable Search:&lt;/strong&gt; Choose or type the name of the exam and specify the range of questions you’d like to search for.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Efficient Navigation:&lt;/strong&gt; Automates the search process, reducing the time needed to access question details.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open Source:&lt;/strong&gt; The project is hosted on GitHub, enabling developers to contribute and enhance its functionality.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  How to Get Started
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Visit the GitHub repository: &lt;a href="https://github.com/mohamednasser018/EXAM_TOPICS" rel="noopener noreferrer"&gt;EXAM_TOPICS Project&lt;/a&gt;.
&lt;/li&gt;
&lt;li&gt;Follow the setup instructions provided in the repository.
&lt;/li&gt;
&lt;li&gt;Run the application and input your desired exam name and question range.
&lt;/li&gt;
&lt;li&gt;The tool will perform automated searches and provide you with easy access to the questions.
&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Why This Project Matters
&lt;/h4&gt;

&lt;p&gt;This solution is particularly useful for:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Professionals preparing for certifications who want unrestricted access to study materials.
&lt;/li&gt;
&lt;li&gt;Students looking to save time and focus on learning.
&lt;/li&gt;
&lt;li&gt;Developers interested in exploring automation solutions for real-world problems.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Contribute to the Project
&lt;/h4&gt;

&lt;p&gt;As an open-source project, contributions are welcome! If you have ideas for new features or optimizations, feel free to fork the repository and submit a pull request. Let’s collaborate to make this tool even more powerful.  &lt;/p&gt;

&lt;p&gt;GitHub Repository: &lt;a href="https://github.com/mohamednasser018/EXAM_TOPICS" rel="noopener noreferrer"&gt;https://github.com/mohamednasser018/EXAM_TOPICS&lt;/a&gt;  &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Tags:&lt;/strong&gt; #ExamTopics #Automation #OpenSource #Certifications #DevTools #GitHub&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>devops</category>
      <category>aws</category>
      <category>cicd</category>
    </item>
    <item>
      <title>Mastering Ansible: The Essential Guide for DevOps Engineers</title>
      <dc:creator>Mohammed Nasser</dc:creator>
      <pubDate>Fri, 20 Dec 2024 22:31:48 +0000</pubDate>
      <link>https://forem.com/mohamednasser018/mastering-ansible-the-essential-guide-for-devops-engineers-32m4</link>
      <guid>https://forem.com/mohamednasser018/mastering-ansible-the-essential-guide-for-devops-engineers-32m4</guid>
      <description>&lt;p&gt;In the world of DevOps, automation is the cornerstone of efficient and reliable IT operations. Among the myriad of tools available, Ansible stands out for its simplicity, versatility, and power. Whether you're configuring servers, deploying applications, or orchestrating complex workflows, Ansible empowers you to automate tasks effortlessly.&lt;/p&gt;

&lt;p&gt;This article dives deep into Ansible's features, setup process, and best practices, providing DevOps engineers with a comprehensive resource to master this tool.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;&lt;em&gt;Why Ansible? Understanding the Advantages&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ansible is an open-source IT automation platform designed to simplify the management of infrastructure and applications. Its unique features make it a favorite among DevOps professionals:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.Agentless Architecture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Unlike other automation tools, Ansible doesn’t require agents or software to be installed on managed nodes. This agentless nature reduces overhead, simplifies deployment, and enhances security.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.Human-Readable YAML Syntax&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ansible uses YAML, a straightforward language that even beginners can understand. This ensures quick adoption and reduces the learning curve for new users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.Idempotency for Safe Automation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Idempotency ensures that tasks can be safely repeated without causing unintended consequences. For example, running a playbook to install a package will not reinstall it if it's already installed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.Broad Compatibility and Extensibility&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ansible integrates seamlessly with various platforms, including:&lt;/p&gt;

&lt;p&gt;Cloud providers like AWS, Azure, and Google Cloud&lt;/p&gt;

&lt;p&gt;Containers such as Docker and Kubernetes&lt;/p&gt;

&lt;p&gt;CI/CD tools like Jenkins and GitHub Actions&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5.Scalability for All Environments&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;From small projects to enterprise-level infrastructures, Ansible handles them all efficiently, making it suitable for teams of any size.&lt;/p&gt;




&lt;p&gt;Setting Up Ansible: A Step-by-Step Guide&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.Control Node: A machine (e.g., laptop, server) where Ansible is installed.&lt;/p&gt;

&lt;p&gt;2.Managed Nodes: Machines controlled by Ansible (e.g., servers, VMs, containers).&lt;/p&gt;

&lt;p&gt;Installation Instructions&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
On Linux&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqgqw3j3595m8x0borion.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqgqw3j3595m8x0borion.jpg" alt=" " width="742" height="302"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
On macOS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fegrsoqxxpkhoyniacm5t.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fegrsoqxxpkhoyniacm5t.jpg" alt=" " width="677" height="273"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
On Windows (via WSL)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1.Install Ubuntu from the Microsoft Store.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.Open WSL and follow the Linux installation steps.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Verify Installation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run the following command to confirm Ansible is installed correctly:&lt;/p&gt;

&lt;p&gt;ansible --version&lt;/p&gt;




&lt;p&gt;Core Components of Ansible&lt;/p&gt;

&lt;p&gt;Inventory Files&lt;/p&gt;

&lt;p&gt;An inventory file is a list of the servers (managed nodes) Ansible will control. It organizes these nodes into groups for easier management.&lt;/p&gt;

&lt;p&gt;Example: Inventory File&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxhert84ngvifcw8atd1f.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxhert84ngvifcw8atd1f.jpg" alt=" " width="800" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ad-Hoc Commands&lt;/p&gt;

&lt;p&gt;Ad-hoc commands let you run quick tasks without writing a playbook.&lt;/p&gt;

&lt;p&gt;Example: Checking Connectivity&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwdiuq0712ig03zulsrw7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwdiuq0712ig03zulsrw7.jpg" alt=" " width="800" height="296"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;all: Targets all hosts&lt;/p&gt;

&lt;p&gt;-i inventory.ini: Specifies the inventory file&lt;/p&gt;

&lt;p&gt;-m ping: Uses the ping module&lt;/p&gt;




&lt;p&gt;Writing Ansible Playbooks: The Heart of Automation&lt;/p&gt;

&lt;p&gt;Playbooks define tasks in YAML, providing a structured way to execute complex workflows.&lt;/p&gt;

&lt;p&gt;Playbook Example: Installing and Configuring Nginx&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1hcft2lmw913w9skjo98.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1hcft2lmw913w9skjo98.jpg" alt=" " width="800" height="687"&gt;&lt;/a&gt;&lt;br&gt;
Command to Run the Playbook:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1e9vksfkzc8ter64vej3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1e9vksfkzc8ter64vej3.jpg" alt=" " width="800" height="270"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Modules: Building Blocks of Ansible&lt;/p&gt;

&lt;p&gt;Ansible’s functionality is built on modules—reusable units of code for specific tasks.&lt;/p&gt;

&lt;p&gt;Commonly Used Modules&lt;/p&gt;

&lt;p&gt;1.ping: Test connectivity.&lt;/p&gt;

&lt;p&gt;2.apt/yum: Manage packages on Debian/Red Hat systems.&lt;/p&gt;

&lt;p&gt;3.service: Manage services.&lt;/p&gt;

&lt;p&gt;4.copy: Transfer files to managed nodes.&lt;/p&gt;

&lt;p&gt;5.file: Manage file permissions and ownership.&lt;/p&gt;

&lt;p&gt;Module Example: Copying a File&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnwgscl9oci6h5n3rgnj4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnwgscl9oci6h5n3rgnj4.jpg" alt=" " width="800" height="534"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Organizing Playbooks with Roles&lt;/p&gt;

&lt;p&gt;Roles provide a way to organize playbooks into reusable components.&lt;/p&gt;

&lt;p&gt;Role Directory Structure&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwo01lbcdxt5begjq7g8v.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwo01lbcdxt5begjq7g8v.jpg" alt=" " width="800" height="471"&gt;&lt;/a&gt;&lt;br&gt;
Creating and Using Roles&lt;/p&gt;

&lt;p&gt;1.Create a role:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faj69zwuw97cvdwc5ku4w.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faj69zwuw97cvdwc5ku4w.jpg" alt=" " width="636" height="239"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2.Define tasks in roles/nginx/tasks/main.yml:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvmmlsn9gv4e9soo1voh9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvmmlsn9gv4e9soo1voh9.jpg" alt=" " width="745" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use the role in a playbook:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwsl1mmp2pehn7qkftqm1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwsl1mmp2pehn7qkftqm1.jpg" alt=" " width="762" height="382"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Securing Automation with Ansible Vault&lt;/p&gt;

&lt;p&gt;Ansible Vault encrypts sensitive data like passwords, API keys, and certificates.&lt;/p&gt;

&lt;p&gt;Encrypt a File&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg9uwxcv8823dwol9lped.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg9uwxcv8823dwol9lped.jpg" alt=" " width="800" height="297"&gt;&lt;/a&gt;&lt;br&gt;
Run Playbooks with Encrypted Files&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv7d7wi2dagv2t1el8nac.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv7d7wi2dagv2t1el8nac.jpg" alt=" " width="796" height="301"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Best Practices for Ansible&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Leverage Roles: Organize your playbooks for better reusability and scalability.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Separate Environments: Maintain distinct inventory files for staging, development, and production.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use Ansible Vault: Secure sensitive data effectively.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Test Thoroughly: Always test playbooks in a sandbox environment before deploying them to production.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Follow YAML Syntax: Be strict with syntax to avoid errors during execution.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;Advanced Features of Ansible&lt;/p&gt;

&lt;p&gt;Dynamic Inventory&lt;/p&gt;

&lt;p&gt;Generate inventory dynamically for environments like cloud or Kubernetes.&lt;/p&gt;

&lt;p&gt;Custom Modules&lt;/p&gt;

&lt;p&gt;Write Python-based modules for specific use cases.&lt;/p&gt;

&lt;p&gt;Integration with CI/CD&lt;/p&gt;

&lt;p&gt;Use Ansible with Jenkins, GitHub Actions, or GitLab CI/CD for automated deployment pipelines.&lt;/p&gt;




&lt;p&gt;Conclusion: Why Every DevOps Engineer Should Use Ansible&lt;/p&gt;

&lt;p&gt;Ansible simplifies complex automation tasks, allowing DevOps teams to focus on innovation rather than repetitive operations. Its agentless architecture, ease of use, and robust ecosystem make it an invaluable tool for managing infrastructure.&lt;/p&gt;

&lt;p&gt;Start with simple playbooks, explore roles and modules, and soon you’ll be mastering advanced features like Ansible Vault and dynamic inventories. With Ansible, automation is no longer a daunting task—it’s a strategic advantage.&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/mohamednasser8" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/mohamednasser8&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ansible</category>
      <category>automation</category>
      <category>devops</category>
      <category>cicd</category>
    </item>
    <item>
      <title>"Witness Innovation at the Huawei Developer Competition Northern Africa 2024 - Egypt Final!"</title>
      <dc:creator>Mohammed Nasser</dc:creator>
      <pubDate>Thu, 19 Dec 2024 20:05:02 +0000</pubDate>
      <link>https://forem.com/mohamednasser018/witness-innovation-at-the-huawei-developer-competition-northern-africa-2024-egypt-final-1c8c</link>
      <guid>https://forem.com/mohamednasser018/witness-innovation-at-the-huawei-developer-competition-northern-africa-2024-egypt-final-1c8c</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv9o7c23m77p153dhdf0a.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv9o7c23m77p153dhdf0a.jpg" alt=" " width="535" height="1279"&gt;&lt;/a&gt;Experience the Huawei Developer Competition Northern Africa 2024 - Egypt Final!&lt;/p&gt;

&lt;p&gt;Get ready for an exciting event celebrating innovation, creativity, and the future of technology! The Huawei Developer Competition Northern Africa 2024 is hosting its Egypt Final Ceremony this December, and it’s an experience you won’t want to miss.&lt;/p&gt;




&lt;p&gt;📅 Event Details&lt;/p&gt;

&lt;p&gt;Date: Thursday, December 26th&lt;/p&gt;

&lt;p&gt;Location: Royal Maxim Palace Kempinski, Cairo&lt;/p&gt;

&lt;p&gt;This event is your chance to witness top developers and innovators in Northern Africa competing for the championship while networking with technology leaders and experts.&lt;/p&gt;




&lt;p&gt;🌟 What to Expect at the Event?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Watch the Competition Unfold (11:00–13:00):&lt;br&gt;
Witness the best tech talents in Egypt showcase their skills and present cutting-edge solutions to real-world challenges.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hands-On Learning with Codelabs (12:00–13:30):&lt;br&gt;
Participate in interactive coding sessions, gain certifications, and explore Huawei’s latest technologies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tech Talks (12:00–13:30):&lt;br&gt;
Engage with industry experts in fields like AI, Big Data, Databases, and DevOps to learn about emerging trends and best practices.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Networking and Fun (13:00–13:30):&lt;br&gt;
Enjoy beverages, participate in a lucky draw, and connect with like-minded tech enthusiasts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Awards and Ceremony (14:00–15:00):&lt;br&gt;
Celebrate the achievements of participants, hear from keynote speakers, and be part of the Innovation Club launch.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;🎯 Why You Should Attend&lt;/p&gt;

&lt;p&gt;This event is not just about competition; it’s about inspiration and connection. Whether you’re a tech enthusiast, a professional, or a student, you’ll gain insights, expand your network, and experience the forefront of technology.&lt;/p&gt;




&lt;p&gt;🔗 How to Register?&lt;/p&gt;

&lt;p&gt;Scan the QR code on the event agenda to secure your spot today. Attendance is free, but places are limited—don’t miss out!&lt;/p&gt;




&lt;p&gt;Join us to celebrate technology, innovation, and the future! Let’s build a better tomorrow together.&lt;/p&gt;

</description>
      <category>cairo</category>
      <category>huawei</category>
      <category>cloud</category>
      <category>devops</category>
    </item>
    <item>
      <title>AWS Storage Services</title>
      <dc:creator>Mohammed Nasser</dc:creator>
      <pubDate>Wed, 27 Nov 2024 11:11:55 +0000</pubDate>
      <link>https://forem.com/mohamednasser018/aws-storage-services-4l3e</link>
      <guid>https://forem.com/mohamednasser018/aws-storage-services-4l3e</guid>
      <description>&lt;p&gt;Unlocking the Power of AWS Storage Services 🚀&lt;/p&gt;

&lt;p&gt;When it comes to data storage, Amazon Web Services (AWS) offers a treasure trove of solutions tailored to meet the needs of businesses big and small. Whether you're looking to store mission-critical data, run high-performance applications, or archive files cost-effectively, AWS has you covered. Let’s explore the stellar features of AWS storage services that are shaping the future of data management.&lt;/p&gt;




&lt;p&gt;1.Amazon Simple Storage Service (S3): The Gold Standard of Object Storage 🏆&lt;/p&gt;

&lt;p&gt;Amazon S3 is the go-to solution for secure, scalable, and reliable object storage.&lt;/p&gt;

&lt;p&gt;Why It Shines:&lt;/p&gt;

&lt;p&gt;Supports data lakes, web apps, and machine learning workflows.&lt;/p&gt;

&lt;p&gt;Offers intelligent tiering for cost savings.&lt;/p&gt;

&lt;p&gt;Provides built-in security with encryption and versioning.&lt;/p&gt;

&lt;p&gt;💡 Image Idea: A vibrant infographic showing S3 tiers like Standard, Intelligent-Tiering, and Glacier, with a data flow diagram.&lt;/p&gt;




&lt;p&gt;2.Amazon Elastic Block Store (EBS): High-Performance Storage ⚡&lt;/p&gt;

&lt;p&gt;EBS delivers fast and consistent block storage for Amazon EC2 instances.&lt;/p&gt;

&lt;p&gt;Top Benefits:&lt;/p&gt;

&lt;p&gt;Perfect for databases, boot volumes, and log files.&lt;/p&gt;

&lt;p&gt;Offers low latency and snapshots for data protection.&lt;/p&gt;

&lt;p&gt;Multiple volume types for every workload, from SSDs to HDDs.&lt;/p&gt;

&lt;p&gt;💡 Image Idea: A sleek comparison chart of EBS volume types (gp3, io2) and their use cases.&lt;/p&gt;




&lt;p&gt;3.Amazon Elastic File System (EFS): Scalable File Storage 📂&lt;/p&gt;

&lt;p&gt;Need shared storage for your Linux workloads? EFS is your answer!&lt;/p&gt;

&lt;p&gt;Key Features:&lt;/p&gt;

&lt;p&gt;Elastic growth: Automatically adjusts to your storage needs.&lt;/p&gt;

&lt;p&gt;Multi-AZ access: Ensures high availability.&lt;/p&gt;

&lt;p&gt;Supports modern applications like Kubernetes and containerized workloads.&lt;/p&gt;

&lt;p&gt;💡 Image Idea: A diagram of containers accessing shared storage through EFS with performance stats.&lt;/p&gt;




&lt;p&gt;4.Amazon FSx: Tailored for Specialized Needs 💼&lt;/p&gt;

&lt;p&gt;From Windows applications to high-performance computing, FSx has it all.&lt;/p&gt;

&lt;p&gt;Highlights:&lt;/p&gt;

&lt;p&gt;Native Windows support with Active Directory integration.&lt;/p&gt;

&lt;p&gt;FSx for Lustre delivers blazing speed for machine learning and HPC.&lt;/p&gt;

&lt;p&gt;💡 Image Idea: Icons representing FSx for Windows and Lustre, with use case examples like HPC simulations.&lt;/p&gt;




&lt;p&gt;5.Amazon S3 Glacier &amp;amp; Deep Archive: Affordable Archiving ❄️&lt;/p&gt;

&lt;p&gt;For long-term storage, S3 Glacier offers low-cost, secure solutions.&lt;/p&gt;

&lt;p&gt;What Makes It Ideal:&lt;/p&gt;

&lt;p&gt;Retrieval options for every need: from expedited (minutes) to bulk (hours).&lt;/p&gt;

&lt;p&gt;Perfect for compliance archives and digital preservation.&lt;/p&gt;

&lt;p&gt;💡 Image Idea: A thermometer graphic showing Glacier's cost and retrieval speeds.&lt;/p&gt;




&lt;p&gt;6.AWS Storage Gateway: Bridge the Gap 🌉&lt;/p&gt;

&lt;p&gt;Seamlessly connect your on-premises data to AWS.&lt;/p&gt;

&lt;p&gt;Types of Gateways:&lt;/p&gt;

&lt;p&gt;File Gateway: Simplifies file uploads.&lt;/p&gt;

&lt;p&gt;Volume Gateway: Supports block storage.&lt;/p&gt;

&lt;p&gt;Tape Gateway: Ideal for backup and archiving.&lt;/p&gt;

&lt;p&gt;💡 Image Idea: A flowchart of hybrid storage with arrows connecting local servers to AWS via Storage Gateway.&lt;/p&gt;




&lt;p&gt;7.AWS Backup: Centralized Protection 🛡️&lt;/p&gt;

&lt;p&gt;Secure your AWS resources with policy-driven automation.&lt;/p&gt;

&lt;p&gt;Why It’s Essential:&lt;/p&gt;

&lt;p&gt;Manages backups for EC2, RDS, DynamoDB, and more.&lt;/p&gt;

&lt;p&gt;Simplifies compliance monitoring with activity logs.&lt;/p&gt;

&lt;p&gt;💡 Image Idea: A shield icon over a cloud, symbolizing data protection and compliance.&lt;/p&gt;




&lt;p&gt;8.Amazon Snow Family: Data Transfer Made Easy 🛻&lt;/p&gt;

&lt;p&gt;Move massive datasets to AWS using physical devices like Snowball and Snowmobile.&lt;/p&gt;

&lt;p&gt;Why Use It:&lt;/p&gt;

&lt;p&gt;Ideal for remote locations with limited connectivity.&lt;/p&gt;

&lt;p&gt;Handles petabyte-scale transfers efficiently.&lt;/p&gt;

&lt;p&gt;💡 Image Idea: A truck icon representing Snowmobile, moving data blocks to the AWS cloud.&lt;/p&gt;




&lt;p&gt;9.AWS DataSync: Fast and Efficient Transfers 🚀&lt;/p&gt;

&lt;p&gt;Move large amounts of data to and from AWS with ease.&lt;/p&gt;

&lt;p&gt;Key Advantages:&lt;/p&gt;

&lt;p&gt;Up to 10x faster than traditional tools.&lt;/p&gt;

&lt;p&gt;Ensures secure, encrypted transfers.&lt;/p&gt;

&lt;p&gt;💡 Image Idea: A speedometer graphic showing DataSync's high-speed data transfer capabilities.&lt;/p&gt;




&lt;p&gt;10.Amazon Backup for Kubernetes: Containerized Protection 🐳&lt;/p&gt;

&lt;p&gt;Protect stateful applications running on Kubernetes with AWS Backup.&lt;/p&gt;

&lt;p&gt;Top Features:&lt;/p&gt;

&lt;p&gt;Supports Amazon EKS and self-managed Kubernetes.&lt;/p&gt;

&lt;p&gt;Automates backup management with policies.&lt;/p&gt;

&lt;p&gt;💡 Image Idea: A Kubernetes cluster with backup arrows pointing to AWS storage.&lt;/p&gt;




&lt;p&gt;Why Choose AWS Storage? 🌟&lt;/p&gt;

&lt;p&gt;AWS storage services empower businesses to:&lt;/p&gt;

&lt;p&gt;Optimize costs with flexible pricing.&lt;/p&gt;

&lt;p&gt;Scale seamlessly as their data grows.&lt;/p&gt;

&lt;p&gt;Ensure security and compliance effortlessly.&lt;/p&gt;

&lt;p&gt;💬 “Data is the heart of modern applications. With AWS, you’re not just storing data; you’re future-proofing your business!”&lt;/p&gt;




&lt;p&gt;Let’s Build a Resilient Future Together 💻🌐&lt;/p&gt;

&lt;p&gt;Whether you're running cutting-edge AI workloads or managing long-term archives, AWS storage services offer unparalleled flexibility and reliability. Start your journey today and unlock endless possibilities!&lt;/p&gt;

&lt;p&gt;💡 Call-to-Action Idea: Add a "Learn More" button linking to AWS’s storage documentation or a YouTube video explaining AWS storage.&lt;/p&gt;




&lt;h1&gt;
  
  
  AWS #CloudStorage #DataManagement #Innovation #ScalableSolutions
&lt;/h1&gt;

&lt;p&gt;Let me know if you'd like to refine it further!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>cloudcomputing</category>
    </item>
    <item>
      <title>GitOps vs. DevOps: Understanding the Key Differences</title>
      <dc:creator>Mohammed Nasser</dc:creator>
      <pubDate>Wed, 27 Nov 2024 09:59:37 +0000</pubDate>
      <link>https://forem.com/mohamednasser018/gitops-vs-devops-understanding-the-key-differences-32d5</link>
      <guid>https://forem.com/mohamednasser018/gitops-vs-devops-understanding-the-key-differences-32d5</guid>
      <description>&lt;p&gt;In modern software delivery, both DevOps and GitOps have emerged as transformative methodologies. While both aim to streamline software delivery and infrastructure management, they employ distinct approaches and principles. Here’s a deeper dive into the nuances of GitOps and DevOps, their processes, and their unique value propositions.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;DevOps Pipeline&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DevOps integrates development and operations teams to improve software delivery processes. The focus is on collaboration, automation, and continuous improvement throughout the software lifecycle.&lt;/p&gt;

&lt;p&gt;1.Code Flow:&lt;/p&gt;

&lt;p&gt;Developers push code changes to a centralized repository, such as GitHub or GitLab.&lt;/p&gt;

&lt;p&gt;The code undergoes Continuous Integration (CI), which includes unit testing, building artifacts, and creating container images.&lt;/p&gt;

&lt;p&gt;2.Deployment:&lt;/p&gt;

&lt;p&gt;The generated container image is stored in a container registry (e.g., Docker Hub, Amazon ECR).&lt;/p&gt;

&lt;p&gt;Deployment to the Kubernetes cluster is manually triggered using tools like kubectl apply or automated CI/CD pipelines.&lt;/p&gt;

&lt;p&gt;The process follows a push-based model, where the pipeline actively pushes the updates into the cluster after validation.&lt;/p&gt;

&lt;p&gt;3.Characteristics:&lt;/p&gt;

&lt;p&gt;Manual Oversight: DevOps relies on engineers to initiate or approve deployments.&lt;/p&gt;

&lt;p&gt;Flexibility: Allows for immediate adjustments during deployments.&lt;/p&gt;

&lt;p&gt;Speed-Focused: Prioritizes rapid iteration and deployment cycles.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;GitOps Pipeline&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;GitOps elevates the concept of infrastructure as code (IaC) by extending Git's version control to application deployment and cluster management.&lt;/p&gt;

&lt;p&gt;1.Code and Manifest Separation:&lt;/p&gt;

&lt;p&gt;Developers push application code and update configuration manifests stored in a dedicated configuration repository.&lt;/p&gt;

&lt;p&gt;Configuration changes are reviewed and approved through Pull Requests (PRs). Once merged, the repository reflects the desired state of the system.&lt;/p&gt;

&lt;p&gt;2.Automated Sync:&lt;/p&gt;

&lt;p&gt;GitOps tools like ArgoCD, Flux, or Weaveworks continuously monitor the repository for changes.&lt;/p&gt;

&lt;p&gt;Kubernetes clusters pull these changes and reconcile the actual state with the desired state defined in the manifests.&lt;/p&gt;

&lt;p&gt;3.Characteristics:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pull-Based Deployment&lt;/strong&gt;: Clusters self-update, minimizing the need for manual intervention.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Single Source of Truth&lt;/strong&gt;: The repository ensures consistency and version control across environments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enhanced Automation&lt;/strong&gt;: Automatically maintains the cluster's state in line with the repository, reducing human error.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Key Differences Between DevOps and GitOps.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deployment Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DevOps: Push-based deployment.&lt;/p&gt;

&lt;p&gt;GitOps: Pull-based deployment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configuration Source&lt;/strong&gt;،: &lt;/p&gt;

&lt;p&gt;DevOps: Relies on pipeline configurations.&lt;/p&gt;

&lt;p&gt;GitOps: Uses the repository as the single source of truth.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Automation Level&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DevOps: Partial automation; some manual steps are required.&lt;/p&gt;

&lt;p&gt;GitOps: High automation; clusters self-update.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Human Intervention&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DevOps: Requires manual steps or approval during deployment.&lt;/p&gt;

&lt;p&gt;GitOps: Minimal intervention; focuses on automation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;State Management&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DevOps: Relies on external checks to ensure the cluster’s state.&lt;/p&gt;

&lt;p&gt;GitOps: Kubernetes reconciles the actual state with the desired state automatically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flexibility&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DevOps: Offers high flexibility with direct deployment control.&lt;/p&gt;

&lt;p&gt;GitOps: Emphasizes declarative configuration and consistency.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tool Examples&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DevOps: Jenkins, GitLab CI/CD, CircleCI.&lt;/p&gt;

&lt;p&gt;GitOps: ArgoCD, Flux, Weave GitOps.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Advantages of GitOps Over DevOps&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.Version Control for Everything: In GitOps, every change, whether for application code or infrastructure, is tracked in the Git repository. This ensures full auditability and traceability.&lt;/p&gt;

&lt;p&gt;2.Improved Reliability: GitOps reduces human error by automating synchronization between the repository and Kubernetes clusters.&lt;/p&gt;

&lt;p&gt;3.Easier Rollbacks: Rolling back to a previous state is as simple as reverting a Git commit.&lt;/p&gt;

&lt;p&gt;4.Enhanced Collaboration: With all changes managed through pull requests, teams can easily review, discuss, and approve updates.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Use Cases and Suitability&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When to Use DevOps:&lt;/p&gt;

&lt;p&gt;Teams seeking rapid iteration cycles and flexibility in deployments.&lt;/p&gt;

&lt;p&gt;Projects requiring frequent manual adjustments and experimental changes.&lt;/p&gt;

&lt;p&gt;When to Use GitOps:&lt;/p&gt;

&lt;p&gt;Environments where consistency, auditability, and compliance are critical.&lt;/p&gt;

&lt;p&gt;Large-scale Kubernetes deployments with complex configurations.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Both DevOps and GitOps are invaluable methodologies, each catering to specific needs and scenarios. DevOps emphasizes collaboration and speed, making it suitable for teams focused on rapid innovation. In contrast, GitOps takes automation and infrastructure-as-code principles to the next level, ensuring consistent and reliable deployments across environments.&lt;/p&gt;

&lt;p&gt;By understanding their differences and strengths, organizations can choose the approach that aligns best with their operational goals and development culture.&lt;/p&gt;

&lt;h1&gt;
  
  
  DevOps #GitOps #CICD #Kubernetes #Automation #InfrastructureAsCode #CloudNative #SoftwareDevelopment
&lt;/h1&gt;

</description>
      <category>devops</category>
      <category>development</category>
      <category>cloud</category>
      <category>cicd</category>
    </item>
    <item>
      <title>Your Path to Cloud Mastery: A Guide to AWS Certifications</title>
      <dc:creator>Mohammed Nasser</dc:creator>
      <pubDate>Tue, 26 Nov 2024 12:03:54 +0000</pubDate>
      <link>https://forem.com/mohamednasser018/your-path-to-cloud-mastery-a-guide-to-aws-certifications-2cbd</link>
      <guid>https://forem.com/mohamednasser018/your-path-to-cloud-mastery-a-guide-to-aws-certifications-2cbd</guid>
      <description>&lt;p&gt;AWS certifications are your gateway to mastering cloud computing and advancing your career. Each certification focuses on unique domains, allowing you to specialize in areas aligned with your goals. Here's a detailed breakdown to help you choose the right one:&lt;/p&gt;

&lt;p&gt;1.AWS Certified Cloud Practitioner&lt;/p&gt;

&lt;p&gt;Overview: Ideal for beginners, this certification covers foundational AWS services, cloud architecture, pricing models, and core cloud concepts.&lt;/p&gt;

&lt;p&gt;Use it for: Gaining a solid understanding of AWS essentials and building a strong base for your cloud journey.&lt;/p&gt;

&lt;p&gt;2.AWS Certified Solutions Architect - Associate&lt;/p&gt;

&lt;p&gt;Overview: Focuses on designing scalable and distributed systems on AWS with an emphasis on best practices.&lt;/p&gt;

&lt;p&gt;Use it for: Transitioning into a cloud architect role and mastering scalable solution design principles.&lt;/p&gt;

&lt;p&gt;3.AWS Certified Developer - Associate&lt;/p&gt;

&lt;p&gt;Overview: Geared towards developers, it emphasizes building cloud-native applications and integrating AWS services through programming.&lt;/p&gt;

&lt;p&gt;Use it for: Advancing as a cloud developer and gaining hands-on experience in application development.&lt;/p&gt;

&lt;p&gt;4.AWS Certified SysOps Administrator - Associate&lt;/p&gt;

&lt;p&gt;Overview: Focuses on efficient system operations, resource management, and monitoring within AWS environments.&lt;/p&gt;

&lt;p&gt;Use it for: Becoming a skilled system administrator and ensuring cloud environments run smoothly.&lt;/p&gt;

&lt;p&gt;5.AWS Certified DevOps Engineer - Professional&lt;/p&gt;

&lt;p&gt;Overview: Combines development and operations expertise, focusing on automation, CI/CD pipelines, and monitoring solutions.&lt;/p&gt;

&lt;p&gt;Use it for: Excelling in DevOps, mastering AWS automation tools, and fostering collaboration between teams.&lt;/p&gt;

&lt;p&gt;6.AWS Certified Solutions Architect - Professional&lt;/p&gt;

&lt;p&gt;Overview: Advanced-level certification for architects, emphasizing complex system designs, migrations, and scalability strategies.&lt;/p&gt;

&lt;p&gt;Use it for: Designing enterprise-level solutions and taking on challenging cloud architecture projects.&lt;/p&gt;

&lt;p&gt;7.AWS Certified Security - Specialty&lt;/p&gt;

&lt;p&gt;Overview: Focuses on cloud security practices, compliance, and advanced risk management techniques.&lt;/p&gt;

&lt;p&gt;Use it for: Becoming an expert in securing AWS environments and ensuring data protection.&lt;/p&gt;

&lt;p&gt;8.AWS Certified Machine Learning - Specialty&lt;/p&gt;

&lt;p&gt;Overview: Covers deploying machine learning models, data preprocessing, and using AWS AI services.&lt;/p&gt;

&lt;p&gt;Use it for: Building a career in AI and ML, leveraging AWS’s advanced tools to create intelligent solutions.&lt;/p&gt;

&lt;p&gt;9.AWS Certified Data Analytics - Specialty&lt;/p&gt;

&lt;p&gt;Overview: Specializes in analyzing big data using AWS services like Amazon Redshift, AWS Glue, and Amazon QuickSight.&lt;/p&gt;

&lt;p&gt;Use it for: Excelling in data analytics, managing large-scale data, and delivering actionable insights.&lt;/p&gt;

&lt;p&gt;Why Choose AWS Certifications?&lt;/p&gt;

&lt;p&gt;AWS certifications validate your expertise and open doors to diverse career paths in cloud computing. Whether you’re starting your journey or are an experienced professional, there’s a certification tailored to your aspirations.&lt;/p&gt;

&lt;p&gt;Start your AWS certification journey today and shape the future of your cloud career.&lt;/p&gt;

&lt;h1&gt;
  
  
  AWS #Certifications #CloudCareer #ContinuousLearning
&lt;/h1&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>cloud</category>
      <category>cicd</category>
    </item>
  </channel>
</rss>
