Setup Prometheus in your Kubernetes Cluster
- Let's begin by provisioning an NFS default StoregeClass called
monitoring-toolsfor themonitoring-toolsNamespace. - Run the
nfs-monitoring-tools-storage-classhelm installation.
- Create the persistent volume and add the flag
--wait=trueto ensure that the claim is made after the deployment is complete.
kubectl apply -f pvc-prometheus.yaml --wait=true
- Run the access-prometheus.yaml to provide ClusterRoleBinding, ClusterRole and ServiceAccount.
kubectl apply -f access-prometheus.yaml
- Run the
deployment-prometheus.yamlto deploy Prometheus, the Service and ConfigMap.
kubectl apply -f deployment-prometheus.yaml
- Finally, from exporters directory, add the exporter and query the
NODE_IP:32002
kubectl apply -f exporter-prometheus-kube-state-metrics.yaml
- If all snapped in place your Prometheus is running on your worker-node_IP:32002
- Additionally, query
worker/mater-node_IP:32002/targetsandworker-node_IP:32002/metrics.