Is there any open-source tool or logic by which I can get the continuous status of K8s resources. For example if have 10 deployments running on my K8s cluster then I want to keep checking the current operational status of those deployments. Similarly, this will hold good for other resources like Replica sets, stateful sets, Daemon sets, etc. Currently, I have a logic that is dependent on the specific deployment hence looking out on something which can be generic for all deployments.
Couple of really simple ways to do this are using command like:
kubectl get deployments -w
or
watch kubectl get deployments
As @rock'n rolla correctly pointed out, kubectl get -w
is a really easy way to get basic information about the state of different Kubernetes resources.
If you need a more powerful tool that can quickly visualize cluster health, you can use the Kubernetes Dashboard or one of the many alternatives.
Personally I like to use the k8dash - Kubernetes Dashboard because it's really easy to install and we can fully manage the cluster via the k8dash
web interface.
I will describe how you can install and use k8dash
.
As described in the k8dash - Getting Started documentation, you can deploy k8dash
with the following command:
$ kubectl apply -f https://raw.githubusercontent.com/indeedeng/k8dash/master/kubernetes-k8dash.yaml
To access k8dash
, you must make it publicly visible using Ingress
(see: Running k8dash with Ingress) or NodePort
(see: Running k8dash with NodePort).
After exposing the dashboard, the easiest way to log into it is to create a dedicated service account (see: Service Account Token).
Using k8dash
UI dashboard is pretty intuitive, you can monitor Nodes
, Pods
, ReplicaSets
, Deployments
, StatefulSets
and more. Real time charts help quickly track down poorly performing resources.