diff --git a/15-k8s-installation.md b/15-k8s-installation.md index 916809e6b4bb3562e8c6fbebc3949b036ca7beb8..f930c1aa67eb0b2ff40926532fa9044ad94cd197 100644 --- a/15-k8s-installation.md +++ b/15-k8s-installation.md @@ -359,3 +359,31 @@ For Kubernetes clusters > 1.15 there is needed special permission of Tiller that ```bash kubectl create clusterrolebinding tiller-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default ``` + +# Enabling K8s Cluster Monitoring +After the K8s cluster is deployed using the steps mentioned above, it is also possible to monitor the workloads running in this K8s cluster using OSM. This K8s cluster is where OSM will deploy KNFs and it is the not the K8s cluster on which OSM is installed. + +On the K8 cluster to be monitored Prometheus operator is installed. Once this K8s cluster information is registered in OSM. MON creates a dashboard automatically in Grafana. Grafana connects to the Prometheus opertator installed in K8s cluster to fetch the performance data of the K8s workloads. + +The following steps describes the procedure to install prometheus operator on K8s cluster and enable the monitoring. + + +1. Run the following steps on K8s-cluster machine to install Prometheus operator: + - Install helm + ```bash + wget https://get.helm.sh/helm-v3.6.2-linux-amd64.tar.gz + tar -zxvf helm-v3.6.2-linux-amd64.tar.gz + sudo mv linux-amd64/helm /usr/local/bin/helm + ``` + + - Install prometheus-operator in monitoring namespace + ```bash + helm repo add prometheus-community https://prometheus-community.github.io/helm-charts + helm repo add stable https://charts.helm.sh/stable + helm repo update + helm install prometheus-operator prometheus-community/kube-prometheus-stack -n monitoring --create-namespace --set prometheus.service.type="LoadBalancer" + ``` + +2. After steps mentioned above are successful, then OSM is ready to monitor K8s cluster. Once the K8s cluster is registered against a OSM project, the corresponding dashboard will be visible in Grafana, as shown below. + + ![K8s-monitoring-dashboard](assets/800px-k8s-monitoring-grafana-dasboard.png) diff --git a/assets/800px-k8s-monitoring-grafana-dasboard.png b/assets/800px-k8s-monitoring-grafana-dasboard.png new file mode 100644 index 0000000000000000000000000000000000000000..b1a4ba8f77d6370cebbce8929d3df0313e0c81a7 Binary files /dev/null and b/assets/800px-k8s-monitoring-grafana-dasboard.png differ