Files
kube-prometheus/docs/weave-net-support.md
2020-03-04 06:32:43 +05:30

2.9 KiB

Setup WeaveNet CNI monitoring using kube-prometheus

WeaveNet is a resilient and simple to use CNI for Kubernetes. A well monitored and observed CNI helps in troubleshooting Kubernetes networking problems. WeaveNet emits prometheus metrics for monitoring WeaveNet. There are many ways to install WeaveNet in your cluster. One of them is using kops.

Following this document, you can setup weave net CNI monitoring for your cluster using kube-prometheus.

Contents

Using kube-prometheus and kubectl you will be able install the following for monitoring weave-net in your cluster:

  1. Service for WeaveNet The service which the service monitor scraps.
  2. ServiceMonitor for WeaveNet Service monitor to scraps the weavenet metrics and bring it to Prometheus.
  3. Prometheus Alerts for WeaveNet This will setup all the important weave net metrics you should be alerted on.
  4. Grafana Dashboard for WeaveNet This will setup the per CNI pod level monitoring for weave net.
  5. Grafana Dashboard for WeaveNet(Cluster) This will setup the cluster level monitoring for weave net.

Instructions

  • You can monitor weave-net CNI using kube-prometheus with: [embedmd]:# (../examples/weavenet-example.jsonnet)
local kp =  (import 'kube-prometheus/kube-prometheus.libsonnet') +
            (import 'kube-prometheus/kube-prometheus-weavenet.libsonnet');

{ ['00namespace-' + name]: kp.kubePrometheus[name] for name in std.objectFields(kp.kubePrometheus) } +
{ ['0prometheus-operator-' + name]: kp.prometheusOperator[name] for name in std.objectFields(kp.prometheusOperator) } +
{ ['node-exporter-' + name]: kp.nodeExporter[name] for name in std.objectFields(kp.nodeExporter) } +
{ ['kube-state-metrics-' + name]: kp.kubeStateMetrics[name] for name in std.objectFields(kp.kubeStateMetrics) } +
{ ['prometheus-' + name]: kp.prometheus[name] for name in std.objectFields(kp.prometheus) } +
{ ['prometheus-adapter-' + name]: kp.prometheusAdapter[name] for name in std.objectFields(kp.prometheusAdapter) }
  • After you have the required yamls file please run
kubectl create -f prometheus-serviceWeaveNet.yaml
kubectl create -f prometheus-serviceMonitorWeaveNet.yaml
kubectl apply -f  prometheus-rules.yaml
kubectl apply -f grafana-dashboardDefinitions.yaml