Monitoring Kubernetes Resources

4/26/2019

What is the best way for monitoring Kubernetes Cluster. I have a social network website builded with nodejs and react. I need to know how much app resources I need per user (example: for 100 user per hour we must have 3 replcias of backend) What is the best solution to do this?

-- Mirnes Halilović
docker
google-kubernetes-engine
kubernetes
rancher

3 Answers

4/26/2019

The only valid way is to do stress testing (using for example AB or Jmeter) of your application and monitoring consumed resources using Prometheus and Grafana. You probably should also enable Horizontal Pod Autoscaler for your application to test how it scales with load.

If you don't have Prometheus and Grafana - here is a simple but powerful instruction way to install it: https://github.com/coreos/kube-prometheus

-- Vasily Angapov
Source: StackOverflow

4/26/2019

I saw based on the comment of a previous answer that you are using Rancher.

Rancher's 2.2 version includes the ability to deploy in-cluster monitoring using Prometheus and Grafana.

Check out https://rancher.com/docs/rancher/v2.x/en/cluster-admin/tools/monitoring/ for a breakdown of this. It's super simple to setup and get going.

-- Eamon Bauman
Source: StackOverflow

4/26/2019

Look at prometheus Operator. https://github.com/coreos/prometheus-operator

It would setup all required modules to monitor the kubernetes cluster resources. you can even define rules and if the thresholds are beached send a notifications via alert manager.

you might need to do little tweaking of some of the services, particularly the stateful pod like prometheus. It would pretty much sets up dashboards and all required to review the metrics and see what is going on in the k8s cluster

-- P Ekambaram
Source: StackOverflow