<?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>DEV Community: Enes Guler</title>
    <description>The latest articles on DEV Community by Enes Guler (@enesguler).</description>
    <link>https://dev.to/enesguler</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4070755%2Fd0eb9528-82f8-4d70-8f14-71913f0cfbb6.png</url>
      <title>DEV Community: Enes Guler</title>
      <link>https://dev.to/enesguler</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/enesguler"/>
    <language>en</language>
    <item>
      <title>AWS &amp; SRE Field Manual (Part 4): Amazon EBS Architecture, Volume Performance &amp; Kubernetes State</title>
      <dc:creator>Enes Guler</dc:creator>
      <pubDate>Tue, 01 Sep 2026 08:54:53 +0000</pubDate>
      <link>https://dev.to/enesguler/aws-sre-field-manual-part-4-amazon-ebs-architecture-volume-performance-kubernetes-state-4dk9</link>
      <guid>https://dev.to/enesguler/aws-sre-field-manual-part-4-amazon-ebs-architecture-volume-performance-kubernetes-state-4dk9</guid>
      <description>&lt;h2&gt;
  
  
  1. TL;DR &amp;amp; Problem Statement
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition:&lt;/strong&gt; A high-performance, persistent block-level storage service designed for use with Amazon EC2 instances and Kubernetes worker nodes. Unlike ephemeral instance store volumes, data on an EBS volume persists independently of the lifecycle of the attached compute instance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Problem Solved:&lt;/strong&gt; Provides durable, stateful block storage for databases, file systems, and enterprise applications with independent provisioning of capacity, IOPS, and throughput, backed by automated point-in-time incremental snapshots.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Category:&lt;/strong&gt; Storage / Persistent Block Storage&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Core Architecture &amp;amp; Key Components
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                     ┌──────────────────────────────────────────────┐
                     │           AWS EKS / EC2 Compute              │
                     └──────────────────────┬───────────────────────┘
                                            │
                               Storage Attachment (RWO / Multi-Attach)
                                            │
      ┌─────────────────────────────────────┴─────────────────────────────────────┐
      ▼                                                                           ▼
┌─────────────────────────────────┐                             ┌─────────────────────────────────┐
│     Amazon EBS Volume (gp3)     │                             │        EBS Snapshot Engine      │
│  Independent IOPS &amp;amp; Throughput  │                             │  Block-Level Incremental Backup │
└────────────────┬────────────────┘                             └────────────────┬────────────────┘
                 │                                                               │
                 ▼                                                               ▼
