diff --git a/stable/prometheus-pushgateway/Chart.yaml b/stable/prometheus-pushgateway/Chart.yaml index a0cf9a255e..5995091e48 100644 --- a/stable/prometheus-pushgateway/Chart.yaml +++ b/stable/prometheus-pushgateway/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.0.0" description: A Helm chart for prometheus pushgateway name: prometheus-pushgateway -version: 1.2.3 +version: 1.2.4 home: https://github.com/prometheus/pushgateway sources: - https://github.com/prometheus/pushgateway diff --git a/stable/prometheus-pushgateway/README.md b/stable/prometheus-pushgateway/README.md index d238bd8986..298fbcb422 100644 --- a/stable/prometheus-pushgateway/README.md +++ b/stable/prometheus-pushgateway/README.md @@ -38,37 +38,37 @@ The command removes all the Kubernetes components associated with the chart and The following table lists the configurable parameters of the pushgateway chart and their default values. -| Parameter | Description | Default | -| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | -| `affinity` | Affinity settings for pod assignment | `{}` | -| `extraArgs` | Optional flags for pushgateway | `[]` | -| `extraVars` | Optional environment variables for pushgateway | `[]` | -| `image.repository` | Image repository | `prom/pushgateway` | -| `image.tag` | Image tag | `v1.0.0` | -| `image.pullPolicy` | Image pull policy | `IfNotPresent` | -| `ingress.enabled` | Enables Ingress for pushgateway | `false` | -| `ingress.annotations` | Ingress annotations | `{}` | -| `ingress.hosts` | Ingress accepted hostnames | `nil` | -| `ingress.tls` | Ingress TLS configuration | `[]` | -| `resources` | CPU/Memory resource requests/limits | `{}` | -| `replicaCount` | Number of replicas | `1` | -| `service.type` | Service type | `ClusterIP` | -| `service.port` | The service port | `9091` | -| `service.targetPort` | The target port of the container | `9091` | -| `serviceLabels` | Labels for service | `{}` | -| `serviceAccount.create` | Specifies whether a service account should be created. | `true` | -| `serviceAccount.name` | Service account to be used. If not set and `serviceAccount.create` is `true`, a name is generated using the fullname template | | -| `tolerations` | List of node taints to tolerate | `{}` | -| `nodeSelector` | Node labels for pod assignment | `{}` | -| `podAnnotations` | Annotations for pod | `{}` | -| `podLabels` | Labels for pod | `{}` | -| `serviceAccountLabels` | Labels for service account | `{}` | -| `serviceMonitor.enabled` | if `true`, creates a Prometheus Operator ServiceMonitor (also requires `metrics.enabled` to be `true`) | `false` | -| `serviceMonitor.namespace` | Namespace which Prometheus is running in | `monitoring` | -| `serviceMonitor.interval` | How frequently to scrape metrics (use by default, falling back to Prometheus' default) | `nil` | -| `serviceMonitor.selector` | Default to kube-prometheus install (CoreOS recommended), but should be set according to Prometheus install | `{ prometheus: kube-prometheus }` | -| `serviceMonitor.honorLabels`| if `true`, label conflicts are resolved by keeping label values from the scraped data | `true` | -| `podDisruptionBudget` | If set, create a PodDisruptionBudget with the items in this map set in the spec | `` | +| Parameter | Description | Default | +| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | +| `affinity` | Affinity settings for pod assignment | `{}` | +| `extraArgs` | Optional flags for pushgateway | `[]` | +| `extraVars` | Optional environment variables for pushgateway | `[]` | +| `image.repository` | Image repository | `prom/pushgateway` | +| `image.tag` | Image tag | `v1.0.0` | +| `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `ingress.enabled` | Enables Ingress for pushgateway | `false` | +| `ingress.annotations` | Ingress annotations | `{}` | +| `ingress.hosts` | Ingress accepted hostnames | `nil` | +| `ingress.tls` | Ingress TLS configuration | `[]` | +| `resources` | CPU/Memory resource requests/limits | `{}` | +| `replicaCount` | Number of replicas | `1` | +| `service.type` | Service type | `ClusterIP` | +| `service.port` | The service port | `9091` | +| `service.targetPort` | The target port of the container | `9091` | +| `serviceLabels` | Labels for service | `{}` | +| `serviceAccount.create` | Specifies whether a service account should be created. | `true` | +| `serviceAccount.name` | Service account to be used. If not set and `serviceAccount.create` is `true`, a name is generated using the fullname template | | +| `tolerations` | List of node taints to tolerate | `{}` | +| `nodeSelector` | Node labels for pod assignment | `{}` | +| `podAnnotations` | Annotations for pod | `{}` | +| `podLabels` | Labels for pod | `{}` | +| `serviceAccountLabels` | Labels for service account | `{}` | +| `serviceMonitor.enabled` | if `true`, creates a Prometheus Operator ServiceMonitor (also requires `metrics.enabled` to be `true`) | `false` | +| `serviceMonitor.namespace` | Namespace which Prometheus is running in | `monitoring` | +| `serviceMonitor.interval` | How frequently to scrape metrics (use by default, falling back to Prometheus' default) | `nil` | +| `serviceMonitor.additionalLables` | Used to pass Labels that are required by the Installed Prometheus Operator | `{}` | +| `serviceMonitor.honorLabels` | if `true`, label conflicts are resolved by keeping label values from the scraped data | `true` | +| `podDisruptionBudget` | If set, create a PodDisruptionBudget with the items in this map set in the spec | `` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/stable/prometheus-pushgateway/templates/servicemonitor.yaml b/stable/prometheus-pushgateway/templates/servicemonitor.yaml index 3c3680e308..3db7063f7c 100644 --- a/stable/prometheus-pushgateway/templates/servicemonitor.yaml +++ b/stable/prometheus-pushgateway/templates/servicemonitor.yaml @@ -7,8 +7,12 @@ metadata: namespace: {{ .Values.serviceMonitor.namespace }} {{- end }} labels: - {{- range $key, $value := .Values.serviceMonitor.selector }} - {{ $key }}: {{ $value | quote }} + app: {{ template "prometheus-pushgateway.name" . }} + chart: {{ template "prometheus-pushgateway.chart" . }} + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + {{- if .Values.serviceMonitor.additionalLabels }} +{{ toYaml .Values.serviceMonitor.additionalLabels | indent 4 }} {{- end }} spec: endpoints: @@ -17,7 +21,11 @@ spec: interval: {{ .Values.serviceMonitor.interval }} {{- end }} honorLabels: {{ .Values.serviceMonitor.honorLabels }} + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} selector: matchLabels: app: {{ template "prometheus-pushgateway.name" . }} + release: {{ .Release.Name }} {{- end -}} diff --git a/stable/prometheus-pushgateway/values.yaml b/stable/prometheus-pushgateway/values.yaml index bc19c1169e..26d3ceb742 100644 --- a/stable/prometheus-pushgateway/values.yaml +++ b/stable/prometheus-pushgateway/values.yaml @@ -98,11 +98,11 @@ serviceMonitor: namespace: monitoring # fallback to the prometheus default unless specified # interval: 10s - ## Defaults to what's used if you follow CoreOS [Prometheus Install Instructions](https://github.com/helm/charts/tree/master/stable/prometheus-operator#tldr) - ## [Prometheus Selector Label](https://github.com/helm/charts/tree/master/stable/prometheus-operator#prometheus-operator-1) - ## [Kube Prometheus Selector Label](https://github.com/helm/charts/tree/master/stable/prometheus-operator#exporters) - selector: - prometheus: kube-prometheus + + ## Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec + additionalLabels: {} + # Retain the job and instance labels of the metrics pushed to the Pushgateway # [Scraping Pushgateway](https://github.com/prometheus/pushgateway#configure-the-pushgateway-as-a-target-to-scrape) honorLabels: true