Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Intelligence View
⚡ tsecurity.de Intelligence

Kubernetes Liveness & Readiness Probes for a Static Site: Stop 404-ing Your Traffic

You just containerized your static site (HTML, CSS, JS) using an nginx:alpine image. You deployed it to Kubernetes. It works locally. Then you get the page flip: 502 Bad Gateway or random Connection Refused errors during a rolling…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

You just containerized your static site (HTML, CSS, JS) using an nginx:alpine image. You deployed it to Kubernetes. It works locally.



Then you get the page flip: 502 Bad Gateway or random Connection Refused errors during a rolling update.



Why? Because Kubernetes thinks your container is "alive" and "ready" simply because the Nginx process is running—even if the configuration is broken, the disk is full, or the site is compiling.



Let's fix that. Here is the only guide you need for liveness and readiness probes on static sites.



The Golden Rule of Static Sites

Liveness ≠ Readiness.



Readiness: "Can I send traffic to this Pod right now?" (Startup & reloads)



Liveness: "Is the Pod broken beyond repair?" (Hard crashes)



For a static site, we use Readiness for startup delays and Liveness for deadlocks.



The Naive Approach (Don't do this)

Most tutorials tell you to do this:



yaml

livenessProbe:

httpGet:

path: /

port: 80

initialDelaySeconds: 5

periodSeconds: 10

Why this is bad for static sites:



Slow Builds: If you use a sidecar or initContainer to fetch a huge static bundle, the probe starts failing immediately. Kubernetes kills your pod before it finishes downloading.



404s happen: What if your app serves a 200 OK for /, but your CSS bundle main.css is corrupted? The pod is "alive" but the site is broken.



The Correct Setup: Two Probes, One Health Endpoint

Step 1: Create a Custom Health Endpoint

Do not probe /. Why? Because a CDN or browser cache might return a stale 200 OK. Instead, map a unique path like /health that returns a real status.



If you're using Nginx (the static site king), add this to your nginx.conf:



nginx

server {

listen 80;




location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
}

# Health check endpoint
location /health {
access_log off;
return 200 "healthy\n";
add_header Content-Type text/plain;
}




}

Step 2: Configuring the Readiness Probe (The "Slow Starter")

The readiness probe determines if your pod is ready to serve traffic. For static sites, the main risk is slow asset hydration (downloading from S3, building from Git, etc.).



yaml

readinessProbe:

httpGet:

path: /health

port: 80

initialDelaySeconds: 0 # Start checking immediately

periodSeconds: 5 # Check every 5 seconds

failureThreshold: 3 # Allow 3 failures (15 seconds) before marking Unready

successThreshold: 1 # One success = ready

Pro-tip: Set initialDelaySeconds: 0 and rely on failureThreshold. This way, your pod starts "NotReady" and only becomes "Ready" when Nginx actually responds.



Step 3: Configuring the Liveness Probe (The "Zombie Killer")

The liveness probe restarts the pod if it enters a deadlock. For static sites, this rarely happens, but you still need it.



Important: The liveness probe should be more conservative than readiness. You don't want Kubernetes restarting your pod during a brief, heavy load spike.



yaml

livenessProbe:

httpGet:

path: /health

port: 80

initialDelaySeconds: 30 # Give it time to start first

periodSeconds: 15

timeoutSeconds: 5

failureThreshold: 3 # Restart after 45 seconds of failures

Step 4: The Complete Deployment

Here is a production-ready static site deployment:



yaml

apiVersion: apps/v1

kind: Deployment

metadata:

name: static-site

spec:

replicas: 3

selector:

matchLabels:

app: static-site

template:

metadata:

labels:

app: static-site

spec:

containers:

- name: nginx

image: nginx:alpine

ports:

- containerPort: 80

# 🟢 The magic happens here

readinessProbe:

httpGet:

path: /health

port: 80

initialDelaySeconds: 0

periodSeconds: 5

failureThreshold: 3

livenessProbe:

httpGet:

path: /health

port: 80

initialDelaySeconds: 30

periodSeconds: 15

failureThreshold: 3

# 🟢 Make sure config is mounted

volumeMounts:

- name: nginx-config

mountPath: /etc/nginx/conf.d/default.conf

subPath: default.conf

volumes:

- name: nginx-config

configMap:






name: nginx-health-config



apiVersion: v1

kind: ConfigMap

metadata:

name: nginx-health-config

data:

default.conf: |

server {

listen 80;

location / {

root /usr/share/nginx/html;

try_files $uri $uri/ /index.html;

}

location /health {

return 200 "OK\n";

access_log off;

}

}

Advanced: Probing a "Real" Resource

Do you want to ensure the actual content is valid? Change the probe path from /health to a critical asset:



yaml

readinessProbe:

httpGet:

path: /index.html # The actual homepage

port: 80

# ... rest of config

But be careful: If you use index.html as your probe, and you delete a CSS file referenced in it, Kubernetes will correctly mark the pod Unready—but it might also restart it unnecessarily. Use this only if your static site is truly atomic (all files deploy together).



Common Static Site Pitfalls

Problem Symptom Fix

Git-sync sidecar slow Pod starts, probe fails Increase initialDelaySeconds or failureThreshold on readiness probe

Nginx config typo 500/502 errors No probe will save you; use ConfigMap validation in CI

Memory leak (rare) Pod slow but alive Liveness probe will restart it

Rolling update hanging Old pods terminate, new pods never get traffic Readiness probe failing? Check your health endpoint's dependencies

The Ultimate Static Site Rule

Readiness probe = Critical.

Liveness probe = Safety net.



For 99% of static sites, a basic httpGet on a custom /health endpoint is all you need. Don't overcomplicate it with exec commands or TCP probes.



What's your static site horror story? Let me know in the comments. 🚀

1. Sofort-Triage & Abwehrmaßnahmen

SOC Incident Playbook: Remote Code Execution (RCE) Defense
Syntax validiert (0 Fehler)
title: Detect Exploitation - Kubernetes Liveness & Readiness Probes for a Static Site: Stop 404-ing Your Traffic
id: ccbaee81-238f-4178-9131-69cd4c1ca6cf
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-27
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-27"
        description = "YARA Signature for "
    strings:
        $str = "Kubernetes Liveness & Readines" ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("Kubernetes Liveness  Readiness Probes fo")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*Kubernetes Liveness  Readiness Probes fo*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "Kubernetes Liveness  Readiness Probes fo"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc

2. Cyber Threat Intelligence & Forensik

🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Analyse für identifizierte Bedrohung auf Basis von Live-CTI (ENISA EUVD): CVSS 0.0 · EPSS 0.0% · CISA KEV: nein. Handlungsableitung aus den verlinkten Hersteller-Quellen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Kubernetes Liveness & Readiness Probes for a Static Site: Stop 404-ing Your Traffic

Thematisch verwandte Begriffe: Kubernetes, Liveness, Readiness, Probes · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-100739 | A vulnerability was detected in mathurvishal CloudClassroom-PHP-Project…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag