Skip to content

Commit

Permalink
Merge pull request #1282 from jcpunk/podmon-labels
Browse files Browse the repository at this point in the history
Add optional labels to the podmonitor
  • Loading branch information
k8s-ci-robot committed Jul 24, 2023
2 parents c9f3550 + 0523257 commit 73bdaa2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ metadata:
name: {{ include "node-feature-discovery.fullname" . }}
labels:
{{- include "node-feature-discovery.selectorLabels" . | nindent 4 }}
{{- with .Values.prometheus.labels }}
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
podMetricsEndpoints:
- honorLabels: true
Expand Down
1 change: 1 addition & 0 deletions deployment/helm/node-feature-discovery/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -498,3 +498,4 @@ tls:

prometheus:
enable: false
labels: {}
1 change: 1 addition & 0 deletions docs/deployment/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ We have introduced the following Chart parameters.
| `tls.certManager` | bool | false | If enabled, requires [cert-manager](https://cert-manager.io/docs/) to be installed and will automatically create the required TLS certificates |
| `enableNodeFeatureApi` | bool | false | Enable the [NodeFeature](../usage/custom-resources.md#nodefeature) CRD API for communicating node features. This will automatically disable the gRPC communication.
| `prometheus.enable` | bool | false | Specifies whether to expose metrics using prometheus operator |
| `prometheus.labels` | dict | {} | Specifies labels for use with the prometheus operator to control how it is selected |

Metrics are configured to be exposed using prometheus operator API's by
default. If you want to expose metrics using the prometheus operator
Expand Down
3 changes: 3 additions & 0 deletions docs/deployment/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ We recommend setting
`--set prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues=false`
when deploying prometheus-operator via Helm to enable the prometheus-operator
to scrape metrics from any PodMonitor.

or setting labels on the PodMonitor via the helm parameter `prometheus.labels`
to control which Prometheus instances will scrape this PodMonitor.

0 comments on commit 73bdaa2

Please sign in to comment.