https://github.com/ratulsharker/k8-probes
Exploring kubernetes probes.
https://github.com/ratulsharker/k8-probes
docker express kubernetes liveliness nodejs probes readiness readiness-probe readiness-probes startup
Last synced: 2 months ago
JSON representation
Exploring kubernetes probes.
- Host: GitHub
- URL: https://github.com/ratulsharker/k8-probes
- Owner: ratulSharker
- License: mit
- Created: 2023-11-27T09:53:13.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-05T05:25:32.000Z (about 1 year ago)
- Last Synced: 2025-12-06T19:47:47.208Z (6 months ago)
- Topics: docker, express, kubernetes, liveliness, nodejs, probes, readiness, readiness-probe, readiness-probes, startup
- Language: JavaScript
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://dev.to/ratulsharker/my-understanding-was-wrong-about-readiness-and-liveliness-probes-1bl8)     [](https://github.com/ratulSharker/k8-probes/actions/workflows/docker-image-push.yml)
# k8-probes
## Blog post:
This repository is better accompanied with the blog post [My understanding was wrong about readiness and liveliness probes](https://dev.to/ratulsharker/my-understanding-was-wrong-about-readiness-and-liveliness-probes-1bl8) and [killercoda.com](https://killercoda.com)
## Background:
For better availability of services, kubernetes offers three type of probes:
- Startup Probe.
- Readiness Probe.
- Liveliness Probe.
To accomodate exploring these probes, requires following:
- A simple rest service.
- Containerisation of the rest service.
- Kubernetes deployment definitions.
This repository covers all above points for exploring the kubernetes probes.
## Implementation details:
**Rest Service:**
- A simple nodejs + expressjs service.
- Exposed three routes `/liveliness`, `/readiness` & `/startup`.
- Each of these routes logs with timestamp.
- Each of these routes response code can be controlled via environment variables.
**Containersation:**
- Docker is used in containerisation of the rest service.
- Used [Dockerhub](https://hub.docker.com) to store the container image.
- `docker-compose.yaml` for local testing and image pushing into [Dockerhub](https://hub.docker.com).
**Kubernetes Deployment:**
- `playground` named namespace declared in the definition.
- Environments variables are configured for response codes for routes.
- Two different deployment files added, with `startup` probe and another without `startup` probe configured.