Links

Central Monitoring Dashboard Setup

Overview

This page provides the steps and process to set up the central monitoring dashboard.

Pre-reads

Pre-requisites

  • DIGIT uses golang (required v1.13.3) automated scripts to deploy the builds onto Kubernetes - Linux or Windows or Mac.
  • All DIGIT services are packaged using helm charts
    Installing Helm
    .
  • kubectl is a CLI to connect to the Kubernetes cluster from your machine.
  • Install VisualStudio IDE Code for better code/configuration editing capabilities.
  • Git
  • Cost-analyzer - cost-analyzer must be deployed on the client side.
  • Prometheus-operator - Prometheus must be deployed on the client side.
  • prometheus-kafka-exporter (A Prometheus exporter acts as a proxy between such an application and the Prometheus server) - prometheus-kafka-exporter must be deployed on the client side

Steps

Step 1: Install Prometheus Operator On Each Client Cluster

Step 2: Expose The Prometheus Operator

Expose the Prometheus Operator using nginx-ingress rule in each client cluster. This makes it easy to access Prometheus metrics in central-dashboard clusters
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
certmanager.k8s.io/cluster-issuer: letsencrypt-prod //By using this annotation, a certificate will be issued
labels:
app: prometheus-operator
name: prometheus-prometheus
namespace: monitoring
spec:
rules:
- host: <host_name> //Replace with prometheus host
http:
paths:
- backend:
service:
name: prometheus-prometheus
port:
number: 9090
path: /
pathType: ImplementationSpecific
tls:
- hosts:
- <host_name> //Replace with prometheus host
secretName: <host_name>-tls-certs //Replace with prometheus host
Note: Ensure you create the CANAME DNS record with the hostname and loadbalancer ID.

Step 3: Install Cost Analyzer On Each Client Cluster

Kubecost provides visibility into current and historical Kubernetes spending and resource allocation. These provide cost transparency in Kubernetes environments.
You can deploy the cost analyser using one of the below methods.
1. Deploy using go lang deployer
git clone https://github.com/egovernments/DIGIT-DevOps.git
cd DIGIT-DevOps/deploy-as-code/egov-deployer
go run main.go -e <environment_name> "cost-analyzer"
2. Deploy using Jenkin’s deployment job. Here we are using deploy-to-dev. Choose your environment-specific deployment job.

Step 4: Install Grafana On The Central Dashboard Cluster

Below Grafana configuration should be added to the environments file, and then Grafana should be deployed using one of the following methods.
Based on the number of client clusters, you have to add data sources. There should be one entry per client cluster as shown below.
1
grafana:
2
image:
3
repository: grafana/grafana
4
tag: 9.0.0
5
6
initContainers:
7
gitSync:
8
enabled: true
9
repo: "[email protected]:egovernments/configs" // repo contain the dashboard json files
10
branch: "central-dashboard"
11
ingress:
12
hostName: central-dashboard.digit.org //central-dashboard hostname
13
context: ""
14
additionalAnnotations: |
15
grafana.ini:
16
server:
17
root_url: "%(protocol)s://%(domain)s"
18
serve_from_sub_path: true
19
20
env: |
21
- name: GF_SERVER_DOMAIN
22
value: {{ .Values.ingress.hostName | quote }}
23
datasources: // Configure Grafana to use prometheus ddata sources datasources.yaml:
24
apiVersion: 1
25
datasources:
26
- name: DIGIT-Dev
27
type: prometheus
28
url: https://<Dev_hostname> //Add exposed hostname for dev environment to access the dev prometheus metrics
29
isDefault: false
30
- name: DIGIT-QA
31
type: prometheus
32
url: https://<QA_hostname>
33
isDefault: false
34
- name: DIGIT-UAT
35
type: prometheus
36
url: https://<UAT_hostname>
37
isDefault: false
38
- name: DIGIT-Staging
39
type: prometheus
40
url: https://<Staging_hostname>
41
isDefault: false
  1. 1.
    Deploy using go lang deployer
    git clone https://github.com/egovernments/DIGIT-DevOps.git
    cd DIGIT-DevOps/deploy-as-code/egov-deployer
    go run main.go -e <environment_name> "grafana"
  2. 2.
    Deploy using Jenkin’s deployment job.

Step 4: DNS Mapping

To access the monitoring central dashboard with this https://central-dashboard.digit.org URL. Ensure you create the CANAME DNS record with the hostname and load balancer ID.
All content on this page by eGov Foundation is licensed under a Creative Commons Attribution 4.0 International License.