This simple visualizer shows a set of pods related to services based on a namespace.
It is based on the gcp-live-visualizer but with some modifications.
- Kubernetes cluster
- Access to Kubernetes proxy via
kubectl
- Go into this repository.
- Target the Kubernetes cluster using
kubectl
. - Create a deployment & service with a
demo
label, complete with the application name. If you want to show dependencies, you can use theuses
label with a comma-separated list to point to other services the pods need to use. - Start the visualization. This requires access to the Kubernetes proxy.
make visualize
- Go to http://127.0.0.1:8001/visualize/.
There are two scripts that need to be run for the demo. One can be run in the background to kill pods, while the other checks the endpoints to ensure it remains alive and well.
- Make sure the Kubernetes proxy and visualizer are up.
- Run
whac-a-pod.sh
. This takes a service and namespace and deletes a random number of pods.bash whac-a-pod.sh [service name] [optional: namespace, default] [optional: deletion interval, 10 seconds]
- In a separate shell, run
check-endpoint.sh
. This is an infinite loop that checks the API endpoint of a service to ensure it is up.bash check-endpoint.sh [service name] [API endpoint] [optional: ':port'] [optional: namespace, default]
- Open the visualizer on one side and the
check-endpoint
script on the other.
- If you want to point to a different namespace, you must go into
script.js
and edit thevar namespace
to use a separate one. - Deployments, pods, and services must have a
demo
label to show up. - Adding a
uses
label and a comma-separated list of services will visualize dependencies.