This project provides a tool for visualizing Kubernetes clusters using Golang for the backend and React for the frontend. It allows users to easily view and understand their Kubernetes cluster configuration.
- Visualize Kubernetes cluster configuration
- Out-of-cluster configuration support
- In-cluster configuration
- Backend powered by Golang
- Frontend built with React
- Go (version 1.22.3 or higher)
- Node.js (version >= v20.10.0 or higher)
- npm (version >= 10.8 or higher)
- Access to a Kubernetes cluster
-
Clone the repository:
git clone https://github.com/Saumya40-codes/k8s-visualizer cd k8s-cluster-visualizer
-
Install backend dependencies:
go mod tidy
-
Install frontend dependencies:
cd ui npm install
-
Set the
KUBECONFIG
env variableEXPORT KUBECONFIG='path/to/your/.kube/config`
-
Start the backend server:
go run main.go
-
In a new terminal, start the frontend development server.
cd ui npm run dev
-
Open your browser and navigate to
http://localhost:5173
(or the appropriate port) -
Use the interface to visualize your Kubernetes cluster
- Run the following command
kubectl create -f https://raw.githubusercontent.com/Saumya40-codes/k8s-visualizer/refs/heads/master/yamls/all-in-one.yaml
-
Wait for respective deployments to get ready, you can check using
kubectl get pods
-
Port forwarding (Or you can expose the service running (see:
kubectl get svc
) you can seekubectl get pods
to see pod full tag/name of your podkubectl port-forward k8s-visualizer-frontend-yourrespectivetag 5173:5173
and
kubectl port-forward k8s-visualizer-backend-yourrespectivetag 8080:8080
-
Open your browser and navigate to
http://localhost:5173
(or the appropriate port) -
Use the interface to visualize your Kubernetes cluster