I am using this link to set up Prometheus using servicemonitoring and RBAC rules.
After deployment, I am trying to access prometheus endpoint using http://<ipaddress_server>:32001
to display the metrics.
I am also trying to add the prometheus datasource in grafana ( running on same node) as http://localhost:32001
or http://localhost:9090
, but both didn't work.
$ kubectl get svc -A | grep prom
default prometheus NodePort 10.XX.XX.XX <none> 9090:32001/TCP 14m
default prometheus-operated ClusterIP None <none> 9090/TCP 14m
default prometheus-operator ClusterIP None <none> 8080/TCP 15m
kubectl get deployment NAME READY UP-TO-DATE AVAILABLE AGE prometheus-operator 1/1 1 1 3h7m
kubectl get deployment
NAME READY UP-TO-DATE AVAILABLE AGE
prometheus-operator 1/1 1 1 3h7m
kubectl get pods -A | grep prom
default prometheus-operator-5dc8bc6f9c-9lwtw 1/1 Running 0 3h7m
default prometheus-prometheus-0 2/2 Running 0 3h6m
default prometheus-prometheus-1 2/2 Running
kubectl get servicemonitor
NAME AGE
prometheus-self 3h4m
0 3h6m
I also tried port forwarding using below command:
kubectl port-forward svc/prometheus 9090
But, it doesn't show anything.
Please help, as I am new to kubernetes and also prometheus and grafana.