Good enough Kubernetes namespace visualization tool

Overview

Kubesurveyor

Good enough Kubernetes namespace visualization tool.
No provisioning to a cluster required, only Kubernetes API is scrapped.

Installation

sudo apt-get install graphviz
pip install kubesurveyor

Usage

Export path to a custom certification authority, if you use one for your Kubernetes cluster API

export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt

Alternatively, ignore K8S API certificate errors using --insecure or -k

kubesurveyor <namespace> --insecure

Show <namespace> namespace as a dot language graph, using currently active K8S config context

kubesurveyor <namespace>

Specify context to be used, if there are multiple in the K8S config file

kubesurveyor <namespace> --context <context>

Dump crawled namespace data to a YAML format for later processing

kubesurveyor <namespace> --context <context> --save > namespace.yaml

Load from YAML file, show as dot language graph

cat namespace.yaml | kubesurveyor <namespace> --load

Load from YAML file and render as png visualization to a current working directory

cat namespace.yaml | kubesurveyor <namespace> --load --out png

If you want to generate architecture image from dot definition by hand, use dot directly

dot -Tpng k8s.dot > k8s.png

Limitations:

  • unconnected pods, services are not shown
  • could have problems with deployments created by Tiller
  • number of replicas is not tracked
You might also like...
A tool for visualization and monitoring Redis cluster realtime
A tool for visualization and monitoring Redis cluster realtime

Redat is a tool for visualize Redis-cluster on terminal Features: Visualize master-replicas relations in the Redis cluster Monitor with metrics: memor

k6-to-honeycomb is a program that sends k6 results into Honeycomb for visualization and analysis.
k6-to-honeycomb is a program that sends k6 results into Honeycomb for visualization and analysis.

k6-to-honeycomb k6-to-honeycomb is a program that sends k6 results into Honeycomb for visualization and analysis. Getting Started k6-to-honeycomb is a

Kubernetes OS Server - Kubernetes Extension API server exposing OS configuration like sysctl via Kubernetes API

KOSS is a Extension API Server which exposes OS properties and functionality using Kubernetes API, so it can be accessed using e.g. kubectl. At the moment this is highly experimental and only managing sysctl is supported. To make things actually usable, you must run KOSS binary as root on the machine you will be managing.

Litmus helps Kubernetes SREs and developers practice chaos engineering in a Kubernetes native way.
Litmus helps Kubernetes SREs and developers practice chaos engineering in a Kubernetes native way.

Litmus Cloud-Native Chaos Engineering Read this in other languages. 🇰🇷 🇨🇳 🇧🇷 🇮🇳 Overview Litmus is a toolset to do cloud-native chaos engineer

 KEDA is a Kubernetes-based Event Driven Autoscaling component. It provides event driven scale for any container running in Kubernetes
KEDA is a Kubernetes-based Event Driven Autoscaling component. It provides event driven scale for any container running in Kubernetes

Kubernetes-based Event Driven Autoscaling KEDA allows for fine-grained autoscaling (including to/from zero) for event driven Kubernetes workloads. KED

network-node-manager is a kubernetes controller that controls the network configuration of a node to resolve network issues of kubernetes.
network-node-manager is a kubernetes controller that controls the network configuration of a node to resolve network issues of kubernetes.

Network Node Manager network-node-manager is a kubernetes controller that controls the network configuration of a node to resolve network issues of ku

A k8s vault webhook is a Kubernetes webhook that can inject secrets into Kubernetes resources by connecting to multiple secret managers
A k8s vault webhook is a Kubernetes webhook that can inject secrets into Kubernetes resources by connecting to multiple secret managers

k8s-vault-webhook is a Kubernetes admission webhook which listen for the events related to Kubernetes resources for injecting secret directly from sec

Carrier is a Kubernetes controller for running and scaling game servers on Kubernetes.
Carrier is a Kubernetes controller for running and scaling game servers on Kubernetes.

Carrier is a Kubernetes controller for running and scaling game servers on Kubernetes. This project is inspired by agones. Introduction Genera

Kubei is a flexible Kubernetes runtime scanner, scanning images of worker and Kubernetes nodes providing accurate vulnerabilities assessment, for more information checkout:
Kubei is a flexible Kubernetes runtime scanner, scanning images of worker and Kubernetes nodes providing accurate vulnerabilities assessment, for more information checkout:

