Skip to content

mjbright/k1spy

Repository files navigation

k1spy

Simple kubernetes dashboard for demos (written in Python3 - inspired by https://github.com/weibeld/k1s)

To run from a machine with kubeconfig

This is the preferred way to run k1s.py - with the best interactivity.

Make sure you have Python3 and the Python Kubernetes client installed.

To install pre-requisites on Ubuntu:

sudo apt-get update
sudo apt-get install -y python3 python3-pip

python3 -m pip install kubernetes

Note:: A safer option is to create a Python .venv environment.

To run k1s.py

./k1s.py

Use k1s.py to view only Pods

./k1s.py pods

Use k1s.py to view only Pods, PVs, PVCs

./k1s.py po,pv,pvc

To run from a Pod

This mode is included more as an exercise to demonstrate the use of ServiceAccounts and RBAC rules.

Create a k1spy Pod, a ServiceAccount and RBAC rules to allow to list various resources types

kubectl create -f kubectl_run_k1spy.yaml

Note: the RBAC rules allow access to the default Namespace only - you may want to create RoleBindings for other Namespaces

Wait for the Pod to be in the Running state - then check the logs

If all is well you should see something like the following:

Context: in-cluster / Namespace: default / Resources: all
services:
   kubernetes                       10.96.0.1      ClusterIP    Pending          443/TCP       eps:1/1 2d02h14m58s
pods:
   k1spy                            1/1  Running     192.168.80.234 /w2         12m22s [mjbright/k1spy]

Attach to the Pod stdout to see k1spy operating

You will see a display similar to the log output, which updates over time.

Note: k1s.py can be slow to update when accessed via attach

About

Simple kubernetes dashboard for demos (written in Python3 - inspired by https://github.com/weibeld/k1s)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published