https://github.com/randsw/kubeinfo
Gets information about some resources in kubernetes cluster. Including CR.
https://github.com/randsw/kubeinfo
client-go crd docker github-actions golang helm helm-chart k8s kube-api kubernetes
Last synced: 2 months ago
JSON representation
Gets information about some resources in kubernetes cluster. Including CR.
- Host: GitHub
- URL: https://github.com/randsw/kubeinfo
- Owner: Randsw
- Created: 2023-04-03T16:51:12.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-07-29T14:47:50.000Z (2 months ago)
- Last Synced: 2025-07-29T17:26:57.948Z (2 months ago)
- Topics: client-go, crd, docker, github-actions, golang, helm, helm-chart, k8s, kube-api, kubernetes
- Language: Go
- Homepage: https://randsw.github.io/kubeinfo/
- Size: 11.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
Kubeinfo
Get information about resources in kubernetes cluster
## Introduction
:warning: **Attention**
**This project created for educational purposes and serves as proof-of-concept. Another goal is to learn how to work with Kubernetes CRD and CR using client-go library. As a CRD for information i choose my favorite GitOps tool - [FluxCD](https://fluxcd.io/)**## Content
1. [Requirements](#requirements)
2. [Overview](#overview)
* [Metrics](#metrics)
* [Health](#health)
3. [Examples](#examples)
* [Docker](#docker)
* [Kubernetes](#kubernetes)## Requirements
[Helm](https://helm.sh/docs/intro/install/) version **3.10.1** or newer
[Kubernetes](https://kubernetes.io) version **1.23.1** or newer
[Fluxcd](https://fluxcd.io/) version **0.40.1** or newer## Overview
This application listen at port **8080** and provides several endpoints
| endpoint | HTTP Verb |return | return value|
|---------------------|-----------------------|-------------|-------------|
| / | GET | All of the following | [struct](https://github.com/Randsw/kubeinfo/blob/e27d51c9f40db18d2ad56718052483812042f68d/KubeApiResponseStruct/kubeapiresponsestruct.go#L53-L60) |
| /nodes | GET | Overall number of nodes and number of nodes by role(control-plane or worker) | [struct](https://github.com/Randsw/kubeinfo/blob/e27d51c9f40db18d2ad56718052483812042f68d/KubeApiResponseStruct/kubeapiresponsestruct.go#L10-L16) |
| /namespaces | GET | Overall number of namespaces | [struct](https://github.com/Randsw/kubeinfo/blob/e27d51c9f40db18d2ad56718052483812042f68d/KubeApiResponseStruct/kubeapiresponsestruct.go#L18-L20) |
| /pods | GET | Overall number of pods and number of pods by phase | [struct](https://github.com/Randsw/kubeinfo/blob/e27d51c9f40db18d2ad56718052483812042f68d/KubeApiResponseStruct/kubeapiresponsestruct.go#L22-L25)
| /ingresses | GET | Overall number of ingresses | [struct](https://github.com/Randsw/kubeinfo/blob/e27d51c9f40db18d2ad56718052483812042f68d/KubeApiResponseStruct/kubeapiresponsestruct.go#L27-L29) |
| /fluxkustomizations | GET | Overall number of fluxkustomizations and number of fluxkustomizations by status | [struct](https://github.com/Randsw/kubeinfo/blob/e27d51c9f40db18d2ad56718052483812042f68d/KubeApiResponseStruct/kubeapiresponsestruct.go#L37-L40) |
| /fluxhelmreleases | GET | Overall number of fluxhelmreleases and number of fluxhelmreleases by status | [struct](https://github.com/Randsw/kubeinfo/blob/e27d51c9f40db18d2ad56718052483812042f68d/KubeApiResponseStruct/kubeapiresponsestruct.go#L48-L51) |### Metrics
Prometheus metrcis exposed on port **8080** via `/metrics` endpoint.
### Health
Healthcheck provided by `/healthz` endpoint on port **8080**
## Examples
### Docker
To build image with application run
`docker build-t kubeinfo: .`
Then push container to your favorite registry
### Kubernetes
To deploy kubeinfo in kubernetes cluster use helm package manager
First clone this repo
`git clone https://github.com/Randsw/kubeinfo.git`
Then go to folder `helm-chart/kubeinfo-backend`
`cd helm-chart/kubeinfo-backend`
And install helm chart in your kubernetes cluster
`helm upgrade --install --namespace --create-namespace .`
Don\`t forget edit `values.yaml` for your needs, specially rigth image name and other settings or just provide your values file
`helm upgrade --install --namespace --create-namespace -f .`
If this code helped solve your problem or helped point you in the right direction, I will be very happy!