Kubei is a vulnerabilities scanning and CIS Docker benchmark tool that allows users to get an accurate and immediate risk assessment of their kubernet

Comments
  • Fails to run for Python 3.9

    Fails to run for Python 3.9

    Does not seem to work for me on MacOS Big Sur with Python 3.9 and everything installed via brew.

    brew install graphviz
    pip3 install kubesurveyor
    
    kubesurveyor default           
    Traceback (most recent call last):
      File "/usr/local/bin/kubesurveyor", line 8, in <module>
        sys.exit(parse_args())
      File "/usr/local/lib/python3.9/site-packages/kubesurveyor/main.py", line 362, in parse_args
        main(args)
      File "/usr/local/lib/python3.9/site-packages/kubesurveyor/main.py", line 272, in main
        viz_dot = visualize()
      File "/usr/local/lib/python3.9/site-packages/kubesurveyor/main.py", line 203, in visualize
        label=proto,
    UnboundLocalError: local variable 'proto' referenced before assignment
    
    pip3 --version
    pip 21.1.1 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)
    cat /usr/local/bin/kubesurveyor
    #!/usr/local/opt/[email protected]/bin/python3.9
    # -*- coding: utf-8 -*-
    import re
    import sys
    from kubesurveyor.main import parse_args
    if __name__ == '__main__':
        sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
        sys.exit(parse_args())
    
    
    opened by patrick-stephens 2
Releases(1.0.0)
Command kube-tmux prints Kubernetes context and namespace to tmux status line.

kube-tmux Command kube-tmux prints Kubernetes context and namespace to tmux status line.

null 7 Sep 10, 2021
K8s-ingress-health-bot - A K8s Ingress Health Bot is a lightweight application to check the health of the ingress endpoints for a given kubernetes namespace.

k8s-ingress-health-bot A K8s Ingress Health Bot is a lightweight application to check the health of qualified ingress endpoints for a given kubernetes

Aaron Tam 0 Jan 2, 2022
Kubernetes Admission Controller Demo: Validating Webhook for Namespace lifecycle events

Kubernetes Admission Controller Based on How to build a Kubernetes Webhook | Admission controllers Local Kuberbetes cluster # create kubernetes cluste

Marco Lehmann 2 Feb 27, 2022
Turn a heterogeneous pile of text docs into a single web page with good search.

Codex Codex turns an unstructured pile of heterogeneous documents into a single interactive web document. Your input documents maybe in markdown, TeX,

Amir Kadivar 4 Jan 2, 2022
Quick find namespace and show log

kubernetes dashboard "替代品" 在terminal发起http请求查看kubernetes相关的信息 注意 本程序以查看当前namespace、deployment、pod等信息为主, 面向业务开发人员,主要原因是权限受限。如果是运维人员绕行即可 当前只是使用与token登录方

clibing 1 Dec 23, 2021
To copy a secret to another namespace and sync it up-to-date

Secret Mirror Operator This kubebuilder-based Kubernetes operator copies a Secret to another namespace and synchronizes it with the custom resource Se

 beBit, Inc. 2 Jul 20, 2022
Enforcing per team quota (sum of used resources across all their namespaces) and delegating the per namespace quota to users.

Quota Operator Enforcing per team quota (sum of used resources across all their namespaces) and delegating the per namespace quota to users. Instructi

Snapp Cab Incubators 16 Nov 9, 2022
Go-namesys - Go-namesys provides publish and resolution support for the /ipns/ namespace

go-namesys go-namesys provides publish and resolution support for the /ipns/ nam

y 0 Jan 18, 2022
A kubectl plugin to query multiple namespace at the same time.

kubemulti A kubectl plugin to query multiple namespace at the same time. $ kubemulti get pods -n cdi -n default NAMESPACE NAME

R0CKSTAR 3 Mar 1, 2022
Display (Namespace, Pod, Container, Primary PID) from a host PID, fails if the target process is running on host

Display (Namespace, Pod, Container, Primary PID) from a host PID, fails if the target process is running on host

K8s-school 13 Oct 17, 2022