Start your local kubernetes cluster
minikube start --driver=virtualbox
Create 2 namespaces for prometheus & loki
kubectl create ns <name-of-namespace>
check your helm repo
helm repo list
or you can also add
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add grafana-loki https://grafana.github.io/helm-charts
update your helm repo
helm repo update
Search your helm repo
helm search repo prometheus-community
Install the kube-prometheus-stack and loki
helm install prometheus prometheus-community/kube-prometheus-stack -n prometheus
helm install loki grafana/loki-stack -n loki
As a part of you stack you get grafana as well as Alertmanager, wait till all the pods are in running state
kubectl get po -n prometheus
kubectl get po -n loki
now expose your services to view the gui
kubectl -n prometheus expose service prometheus-kube-prometheus-prometheus --type=NodePort --target-port=9090 --name prometheus-svc-ext
kubectl -n prometheus expose service prometheus-kube-prometheus-alertmanager --type=NodePort --target-port=9093 --name=alertmanager-svc-ext
kubectl -n prometheus expose service prometheus-grafana --type=NodePort --target-port=3000 --name=grafana-svc-ext
kubectl -n loki expose service loki --type=NodePort --target-port=3100 --name=loki-svc-ext
Grafana Dashboard after adding data sources
create a deployment to check if we are getting logs for the containers
kubectl create deployment nginx-deployment --image=nginx --replicas=4
After nginx deployment we can see loki logs
Configure slack to receive notification
https://api.slack.com/ --> yor apps --> create new app --> From Scratch --> after creating --> incoming weebhooks--> Add new webhook to workspace
Upgrade the helm chart to receieve alerts
helm upgrade --reuse-values -f /home/supriyo/alertmanager-config.yaml prometheus prometheus-community/kube-prometheus-stack -n prometheus
Go to Komodor UI and install the helm mentioned or generated when adding cluster