Strapi plugin logo for Kubernetes Health Checks

Kubernetes Health Checks

Adds /health endpoint for Kubernetes health checks

Strapi Health Plugin

npm version license npm total downloads PRs Welcome GitHub stars Last Commit

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 seconds
  • message: 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

  1. Ensure you've run npm run build after installation
  2. Check that the plugin is listed in your package.json dependencies
  3. Restart your Strapi application

Endpoint Not Accessible

  1. Verify your Strapi server is running
  2. Check if custom middleware is blocking the endpoint
  3. 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

STATS

11 GitHub stars2184 weekly downloads

Last updated

1 day ago

Strapi Version

>=4.4.0 <6.0.0

Author

github profile image for Remi Kristelijn
Remi Kristelijn

Useful links

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.