<?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: riyankhamdani</title>
    <description>The latest articles on DEV Community by riyankhamdani (@riyankhamdani).</description>
    <link>https://dev.to/riyankhamdani</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%2F4232983%2F376878a6-4fbf-458a-86fc-85b6bf690984.png</url>
      <title>DEV Community: riyankhamdani</title>
      <link>https://dev.to/riyankhamdani</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/riyankhamdani"/>
    <language>en</language>
    <item>
      <title>Locking Down Kubernetes Secrets: Zero Trust After Rackspace Spot</title>
      <dc:creator>riyankhamdani</dc:creator>
      <pubDate>Sat, 28 Nov 2026 02:02:46 +0000</pubDate>
      <link>https://dev.to/riyankhamdani/locking-down-kubernetes-secrets-zero-trust-after-rackspace-spot-48bo</link>
      <guid>https://dev.to/riyankhamdani/locking-down-kubernetes-secrets-zero-trust-after-rackspace-spot-48bo</guid>
      <description>&lt;p&gt;The shutdown of Rackspace Spot following a credential breach that exposed Kubernetes Secrets is a sobering reminder for every platform team: &lt;strong&gt;perimeter security alone will not save your cluster.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When attackers obtain valid cloud or cluster credentials, they don't need to break down the front door—they walk right through it with legitimate permissions. If your internal cluster posture relies on implicit trust, a single leaked token or over-privileged service account is enough to compromise every workload and database connected to your environment.&lt;/p&gt;

&lt;p&gt;Here is how to close those internal gaps and enforce Zero Trust inside your Kubernetes boundary.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Stop Storing Raw Secrets in Plain Manifests or Env Vars
&lt;/h2&gt;

&lt;p&gt;Native Kubernetes &lt;code&gt;Secret&lt;/code&gt; objects are base64-encoded, not encrypted at rest by default, and mounting them as environment variables exposes sensitive values to crash dumps, debug endpoints, and child processes.&lt;/p&gt;

