Monitoring - Kubernetes Cluster

12/13/2019

Let’s say I just got a Kubernetes cluster provisioned and every second hour I want to check that all my cluster services are healthy and running as expected.

Is there a framework/configuration that supports testing for kubernetes cluster and services. Precisely speaking a monitoring system that does a periodic check on clusters and network partitions.

-- Amit kumar
kubernetes
kubernetes-health-check
kubernetes-helm
kubernetes-pod
kubernetes-service

2 Answers

12/14/2019

Testing kubernetes cluster could very wide area depending whether you want to check application running on cluster needs testing or versions of code on cluster/pods. Assuming you are looking state of pods ( which are the compute power in kubernetes) , try configuring liveness probe on each of the pods. Example as below

livenessProbe:
  httpGet:
    path: /healthz
    port: 8080
    httpHeaders:
    - name: Custom-Header
      value: Awesome

If you want something that sits outside, then create a script to check events Below command gives the events on all namespaces and greps fatal/warning

kubectl get events --all-namespaces | grep "Fatal\|Warning"

-- Shambu
Source: StackOverflow

12/13/2019

The smoke testing is different than the monitoring system. Please read Wikipedia for smoke testing.

Your requirement is for having a monitoring mechanism of services deployed in the Kubernetes cluster which is done through readiness and liveliness probe that is provided by Kubernetes, it can be used for rolling upgrade, high availability of services, documentation.

This is another good article for managing the lifecycle of your services.

-- Vishrant
Source: StackOverflow