Back to home

Kubernetes Healthchecks main image

Kubernetes Healthchecks

If the application malfunctions, the pod and container may still be running but the application may no longer be running. This is where health checks come in.

Two types of health checks

  1. Running a command in the container periodically
  2. Periodic checks on a URL

The typical prod application behind a load balancer should always have health checks implemented in some way to ensure availability and resiliency.

Below you can see where the healthcheck is. You can check the port or container port name.

# pod-helloworld.yml apiVersion: v1 kind: Pod metadata: name: labels: app: helloworld spec: # The containers are listed here containers: - name: k8s-demo image: okeeffed/docker-demo ports: - containerPort: 3000 # ! This is the health check livenessProbe: httpGet: path: / port: 3000 initialDelaySeconds: 15 timeoutSeconds: 30

More explicit information can be found here.

Personal image

Dennis O'Keeffe

  • Melbourne, Australia

Hi, I am a professional Software Engineer. Formerly of Culture Amp, UsabilityHub, Present Company and NightGuru.
I am currently working on Visibuild.


Get fresh posts + news direct to your inbox.

No spam. We only send you relevant content.