Kubernetes Health Checks
Adds /health endpoint for Kubernetes health checks
Strapi Health Plugin
A lightweight Strapi plugin that provides health check endpoints for monitoring and Kubernetes readiness/liveness probes.
Features
- ✅ Simple health endpoint at
/health
- ✅ Returns uptime, status, and timestamp
- ✅ Perfect for Kubernetes readiness/liveness probes
- ✅ Zero configuration required
- ✅ Minimal performance impact
Installation
npm install strapi-health-plugin
After installation, rebuild your Strapi application:
npm run build
# or
strapi build
Usage
Once installed, the plugin automatically exposes a health endpoint at:
1GET /health
Response Format
1{
2 "uptime": 19122.561740091,
3 "message": "OK",
4 "timestamp": 1696513452150
5}
uptime
: Process uptime in secondsmessage
: Status message ("OK" when healthy)timestamp
: Current timestamp in milliseconds
Kubernetes Configuration
Readiness Probe
1readinessProbe:
2 httpGet:
3 path: /health
4 port: 1337
5 initialDelaySeconds: 30
6 periodSeconds: 10
Liveness Probe
1livenessProbe:
2 httpGet:
3 path: /health
4 port: 1337
5 initialDelaySeconds: 60
6 periodSeconds: 30
Docker Health Check
1HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
2 CMD curl -f http://localhost:1337/health || exit 1
Troubleshooting
Plugin Not Loading
- Ensure you've run
npm run build
after installation - Check that the plugin is listed in your
package.json
dependencies - Restart your Strapi application
Endpoint Not Accessible
- Verify your Strapi server is running
- Check if custom middleware is blocking the endpoint
- Ensure no conflicting routes exist
Permission Issues
The health endpoint is publicly accessible by default. If you need to restrict access, you can modify the route configuration in your Strapi application.
Contributing
Contributions are welcome! Please read our Contributing Guidelines before submitting PRs.
Releases
This project uses Changesets for automated releases:
npm run changeset # Add changeset after changes
git push # Triggers release PR
Security
For security concerns, please see our Security Policy.
License
MIT © Remi Kristelijn
Support
Made with ❤️ for the Strapi community
Install now
npm install strapi-health-plugin
Create your own plugin
Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.