GitHub – soub4i/kubestatus-operator: kubestatus operator

Kubestatus is an free and open-source tool to easily add status page to your Kubernetes cluster that currently display the status (operational, degraded or DOWN) of services.It is written in Go and uses the Kubernetes API to fetch information about the clusters and resources checck the kubestatus-operand image.
The tool provides a simple and convenient way to view the current state of your cluster and resources without having to use the kubectl command-line tool or the Kubernetes dashboard and in the same time give you a costumer friendly page that can be used as you main status page.
Features:
- ⚡ Lightweight
- 🔧 Minimal configuration
- 📖 Open-source
- 📫 Support TCP and UDP services
Before installing the KubeStatus Operator, ensure you have:
- Kubernetes cluster version 1.19+
- kubectl installed and configured
- Cluster admin access or appropriate RBAC permissions
You can install the KubeStatus Operator using the following command:
kubectl apply -f https://raw.githubusercontent.com/soubai/kubestatus-operator/main/dist/install.yaml
- Clone the repository:
git clone https://github.com/soubai/kubestatus-operator.git
cd kubestatus-operator
- Install the CRDs:
kubectl apply -f config/crd/bases
- Install the operator:
kubectl apply -f dist/install.yaml
- Check if the operator pod is running:
kubectl get pods -n kubestatus-operator-system
- Verify the CRDs are installed:
kubectl get crds | grep kubestatus
- Create a KubeStatus resource:
apiVersion: crd.soubai.me/v1
kind: KubeStatus
metadata:
name: sample-kubestatus
spec:
# Add your spec configuration here
- Apply the resource:
kubectl apply -f kubestatus-sample.yaml
- Check the status:
kubectl get kubestatus sample-kubestatus -o yaml
| Field | Type | Description | Required |
|---|---|---|---|
spec.Namespaces |
[]string | List of namesp | Yes |
spec.Size |
integer | Number of replicas of Kubestatus (default 3) |
No |
spec.ConfigMapName |
string | ConfigMap name used by Kubestatus (default kubestatus-configmap) |
No |
apiVersion: crd.soubai.me/v1
kind: KubeStatus
metadata:
name: dub-cluster12-status
spec:
namespaces:
- default
- web-namepace
Size: 1
To monitor your services with KubeStatus, you need to add them to the watch list. You can do this by adding a specific annotation to each service you want to monitor:
kubectl annotate svc my-service-name kubestatus/watch='true'
You created this web application based on nginx image.
cat <<EOF | kubectl apply -f -
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
selector:
matchLabels:
app: nginx
replicas: 1
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
EOF
Exposing the web application using k8s service
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Service
metadata:
name: web-service
spec:
selector:
app: nginx
ports:
- port: 80
EOF
Add annotation to web-service:
kubectl annotate svc web-service kubestatus/watch='true'
In order to visit kubestatus status page you can port-forword the Kubestatus service:
kubectl port-forward service/kubestatus-service 8080 -n kubestatus
🚀 Now navigate to http://localhost:8080 you should see your status page like this:
-
Operator pod not starting:
kubectl logs -n kubestatus-operator-system deployment/kubestatus-operator-controller-manager -c manager
-
Status not updating:
- Check the operator logs for errors
- Verify the KubeStatus resource is properly configured
If you encounter any issues:
- Open an issue on GitHub
- Check existing issues for solutions
- Include operator logs and resource definitions when reporting problems
To remove the KubeStatus Operator from your cluster:
kubectl delete -f dist/install.yaml
kubectl delete -f config/crd/bases
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the Apache License 2.0.



