cd prometheus
helm dependency update
cd ../
kubectl create namespace prometheus
helm install prometheus prometheus \
--namespace prometheus \
--set alertmanager.persistentVolume.storageClass="gp2" \
--set server.persistentVolume.storageClass="gp2"
kubectl get all -n prometheus
kubectl edit svc prometheus-server -n prometheus
kubectl get svc -n prometheus
http://a4e29142a2b51463fac7d3238106d32b-896983688.us-east-1.elb.amazonaws.com/graph
datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://prometheus-server.prometheus.svc.cluster.local
access: proxy
isDefault: true
cd grafana
helm dependency update
cd ../
kubectl create namespace grafana
helm install grafana grafana \
--namespace grafana \
--set persistence.storageClassName="gp2" \
--set persistence.enabled=true \
--set adminPassword='admin123' \
--values grafana.yaml \
--set service.type=LoadBalancer
kubectl get all -n grafana
kubectl get svc -n grafana
username: admin
password: admin123
For creating a dashboard to monitor the cluster:
- Click '+' button on left panel and select 'Import'.
- Enter 3119 dashboard id under Grafana.com Dashboard.
- Click 'Load'.
- Select 'Prometheus' as the endpoint under prometheus data sources drop down.
- Click 'Import'. This will show monitoring dashboard for all cluster nodes:
For creating a dashboard to monitor all the pods:
- Click '+' button on left panel and select ‘Import’.
- Enter 6417 dashboard id under Grafana.com Dashboard.
- Click 'Load'.
- Enter Kubernetes Pods Monitoring as the Dashboard name.
- Click change to set the Unique identifier (uid).
- Select 'Prometheus' as the endpoint under prometheus data sources drop down.s
- Click 'Import'.