Monitor your Azure Kubernetes Cluster (AKS) with Prometheus and Grafana

Prerequisites

- An AKS cluster provisioned and is in Running state- Azure CLI- az aks get-credentials -g {resource-group} -n {aks-cluster-name}- Install Helm for your respective OS - https://github.com/helm/helm/releases

Steps to configure Prometheus in AKS

  1. Define the Helm repo
helm repo add stable https://charts.helm.sh/stable
With Helm, you do not need to worry about the internals of writing manifests and wiring things up. Helm provides you with battle-hardened, production-grade setups extensively tested across multiple scenarios and use cases.We will be using the stable/prometheus-operator chart for this. It's also a good idea to install Prometheus operator in a separate namespace.$kubectl create ns monitoring$helm install prometheus stable/prometheus-operator --namespace monitoring
bash-3.2$ kubectl --namespace monitoring get pods -l "release=prometheus"
NAME READY STATUS RESTARTS AGE
prometheus-prometheus-node-exporter-9fhrl 1/1 Running 0 21m
prometheus-prometheus-oper-operator-6d9c4bdb9f-hfpbb 2/2 Running 0 21m
bash-3.2$ kubectl port-forward -n monitoring prometheus-prometheus-oper-operator-6d9c4bdb9f-hfpbb-0 9090
Forwarding from 127.0.0.1:9090 -> 9090
Forwarding from [::1]:9090 -> 9090
bash-3.2$ kubectl get pod -n monitoring|grep grafana
prometheus-grafana-7c78857f5c-qfhld 2/2 Running 0 11m
bash-3.2$ kubectl port-forward -n monitoring prometheus-grafana-7c78857f5c-qfhld 3000
Forwarding from 127.0.0.1:3000 -> 3000
Forwarding from [::1]:3000 -> 3000
Handling connection for 3000
Handling connection for 3000
kubectl get secret -n monitoring prometheus-grafana -o yaml
Get the username and password.

References

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Benefits of Using AWS Alternative APIs for Building Your Products and Business

Flyway in Practice — How I use in my projects

A Beginner’s Guide to Microsoft Azure Backup

Interview With Moving On TV — Part 2

Project thinking vs product thinking (for the engineer inside the product manager)

Estimated time != Calendar time

L&T Build India Scholarship 2022 | Hiring Freshers | B.E/B.Tech | Apply Now

Ruby, config this

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kumar Allamraju

Kumar Allamraju

More from Medium

Kubernetes on Microsoft AZURE — Azure Kubernetes Service (AKS) in Easy Steps

Create Kubernetes cluster

IaaC with Openshift on Azure

Rotating AKS Cluster Certificates

Deploying Nginx container on Azure Kubernetes AKS

Introduction to Azure DevOps