-1

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
  • 2,169
  • 10
  • 25
  • 36
  • you are mixing multiple things here. What do you mean by "smoke testing for kubernetes" you smoke test the services that you deploy in the k8s cluster. K8s takes care of readiness and liveliness of the services to redirect the calls (both have a different purpose). Add more details to your question and I can answer it for you. – Vishrant Dec 13 '19 at 15:38
  • check this documentation https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ – Vishrant Dec 13 '19 at 16:01
  • This looks good! Thanks a ton @Vishrant. – Amit kumar Dec 13 '19 at 16:07

3 Answers3

1

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
  • 15,456
  • 11
  • 71
  • 120
0

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
  • 2,612
  • 1
  • 21
  • 16
0

Try out prometheus.

You can install prometheus using

$ helm install [RELEASE_NAME] prometheus-community/prometheus

Then edit the alertmanager.yml file accordingly setting the metrics and timing as you wish.

m4n0
  • 29,823
  • 27
  • 76
  • 89