DevOpsLesson
DevOpsLesson

Free, comprehensive DevOps tutorials and learning roadmaps. Master Docker, Kubernetes, CI/CD, and more.

Stay Updated

Get notified about new tutorials and features.

Tutorials

  • What is DevOps?
  • Docker Tutorial
  • Terraform Tutorial
  • CI/CD Pipeline
  • All Tutorials

Roadmaps

  • DevOps Engineer
  • Cloud Engineer
  • SRE Path
  • All Roadmaps

Company

  • About Us
  • Blog
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 DevOpsLesson. All rights reserved.

DOCKERKUBERNETESTERRAFORMAWSCI/CDLINUXGITDEVOPS ROADMAPCLOUD ROADMAPSRE ROADMAPGIT CHEATSHEETDOCKER CHEATSHEETK8S CHEATSHEETTF CHEATSHEETLINUX CHEATSHEETDOCKERFILE LINTERYAML VALIDATORCRON PARSERREGEX TESTER

Kubernetes Tutorial

Introduction to Kubernetes
Kubernetes Architecture
Installing Kubernetes
kubectl Basics
Kubernetes Pods
Kubernetes Deployments
Kubernetes Services
ConfigMaps and Secrets
Kubernetes Storage
Kubernetes Namespaces
Kubernetes Resource Management
Helm for Kubernetes
Kubernetes Monitoring

Kubernetes Probes

PreviousPrev
Next

Use liveness, readiness, and startup probes to help Kubernetes know when your containers are healthy and ready for traffic.

Why Probes Matter

A container can be running but still unhealthy. It may be stuck, warming up, or unable to serve traffic. Probes help Kubernetes respond intelligently.

Probe Types

Liveness Probe

If the liveness probe fails repeatedly, Kubernetes restarts the container.

Readiness Probe

If the readiness probe fails, Kubernetes stops sending Service traffic to that pod.

Startup Probe

A startup probe gives slow-starting apps extra time before liveness checks begin.

Probe Method Comparison

Probe methodBest forNotes
httpGetWeb apps with health endpointsEasy to read and common
tcpSocketBasic port availability checksConfirms a port is open, not app correctness
execCustom logic inside containerFlexible but can be heavier

Full YAML Example

apiVersion: v1
kind: Pod
metadata:
  name: probed-app
spec:
  containers:
    - name: web
      image: nginx:1.27
      ports:
        - containerPort: 80
      startupProbe:
        httpGet:
          path: /
          port: 80
        failureThreshold: 30
        periodSeconds: 5
      livenessProbe:
        httpGet:
          path: /
          port: 80
        initialDelaySeconds: 10
        periodSeconds: 10
      readinessProbe:
        tcpSocket:
          port: 80
        initialDelaySeconds: 5
        periodSeconds: 5

Why These Three Probes Are Different

  • startupProbe protects slow startup
  • livenessProbe answers "should I restart this?"
  • readinessProbe answers "should I send traffic to this right now?"

Common Mistakes

Liveness Too Aggressive

If the liveness probe is too strict, Kubernetes may restart a healthy but slow app repeatedly.

No Readiness Probe

Without readiness checks, traffic may hit an app before it is actually ready.

Confusing Readiness with Liveness

Readiness should remove traffic. Liveness should recover a broken container.

Think of readiness like opening the front door for customers and liveness like deciding whether the shop is broken badly enough to reboot the entire register system.

Exercise

Readiness Meaning

What happens when a readiness probe fails?

Exercise

Startup Probe Use

Why would you add a startup probe?

PreviousPrev
Next

Continue Learning

Kubernetes Pod Manifest

Learn the anatomy of Pod YAML and understand the purpose of apiVersion, kind, metadata, labels, annotations, and the spec section.

20 min·Easy

Kubernetes Pod Lifecycle

Understand pod phases, container states, restart policies, and what Kubernetes does when pods or nodes fail.

20 min·Easy

Multi-container Pods

Learn when multiple containers should share a pod, including sidecar, ambassador, adapter, and init container patterns.

20 min·Easy

Explore Related Topics

Do

Docker Tutorials

Build the containers Kubernetes orchestrates

Te

Terraform Tutorials

Provision Kubernetes clusters as code

Try the Tool

YAML Validator

Validate Kubernetes manifests and any YAML files instantly.

On This Page

Why Probes MatterProbe TypesLiveness ProbeReadiness ProbeStartup ProbeProbe Method ComparisonFull YAML ExampleWhy These Three Probes Are DifferentCommon MistakesLiveness Too AggressiveNo Readiness ProbeConfusing Readiness with Liveness