A simple tool that allows visualizing Kubernetes resources (Pods, Deployments, Replica Sets, and so on) from the specified Kubernetes namespace in real-time. Kubegraph also allows you to store the events from a Kubernetes cluster in a file, so you can replay the events again without connecting to the cluster. And last but not least, you can use the saved events to generate a standalone HTML file, that allows you to replay the visualization in your browser without the cluster and Kubegraph itself.
Examples of generated HTML for simple scenarios:
- Example 1
-
Create Replication Controller and Deployment, scale the Deployment up and down, use the Deployment to roll out a new version, and, finally, delete both Replication Controller and Deployment.
- Example 2
-
Install Sock Shop application and then delete it.
- Example 3
-
Install Sock Shop application and keep it running.
The project started as a proof of concept of a new monitoring system for Kubernetes, that works with a cluster through its public API and uses a Java client to watch Kubernetes resources. Kubegraph can be used to learn how basic Kubernetes resources work and what are the relationships between them.
The application is in development. Currently it is able to visualize: Nodes, Pods, Replication Controllers, Replica Sets, Deployments, Services. Also it shows connections between Pods and corresponding Replication Controller and Replica Sets. For Deployments, it shows corresponding Replica Sets.
Temporarily, the embedded HTTP server supports only one client: you can open more connections, but they will receive events in undetermined order.
Prerequisites:
-
Java SE 8
-
Running Kubernetes cluster
To build a "fat" jar:
$ ./gradlew shadowJar
Show usage information:
$ java -jar build/libs/kubegraph-all.jar
Start HTTP server on port 8080, connect to the Kubernetes cluster using the specified config file and watch the default
name name:
$ java -jar build/libs/kubegraph-all.jar watch -c ~/.kube/config
The same as above, but also save the cluster events to the specified file:
$ java -jar build/libs/kubegraph-all.jar watch -c ~/.kube/config -f session.yaml
Start HTTP server on port 8080 and play the recorded events from the specified file (Kubernetes cluster is not needed):
$ java -jar build/libs/kubegraph-all.jar load -f session.yaml
Generate a standalone HTML file from the specified file:
$ java -jar build/libs/kubegraph-all.jar load -f session.yaml --html session.html
-
Visualize other Kubernetes resources, such as Daemon Sets, Jobs, and so on
-
Visualize other connections between resources, for example, between Services and corresponding Pods
-
Visualize other resource properties, for example, Pod status
-
Monitor multiple namespaces
-
Make a graph configurable, for example which resources and connections to show
-
Make an HTML player more user friendly, for example, use a slider to navigate in time
-
Smart graph layout (currently, a graph can be messy, if there are a lot of connections)