┌─────────────────────────────────┐                             ┌─────────────────────────────────┐
│ Dynamic Kubernetes PVC Binding  │                             │   Stored Durably in Amazon S3   │
└─────────────────────────────────┘                             └─────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.1. Volume Types &amp;amp; Performance Spectrum
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;General Purpose SSD (&lt;code&gt;gp3&lt;/code&gt;):&lt;/strong&gt; The modern cloud standard. Decouples storage volume capacity (GiB) from performance metrics (IOPS and throughput in MB/s), delivering a baseline of 3,000 IOPS and 125 MB/s free with every volume.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;General Purpose SSD (&lt;code&gt;gp2&lt;/code&gt; - Legacy):&lt;/strong&gt; Couples IOPS linearly to capacity (3 IOPS per GiB). Scaling performance requires over-provisioning unused disk size.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Provisioned IOPS SSD (&lt;code&gt;io2 Block Express&lt;/code&gt;):&lt;/strong&gt; Sub-millisecond latency SAN-grade storage delivering up to 256,000 IOPS, 4,000 MB/s throughput, and 99.999% durability for mission-critical database engines (Oracle, SAP HANA, Microsoft SQL Server).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2.2. EBS Multi-Attach (Clustered Storage)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Enables attaching a single Provisioned IOPS (&lt;code&gt;io2&lt;/code&gt;/&lt;code&gt;io1&lt;/code&gt;) volume concurrently to up to 16 nitro-based EC2 instances within the &lt;strong&gt;same Availability Zone&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Requires a cluster-aware file system (e.g., GFS2, OCFS2) to manage write locks and prevent data corruption.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2.3. EBS Snapshots &amp;amp; Data Durability
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Incremental Block-Level Backups:&lt;/strong&gt; Snapshots capture only the delta (modified blocks) since the previous snapshot, stored durably inside Amazon S3 across multiple Availability Zones.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Crash-Consistent vs. Application-Consistent:&lt;/strong&gt; Snapshots taken on running instances are crash-consistent; freeze I/O or flush database buffers to disk prior to snapshot creation for application consistency.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. Deep Dive Engineering &amp;amp; Architectural Comparison
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Attribute&lt;/th&gt;
&lt;th&gt;Legacy &lt;code&gt;gp2&lt;/code&gt; Volume&lt;/th&gt;
&lt;th&gt;Modern &lt;code&gt;gp3&lt;/code&gt; Volume&lt;/th&gt;
&lt;th&gt;Provisioned IOPS &lt;code&gt;io2 Block Express&lt;/code&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Baseline Performance&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Tied to capacity (3 IOPS/GiB)&lt;/td&gt;
&lt;td&gt;Fixed 3,000 IOPS &amp;amp; 125 MB/s&lt;/td&gt;
&lt;td&gt;Configured per provisioned IOPS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Performance Scaling&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Must expand disk capacity&lt;/td&gt;
&lt;td&gt;Scale IOPS up to 16,000 independently&lt;/td&gt;
&lt;td&gt;Scale up to 256,000 IOPS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Max Throughput&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;250 MB/s&lt;/td&gt;
&lt;td&gt;1,000 MB/s&lt;/td&gt;
&lt;td&gt;4,000 MB/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Durability SLA&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;99.8%–99.9%&lt;/td&gt;
&lt;td&gt;99.8%–99.9%&lt;/td&gt;
&lt;td&gt;99.999%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Multi-Attach Support&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes (Up to 16 EC2 nodes in same AZ)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cost Profile&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Expensive due to capacity bloat&lt;/td&gt;
&lt;td&gt;Up to 20% cheaper per GiB than &lt;code&gt;gp2&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Premium pricing for extreme IOPS&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  4. Advanced Integrations &amp;amp; Kubernetes Binding
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Kubernetes &lt;code&gt;volumeBindingMode: WaitForFirstConsumer&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Standard EBS volumes are &lt;strong&gt;strictly zonal&lt;/strong&gt; (locked to a specific AZ such as &lt;code&gt;us-east-1a&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;If &lt;code&gt;volumeBindingMode: Immediate&lt;/code&gt; is used, the EBS CSI driver provisions the volume in an arbitrary AZ upon PVC creation. If the pod is subsequently scheduled on a worker node in a different AZ, the pod fails to start with &lt;code&gt;FailedAttachVolume&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;WaitForFirstConsumer&lt;/code&gt; delays volume creation until the Kubernetes scheduler assigns the pod to a specific node, ensuring the EBS volume is dynamically provisioned in the exact matching AZ.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Fast Snapshot Restore (FSR) &amp;amp; Pre-Warming (Lazy Loading)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;When restoring an EBS volume from an S3 snapshot, storage blocks are pulled on-demand (&lt;strong&gt;lazy loaded&lt;/strong&gt;) upon first access, causing a temporary latency spike.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mitigation:&lt;/strong&gt; Enable &lt;strong&gt;Fast Snapshot Restore (FSR)&lt;/strong&gt; on the snapshot for instantaneous maximum performance, or execute block-level sequential reads (&lt;code&gt;fio&lt;/code&gt; or &lt;code&gt;dd&lt;/code&gt;) to pre-warm the volume before routing production traffic.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5. Practical Notes &amp;amp; Configuration Snippets
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Production Kubernetes StorageClass (&lt;code&gt;gp3&lt;/code&gt; with Delayed Binding)
&lt;/h3&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;storage.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;StorageClass&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;ebs-gp3-sc&lt;/span&gt;
&lt;span class="na"&gt;provisioner&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ebs.csi.aws.com&lt;/span&gt;
&lt;span class="na"&gt;volumeBindingMode&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;WaitForFirstConsumer&lt;/span&gt;
&lt;span class="na"&gt;allowVolumeExpansion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="na"&gt;parameters&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;gp3&lt;/span&gt;
  &lt;span class="na"&gt;iops&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;4000"&lt;/span&gt;
  &lt;span class="na"&gt;throughput&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;250"&lt;/span&gt;
  &lt;span class="na"&gt;encrypted&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;true"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Terraform: Provisioning an EBS &lt;code&gt;gp3&lt;/code&gt; Volume with Custom IOPS &amp;amp; Throughput
&lt;/h3&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_volume"&lt;/span&gt; &lt;span class="s2"&gt;"database_data"&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="s2"&gt;"us-east-1a"&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;200&lt;/span&gt; &lt;span class="c1"&gt;# 200 GiB&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;iops&lt;/span&gt;              &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;
  &lt;span class="nx"&gt;throughput&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;250&lt;/span&gt;
  &lt;span class="nx"&gt;encrypted&lt;/span&gt;         &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="nx"&gt;kms_key_id&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_kms_key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ebs_encryption_key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;arn&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;"prod-postgres-data-vol"&lt;/span&gt;
    &lt;span class="nx"&gt;Environment&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"production"&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;h3&gt;
  
  
  Volume Initialization / Pre-Warming via Linux CLI
&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;# Read all blocks sequentially from newly attached raw EBS block device&lt;/span&gt;
&lt;span class="nb"&gt;sudo dd &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/dev/xvdf &lt;span class="nv"&gt;of&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/dev/null &lt;span class="nv"&gt;bs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1M &lt;span class="nv"&gt;status&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;progress
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  6. Gotchas &amp;amp; Common Pitfalls
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cross-AZ Attachment Impossibility:&lt;/strong&gt; EBS volumes cannot attach across Availability Zone boundaries. Stateful workloads requiring multi-AZ concurrent file sharing must use &lt;strong&gt;Amazon EFS&lt;/strong&gt; (NFS) or &lt;strong&gt;Amazon FSx&lt;/strong&gt; rather than EBS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic Volume Expansion Limits:&lt;/strong&gt; While AWS allows online expansion of EBS volume size without downtime, reducing the size of an EBS volume is &lt;strong&gt;not supported&lt;/strong&gt; by the AWS API. To shrink a disk, you must provision a smaller volume and copy filesystems over.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Volume Modification Rate Limits:&lt;/strong&gt; AWS enforces a mandatory &lt;strong&gt;6-hour cooldown period&lt;/strong&gt; between modifications (size, IOPS, throughput) on a single EBS volume.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  7. Production Best Practices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Always Migrate Legacy &lt;code&gt;gp2&lt;/code&gt; to &lt;code&gt;gp3&lt;/code&gt;:&lt;/strong&gt; Migrating volumes from &lt;code&gt;gp2&lt;/code&gt; to &lt;code&gt;gp3&lt;/code&gt; is a live, zero-downtime operation using the &lt;code&gt;ModifyVolume&lt;/code&gt; API. It instantly yields a 20% baseline cost reduction while decoupling IOPS scaling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enforce Account-Level EBS Encryption by Default:&lt;/strong&gt; Enable the account-level setting &lt;code&gt;EnableEbsEncryptionByDefault&lt;/code&gt; across all AWS regions to guarantee that unencrypted block storage cannot be accidentally provisioned via CLI, Console, or CI/CD pipelines.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS Data Lifecycle Manager (DLM) for Automated Backups:&lt;/strong&gt; Use Amazon Data Lifecycle Manager to automate snapshot creation schedules, cross-region replication for disaster recovery (DR), and automated retention cleanup policies without writing custom Lambda cron scripts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitor &lt;code&gt;VolumeQueueLength&lt;/code&gt; &amp;amp; &lt;code&gt;VolumeThroughputPercentage&lt;/code&gt;:&lt;/strong&gt; Use CloudWatch metrics to detect storage bottlenecks. A continuously elevated &lt;code&gt;VolumeQueueLength&lt;/code&gt; indicates that application I/O requests are queuing due to exhausted IOPS limits.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>kubernetes</category>
      <category>cloud</category>
    </item>
    <item>
      <title>AWS &amp; SRE Field Manual (Part 3): Amazon EC2 Architecture, Hardware Strategy &amp; Modern Autoscaling</title>
      <dc:creator>Enes Guler</dc:creator>
      <pubDate>Mon, 31 Aug 2026 07:00:20 +0000</pubDate>
      <link>https://dev.to/enesguler/aws-sre-field-manual-part-3-amazon-ec2-architecture-hardware-strategy-modern-autoscaling-1om4</link>
      <guid>https://dev.to/enesguler/aws-sre-field-manual-part-3-amazon-ec2-architecture-hardware-strategy-modern-autoscaling-1om4</guid>
      <description>&lt;h2&gt;
  
  
  1. TL;DR &amp;amp; Problem Statement
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition:&lt;/strong&gt; A core cloud compute service providing resizable, secure, and on-demand virtual machines (instances) with customizable hardware architectures, CPU/memory ratios, and operating systems.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Problem Solved:&lt;/strong&gt; Eliminates physical server procurement lead times (weeks to months), datacenter maintenance overhead, and capacity planning risks by enabling instant provisioning of scalable infrastructure for containerized workloads, databases, and application backends.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Category:&lt;/strong&gt; Compute / Infrastructure-as-a-Service (IaaS)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Core Architecture &amp;amp; Key Components
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                                  ┌───────────────────────────────────────────┐
                                  │            Amazon EC2 Security            │
                                  │           Stateful Firewalls              │
                                  └─────────────────────┬─────────────────────┘
                                                        │
                                                        ▼
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                       Workload Optimization Spectrum                                        │
│                                                                                                             │
│  ┌───────────────────────┐   ┌───────────────────────┐   ┌───────────────────────┐   ┌───────────────────┐  │
│  │ General Purpose (T/M) │   │ Compute Optimized (C) │   │ Memory Optimized (R)  │   │  GPU / AI (G/P)   │  │
│  │ Burstable / Balanced  │   │ High CPU / Analytics  │   │ In-Memory / Redis     │   │ Machine Learning  │  │
│  └───────────────────────┘   └───────────────────────┘   └───────────────────────┘   └───────────────────┘  │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.1. Instance Families &amp;amp; Workload Mapping
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;General Purpose (T &amp;amp; M Series):&lt;/strong&gt; Delivers balanced compute, memory, and networking resources. Ideal for web servers, microservices, and development environments.

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;T-Series Burstable Capacity:&lt;/em&gt; Operates on a &lt;strong&gt;CPU Credit&lt;/strong&gt; model. Instances accumulate credits during idle periods and burst to full CPU capacity when traffic spikes occur, providing a cost-effective compute base for baseline workloads.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compute Optimized (C Series):&lt;/strong&gt; Engineered for high-performance processors. Tailored for compute-intensive applications such as batch processing, media encoding, high-traffic web APIs, and scientific modeling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory Optimized (R Series):&lt;/strong&gt; Provides high RAM-to-vCPU ratios. Designed to handle memory-heavy workloads, including in-memory caches (Redis, Valkey, Memcached), large-scale data processing pipelines (Pandas/Spark), and enterprise relational databases.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accelerated Computing / GPU (G &amp;amp; P Series):&lt;/strong&gt; Equipped with high-performance hardware graphics processors (NVIDIA GPUs). Essential for deep learning model training, generative AI inference, high-end rendering, and complex parallel matrix calculations.

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Kubernetes Connection:&lt;/em&gt; In EKS clusters, G/P series instances are assigned Taints (e.g., &lt;code&gt;gpu-workload=true:NoSchedule&lt;/code&gt;) to isolate them, ensuring only dedicated machine learning pods with matching Tolerations deploy onto expensive GPU nodes.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2.2. Purchasing Models &amp;amp; Cost Engineering Strategies
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;On-Demand Instances:&lt;/strong&gt; Billed by the second with zero long-term commitments or upfront costs. This is the most expensive purchasing model, intended primarily for short-term testing, dynamic unpredictable spikes, and initial environment setups.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Savings Plans &amp;amp; Reserved Instances (RI):&lt;/strong&gt; Committing to run a specific instance profile or consistent compute usage over a 1-year or 3-year term yields discounts ranging from 30% to 72% compared to On-Demand rates. Ideal for baseline production workloads and database clusters that run non-stop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spot Instances:&lt;/strong&gt; Allows purchasing spare AWS compute capacity at steep discounts (up to 90% off On-Demand pricing).

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;The Interruption Risk:&lt;/em&gt; If AWS requires the capacity back for On-Demand customers, it issues a &lt;strong&gt;2-minute warning notification&lt;/strong&gt; (Spot Interruption Notice) before forcibly terminating the Spot instance.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Kubernetes Node Strategy:&lt;/em&gt; Stateless web microservices running in Amazon EKS can be deployed onto Spot instance node groups. When AWS reclaims a Spot node, the EKS control plane uses the 2-minute notice window to gracefully drain node connections (&lt;code&gt;kubectl drain&lt;/code&gt;) and reschedule pods onto remaining healthy nodes, dramatically lowering compute overhead.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2.3. Placement Groups (Physical Placement Strategies)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cluster:&lt;/strong&gt; Places instances physically close together inside a single Availability Zone to achieve ultra-low network latency and high packet-per-second throughput (ideal for HPC and distributed ML model training).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spread:&lt;/strong&gt; Strictly places each instance across distinct physical hardware racks with independent power and network paths to minimize correlated hardware failure risks for critical single-node instances.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Partition:&lt;/strong&gt; Divides groups of instances into logical partitions across distinct hardware racks, ensuring that large distributed systems (Kafka, Cassandra, HDFS) do not share common rack failures.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2.4. EBS-Optimized &amp;amp; Enhanced Networking (ENA)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;EBS-Optimized Instances:&lt;/strong&gt; Allocates dedicated, isolated network bandwidth strictly for EBS block storage I/O, preventing storage traffic from competing with general application networking.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enhanced Networking (ENA):&lt;/strong&gt; Uses SR-IOV (Single Root I/O Virtualization) to bypass the hypervisor layer, minimizing CPU utilization and providing up to 100+ Gbps network bandwidth with ultra-low jitter.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. Network Security: Security Groups vs. Network ACLs
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Incoming Request (Port 8080)
                             │
                             ▼
              ┌─────────────────────────────┐
              │    EC2 Security Group       │
              │  (Implicit Default Deny)    │
              └──────────────┬──────────────┘
                             │  Matched Ingress Rule?
                             ├─── No  ──► [Dropped / Blocked]
                             │
                             └─── Yes ──► [Allowed to Instance]
                                              │
                                              ▼
                                 Auto-Allowed Return Traffic
                                   (Stateful Mechanism)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Security Groups (Virtual Firewall):&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Operates at the virtual network interface (ENI) and instance level.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Implicit Default Deny:&lt;/strong&gt; By default, all incoming traffic is blocked until explicit ingress rules are defined.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stateful Mechanism:&lt;/strong&gt; Connection tracking is fully stateful. If an inbound request is permitted by an ingress rule, the corresponding outbound response traffic is automatically allowed out of the instance, regardless of outbound/egress rules.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network ACLs (NACLs):&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Operates at the subnet boundary level.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stateless Mechanism:&lt;/strong&gt; Rules are evaluated sequentially (by rule number) and are completely stateless, requiring explicit allow rules in both inbound and outbound directions (including ephemeral port ranges for return traffic).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. Practical Notes &amp;amp; Configuration Snippets
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Secure Metadata and Token Retrieval via IMDSv2
&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;# Step 1: Request a short-lived session token (TTL: 21600 seconds)&lt;/span&gt;
&lt;span class="nv"&gt;TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-X&lt;/span&gt; PUT &lt;span class="s2"&gt;"[http://169.254.169.254/latest/api/token](http://169.254.169.254/latest/api/token)"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"X-aws-ec2-metadata-token-ttl-seconds: 21600"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;# Step 2: Fetch instance role credentials securely using the token&lt;/span&gt;
curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"X-aws-ec2-metadata-token: &lt;/span&gt;&lt;span class="nv"&gt;$TOKEN&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="o"&gt;[&lt;/span&gt;http://169.254.169.254/latest/meta-data/iam/security-credentials/]&lt;span class="o"&gt;(&lt;/span&gt;http://169.254.169.254/latest/meta-data/iam/security-credentials/&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Karpenter NodePool Manifest (Modern Spot and On-Demand Node Autoscaling)
&lt;/h3&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;karpenter.sh/v1beta1&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;NodePool&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;dynamic-spot-pool&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;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;requirements&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;karpenter.sh/capacity-type"&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="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;spot"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;on-demand"&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;karpenter.k8s.aws/instance-category"&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="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;c"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;m"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;r"&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;kubernetes.io/arch"&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="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;amd64"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;arm64"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
      &lt;span class="na"&gt;nodeClassRef&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;default-ec2-node-class&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="m"&gt;1000&lt;/span&gt;
    &lt;span class="na"&gt;memory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;1000Gi&lt;/span&gt;
  &lt;span class="na"&gt;disruption&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;consolidationPolicy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;WhenUnderutilized&lt;/span&gt;
    &lt;span class="na"&gt;expireAfter&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;720h&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  5. Gotchas &amp;amp; Common Pitfalls
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;IMDSv1 Vulnerability &amp;amp; SSRF Exploits:&lt;/strong&gt; IMDSv1 responds to unauthenticated, simple HTTP GET requests. If an application hosted on the instance contains a Server-Side Request Forgery (SSRF) vulnerability, attackers can fetch &lt;code&gt;http://169.254.169.254&lt;/code&gt; to steal the temporary IAM role credentials assigned to the EC2 instance. Enforce IMDSv2 (&lt;code&gt;HttpTokens=required&lt;/code&gt;) across all launch templates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;T-Series CPU Credit Depletion Throttling:&lt;/strong&gt; When a burstable T-series instance exhausts its CPU credit balance, AWS forcefully throttles CPU execution down to the baseline performance limit (e.g., 10-20% CPU utilization). In production, either migrate to dedicated M or C series instances or enable &lt;strong&gt;T Unlimited&lt;/strong&gt; mode to prevent complete service lockups.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stop vs. Terminate Cost Dynamics:&lt;/strong&gt; Stopping an EC2 instance halts vCPU and RAM compute charges immediately; however, all attached Amazon EBS storage volumes, provisioned IOPS, and allocated Elastic IPs continue to generate ongoing billing costs until explicitly released or terminated.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  6. Production Best Practices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Eliminate Inbound SSH (AWS Systems Manager Session Manager):&lt;/strong&gt; Close inbound port 22 in all Security Groups and remove local &lt;code&gt;.pem&lt;/code&gt; key pairs. Use AWS SSM Session Manager to connect to instances via encrypted IAM-authenticated sessions, logging all terminal activity to CloudTrail and Amazon S3.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Adopt AWS Graviton (ARM64) Instances:&lt;/strong&gt; Migrate x86 workloads to ARM64 Graviton instances (&lt;code&gt;c7g&lt;/code&gt;, &lt;code&gt;m7g&lt;/code&gt;, &lt;code&gt;r7g&lt;/code&gt;) to reduce direct instance costs by 20% while gaining up to 40% higher price-performance efficiency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deploy Karpenter over Legacy Cluster Autoscaler:&lt;/strong&gt; Rather than relying on static Auto Scaling Groups that require predefined instance sizes, deploy Karpenter to inspect pending pod specs directly and provision exact-fit Spot/On-Demand instance fleets within seconds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configure Automated EC2 Instance Recovery:&lt;/strong&gt; Set up a CloudWatch Alarm monitoring the &lt;code&gt;StatusCheckFailed_System&lt;/code&gt; metric with an attached &lt;strong&gt;EC2 Auto-Recovery Action&lt;/strong&gt;. If the underlying physical hardware hypervisor crashes, AWS automatically reboots and migrates the instance to a healthy physical host while retaining the same instance ID, IP address, and EBS state.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>kubernetes</category>
      <category>linux</category>
    </item>
    <item>
      <title>AWS &amp; SRE Field Manual (Part 2): Application (ALB) vs. Network (NLB) Load Balancing Architecture</title>
      <dc:creator>Enes Guler</dc:creator>
      <pubDate>Sun, 30 Aug 2026 09:02:10 +0000</pubDate>
      <link>https://dev.to/enesguler/aws-sre-field-manual-part-2-application-alb-vs-network-nlb-load-balancing-architecture-59i6</link>
      <guid>https://dev.to/enesguler/aws-sre-field-manual-part-2-application-alb-vs-network-nlb-load-balancing-architecture-59i6</guid>
      <description>&lt;h2&gt;
  
  
  1. TL;DR &amp;amp; Problem Statement
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition:&lt;/strong&gt; A fully managed, highly available traffic distribution service that automatically routes incoming application and network traffic across multiple targets (Amazon EC2 instances, EKS Pods, AWS Lambda functions, and IP addresses) across multiple Availability Zones.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Problem Solved:&lt;/strong&gt; Eliminates single-point-of-failure bottlenecks, handles automated health checks, offloads cryptographic TLS termination, and provides scalable ingress routing mechanisms for cloud-native microservices and high-throughput TCP/UDP streams.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Category:&lt;/strong&gt; Networking &amp;amp; Content Delivery / Ingress Architecture&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Core Architecture &amp;amp; Key Components
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                                Incoming Client Traffic
                                           │
           ┌───────────────────────────────┴───────────────────────────────┐
           ▼                                                               ▼
┌─────────────────────────────────────────┐             ┌─────────────────────────────────────────┐
│ Layer 7: Application Load Balancer (ALB)│             │  Layer 4: Network Load Balancer (NLB)   │
├─────────────────────────────────────────┤             ├─────────────────────────────────────────┤
│ • Inspects HTTP/HTTPS Headers &amp;amp; Paths   │             │ • Operates strictly at TCP/UDP/TLS      │
│ • Path-Based &amp;amp; Host-Based Routing       │             │ • Non-Inspecting Packet Forwarding      │
│ • SSL Termination &amp;amp; Sticky Sessions     │             │ • Ultra-Low Latency (Sub-millisecond)   │
└────────────────────┬────────────────────┘             └────────────────────┬────────────────────┘
                     │                                                       │
        HTTP / HTTPS Ingress                                    Raw TCP/UDP Stream
                     │                                                       │
        ┌────────────┴────────────┐                                          │
        ▼                         ▼                                          ▼
┌──────────────┐          ┌──────────────┐                        ┌────────────────────┐
│ API Pods     │          │ Frontend Pods│                        │ Ingress Controller │
│ (/api/*)     │          │ (/static/*)  │                        │ / Kafka / Games    │
└──────────────┘          └──────────────┘                        └────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.1. Application Load Balancer (ALB — OSI Layer 7)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Deep Packet Inspection:&lt;/strong&gt; Evaluates application-layer headers, hostnames, HTTP methods, query parameters, and URL paths.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content-Based Routing:&lt;/strong&gt; Routes traffic intelligently across multiple Target Groups (e.g., &lt;code&gt;/api/*&lt;/code&gt; to backend microservices, &lt;code&gt;/static/*&lt;/code&gt; to object caches or static web pods).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Modern Protocol Support:&lt;/strong&gt; Natively supports HTTP/2, gRPC, and WebSockets alongside automated HTTP-to-HTTPS redirect rules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sticky Sessions (Cookie Affinity):&lt;/strong&gt; Binds subsequent requests from a specific client to the same backend target instance/pod using encrypted cookies when state is not externalized.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2.2. Network Load Balancer (NLB — OSI Layer 4)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Raw Transport Passthrough:&lt;/strong&gt; Operates at the transport layer, routing raw TCP, UDP, and TLS connections based exclusively on IP addresses and ports without payload inspection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ultra-Low Latency:&lt;/strong&gt; Delivers sub-millisecond connection handling directly in the data path.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instantaneous Burst Capacity:&lt;/strong&gt; Capable of handling millions of requests per second (RPS) and absorbing sudden, massive traffic spikes without requiring manual pre-warming tickets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Static &amp;amp; Elastic IPs:&lt;/strong&gt; Provides one static public IP per Availability Zone, making it ideal for client firewalls requiring strict IP whitelisting.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. Deep Dive Engineering &amp;amp; Architectural Comparison
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature / Metric&lt;/th&gt;
&lt;th&gt;Application Load Balancer (ALB)&lt;/th&gt;
&lt;th&gt;Network Load Balancer (NLB)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;OSI Layer&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Layer 7 (Application)&lt;/td&gt;
&lt;td&gt;Layer 4 (Transport)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Protocols&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;HTTP, HTTPS, HTTP/2, gRPC, WebSockets&lt;/td&gt;
&lt;td&gt;TCP, UDP, TLS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Routing Decisions&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;URL path, Host header, Query params, HTTP method&lt;/td&gt;
&lt;td&gt;Source/Destination IP and Port&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Latency Profile&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Milliseconds (2-10 ms)&lt;/td&gt;
&lt;td&gt;Sub-millisecond (&amp;lt; 1 ms)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Traffic Spikes&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Scales elastically via DNS over minutes&lt;/td&gt;
&lt;td&gt;Instantaneous line-rate scaling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Static IP Support&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Dynamic DNS resolution (CNAME required)&lt;/td&gt;
&lt;td&gt;Static Elastic IP per Availability Zone&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Client IP Identification&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Injects &lt;code&gt;X-Forwarded-For&lt;/code&gt; HTTP header&lt;/td&gt;
&lt;td&gt;Client IP Preservation / Proxy Protocol v2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Primary Use Cases&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Microservices routing, REST/gRPC APIs, Web apps&lt;/td&gt;
&lt;td&gt;High-throughput streaming, Kafka, Game servers, K8s Ingress Entry&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  4. Advanced Integrations &amp;amp; Ingress Mechanics
&lt;/h2&gt;

&lt;h3&gt;
  
  
  AWS Load Balancer Controller (Instance Mode vs. IP Mode)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Instance Mode (&lt;code&gt;target-type: instance&lt;/code&gt;):&lt;/strong&gt; Routes traffic to EC2 host NodePorts. Requires an internal network hop through &lt;code&gt;kube-proxy&lt;/code&gt; and &lt;code&gt;iptables&lt;/code&gt;/IPVS, adding latency and SNAT overhead.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IP Mode (&lt;code&gt;target-type: ip&lt;/code&gt;):&lt;/strong&gt; Leverages the AWS VPC CNI to route ingress traffic directly from the ALB/NLB to the individual Kubernetes Pod IP. Bypasses &lt;code&gt;kube-proxy&lt;/code&gt; entirely, reducing latency and packet manipulation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Preserving Real Client IP
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ALB:&lt;/strong&gt; Appends the originating client IP to the &lt;code&gt;X-Forwarded-For&lt;/code&gt; and &lt;code&gt;X-Forwarded-Proto&lt;/code&gt; request headers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NLB:&lt;/strong&gt; Because Layer 4 cannot modify HTTP headers, real client IPs are preserved via native &lt;strong&gt;Client IP Preservation&lt;/strong&gt; or by enabling &lt;strong&gt;Proxy Protocol v2&lt;/strong&gt; (prepends a binary connection header).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Deregistration Delay (Connection Draining)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Prevents inflight HTTP requests from dropping (502 Bad Gateway) when a backend instance or Kubernetes pod is marked for termination.&lt;/li&gt;
&lt;li&gt;The load balancer stops sending new connections to the deregistering target and waits for active transactions to complete within &lt;code&gt;deregistration_delay.timeout_seconds&lt;/code&gt; (default: 300s, typically tuned to 15–30s in Kubernetes).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Cross-Zone Load Balancing
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Enabled by default on ALB; optional on NLB.&lt;/li&gt;
&lt;li&gt;Evenly distributes traffic across all registered targets in all enabled Availability Zones regardless of which AZ received the initial network packet, eliminating uneven target group saturation.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5. Practical Notes &amp;amp; Configuration Snippets
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Kubernetes Ingress Manifest (ALB in IP Mode with SSL Redirect)
&lt;/h3&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;networking.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;Ingress&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;api-ingress&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;production&lt;/span&gt;
  &lt;span class="na"&gt;annotations&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;kubernetes.io/ingress.class&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;alb&lt;/span&gt;
    &lt;span class="na"&gt;alb.ingress.kubernetes.io/scheme&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;internet-facing&lt;/span&gt;
    &lt;span class="na"&gt;alb.ingress.kubernetes.io/target-type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ip&lt;/span&gt;
    &lt;span class="na"&gt;alb.ingress.kubernetes.io/listen-ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;[{"HTTP":&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;80},&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;{"HTTPS":&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;443}]'&lt;/span&gt;
    &lt;span class="na"&gt;alb.ingress.kubernetes.io/ssl-redirect&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;443'&lt;/span&gt;
    &lt;span class="na"&gt;alb.ingress.kubernetes.io/certificate-arn&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;arn:aws:acm:us-east-1:123456789012:certificate/abc-123&lt;/span&gt;
    &lt;span class="na"&gt;alb.ingress.kubernetes.io/target-group-attributes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;deregistration_delay.timeout_seconds=20&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;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;host&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;api.example.com&lt;/span&gt;
      &lt;span class="na"&gt;http&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;path&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;pathType&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Prefix&lt;/span&gt;
            &lt;span class="na"&gt;backend&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;api-service&lt;/span&gt;
                &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                  &lt;span class="na"&gt;number&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;8080&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Terraform: Network Load Balancer with Cross-Zone Load Balancing
&lt;/h3&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_lb"&lt;/span&gt; &lt;span class="s2"&gt;"network_lb"&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;"prod-streaming-nlb"&lt;/span&gt;
  &lt;span class="nx"&gt;internal&lt;/span&gt;                         &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="nx"&gt;load_balancer_type&lt;/span&gt;               &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"network"&lt;/span&gt;
  &lt;span class="nx"&gt;subnets&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;public_subnet_ids&lt;/span&gt;
  &lt;span class="nx"&gt;enable_cross_zone_load_balancing&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="nx"&gt;enable_deletion_protection&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&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_lb_target_group"&lt;/span&gt; &lt;span class="s2"&gt;"nlb_tg"&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;"tcp-stream-tg"&lt;/span&gt;
  &lt;span class="nx"&gt;port&lt;/span&gt;        &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;9092&lt;/span&gt;
  &lt;span class="nx"&gt;protocol&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"TCP"&lt;/span&gt;
  &lt;span class="nx"&gt;vpc_id&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;vpc_id&lt;/span&gt;
  &lt;span class="nx"&gt;target_type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"ip"&lt;/span&gt;

  &lt;span class="nx"&gt;proxy_protocol_v2&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="c1"&gt;# Enables Proxy Protocol v2 for client IP pass-through&lt;/span&gt;

  &lt;span class="nx"&gt;health_check&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;protocol&lt;/span&gt;            &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"TCP"&lt;/span&gt;
    &lt;span class="nx"&gt;port&lt;/span&gt;                &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"9092"&lt;/span&gt;
    &lt;span class="nx"&gt;interval&lt;/span&gt;            &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
    &lt;span class="nx"&gt;healthy_threshold&lt;/span&gt;   &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
    &lt;span class="nx"&gt;unhealthy_threshold&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&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;
  
  
  6. Gotchas &amp;amp; Common Pitfalls
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Subnet Capacity &amp;amp; IP Exhaustion:&lt;/strong&gt; Each ALB node placed in a public subnet dynamically scales and consumes multiple private IP addresses within that subnet. If your public subnet CIDR is too narrow (e.g., &lt;code&gt;/28&lt;/code&gt;), ALB scale-out events will fail under heavy traffic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Misconfigured Security Group on NLB:&lt;/strong&gt; By default, NLBs historically did not have associated Security Groups; firewalling occurred strictly at the backend instance level. While security groups on NLBs are now supported, failing to allow client ingress on the backend node security group when using client IP preservation will cause silent packet drops.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Target Group Health Check Latency:&lt;/strong&gt; If health check intervals and thresholds are set too conservatively (e.g., 30s interval, 5 unhealthy thresholds), dead or hung pods will receive live user traffic for over 2 minutes before the load balancer drops them from the target rotation.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  7. Production Best Practices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AWS WAF Integration on ALB:&lt;/strong&gt; Always attach an AWS WAF (Web Application Firewall) WebACL to public-facing ALBs to block common OWASP Top 10 vulnerabilities, SQL injection, cross-site scripting (XSS), and rate-limit abusive IP addresses at the cloud edge.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Access Logs to Amazon S3:&lt;/strong&gt; Enable access logging on both ALB and NLB. Load balancers stream structured access logs (client IP, request processing latency, TLS ciphers, backend response codes) directly to an S3 bucket with lifecycle rules for compliance and security forensics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Match Ingress Controller Pod Disruption Budgets (PDB):&lt;/strong&gt; Ensure the &lt;code&gt;deregistration_delay&lt;/code&gt; on the AWS Load Balancer matches the &lt;code&gt;terminationGracePeriodSeconds&lt;/code&gt; and &lt;code&gt;preStop&lt;/code&gt; sleep hook of your Kubernetes pods to guarantee zero-downtime rolling deployments.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>kubernetes</category>
      <category>sre</category>
    </item>
    <item>
      <title>AWS &amp; SRE Field Manual (Part 1): Zero-Trust Identity &amp; Access Management (IAM)</title>
      <dc:creator>Enes Guler</dc:creator>
      <pubDate>Sat, 29 Aug 2026 08:53:29 +0000</pubDate>
      <link>https://dev.to/enesguler/aws-sre-field-manual-part-1-zero-trust-identity-access-management-iam-9c4</link>
      <guid>https://dev.to/enesguler/aws-sre-field-manual-part-1-zero-trust-identity-access-management-iam-9c4</guid>
      <description>&lt;h2&gt;
  
  
  📌 TL;DR &amp;amp; Problem Statement
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition:&lt;/strong&gt; The centralized security control plane that manages authentication and authorization across all AWS cloud resources. It serves as the native AWS equivalent of Kubernetes RBAC.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Problem Solved:&lt;/strong&gt; Secures access to infrastructure resources using centralized, auditable, fine-grained, and temporary security credentials instead of distributed, static passwords and access keys.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Category:&lt;/strong&gt; Security, Identity, &amp;amp; Compliance&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Core Rule (Implicit Default Deny):&lt;/strong&gt; All API requests across AWS are strictly denied by default unless explicitly granted by a matching Allow statement.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🏛️ Core Architecture &amp;amp; Key Components
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. IAM Users (Human Identities &amp;amp; Static Credentials)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Represents discrete individuals interacting with AWS.&lt;/li&gt;
&lt;li&gt;Access is provided via console password with mandatory Multi-Factor Authentication (MFA), or programmatic access via static AccessKeyId and SecretAccessKey pairs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Root Account:&lt;/strong&gt; The initial, all-powerful identity created upon account registration. It must be locked behind hardware/virtual MFA immediately, stripped of static access keys, and reserved exclusively for emergency break-glass procedures.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. IAM Groups (Role-Based Membership)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Logical collections of users sharing identical permission requirements (e.g., DevOps-Admins, Data-Engineers).&lt;/li&gt;
&lt;li&gt;Attaching permissions directly to individual users is an anti-pattern; policies attach to groups, and users inherit privileges through group membership.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. IAM Roles &amp;amp; AWS STS (Temporary Credentials &amp;amp; Workload Identity)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;An identity abstraction without permanent passwords or static keys, assumed dynamically via the sts:AssumeRole API.&lt;/li&gt;
&lt;li&gt;Mirrors the mechanics of Kubernetes ServiceAccounts and EKS IRSA / Pod Identities. Workloads (EC2 instances, Lambda functions, ECS/EKS pods) obtain short-lived, self-expiring tokens generated by the AWS Security Token Service (STS).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blast Radius Reduction:&lt;/strong&gt; Even if a compute instance or container is compromised, the leaked STS token expires within minutes to hours, preventing long-term credential exfiltration.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. IAM Policies (Declarative Permission Documents)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Structured JSON documents defining who can execute specific actions against target resources under designated conditions:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Effect:&lt;/strong&gt; Explicit Allow or Deny (an Explicit Deny unconditionally overrides any Allow).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Action:&lt;/strong&gt; Targeted API operations (e.g., s3:GetObject, ec2:DescribeInstances).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resource:&lt;/strong&gt; The target Amazon Resource Name (ARN) governed by the statement (e.g., arn:aws:s3:::production-app-bucket/*).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Condition:&lt;/strong&gt; Contextual prerequisites required to satisfy the policy (source IP ranges, MFA enforcement, secure transport, resource/principal tags).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⚙️ Deep Dive Engineering &amp;amp; Authorization Mechanisms
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Policy Evaluation Logic (Order of Precedence)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Incoming API Request
        │
        ▼
[ Is there an Explicit Deny? ] ─────── YES ────► [ Access Denied ]
        │
        NO
        ▼
[ Does SCP allow it? ] ─────────────── NO  ────► [ Access Denied ]
        │
       YES
        ▼
[ Does Resource Policy allow it? ] ─── YES ──┐
        │                                    │
        NO                                   │
        ▼                                    │
[ Does Identity Policy allow it? ] ─── YES ──┼──► [ Check Boundaries/Session ] ──► [ Access Granted ]
        │                                    │
        NO                                   │
        ▼                                    │
 [ Access Denied (Implicit Deny) ] ◄─────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Is there an &lt;strong&gt;Explicit Deny&lt;/strong&gt; anywhere in the evaluation chain? (If yes, immediate termination and rejection).&lt;/li&gt;
&lt;li&gt;Does an &lt;strong&gt;AWS Organizations Service Control Policy (SCP)&lt;/strong&gt; permit the request?&lt;/li&gt;
&lt;li&gt;Does a &lt;strong&gt;Resource-based Policy&lt;/strong&gt; (e.g., S3 Bucket Policy, KMS Key Policy) allow the action?&lt;/li&gt;
&lt;li&gt;Does an &lt;strong&gt;Identity-based Policy&lt;/strong&gt; (IAM Policy attached to the principal) allow the action?&lt;/li&gt;
&lt;li&gt;Does the request fall within the ceiling defined by &lt;strong&gt;Permissions Boundaries&lt;/strong&gt; and &lt;strong&gt;Session Policies&lt;/strong&gt;?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Outcome:&lt;/strong&gt; If any evaluation point yields an Explicit Deny, or if no policy grants an explicit Allow, the request is dropped (&lt;strong&gt;Implicit Deny&lt;/strong&gt;).&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  IAM Permissions Boundaries
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Defines the maximum permission ceiling for an IAM entity.&lt;/li&gt;
&lt;li&gt;Enables delegating policy creation to development teams without risking privilege escalation. Even if a developer creates a new role with AdministratorAccess, the effective permissions will never exceed the attached Permissions Boundary (e.g., S3FullAccessBoundary).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Attribute-Based Access Control (ABAC) &amp;amp; Session Tags
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Grants dynamic access based on matching metadata tags rather than maintaining complex, static JSON policies per user.&lt;/li&gt;
&lt;li&gt;A single generic policy allows access if the principal's department or project tag matches the target resource tag (aws:ResourceTag/Project == aws:PrincipalTag/Project).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Cross-Account Access &amp;amp; ExternalID (Confused Deputy Protection)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;When delegating role access to third-party SaaS vendors (e.g., Datadog, Databricks), requiring an sts:ExternalId condition inside the Role Trust Policy is mandatory.&lt;/li&gt;
&lt;li&gt;Prevents the Confused Deputy attack vector, where an adversary manipulates the third-party platform into assuming another customer's role inside your AWS account.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💻 Practical Notes &amp;amp; Configuration Snippets
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Attribute-Based Access Control (ABAC) Policy (Tag-Match Enforcement)
&lt;/h3&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;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&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="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Action"&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="s2"&gt;"ec2:StartInstances"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"ec2:StopInstances"&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;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:ec2:*:*:instance/*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"Condition"&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;"StringEquals"&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;"aws:ResourceTag/Project"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"${aws:PrincipalTag/Project}"&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;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;
  
  
  Essential AWS CLI Commands for IAM &amp;amp; STS
&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;# Check current caller identity and active ARN&lt;/span&gt;
aws sts get-caller-identity

&lt;span class="c"&gt;# Assume an IAM Role manually (returns temporary credentials)&lt;/span&gt;
aws sts assume-role &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--role-arn&lt;/span&gt; &lt;span class="s2"&gt;"arn:aws:iam::123456789012:role/DevOpsAdminRole"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--role-session-name&lt;/span&gt; &lt;span class="s2"&gt;"CLI-Session"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--external-id&lt;/span&gt; &lt;span class="s2"&gt;"UniqueSecretId123"&lt;/span&gt;

&lt;span class="c"&gt;# List IAM policies attached to a specific group&lt;/span&gt;
aws iam list-attached-group-policies &lt;span class="nt"&gt;--group-name&lt;/span&gt; &lt;span class="s2"&gt;"Engineering-Team"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  ⚠️ Gotchas &amp;amp; Common Pitfalls
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Eventual Consistency in IAM APIs:&lt;/strong&gt; IAM is a globally distributed control plane. Changes to policies, roles, or group memberships take several seconds to propagate across all AWS edge endpoints worldwide. Automation scripts and CI/CD pipelines must incorporate exponential backoff or brief delay retries immediately following IAM resource provisioning.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Identity-Based vs. Resource-Based Policy Overlaps:&lt;/strong&gt; An Identity-based policy is a credential held by the caller; a Resource-based policy (e.g., S3 Bucket Policy, SQS Policy) is an access control list on the target resource. Within the same AWS account, if a resource-based policy grants explicit access, the caller can execute the action even without an attached identity-based IAM policy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wildcard (*) Operator Abuse:&lt;/strong&gt; Using Action: "&lt;em&gt;" and Resource: "&lt;/em&gt;" violates the Principle of Least Privilege and represents the primary security vulnerability identified during compliance audits.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 Production Best Practices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Enforce IMDSv2 Globally:&lt;/strong&gt; Prevent SSRF-driven IAM token leakage from compute nodes by enforcing IMDSv2 (HttpTokens=required, HttpPutResponseHopLimit=1) across all EC2 launch templates and running instances.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automate IAM Access Analyzer:&lt;/strong&gt; Enable IAM Access Analyzer across the organization to automatically flag external, cross-account, and public access to S3 buckets, KMS keys, and IAM roles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Root Account Monitoring &amp;amp; Alarms:&lt;/strong&gt; Deploy an Amazon EventBridge rule tied to SNS alerts to notify security teams immediately via Slack or PagerDuty whenever the Root user logs into the AWS Management Console or triggers an API call.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Service Control Policies (SCPs) as Hard Guardrails:&lt;/strong&gt; Implement SCPs at the AWS Organizations root to enforce organizational compliance (e.g., restricting available AWS Regions or denying modification to security audit log buckets). SCP Deny statements cannot be bypassed by any user within a member account, including IAM identities with full AdministratorAccess.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>security</category>
      <category>sre</category>
    </item>
    <item>
      <title>Kubernetes Architecture Deep Dive: From Resource Limits to Custom Operators</title>
      <dc:creator>Enes Guler</dc:creator>
      <pubDate>Wed, 12 Aug 2026 12:33:54 +0000</pubDate>
      <link>https://dev.to/enesguler/kubernetes-architecture-deep-dive-from-resource-limits-to-custom-operators-47dk</link>
      <guid>https://dev.to/enesguler/kubernetes-architecture-deep-dive-from-resource-limits-to-custom-operators-47dk</guid>
      <description>&lt;h2&gt;
  
  
  Resource Management (Requests &amp;amp; Limits)
&lt;/h2&gt;

&lt;p&gt;Resource management prevents Kubernetes workloads from depleting node hardware or causing resource contention among containers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resource Requests
&lt;/h3&gt;

&lt;p&gt;The absolute minimum CPU and Memory guaranteed for a Pod to start. The Kubernetes Scheduler uses requests to determine node placement. If a node cannot fulfill the requested resources, the Pod will not be scheduled on that node.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;em&gt;Architectural Takeaway:&lt;/em&gt; Omitting requests leads to poor scheduling decisions, resulting in unbalanced cluster distribution and potential node starvation.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Resource Limits
&lt;/h3&gt;

&lt;p&gt;The maximum ceiling of CPU and Memory a Pod is allowed to consume.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Memory (Non-Compressible Resource):&lt;/strong&gt; If a process (e.g., a memory-heavy Pandas pipeline) exceeds its memory limit by even 1 MB, the Linux Kernel terminates the container with an &lt;strong&gt;OOMKilled (Out Of Memory Killed)&lt;/strong&gt; exit code. This acts as a critical safety circuit breaker to constrain the &lt;strong&gt;blast radius&lt;/strong&gt; and protect co-located services.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CPU (Compressible Resource):&lt;/strong&gt; Unlike memory, exceeding CPU limits does not terminate the pod. Instead, the Linux &lt;strong&gt;Completely Fair Scheduler (CFS)&lt;/strong&gt; enforces &lt;strong&gt;CPU Throttling&lt;/strong&gt;. This constrains CPU usage, keeping the application alive but causing severe latency spikes during heavy traffic.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;em&gt;Architectural Takeaway:&lt;/em&gt; Memory limits protect nodes from crashing due to leaks, while improperly tuned CPU limits risk performance degradation via throttling even when the host node has idle CPU capacity.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Advanced Architectural Concepts
&lt;/h2&gt;

&lt;p&gt;Beyond basic resource allocation, managing production Kubernetes clusters requires an understanding of hardware overcommitment, Linux Kernel throttling mechanics, and implicit Quality of Service (QoS) eviction hierarchies.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+-----------------------------------------------------------------------------------+
|                            Node Hardware Capacity                                 |
|                                                                                   |
|  +---------------------------+  +---------------------------+  +---------------+  |
|  | Guaranteed Pod            |  | Burstable Pod             |  | BestEffort    |  |
|  | Requests == Limits        |  | Requests &amp;lt; Limits         |  | No Req/Limits |  |
|  | (Lowest OOM Kill Priority)|  | (Medium Eviction Risk)    |  | (First Killed)|  |
|  +---------------------------+  +---------------------------+  +---------------+  |
+-----------------------------------------------------------------------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Resource Overcommit
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Overcommit&lt;/strong&gt; occurs when the sum of all container resource limits on a node exceeds the node's actual physical hardware capacity, while the sum of resource requests remains within capacity bounds.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Economics:&lt;/strong&gt; In cloud infrastructure, running compute nodes at 20% average utilization is an expensive waste. Overcommit allows engineering teams to pack more workloads onto fewer nodes by betting that not all pods will hit their maximum resource limits simultaneously.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The Overcommit Trade-off:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CPU Overcommit:&lt;/strong&gt; Safe and manageable. CPU is a compressible resource; if demand exceeds capacity, execution speed slows down across pods.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory Overcommit:&lt;/strong&gt; High risk. Memory is non-compressible. If multiple pods suddenly spike toward their memory limits concurrently, the node runs out of physical RAM and swap. The Linux Kernel triggers &lt;code&gt;OOMKilled&lt;/code&gt; events to forcibly terminate containers and reclaim memory.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;&lt;em&gt;Architectural Takeaway:&lt;/em&gt; Calculate the &lt;strong&gt;Overcommit Ratio&lt;/strong&gt; &lt;code&gt;(Sum of Limits) / (Physical Capacity)&lt;/code&gt; carefully. Overcommit CPU aggressively to save money, but keep memory overcommit conservative to avoid cascading application crashes.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Linux CFS Quota &amp;amp; CPU Throttling Trap
&lt;/h3&gt;

&lt;p&gt;Setting CPU limits relies on the Linux Kernel &lt;strong&gt;Completely Fair Scheduler (CFS)&lt;/strong&gt; using &lt;code&gt;cgroup&lt;/code&gt; enforcement. The Kernel evaluates CPU usage in enforced time windows, typically every 100ms (the CFS Period).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;How the Trap Works:&lt;/strong&gt; If a pod with a CPU limit of &lt;code&gt;1 vCPU&lt;/code&gt; (1000m) executes a multi-threaded operation that consumes 100ms worth of CPU processing time within the first 20ms of a period, the Kernel locks out the pod's CPU access for the remaining 80ms of that window.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;100ms CFS Period Window
┌────────────────────────┬─────────────────────────────────────────┐
│  Multi-Threaded Burst  │          CPU Throttled / Locked         │
│   (Consumes 100ms CPU) │           (Latency Spikes Hit)          │
└────────────────────────┴─────────────────────────────────────────┘
 0ms                    20ms                                     100ms
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Idle Node Paradox:&lt;/strong&gt; A pod can experience severe &lt;strong&gt;CPU Throttling&lt;/strong&gt; (causing 500ms+ latency spikes in HTTP services) even when the underlying host worker node shows 80% idle CPU capacity.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;&lt;em&gt;Architectural Takeaway:&lt;/em&gt; Many enterprise SRE teams disable CPU limits entirely (&lt;code&gt;Limits: Unset&lt;/code&gt;) for latency-sensitive microservices, relying strictly on well-tuned &lt;strong&gt;CPU Requests&lt;/strong&gt; paired with Horizontal Pod Autoscaler (HPA) to handle traffic spikes safely.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Quality of Service (QoS) Classes &amp;amp; Eviction Order
&lt;/h3&gt;

&lt;p&gt;Kubernetes automatically assigns every pod a &lt;strong&gt;QoS Class&lt;/strong&gt; based on how its container requests and limits are configured. When a worker node experiences memory pressure, the Linux Kernel and Kubernetes Kubelet use the QoS class to determine eviction priority via the &lt;code&gt;oom_score_adj&lt;/code&gt; metric.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Node Resource Exhaustion (Eviction Sequence)
────────────────────────────────────────────────────────────────────────►
[BestEffort Pods]   ───►   [Burstable Pods]   ───►   [Guaranteed Pods]
 (Terminated First)         (Terminated Second)       (Protected / Last)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Guaranteed (Highest Priority / Protected)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Condition:&lt;/strong&gt; Every container in the pod must explicitly specify both CPU and Memory, and &lt;code&gt;Requests == Limits&lt;/code&gt; for all resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Behavior:&lt;/strong&gt; Highly stable. Granted an &lt;code&gt;oom_score_adj&lt;/code&gt; of &lt;code&gt;-997&lt;/code&gt;. These pods are the absolute last to be evicted or terminated during node memory starvation. Ideal for databases, core stateful sets, and critical payment services.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Burstable (Medium Priority / Standard)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Condition:&lt;/strong&gt; At least one container specifies a request or limit, but &lt;code&gt;Requests != Limits&lt;/code&gt; (or CPU has a limit while Memory does not).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Behavior:&lt;/strong&gt; Allowed to burst beyond baseline when capacity allows. Evicted after all &lt;code&gt;BestEffort&lt;/code&gt; pods are killed if memory pressure persists. Ideal for web APIs, background workers, and standard web applications.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;BestEffort (Lowest Priority / Disposable)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Condition:&lt;/strong&gt; No requests or limits are defined for any container in the pod.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Behavior:&lt;/strong&gt; Assigned an &lt;code&gt;oom_score_adj&lt;/code&gt; of &lt;code&gt;1000&lt;/code&gt;. Gets access to unallocated node resources, but is the first target for termination during node memory pressure. Ideal for non-critical batch processing, dev/test pods, or temporary log collectors.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Security and Observability
&lt;/h2&gt;

&lt;p&gt;The control mechanisms that keep the system resilient before everything crashes or when a breach occurs.&lt;/p&gt;

&lt;h3&gt;
  
  
  RBAC (Role-Based Access Control)
&lt;/h3&gt;

&lt;p&gt;The identity card and permission firewall for your code. It strictly limits what a Pod (or a user) can execute within the system.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ServiceAccount:&lt;/strong&gt; The identity assigned to a Pod.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Role/ClusterRole:&lt;/strong&gt; The explicit list of allowed permissions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RoleBinding/ClusterRoleBinding:&lt;/strong&gt; The bridge that staples an identity to a set of permissions. Even if a vulnerability leaks into the application code, RBAC prevents lateral movement and protects the underlying infrastructure.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Monitoring &amp;amp; Alerting
&lt;/h3&gt;

&lt;p&gt;Kubernetes knows whether an application is running, but it is blind to the question: &lt;em&gt;“Is the business logic actually behaving correctly?”&lt;/em&gt; To solve this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Prometheus:&lt;/strong&gt; Continuously scrapes and collects every metric (CPU, API response times, queue lengths, etc.) from the system.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Grafana:&lt;/strong&gt; Transforms raw time-series metrics into visual, customizable dashboards.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alertmanager:&lt;/strong&gt; Triggers notifications (Slack, PagerDuty, Email) when response latency spikes from 200ms to 4 seconds, or when &lt;strong&gt;&lt;code&gt;OOMKilled&lt;/code&gt;&lt;/strong&gt; errors start popping up.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Service Mesh (Istio/Linkerd)
&lt;/h3&gt;

&lt;p&gt;An infrastructure highway that manages, encrypts, and observes inter-service communication &lt;strong&gt;(East-West Traffic)&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sidecar Proxy:&lt;/strong&gt; A lightweight proxy (like Envoy or NGINX) injected alongside your main application container inside the same Pod. It intercepts all inbound and outbound traffic completely transparently to your application code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;mTLS (Mutual TLS):&lt;/strong&gt; Automatically encrypts network traffic between microservices in transit. Even if an attacker intercepts the network traffic, the payload remains unreadable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Traffic Splitting:&lt;/strong&gt; Allows you to route a portion of live traffic (e.g., 10%) to a new application version &lt;strong&gt;(Canary deployment)&lt;/strong&gt; without altering a single line of application code.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Pod Lifecycle and Probes
&lt;/h2&gt;

&lt;p&gt;Kubernetes evaluates the true health and readiness of an application inside a Pod using three distinct types of &lt;strong&gt;Probes&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Startup Probe
&lt;/h3&gt;

&lt;p&gt;Ensures Kubernetes remains patient while an application boots up (for instance, legacy Java applications that might take over a minute to initialize). No other probes run until the &lt;strong&gt;Startup Probe&lt;/strong&gt; succeeds. If this probe fails, Kubernetes assumes the application is stuck during startup and immediately restarts the Pod.&lt;/p&gt;

&lt;h3&gt;
  
  
  Liveness Probe
&lt;/h3&gt;

&lt;p&gt;Answers the question: &lt;strong&gt;&lt;em&gt;“Is this Pod alive?”&lt;/em&gt;&lt;/strong&gt; If the application enters a deadlock or infinite loop, Kubernetes detects the stall via the probe, terminates the unresponsive container, and restarts it according to the restart policy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Readiness Probe
&lt;/h3&gt;

&lt;p&gt;Answers the question: &lt;strong&gt;&lt;em&gt;“This Pod is alive, but is it ready to accept incoming user requests?”&lt;/em&gt;&lt;/strong&gt; For example, the application process might be running, but it’s still establishing connection to a database. If this probe fails, &lt;strong&gt;Kubernetes does NOT kill or restart the Pod;&lt;/strong&gt; it simply removes the Pod’s IP from the Service endpoints to stop routing traffic to it. Once the connection is established and the probe passes, traffic automatically resumes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Networking Architecture: Ingress vs. Service
&lt;/h2&gt;

&lt;p&gt;The networking layer that defines how traffic flows within the cluster and how external users access internal workloads.&lt;/p&gt;

&lt;h3&gt;
  
  
  ClusterIP (Service)
&lt;/h3&gt;

&lt;p&gt;An &lt;strong&gt;internal extension line&lt;/strong&gt; that allows Pods to communicate with one another within the cluster. It is completely isolated from the outside world.&lt;/p&gt;

&lt;h3&gt;
  
  
  NodePort (Service)
&lt;/h3&gt;

&lt;p&gt;Exposes a specific port on every Node directly to the public internet. It is insecure and inefficient, making it rarely suitable for production environments.&lt;/p&gt;

&lt;h3&gt;
  
  
  LoadBalancer (Service)
&lt;/h3&gt;

&lt;p&gt;Provisions a dedicated, paid external Cloud Load Balancer from your cloud provider (e.g., AWS ALB/NLB). Provisioning a separate cloud load balancer for every single microservice drastically inflates your cloud bill.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ingress
&lt;/h3&gt;

&lt;p&gt;A single &lt;strong&gt;Smart Traffic Router (Reverse Proxy)&lt;/strong&gt; positioned at the cluster gateway. It terminates traffic from a single external Load Balancer and intelligently routes incoming requests to internal services based on domain names or URL path rules (&lt;strong&gt;&lt;code&gt;/api&lt;/code&gt;, &lt;code&gt;/auth&lt;/code&gt;&lt;/strong&gt;). It minimizes infrastructure costs while providing a centralized point for TLS termination and traffic management.&lt;/p&gt;

&lt;h2&gt;
  
  
  Smart Placement
&lt;/h2&gt;

&lt;p&gt;It is the set of rules that decides which applications run on which physical/virtual servers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Taints
&lt;/h3&gt;

&lt;p&gt;A security barrier (or label) applied to a Node. It is a node’s way of saying: &lt;em&gt;“I am an expensive, GPU-heavy server. Standard web APIs without the right **tolerance&lt;/em&gt;* should stay away from me.”*&lt;/p&gt;

&lt;h3&gt;
  
  
  Tolerations
&lt;/h3&gt;

&lt;p&gt;A specification written inside a Pod’s configuration. It is a Pod’s way of saying: &lt;em&gt;“Yes, that server has a GPU taint, but I have the tolerance for it. You can place me there.”&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Node Affinity
&lt;/h3&gt;

&lt;p&gt;A specific requirement whispered by a Pod to the Kubernetes Control Plane. It is a Pod’s way of saying: &lt;em&gt;“Do not place me randomly; run me strictly (or preferably) on Memory-Optimized nodes.”&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hard Constraint (&lt;code&gt;required...&lt;/code&gt;):&lt;/strong&gt; &lt;em&gt;“I MUST have this node type, or do NOT deploy me at all.”&lt;/em&gt; &lt;strong&gt;(Strict rule)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Soft Constraint (&lt;code&gt;preferred...&lt;/code&gt;):&lt;/strong&gt; &lt;em&gt;“I WOULD LIKE this node type, but if it’s not available, just put me anywhere.”&lt;/em&gt; &lt;strong&gt;(Preference)&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Scaling and Autonomy
&lt;/h2&gt;

&lt;p&gt;A set of mechanisms used to balance performance and infrastructure costs as workload demand increases or decreases.&lt;/p&gt;

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

&lt;p&gt;Monitors CPU and RAM usage of Pods. If a Pod is under heavy load (heats up), HPA increases the replica count; as load drops (cools down), it scales back down. It is inherently sluggish because waiting for CPU metrics to spike takes time.&lt;/p&gt;

&lt;h3&gt;
  
  
  KEDA (Kubernetes Event-Driven Autoscaling)
&lt;/h3&gt;

&lt;p&gt;Grants Kubernetes the ability to listen to external event sources (such as Redpanda, Kafka, S3, RabbitMQ, etc.). If a queue in Redpanda is empty, KEDA can scale the Pod replicas down to zero &lt;strong&gt;(Scale-to-Zero)&lt;/strong&gt; to completely eliminate compute costs. If 10,000 messages suddenly hit the queue, it immediately spins up 50 Pods within seconds without waiting for CPU usage to rise.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data and Storage
&lt;/h2&gt;

&lt;p&gt;The layer that overcomes the &lt;strong&gt;ephemeral&lt;/strong&gt; (temporary) nature of containers to manage persistent data.&lt;/p&gt;

&lt;h3&gt;
  
  
  CSI (Container Storage Interface)
&lt;/h3&gt;

&lt;p&gt;The standard interface Kubernetes uses to communicate with cloud providers regarding storage. When a Pod needs a 50 GB disk for a database or AI model weights, the CSI driver dynamically provisions that disk from the cloud and physically attaches it to the node hosting the Pod. If the Pod dies and reschedules onto another node, CSI detaches the disk and reattaches it to the new node.&lt;/p&gt;

&lt;h3&gt;
  
  
  PV (Persistent Volume)
&lt;/h3&gt;

&lt;p&gt;The physical/actual disk allocated to the cluster by the infrastructure administrator. It is a cluster-level resource independent of Pods, representing a declaration like: &lt;em&gt;“I have a 100 GB SSD-backed disk available in AWS.”&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  PVC (Persistent Volume Claim)
&lt;/h3&gt;

&lt;p&gt;A request for storage made by a developer (or application) to Kubernetes. It is a Pod’s way of saying: &lt;em&gt;“I urgently need a 20 GB high-speed read/write disk.”&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  How PV and PVC Interact
&lt;/h4&gt;

&lt;p&gt;When a developer creates a PVC, Kubernetes acts like a &lt;strong&gt;matchmaker&lt;/strong&gt;. It scans the pool of available PVs. If it finds a PV that meets the requested capacity and access modes, it &lt;strong&gt;binds&lt;/strong&gt; that PVC to the PV. The Pod only knows the name of the PVC and doesn’t care about the underlying storage implementation.&lt;/p&gt;

&lt;h3&gt;
  
  
  SC (StorageClass)
&lt;/h3&gt;

&lt;p&gt;The set of instructions given to the CSI driver. When a developer specifies &lt;code&gt;storageClassName: gp3&lt;/code&gt; inside a PVC, Kubernetes checks if a matching PV exists. If no pre-provisioned PV is available, it immediately triggers the CSI driver. The CSI driver then provisions a 20 GB volume on AWS, registers it in Kubernetes as a new PV, and binds it to the PVC. This entire automated workflow is called &lt;strong&gt;Dynamic Provisioning&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Teaching K8s a New Language (Extending Kubernetes)
&lt;/h2&gt;

&lt;p&gt;The capability that transforms Kubernetes from a simple application runner into a customizable platform builder.&lt;/p&gt;

&lt;h3&gt;
  
  
  CRD (Custom Resource Definition)
&lt;/h3&gt;

&lt;p&gt;The process of extending Kubernetes’ built-in dictionary (which natively includes objects like Pods, Services, and Deployments) with your own custom resources. You define and register brand-new objects—such as &lt;strong&gt;&lt;code&gt;ModelDeployment&lt;/code&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;code&gt;PostgresDatabase&lt;/code&gt;&lt;/strong&gt;—directly into the Kubernetes API database (etcd).&lt;/p&gt;

&lt;h3&gt;
  
  
  Operator Pattern
&lt;/h3&gt;

&lt;p&gt;Kubernetes natively recognizes custom resources like &lt;strong&gt;&lt;code&gt;ModelDeployment&lt;/code&gt;&lt;/strong&gt;, but it doesn’t know what actions to take when one is created. An &lt;strong&gt;Operator&lt;/strong&gt; is a custom controller written in languages like Go or Python that hooks into the Kubernetes control loop. When someone submits a &lt;strong&gt;&lt;code&gt;ModelDeployment&lt;/code&gt;&lt;/strong&gt; YAML manifest, the Operator wakes up and says: &lt;em&gt;“Got it! I need to pull the AI model weights from S3, schedule a GPU-enabled node, and expose a REST API.”&lt;/em&gt; It then automatically orchestrates all the underlying standard Kubernetes objects on your behalf.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>security</category>
      <category>sre</category>
    </item>
  </channel>
</rss>