&lt;p&gt;Instead of committing or injecting static secrets:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Enable Encryption at Rest&lt;/strong&gt; for &lt;code&gt;etcd&lt;/code&gt; using a cloud KMS provider (&lt;code&gt;EncryptionConfiguration&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use Dynamic Secret Engines&lt;/strong&gt; like &lt;strong&gt;HashiCorp Vault&lt;/strong&gt; or &lt;strong&gt;AWS Secrets Manager&lt;/strong&gt; paired with the &lt;strong&gt;External Secrets Operator (ESO)&lt;/strong&gt; or &lt;strong&gt;Secrets Store CSI Driver&lt;/strong&gt;. Secrets are fetched at runtime directly into memory (&lt;code&gt;tmpfs&lt;/code&gt;) and rotated automatically without touching Git or environment variables.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Enforce Least-Privilege RBAC &amp;amp; Disable Auto-Mounted Tokens
&lt;/h2&gt;

&lt;p&gt;By default, Kubernetes mounts a service account token into every pod—even when the application never talks to the Kubernetes API. Furthermore, broad &lt;code&gt;get&lt;/code&gt; or &lt;code&gt;list&lt;/code&gt; permissions on &lt;code&gt;secrets&lt;/code&gt; across namespaces turn a single compromised pod into a cluster-wide credential harvester.&lt;/p&gt;

&lt;p&gt;Lock down your &lt;code&gt;Pod&lt;/code&gt; specs and &lt;code&gt;Role&lt;/code&gt; definitions:&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="p"&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="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ServiceAccount&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;payment-worker-sa&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;production&lt;/span&gt;
&lt;span class="na"&gt;automountServiceAccountToken&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="nn"&gt;---
&lt;/span&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;rbac.authorization.k8s.io/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Role&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;payment-secret-reader&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;production&lt;/span&gt;
&lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;apiGroups&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;resources&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"secrets"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="c1"&gt;# Restrict access to named secrets only—never allow wildcard list/watch
&lt;/span&gt;    &lt;span class="na"&gt;resourceNames&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"payment-db-creds"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;verbs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"get"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Replace Long-Lived Static Keys with Short-Lived OIDC Tokens
&lt;/h2&gt;

&lt;p&gt;Static cloud access keys (&lt;code&gt;AWS_ACCESS_KEY_ID&lt;/code&gt;, GCP JSON keys) stored inside clusters are prime targets during breaches because they remain valid until someone manually revokes them.&lt;/p&gt;

&lt;p&gt;Migrate workload identity to &lt;strong&gt;OIDC federation&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AWS:&lt;/strong&gt; IAM Roles for Service Accounts (IRSA) or EKS Pod Identity&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GCP:&lt;/strong&gt; Workload Identity Federation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CI/CD Pipelines (GitHub Actions / GitLab CI):&lt;/strong&gt; Exchange short-lived OIDC JWTs for temporary cloud credentials scoped strictly to a single deployment job.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a token leaks, its blast radius is limited to minutes rather than months.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Isolate East-West Traffic with Default-Deny NetworkPolicies
&lt;/h2&gt;

&lt;p&gt;Once an attacker lands inside a pod, flat cluster networking lets them freely probe internal databases, metadata endpoints (&lt;code&gt;169.254.169.254&lt;/code&gt;), and adjacent microservices.&lt;/p&gt;

&lt;p&gt;Apply a default-deny posture in every production namespace and explicitly whitelist only required egress/ingress paths:&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="p"&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="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;NetworkPolicy&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;default-deny-all&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;production&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;policyTypes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Ingress&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Egress&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Key Takeaway
&lt;/h2&gt;

&lt;p&gt;Cloud login MFA and firewalls protect the outer shell, but &lt;strong&gt;cluster resilience is defined by what happens after a credential leaks&lt;/strong&gt;. Audit your &lt;code&gt;ClusterRoleBindings&lt;/code&gt;, eliminate static secrets, disable unnecessary service account token mounts, and treat every namespace as an untrusted network zone.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;How are you managing secret rotation and workload identity across your clusters right now—Vault, External Secrets Operator, or native cloud KMS? Drop your setup in the comments.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>security</category>
      <category>devops</category>
      <category>cloudnative</category>
    </item>
    <item>
      <title>Your Kubernetes Ingress Is One Crafted Packet Away from a Blackout: Hardening HAProxy Against HTTP/2 &amp; HTTP/3 DoS</title>
      <dc:creator>riyankhamdani</dc:creator>
      <pubDate>Sat, 21 Nov 2026 03:07:28 +0000</pubDate>
      <link>https://dev.to/riyankhamdani/your-kubernetes-ingress-is-one-crafted-packet-away-from-a-blackout-hardening-haproxy-against-509l</link>
      <guid>https://dev.to/riyankhamdani/your-kubernetes-ingress-is-one-crafted-packet-away-from-a-blackout-hardening-haproxy-against-509l</guid>
      <description>&lt;p&gt;If you run HAProxy as your Kubernetes Ingress Controller or edge load balancer, the &lt;strong&gt;November 2026 HAProxy CVE security bulletin&lt;/strong&gt; deserves immediate attention.&lt;/p&gt;

&lt;p&gt;Unlike vulnerabilities that require complex authentication bypasses or internal network access, this class of flaw targets the front door of your cluster: &lt;strong&gt;unauthenticated remote clients sending crafted HTTP/2 and HTTP/3 traffic&lt;/strong&gt; can trigger internal safety checks inside HAProxy, instantly terminating the worker process and dropping every active connection.&lt;/p&gt;

&lt;p&gt;There is no data leak or remote code execution here—it is a pure availability kill-switch. And in Kubernetes environments handling long-lived gRPC streams, WebSockets, or high-throughput API traffic, an edge proxy crash triggers cascading retry storms across your downstream microservices.&lt;/p&gt;

&lt;p&gt;Here is how to audit your exposure, roll out patches without causing self-inflicted downtime, and harden your ingress layer at the edge.&lt;/p&gt;




&lt;h2&gt;
  
  
  💥 Why an Ingress Process Crash Cascades Across Kubernetes
&lt;/h2&gt;

&lt;p&gt;When a single backend application pod crashes, Kubernetes isolates the blast radius to a fraction of requests. When an edge HAProxy instance hits an internal safety check and aborts, every in-flight connection through that node dies simultaneously:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Impact Vector&lt;/th&gt;
&lt;th&gt;Standard Backend Pod Crash&lt;/th&gt;
&lt;th&gt;HAProxy Ingress Worker Abort&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Active Connections&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Only requests routed to that pod fail&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;100% of active HTTP/1.1, HTTP/2, and HTTP/3 streams drop&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Client Behavior&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Normal retry on single endpoint&lt;/td&gt;
&lt;td&gt;Synchronized client reconnect spikes (&lt;strong&gt;thundering herd&lt;/strong&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Service Mesh / Upstream&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Local circuit breaker trips&lt;/td&gt;
&lt;td&gt;Sudden connection pool exhaustion across all services&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Recovery Time&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Seconds (pod restart)&lt;/td&gt;
&lt;td&gt;Immediate process respawn, followed by minutes of retry-storm latency&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🔍 Step 1: Audit Your Cluster's HAProxy Exposure
&lt;/h2&gt;

&lt;p&gt;Before applying fixes, verify every HAProxy Ingress Controller and standalone HAProxy proxy running across your namespaces, along with whether HTTP/2 or HTTP/3 (QUIC over UDP/443) is enabled.&lt;/p&gt;

&lt;p&gt;Run a quick inventory check across 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;&lt;span class="c"&gt;# 1. Locate all HAProxy pods and inspect their running container images&lt;/span&gt;
kubectl get pods -A -o wide &lt;span class="o"&gt;|&lt;/span&gt; grep -i haproxy
kubectl get pods -A -l app.kubernetes.io/name=haproxy-ingress \
  -o &lt;span class="nv"&gt;jsonpath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'{range .items[*]}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{.spec.containers[*].image}{"\n"}{end}'&lt;/span&gt;

&lt;span class="c"&gt;# 2. Check if UDP/443 (HTTP/3 QUIC) is exposed on your Ingress LoadBalancer&lt;/span&gt;
kubectl get svc -A -o &lt;span class="nv"&gt;jsonpath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'{range .items[?(@.spec.type=="LoadBalancer")]}{.metadata.namespace}{"/"}{.metadata.name}{"\t"}{range .spec.ports[*]}{.port}{"/"}{.protocol}{" "}{end}{"\n"}{end}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you deploy via Helm, check your active chart revisions so you can map them against the patched releases listed in the November 2026 HAProxy bulletin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;helm list -A &lt;span class="o"&gt;|&lt;/span&gt; grep -i haproxy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🛡️ Step 2: Patch Without Dropping Production Traffic
&lt;/h2&gt;

&lt;p&gt;Rushing an ingress rollout without graceful connection draining will cause the exact connection-drop outage you are trying to prevent.&lt;/p&gt;

&lt;p&gt;Ensure your HAProxy Ingress Deployment or DaemonSet enforces zero-unavailable rollouts, a &lt;code&gt;PodDisruptionBudget&lt;/code&gt;, and a &lt;code&gt;preStop&lt;/code&gt; lifecycle hook so cloud load balancers deregister the pod before &lt;code&gt;SIGTERM&lt;/code&gt; closes active sockets:&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="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;policy/v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;PodDisruptionBudget&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;haproxy-ingress-pdb&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ingress-controller&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;minAvailable&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
  &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;app.kubernetes.io/name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;haproxy-ingress&lt;/span&gt;
&lt;span class="nn"&gt;---
&lt;/span&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&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="p"&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="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;haproxy-ingress&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ingress-controller&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;replicas&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
  &lt;span class="na"&gt;strategy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&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="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;maxUnavailable&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
      &lt;span class="na"&gt;maxSurge&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
  &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;app.kubernetes.io/name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;haproxy-ingress&lt;/span&gt;
  &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;app.kubernetes.io/name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;haproxy-ingress&lt;/span&gt;
    &lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;terminationGracePeriodSeconds&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;
      &lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;haproxy-ingress&lt;/span&gt;
          &lt;span class="c1"&gt;# Replace with the patched image tag from the November 2026 bulletin
&lt;/span&gt;          &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;haproxytech/kubernetes-ingress:&amp;lt;PATCHED_TAG&amp;gt;&lt;/span&gt;
          &lt;span class="na"&gt;lifecycle&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;preStop&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
              &lt;span class="na"&gt;exec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"/bin/sh"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"-c"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"sleep 15"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once updated, monitor the rollout and confirm zero &lt;code&gt;CrashLoopBackOff&lt;/code&gt; or unexpected worker restarts in the ingress logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl rollout status deployment/haproxy-ingress -n ingress-controller
kubectl logs -n ingress-controller -l app.kubernetes.io/name=haproxy-ingress --tail=50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🧱 Step 3: Temporary Edge Mitigations (If You Have a Change Freeze)
&lt;/h2&gt;

&lt;p&gt;If organizational change windows delay an immediate binary upgrade, reduce your attack surface at the edge right away:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Enforce Strict HTTP/2 Limits &amp;amp; Connection Rate-Limiting
&lt;/h3&gt;

&lt;p&gt;Tighten HTTP/2 concurrent stream limits and apply stick-table connection rate limiting in your HAProxy Ingress &lt;code&gt;ConfigMap&lt;/code&gt; so single clients cannot flood malformed frames:&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="p"&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="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ConfigMap&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;haproxy-ingress&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ingress-controller&lt;/span&gt;
&lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="c1"&gt;# Cap concurrent streams per HTTP/2 connection to limit multiplexing abuse
&lt;/span&gt;  &lt;span class="na"&gt;tune.h2.max-concurrent-streams&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"100"&lt;/span&gt;
  &lt;span class="c1"&gt;# Enforce connection rate limiting via stick-tables
&lt;/span&gt;  &lt;span class="na"&gt;rate-limit-requests&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"100"&lt;/span&gt;
  &lt;span class="na"&gt;rate-limit-period&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"10s"&lt;/span&gt;
  &lt;span class="c1"&gt;# Tighten client timeouts to clear stalled malformed connections
&lt;/span&gt;  &lt;span class="na"&gt;timeout-client&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"30s"&lt;/span&gt;
  &lt;span class="na"&gt;timeout-http-request&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"10s"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Disable HTTP/3 (QUIC) Until Patched
&lt;/h3&gt;

&lt;p&gt;If HTTP/3 is not strictly required by your clients, temporarily remove UDP/443 from your Ingress &lt;code&gt;LoadBalancer&lt;/code&gt; service until the patched HAProxy image is rolled out. This eliminates the HTTP/3 attack vector completely without impacting standard HTTPS (TCP/443) traffic.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Put L7 Inspection in Front of the Cluster
&lt;/h3&gt;

&lt;p&gt;Ensure your upstream CDN or WAF (Cloudflare, AWS WAF, Fastly) is actively inspecting and normalizing HTTP/2 and HTTP/3 frames before traffic ever hits your Kubernetes nodes. Edge scrubbing stops malformed protocol frames before they reach HAProxy's multiplexer.&lt;/p&gt;




&lt;h2&gt;
  
  
  📌 Production Ingress Hardening Checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Automate Base-Image CVE Alerts:&lt;/strong&gt; Wire Trivy or Grype into your CI/CD pipelines and container registry so critical proxy advisories trigger alerts before manual bulletin checks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never Run Single-Replica Ingress:&lt;/strong&gt; Always run at least 2–3 replicas across separate availability zones with &lt;code&gt;podAntiAffinity&lt;/code&gt; so a single worker crash never takes down your entire public endpoint.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alert on Worker Restarts, Not Just Pod Restarts:&lt;/strong&gt; HAProxy's master-worker architecture can respawn a crashed worker process without Kubernetes restarting the container. Monitor &lt;code&gt;haproxy_process_nbthread&lt;/code&gt; and process uptime metrics in Prometheus to catch silent worker aborts immediately.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test Graceful Draining:&lt;/strong&gt; Periodically validate your &lt;code&gt;preStop&lt;/code&gt; and &lt;code&gt;terminationGracePeriodSeconds&lt;/code&gt; settings under synthetic load to verify zero &lt;code&gt;502/504&lt;/code&gt; spikes during ingress upgrades.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Reference: &lt;a href="https://www.haproxy.com/blog/november-2026-cve-security-bulletin" rel="noopener noreferrer"&gt;HAProxy November 2026 CVE Security Bulletin&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>sre</category>
      <category>security</category>
    </item>
    <item>
      <title>Your Monitoring Stack Is Lying to You: Architecting an Out-of-Band Dead-Man's Switch on Kubernetes</title>
      <dc:creator>riyankhamdani</dc:creator>
      <pubDate>Sat, 14 Nov 2026 01:26:00 +0000</pubDate>
      <link>https://dev.to/riyankhamdani/your-monitoring-stack-is-lying-to-you-architecting-an-out-of-band-dead-mans-switch-on-kubernetes-1n51</link>
      <guid>https://dev.to/riyankhamdani/your-monitoring-stack-is-lying-to-you-architecting-an-out-of-band-dead-mans-switch-on-kubernetes-1n51</guid>
      <description>&lt;p&gt;The November 12 Microsoft outage highlighted a classic blind spot in distributed systems: &lt;strong&gt;when your observability stack shares fate with the infrastructure it monitors, a major collapse produces total silence.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Most engineering teams spend months tuning SLO burn rates, latency histograms, and PagerDuty escalation policies. Yet in many production environments, Prometheus, Alertmanager, and custom notification webhooks still run inside the exact same Kubernetes cluster, VPC, or cloud region as the workloads they watch. When a regional network partition, DNS failure, or control-plane outage hits, alerts never leave the cluster—leaving on-call engineers completely blind until customers start complaining.&lt;/p&gt;

&lt;p&gt;In this guide, we will implement an &lt;strong&gt;out-of-band Dead-Man's Switch&lt;/strong&gt; on Kubernetes using Prometheus &lt;code&gt;Watchdog&lt;/code&gt; alerts and decoupled heartbeat routing so you know immediately when your monitoring pipeline goes dark.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔍 Why Traditional Alerting Fails During Major Outages
&lt;/h2&gt;

&lt;p&gt;Standard alerting relies on &lt;strong&gt;positive assertion&lt;/strong&gt;: &lt;em&gt;"If error rate &amp;gt; 5%, send an alert."&lt;/em&gt; That model breaks down the moment the alerting pipeline itself becomes the casualty.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Failure Scenario&lt;/th&gt;
&lt;th&gt;Standard In-Cluster Alerting&lt;/th&gt;
&lt;th&gt;Out-of-Band Dead-Man's Switch&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Pod / Node Crash&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Fires alert normally&lt;/td&gt;
&lt;td&gt;Fires alert normally&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Alertmanager OOM / CrashLoop&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Silent failure&lt;/strong&gt; (No alerts sent)&lt;/td&gt;
&lt;td&gt;External monitor detects missed heartbeat &amp;amp; pages on-call&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cluster Egress / DNS Outage&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Silent failure&lt;/strong&gt; (Webhooks time out)&lt;/td&gt;
&lt;td&gt;Heartbeat stops arriving; external trigger fires within minutes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Regional Cloud Control-Plane Failure&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Silent failure&lt;/strong&gt; (Entire stack unreachable)&lt;/td&gt;
&lt;td&gt;Decoupled cloud/SaaS receiver escalates immediately&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  🏗️ Architecture: Decoupled Heartbeat Pipeline
&lt;/h2&gt;

&lt;p&gt;Instead of waiting for something to break to send a signal, a Dead-Man's Switch inverts the logic: &lt;strong&gt;your cluster must continuously prove it is alive.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+-------------------------------------------------------+
|              Production Kubernetes Cluster            |
|                                                       |
|  [ Prometheus ]                                       |
|    └── Evaluates `Watchdog` (expr: vector(1))         |
|          │                                            |
|          ▼ (Always Firing)                            |
|  [ Alertmanager ]                                     |
|    └── Dedicated Route (repeat_interval: 5m)          |
+----------|--------------------------------------------+
           │
           │ HTTPS Heartbeat Ping (Every 5 mins)
           ▼
+-------------------------------------------------------+
|       Out-of-Band Receiver (Separate Cloud / SaaS)    |
|     (Healthchecks.io / PagerDuty / Cross-Cloud Lambda)|
|                                                       |
|  [ Timer &amp;gt; 10m without ping? ] ──► Page On-Call (SMS) |
+-------------------------------------------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🛠️ Implementation on Kubernetes
&lt;/h2&gt;

&lt;p&gt;If you are running &lt;code&gt;kube-prometheus-stack&lt;/code&gt;, you can configure this cleanly using declarative Custom Resources (&lt;code&gt;PrometheusRule&lt;/code&gt; and &lt;code&gt;AlertmanagerConfig&lt;/code&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Define an Always-Firing &lt;code&gt;Watchdog&lt;/code&gt; Rule
&lt;/h3&gt;

&lt;p&gt;Create a &lt;code&gt;PrometheusRule&lt;/code&gt; that evaluates &lt;code&gt;vector(1)&lt;/code&gt;. Because &lt;code&gt;vector(1)&lt;/code&gt; always returns a value, Prometheus keeps this alert permanently in the &lt;code&gt;FIRING&lt;/code&gt; state as long as the rule evaluation engine is healthy.&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="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;monitoring.coreos.com/v1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="s"&gt;(https://monitoring.coreos.com/v1)&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;PrometheusRule&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;deadmans-switch-watchdog&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;monitoring&lt;/span&gt;
  &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;release&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;kube-prometheus-stack&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;groups&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;observability.heartbeat&lt;/span&gt;
      &lt;span class="na"&gt;interval&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;30s&lt;/span&gt;
      &lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Watchdog&lt;/span&gt;
          &lt;span class="na"&gt;expr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;vector(1)&lt;/span&gt;
          &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;severity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;none&lt;/span&gt;
            &lt;span class="na"&gt;pipeline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;deadmans-switch&lt;/span&gt;
          &lt;span class="na"&gt;annotations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Observability pipeline heartbeat"&lt;/span&gt;
            &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Continuous heartbeat proving Prometheus and Alertmanager can evaluate and dispatch alerts."&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Route Heartbeats to an External Receiver
&lt;/h3&gt;

&lt;p&gt;Configure Alertmanager to intercept the &lt;code&gt;Watchdog&lt;/code&gt; alert and push a recurring HTTP ping every 5 minutes (&lt;code&gt;repeat_interval: 5m&lt;/code&gt;). Setting &lt;code&gt;continue: false&lt;/code&gt; ensures this heartbeat never pollutes your regular Slack or incident channels.&lt;/p&gt;

&lt;p&gt;Store your external heartbeat URL (from Healthchecks.io, PagerDuty Dead Man's Snitch, or a lightweight serverless function deployed in a secondary cloud provider) inside a Kubernetes &lt;code&gt;Secret&lt;/code&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 deadmans-switch-webhook \
  --namespace monitoring \
  --from-literal=url=&lt;span class="s1"&gt;'[https://hc-ping.com/your-unique-uuid-here](https://hc-ping.com/your-unique-uuid-here)'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, apply the &lt;code&gt;AlertmanagerConfig&lt;/code&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="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;monitoring.coreos.com/v1alpha1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="s"&gt;(https://monitoring.coreos.com/v1alpha1)&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;AlertmanagerConfig&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;deadmans-switch-route&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;monitoring&lt;/span&gt;
  &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;release&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;kube-prometheus-stack&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;route&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;groupBy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'alertname'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;groupWait&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;0s&lt;/span&gt;
    &lt;span class="na"&gt;groupInterval&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;1m&lt;/span&gt;
    &lt;span class="na"&gt;repeatInterval&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;5m&lt;/span&gt;
    &lt;span class="na"&gt;receiver&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;external-heartbeat&lt;/span&gt;
    &lt;span class="na"&gt;matchers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;alertname&lt;/span&gt;
        &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Watchdog&lt;/span&gt;
        &lt;span class="na"&gt;matchType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"="&lt;/span&gt;
    &lt;span class="na"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="na"&gt;receivers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;external-heartbeat&lt;/span&gt;
      &lt;span class="na"&gt;webhookConfigs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;urlSecret&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;deadmans-switch-webhook&lt;/span&gt;
            &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;url&lt;/span&gt;
          &lt;span class="na"&gt;sendResolved&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🧪 Chaos Testing Your Blind Spot
&lt;/h2&gt;

&lt;p&gt;Never assume a Dead-Man's Switch works until you have tested a simulated blackout during a game day. You can validate the failure path safely by blocking Alertmanager's outbound traffic using a temporary &lt;code&gt;NetworkPolicy&lt;/code&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="p"&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="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;NetworkPolicy&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;simulate-alerting-blackout&lt;/span&gt;
  &lt;span class="na"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;monitoring&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;podSelector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;matchLabels&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;app.kubernetes.io/name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;alertmanager&lt;/span&gt;
  &lt;span class="na"&gt;policyTypes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Egress&lt;/span&gt;
  &lt;span class="na"&gt;egress&lt;/span&gt;&lt;span class="p"&gt;:&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;p&gt;&lt;strong&gt;Expected Verification Flow:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Alertmanager continues receiving the &lt;code&gt;Watchdog&lt;/code&gt; alert internally from Prometheus, but all outbound HTTP pings drop silently.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once your external receiver's grace period expires (e.g., 10 minutes), it triggers an out-of-band escalation (SMS, phone call, or secondary chat webhook).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Delete the test policy (&lt;code&gt;kubectl delete networkpolicy simulate-alerting-blackout -n monitoring&lt;/code&gt;) and confirm the heartbeat auto-recovers within one &lt;code&gt;repeatInterval&lt;/code&gt; cycle.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  📌 Production Hardening Checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Avoid Single-Region Correlation:&lt;/strong&gt; If your cluster runs on Azure East US or AWS &lt;code&gt;us-east-1&lt;/code&gt;, do not host your heartbeat receiver in that same region. Use an independent SaaS monitor or a minimal serverless endpoint in a different cloud provider.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Alert on Pipeline Latency, Not Just Hard Down:&lt;/strong&gt; Set your external grace period tightly (2x to 2.5x of your &lt;code&gt;repeatInterval&lt;/code&gt;). If Alertmanager is heavily throttled due to memory pressure, delayed pings will surface degradation before a complete crash occurs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Include Direct Runbook Context:&lt;/strong&gt; Configure the external receiver's failure message with direct links to your out-of-band cluster access (bastion/VPN) and cloud status dashboards so responders do not waste time debugging via broken internal tools.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Inspired by real-world lessons from the November 12 outage and further reading on &lt;a href="https://www.franksworld.com/2026/11/12/the-importance-of-a-dead-mans-switch-in-modern-monitoring-systems" rel="noopener noreferrer"&gt;the importance of a Dead-Man's Switch in modern monitoring systems&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>sre</category>
      <category>kubernetes</category>
      <category>devops</category>
      <category>observability</category>
    </item>
    <item>
      <title>Zero-Downtime LLM Inference on Kubernetes Spot Instances (~70% GPU Cost Savings)</title>
      <dc:creator>riyankhamdani</dc:creator>
      <pubDate>Sun, 08 Nov 2026 01:39:06 +0000</pubDate>
      <link>https://dev.to/riyankhamdani/zero-downtime-llm-inference-on-kubernetes-spot-instances-70-gpu-cost-savings-6en</link>
      <guid>https://dev.to/riyankhamdani/zero-downtime-llm-inference-on-kubernetes-spot-instances-70-gpu-cost-savings-6en</guid>
      <description>&lt;p&gt;Self-hosting open-source Large Language Models (LLMs) like Llama 3, DeepSeek, or Mistral on dedicated On-Demand cloud GPU instances gets expensive rapidly. A typical 4x GPU setup easily exceeds 2,000 USD/month on AWS or GCP.&lt;/p&gt;

&lt;p&gt;Spot/Preemptible instances offer steep 65% to 75% discounts, but cloud providers can reclaim them with only a 30 to 120-second warning. Without an automated eviction mechanism, node preemptions cause dropped TCP connections, broken streaming completions, and severe HTTP 502/504 spikes.&lt;/p&gt;

&lt;p&gt;In this guide, we break down a production-grade Kubernetes architecture that achieves a 0.0% request failure rate during spot node evictions while automatically falling back to On-Demand nodes when spot capacity evaporates.&lt;/p&gt;

&lt;p&gt;💰 FinOps &amp;amp; Cost Breakdown&lt;/p&gt;

&lt;p&gt;Strategy&lt;/p&gt;

&lt;p&gt;Compute Nodes (4x GPUs)&lt;/p&gt;

&lt;p&gt;Monthly Cost (est.)&lt;/p&gt;

&lt;p&gt;Preemption Failure Rate&lt;/p&gt;

&lt;p&gt;Reliability Risk&lt;/p&gt;

&lt;p&gt;Standard On-Demand&lt;/p&gt;

&lt;p&gt;g4dn.xlarge (AWS) / g2-standard-4 (GCP)&lt;/p&gt;

&lt;p&gt;~$2,050 / mo&lt;/p&gt;

&lt;p&gt;0%&lt;/p&gt;

&lt;p&gt;None (High Cost)&lt;/p&gt;

&lt;p&gt;Naive Spot Instances&lt;/p&gt;

&lt;p&gt;Spot / Preemptible equivalents&lt;/p&gt;

&lt;p&gt;~$615 / mo&lt;/p&gt;

&lt;p&gt;12% - 25% dropped reqs&lt;/p&gt;

&lt;p&gt;High (HTTP 502/504 spikes)&lt;/p&gt;

&lt;p&gt;Spot + Resilient Architecture&lt;/p&gt;

&lt;p&gt;Spot with On-Demand Fallback&lt;/p&gt;

&lt;p&gt;~$635 / mo&lt;/p&gt;

&lt;p&gt;0.0% (Zero dropped reqs)&lt;/p&gt;

&lt;p&gt;Zero-Downtime&lt;/p&gt;

&lt;p&gt;🏗️ Architecture &amp;amp; Failover Mechanics&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;              [ Ingress / In-Cluster Service Proxy ]
                                |
        +-----------------------+-----------------------+
        |                                               |
        v                                               v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;[ Node Pool: Spot (Worker 2) ]              [ Node Pool: On-Demand (Worker 1) ]&lt;br&gt;
  +----------------------------+              +---------------------------------+&lt;br&gt;
  | [Spot Termination Daemon]  |              |                                 |&lt;br&gt;
  |  - Watches metadata API    |              |                                 |&lt;br&gt;
  |  - Triggers cordon &amp;amp; drain |              |                                 |&lt;br&gt;
  |                            |              |                                 |&lt;br&gt;
  | &lt;a href="https://dev.toActive"&gt;vLLM Pod 1&lt;/a&gt;      |  --Evict--&amp;gt;  | &lt;a href="https://dev.toScheduled%20here"&gt;vLLM Pod 1&lt;/a&gt;   |&lt;br&gt;
  | &lt;a href="https://dev.toPDB%20Locked"&gt;vLLM Pod 2&lt;/a&gt;  |  --Evict--&amp;gt;  | &lt;a href="https://dev.toScheduled%20after%201"&gt;vLLM Pod 2&lt;/a&gt;|&lt;br&gt;
  +----------------------------+              +---------------------------------+&lt;/p&gt;

&lt;p&gt;The 4 Pillars of Resilient Failover&lt;/p&gt;

&lt;p&gt;Autonomous Preemption Handler (DaemonSet):&lt;br&gt;
Runs strictly on nodes labeled node-type: spot. It accesses the host node name via the Kubernetes Downward API (spec.nodeName) and monitors cloud preemption metadata. Upon receiving a warning, it cordons the node and initiates an asynchronous kubectl drain.&lt;/p&gt;

&lt;p&gt;Pod Disruption Budget (PDB):&lt;br&gt;
Configured with minAvailable: 1. When the node drain fires, Kubernetes rejects simultaneous evictions. It forces sequential evacuation, keeping active inference pods alive until fallback pods pass readiness probes.&lt;/p&gt;

&lt;p&gt;Graceful Traffic Handover (preStop Hook):&lt;br&gt;
Inference pods delay shutdown using a lifecycle.preStop sleep hook (5–15 seconds). This grace period allows kube-proxy and ingress controllers to deregister the pod endpoint before the container process receives SIGTERM.&lt;/p&gt;

&lt;p&gt;Soft Node Affinity:&lt;br&gt;
Inference workloads use preferredDuringSchedulingIgnoredDuringExecution to prioritize Spot instances during standard scheduling cycles, but fall back seamlessly to On-Demand nodes when Spot capacity is exhausted.&lt;/p&gt;

&lt;p&gt;🧪 Validating the Failover Locally with Kind&lt;/p&gt;

&lt;p&gt;You can validate this entire failover flow locally without renting cloud GPU instances by using kind (Kubernetes in Docker).&lt;/p&gt;

&lt;p&gt;Step 1: Provision the Multi-Node Cluster&lt;/p&gt;

&lt;p&gt;Create a cluster with heterogeneous node labels representing Spot and On-Demand pools:&lt;/p&gt;

&lt;h1&gt;
  
  
  kind-config.yaml
&lt;/h1&gt;

&lt;p&gt;kind: Cluster&lt;br&gt;
apiVersion: kind.x-k8s.io/v1alpha4&lt;br&gt;
nodes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;role: control-plane&lt;/li&gt;
&lt;li&gt;role: worker
labels:
node-type: on-demand&lt;/li&gt;
&lt;li&gt;role: worker
labels:
node-type: spot&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Apply the configuration:&lt;/p&gt;

&lt;p&gt;kind create cluster --name spot-lab --config kind-config.yaml&lt;/p&gt;

&lt;p&gt;Step 2: Deploy Workloads &amp;amp; Preemption DaemonSet&lt;/p&gt;

&lt;p&gt;Deploy the inference service, PodDisruptionBudget, and the preemption listener:&lt;/p&gt;

&lt;p&gt;kubectl apply -f &lt;a href="https://raw.githubusercontent.com/riyankhamdani/spot-llm-k8s/main/k8s/vllm-resilient.yaml" rel="noopener noreferrer"&gt;https://raw.githubusercontent.com/riyankhamdani/spot-llm-k8s/main/k8s/vllm-resilient.yaml&lt;/a&gt;&lt;br&gt;
kubectl apply -f &lt;a href="https://raw.githubusercontent.com/riyankhamdani/spot-llm-k8s/main/k8s/spot-handler.yaml" rel="noopener noreferrer"&gt;https://raw.githubusercontent.com/riyankhamdani/spot-llm-k8s/main/k8s/spot-handler.yaml&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Step 3: Run the Chaos Test&lt;/p&gt;

&lt;p&gt;In your first terminal, simulate continuous live inference requests from an in-cluster client locked to the on-demand worker:&lt;/p&gt;

&lt;p&gt;kubectl run traffic-tester --rm -it --image=curlimages/curl --restart=Never \&lt;br&gt;
  --overrides='{"spec":{"nodeSelector":{"node-type":"on-demand"}}}' -- sh -c '&lt;br&gt;
  SUCCESS=0; FAILED=0;&lt;br&gt;
  while true; do&lt;br&gt;
    STATUS=$(curl -s -o /dev/null -w "%{http_code}" --connect-timeout 2 -X POST &lt;a href="http://vllm-service:8000/v1/completions" rel="noopener noreferrer"&gt;http://vllm-service:8000/v1/completions&lt;/a&gt; -H "Content-Type: application/json" -d "{\"prompt\": \"Test\"}")&lt;br&gt;
    [ "$STATUS" -eq 200 ] &amp;amp;&amp;amp; SUCCESS=$((SUCCESS+1)) || FAILED=$((FAILED+1))&lt;br&gt;
    echo "[$(date +%T)] Status: $STATUS | Success: $SUCCESS | Failed: $FAILED"&lt;br&gt;
    sleep 0.3&lt;br&gt;
  done'&lt;/p&gt;

&lt;p&gt;In a second terminal, trigger a simulated spot termination signal:&lt;/p&gt;

&lt;p&gt;POD_NAME=$(kubectl get pods -l app=spot-termination-handler -o jsonpath='{.items[0].metadata.name}')&lt;br&gt;
kubectl exec -it $POD_NAME -- touch /tmp/preempt_signal&lt;/p&gt;

&lt;p&gt;Observation:&lt;/p&gt;

&lt;p&gt;The DaemonSet detects the signal, immediately marks the spot worker as SchedulingDisabled, and initiates sequential pod eviction.&lt;/p&gt;

&lt;p&gt;The PodDisruptionBudget maintains an active replica while the displaced replica spins up on the fallback on-demand node.&lt;/p&gt;

&lt;p&gt;The traffic generator maintains continuous 200 OK responses with a 0.0% failure rate.&lt;/p&gt;

&lt;p&gt;☁️ Production Cloud Migration&lt;/p&gt;

&lt;p&gt;To run this in live production environments (AWS EKS or GCP GKE):&lt;/p&gt;

&lt;p&gt;Metadata Endpoint Polling:&lt;br&gt;
Replace the local file trigger in the DaemonSet with HTTP calls pointing to cloud provider metadata:&lt;/p&gt;

&lt;p&gt;AWS IMDSv2:&lt;/p&gt;

&lt;p&gt;TOKEN=$(curl -s -S -X PUT "&lt;a href="http://169.254.169.254/latest/api/token" rel="noopener noreferrer"&gt;http://169.254.169.254/latest/api/token&lt;/a&gt;" -H "X-aws-ec2-metadata-token-ttl-seconds: 60")&lt;br&gt;
curl -s -H "X-aws-ec2-metadata-token: $TOKEN" &lt;a href="http://169.254.169.254/latest/meta-data/spot/instance-action" rel="noopener noreferrer"&gt;http://169.254.169.254/latest/meta-data/spot/instance-action&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GCP Metadata:&lt;/p&gt;

&lt;p&gt;curl -s -H "Metadata-Flavor: Google" &lt;a href="http://metadata.google.internal/computeMetadata/v1/instance/preempted" rel="noopener noreferrer"&gt;http://metadata.google.internal/computeMetadata/v1/instance/preempted&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Production Image &amp;amp; GPU Limits:&lt;br&gt;
Switch the mock inference container image to official vllm/vllm-openai:latest and declare explicit GPU limits (nvidia.com/gpu: 1).&lt;/p&gt;

&lt;p&gt;📦 Source Code&lt;/p&gt;

&lt;p&gt;All Kubernetes manifests, kind configuration files, and chaos testing scripts are available in the GitHub repository:&lt;/p&gt;

&lt;p&gt;👉 github.com/riyankhamdani/spot-llm-k8s&lt;/p&gt;

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