A lab to help you setup, explore, and test Prometheus metrics using a Python app running on Kubernetes. Enjoy!
app
- a Python app for which we'll create a docker image, run in Kubernetes, and see that it is instrumented with Prometheusk8s_resources
- the Kubernetes resources required to run the Python appscripts
- supporting scriptslab
- documentation to help you setup a development Kubernetes cluster and test the app
Please work from one terminal only. Why?
- In the beginning, we temporarily alter the path and set environment variables.
- At the end, we rely on previously set environment variables to do tear-down, and return your computer to a predictable state.
- Clone this repo
- Replace
kylos101
in image-build.sh with your own account on Docker Hub. - Replace
kylos101
fortemplate.spec.containers[0].image
with your account on Docker Hub in deployment.yaml. - Setup a lab environment.
- Explore, test, and then teardown the lab environment.
The Prometheus chart ingests metrics from pods if they have corresponding annotations. You'll see them in deployment.yaml.
- Not seeing metrics in Prometheus? Port forward to Prometheus, and check if the target endpoint is listed, and if it is up/down.