envinfo
Getting started
EnvInfo is an open-source project. This goal is to provide a very small micro-service which display the execution environment in a JSON on the HTTP protocol.
It is written in the Rust language with the Rocket framework and offers a container image for using in a Kubernetes cluster, for example.
Below, find the instruction for localy rebuild the project and create a container image (based on docker runtime). Else, the current docker image is provide in gitlab registry registry.gitlab.com/tech-engineering/tools/envinfo.
Build and run source codes
Build source code:
And run the source code, run http server on port 8000:
ROCKET_PROFILE=debug
Test with httpie:
http http://127.0.0.1:8000
Build container image
Build image for two platform CPU architecture (amd64 and arm64):
Remark: The port and address allow are configured for 0.0.0.0 on 8080.
Test the endpoints (with httpie):
Health probes implemented
The microservice implemented 4 endpoints:
/health/alive/health/ready/health/started/health
These endpoints respond with HTTP status 200 OK on success or 503 Service Unavailable on failure, and a JSON object like the following: Successful response for endpoints without additional per-check information:
Only for /health/started endpoint:
Deploy on kubernetes cluster
The yaml manifest is ready to use. Apply on your cluster:
Check it:
Using
Test the endpoints (with httpie):
Example, hostname of container:
|
or distro:
|
or ip:
|
or name of environment variables:
|
Search in particular an environment variable (here ROCKET_ADDRESS):
|
or (only value):
| |
Contributing
Thanks to participate at this project if you want :)
I need any ideas about what display informations, or other.