Podinfo is a tiny internet software made with Go that showcases the perfect practices of working microservices in Kubernetes. Podinfo is utilized by CNCF initiatives like Flux and Flagger for end-to-end testing and workshops.
Golang Challenge Specs
- Well being checks (readiness and liveness)
- Sleek shutdown on interrupt indicators
- File watcher for secrets and techniques and configmaps
- Structured logging with zap
- 12-factor app with viper
- Fault injection (random errors and latency)
- Instrumented with Prometheus and Open Telemetry
- Swagger docs
- CUE, Helm and Kustomize installers
- Finish-to-Finish testing with Kubernetes Form and Helm
- Kustomize testing with GitHub Actions and Open Coverage Agent
- Multi-arch container picture with Docker buildx and Github Actions
- Container picture signing with Sigstore cosign
- CVE scanning with Trivy
Go Net API:
GET /
prints runtime dataGET /model
prints podinfo model and git commit hashGET /metrics
return HTTP requests length and Go runtime metricsPOST /readyz/allow
indicators the Kubernetes LB that this occasion is able to obtain site visitorsPOST /readyz/disable
indicators the Kubernetes LB to cease sending requests to this occasionGET /healthz
utilized by Kubernetes liveness probeGET /readyz
utilized by Kubernetes readiness probeGET /standing/{code}
returns the standing codeGET /panic
crashes the method with exit code 255POST /echo
forwards the decision to the backend service and echos the posted content materialGET /env
returns the setting variables as a JSON arrayGET /headers
returns a JSON with the request HTTP headersGET /delay/{seconds}
waits for the desired intervalPOST /token
points a JWT token legitimate for one minuteJWT=$(curl -sd 'anon' podinfo:9898/token | jq -r .token)
GET /token/validate
validates the JWT tokencurl -H "Authorization: Bearer $JWT" podinfo:9898/token/validate
GET /configs
returns a JSON with configmaps and/or secrets and techniques mounted within theconfig
quantityPOST/PUT /cache/{key}
saves the posted content material to RedisGET /cache/{key}
returns the content material from Redis if the important thing existsDELETE /cache/{key}
deletes the important thing from Redis if existsPOST /retailer
writes the posted content material to disk at /information/hash and returns the SHA1 hash of the content materialGET /retailer/{hash}
returns the content material of the file /information/hash if existsGET /ws/echo
echos content material through websocketspodcli ws ws://localhost:9898/ws/echo
GET /chunked/{seconds}
makes use oftransfer-encoding
sortchunked
to offer a partial response after which waits for the desired intervalGET /swagger.json
returns the API Swagger docs, used for Linkerd service profiling and Gloo routes discovery
Golang gRPC API
/grpc.well being.v1.Well being/Examine
well being checking