-
What did you do? Did you expect to see some different? Environment
Digital Ocean managed k8s Just a newb question, I installed the stack, I have an nginx ingress-controller and I want to add the nginx metrics and also a dashboard to my grafana. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
If you installed ingress-nginx via Helm, you can enable the If you didn't you can write a similar ServiceMonitor resource yourself that matches your ingress-nginx deployment. Just make sure the endpoint has |
Beta Was this translation helpful? Give feedback.
-
Cool, I enabled it and now I can get Thanks. |
Beta Was this translation helpful? Give feedback.
-
For those googling, here's how to configure nginx-ingress controller to send metrics to prometheus using the ServiceConfig resource. Note the
Now my question remains, how do I add dashboard and persist them? |
Beta Was this translation helpful? Give feedback.
-
That depends on how you deployed your dashboarding solution. Prometheus-operator doesn't have any dashboarding solution built-in. |
Beta Was this translation helpful? Give feedback.
-
I deployed with helm this stack: I noticed the dashboards are mounted to |
Beta Was this translation helpful? Give feedback.
-
Got it.
Will be caught by the container: |
Beta Was this translation helpful? Give feedback.
-
Took me a while to figure this out, posting my experience here.
I installed metrics:
enabled: true
serviceMonitor:
namespace: kube-prometheus
enabled: true
additionalLabels:
release: kube-prometheus Now find a dashboard json you want to use, for example https://github.com/kubernetes/ingress-nginx/blob/master/deploy/grafana/dashboards/nginx.json. Create a configmap with the label apiVersion: v1
kind: ConfigMap
metadata:
labels:
grafana_dashboard: "1"
name: nginx-ingress-dashboard
# I dont think the configmap has to be in a certain namespace, I just did it to keep
# all the dashboards in the same namespace.
namespace: kube-prometheus
data:
nginx.json: |-
// ... paste json here Then go to your grafana site and wait ~30 seconds, the dashboard and it's data should appear. |
Beta Was this translation helpful? Give feedback.
Got it.
Adding a configmap with the label:
Will be caught by the container:
grafana-sc-dashboard
and loaded to grafana.Described (poorly) here:
https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml#L621