mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-02-14 10:19:52 +00:00
v0.x
k8s-podinfo
Podinfo is a tiny web application made with Go that showcases best practices of running microservices in Kubernetes.
Specifications:
- Release automation (Make/TravisCI/CircleCI/Quay.io/Google Cloud Container Builder/Skaffold/Weave Flux)
- Multi-platform Docker image (amd64/arm/arm64/ppc64le/s390x)
- Health checks (readiness and liveness)
- Graceful shutdown on interrupt signals
- Watches for secrets and configmaps changes and updates the in-memory cache
- Prometheus instrumentation (RED metrics)
- Dependency management with golang/dep
- Structured logging with zerolog
- Error handling with pkg/errors
- Helm chart
Web API:
GET /prints runtime information, environment variables, labels and annotationsGET /versionprints podinfo version and git commit hashGET /metricshttp requests duration and Go runtime metricsGET /healthzused by Kubernetes liveness probeGET /readyzused by Kubernetes readiness probePOST /readyz/enablesignals the Kubernetes LB that this instance is ready to receive trafficPOST /readyz/disablesignals the Kubernetes LB to stop sending requests to this instanceGET /errorreturns code 500 and logs the errorGET /paniccrashes the process with exit code 255POST /echoechos the posted content, logs the SHA1 hash of the contentGET /echoheadersprints the request HTTP headersPOST /joblong running job, json body:{"wait":2}GET /configsprints the configmaps and/or secrets mounted in theconfigvolumePOST /writewrites the posted content to disk at /data/hash and returns the SHA1 hash of the contentPOST /readreceives a SHA1 hash and returns the content of the file /data/hash if existsPOST /backendforwards the call to the backend service onhttp://backend-podinfo:9898/echo
Guides
Description
Languages
Go
76.4%
CUE
11.8%
HTML
3.8%
Makefile
3.5%
Shell
2.4%
Other
2.1%