diff --git a/charts/kube-prometheus-stack/Chart.yaml b/charts/kube-prometheus-stack/Chart.yaml index 2ed75bfa007d..9aa757a0d1d9 100644 --- a/charts/kube-prometheus-stack/Chart.yaml +++ b/charts/kube-prometheus-stack/Chart.yaml @@ -23,7 +23,7 @@ name: kube-prometheus-stack sources: - https://github.com/prometheus-community/helm-charts - https://github.com/prometheus-operator/kube-prometheus -version: 65.7.0 +version: 65.8.0 appVersion: v0.77.2 kubeVersion: ">=1.19.0-0" home: https://github.com/prometheus-operator/kube-prometheus diff --git a/charts/kube-prometheus-stack/ci/03-non-defaults-values.yaml b/charts/kube-prometheus-stack/ci/03-non-defaults-values.yaml index 2f80650f9c2f..dcfe23ef199f 100644 --- a/charts/kube-prometheus-stack/ci/03-non-defaults-values.yaml +++ b/charts/kube-prometheus-stack/ci/03-non-defaults-values.yaml @@ -19,6 +19,8 @@ prometheusOperator: operator: NotIn values: - "true" + extraArgs: + - --labels="cluster=talos-cluster" alertmanager: alertmanagerSpec: diff --git a/charts/kube-prometheus-stack/templates/exporters/core-dns/servicemonitor.yaml b/charts/kube-prometheus-stack/templates/exporters/core-dns/servicemonitor.yaml index 9f057d4d4ae9..85ae4077df5f 100644 --- a/charts/kube-prometheus-stack/templates/exporters/core-dns/servicemonitor.yaml +++ b/charts/kube-prometheus-stack/templates/exporters/core-dns/servicemonitor.yaml @@ -16,6 +16,10 @@ metadata: {{ include "kube-prometheus-stack.labels" . | indent 4 }} spec: jobLabel: {{ .Values.coreDns.serviceMonitor.jobLabel }} + {{- with .Values.coreDns.serviceMonitor.targetLabels }} + targetLabels: + {{- toYaml . | nindent 4 }} + {{- end }} {{- include "servicemonitor.scrapeLimits" .Values.coreDns.serviceMonitor | nindent 2 }} selector: {{- if .Values.coreDns.serviceMonitor.selector }} diff --git a/charts/kube-prometheus-stack/templates/exporters/kube-api-server/servicemonitor.yaml b/charts/kube-prometheus-stack/templates/exporters/kube-api-server/servicemonitor.yaml index a140d4554a7f..2d5dfb565a1a 100644 --- a/charts/kube-prometheus-stack/templates/exporters/kube-api-server/servicemonitor.yaml +++ b/charts/kube-prometheus-stack/templates/exporters/kube-api-server/servicemonitor.yaml @@ -39,6 +39,10 @@ spec: serverName: {{ .Values.kubeApiServer.tlsConfig.serverName }} insecureSkipVerify: {{ .Values.kubeApiServer.tlsConfig.insecureSkipVerify }} jobLabel: {{ .Values.kubeApiServer.serviceMonitor.jobLabel }} + {{- with .Values.kubeApiServer.serviceMonitor.targetLabels }} + targetLabels: + {{- toYaml . | nindent 4 }} + {{- end }} namespaceSelector: matchNames: - default diff --git a/charts/kube-prometheus-stack/templates/exporters/kube-controller-manager/servicemonitor.yaml b/charts/kube-prometheus-stack/templates/exporters/kube-controller-manager/servicemonitor.yaml index d4813f0b5308..2ee8aff68272 100644 --- a/charts/kube-prometheus-stack/templates/exporters/kube-controller-manager/servicemonitor.yaml +++ b/charts/kube-prometheus-stack/templates/exporters/kube-controller-manager/servicemonitor.yaml @@ -16,6 +16,10 @@ metadata: {{ include "kube-prometheus-stack.labels" . | indent 4 }} spec: jobLabel: {{ .Values.kubeControllerManager.serviceMonitor.jobLabel }} + {{- with .Values.kubeControllerManager.serviceMonitor.targetLabels }} + targetLabels: + {{- toYaml . | nindent 4 }} + {{- end }} {{- include "servicemonitor.scrapeLimits" .Values.kubeControllerManager.serviceMonitor | nindent 2 }} selector: {{- if .Values.kubeControllerManager.serviceMonitor.selector }} diff --git a/charts/kube-prometheus-stack/templates/exporters/kube-dns/servicemonitor.yaml b/charts/kube-prometheus-stack/templates/exporters/kube-dns/servicemonitor.yaml index 52190775b6c6..8e98c1dfc0bf 100644 --- a/charts/kube-prometheus-stack/templates/exporters/kube-dns/servicemonitor.yaml +++ b/charts/kube-prometheus-stack/templates/exporters/kube-dns/servicemonitor.yaml @@ -16,6 +16,10 @@ metadata: {{ include "kube-prometheus-stack.labels" . | indent 4 }} spec: jobLabel: {{ .Values.kubeDns.serviceMonitor.jobLabel }} + {{- with .Values.kubeDns.serviceMonitor.targetLabels }} + targetLabels: + {{- toYaml . | nindent 4 }} + {{- end }} {{- include "servicemonitor.scrapeLimits" .Values.kubeDns.serviceMonitor | nindent 2 }} selector: {{- if .Values.kubeDns.serviceMonitor.selector }} diff --git a/charts/kube-prometheus-stack/templates/exporters/kube-etcd/servicemonitor.yaml b/charts/kube-prometheus-stack/templates/exporters/kube-etcd/servicemonitor.yaml index f76e971a6b6b..df9509cc08ed 100644 --- a/charts/kube-prometheus-stack/templates/exporters/kube-etcd/servicemonitor.yaml +++ b/charts/kube-prometheus-stack/templates/exporters/kube-etcd/servicemonitor.yaml @@ -16,6 +16,10 @@ metadata: {{ include "kube-prometheus-stack.labels" . | indent 4 }} spec: jobLabel: {{ .Values.kubeEtcd.serviceMonitor.jobLabel }} + {{- with .Values.kubeEtcd.serviceMonitor.targetLabels }} + targetLabels: + {{- toYaml . | nindent 4 }} + {{- end }} {{- include "servicemonitor.scrapeLimits" .Values.kubeEtcd.serviceMonitor | nindent 4 }} selector: {{- if .Values.kubeEtcd.serviceMonitor.selector }} diff --git a/charts/kube-prometheus-stack/templates/exporters/kube-proxy/servicemonitor.yaml b/charts/kube-prometheus-stack/templates/exporters/kube-proxy/servicemonitor.yaml index ab9bb8fa8120..e572d0829905 100644 --- a/charts/kube-prometheus-stack/templates/exporters/kube-proxy/servicemonitor.yaml +++ b/charts/kube-prometheus-stack/templates/exporters/kube-proxy/servicemonitor.yaml @@ -16,6 +16,10 @@ metadata: {{ include "kube-prometheus-stack.labels" . | indent 4 }} spec: jobLabel: {{ .Values.kubeProxy.serviceMonitor.jobLabel }} + {{- with .Values.kubeProxy.serviceMonitor.targetLabels }} + targetLabels: + {{- toYaml . | nindent 4 }} + {{- end }} {{- include "servicemonitor.scrapeLimits" .Values.kubeProxy.serviceMonitor | nindent 2 }} selector: {{- if .Values.kubeProxy.serviceMonitor.selector }} diff --git a/charts/kube-prometheus-stack/templates/exporters/kube-scheduler/servicemonitor.yaml b/charts/kube-prometheus-stack/templates/exporters/kube-scheduler/servicemonitor.yaml index 73de91de12c0..26c2853ef2ba 100644 --- a/charts/kube-prometheus-stack/templates/exporters/kube-scheduler/servicemonitor.yaml +++ b/charts/kube-prometheus-stack/templates/exporters/kube-scheduler/servicemonitor.yaml @@ -16,6 +16,10 @@ metadata: {{ include "kube-prometheus-stack.labels" . | indent 4 }} spec: jobLabel: {{ .Values.kubeScheduler.serviceMonitor.jobLabel }} + {{- with .Values.kubeScheduler.serviceMonitor.targetLabels }} + targetLabels: + {{- toYaml . | nindent 4 }} + {{- end }} {{- include "servicemonitor.scrapeLimits" .Values.kubeScheduler.serviceMonitor | nindent 2 }} selector: {{- if .Values.kubeScheduler.serviceMonitor.selector }} diff --git a/charts/kube-prometheus-stack/templates/exporters/kubelet/servicemonitor.yaml b/charts/kube-prometheus-stack/templates/exporters/kubelet/servicemonitor.yaml index a3e28d718851..d0443c3343c0 100644 --- a/charts/kube-prometheus-stack/templates/exporters/kubelet/servicemonitor.yaml +++ b/charts/kube-prometheus-stack/templates/exporters/kubelet/servicemonitor.yaml @@ -223,6 +223,10 @@ spec: {{- end }} {{- end }} jobLabel: k8s-app + {{- with .Values.kubelet.serviceMonitor.targetLabels }} + targetLabels: + {{- toYaml . | nindent 4 }} + {{- end }} namespaceSelector: matchNames: - {{ .Values.kubelet.namespace }} diff --git a/charts/kube-prometheus-stack/templates/prometheus-operator/deployment.yaml b/charts/kube-prometheus-stack/templates/prometheus-operator/deployment.yaml index 8983ab21c724..be35dd80af28 100644 --- a/charts/kube-prometheus-stack/templates/prometheus-operator/deployment.yaml +++ b/charts/kube-prometheus-stack/templates/prometheus-operator/deployment.yaml @@ -143,6 +143,9 @@ spec: - --web.key-file=/cert/{{ if .Values.prometheusOperator.admissionWebhooks.certManager.enabled }}tls.key{{ else }}key{{ end }} - --web.listen-address=:{{ .Values.prometheusOperator.tls.internalPort }} - --web.tls-min-version={{ .Values.prometheusOperator.tls.tlsMinVersion }} + {{- with .Values.prometheusOperator.extraArgs }} + {{- tpl (toYaml .) $ | nindent 12 }} + {{- end }} ports: - containerPort: {{ .Values.prometheusOperator.tls.internalPort }} name: https diff --git a/charts/kube-prometheus-stack/values.yaml b/charts/kube-prometheus-stack/values.yaml index e80aae2d8996..0b728f2fe541 100644 --- a/charts/kube-prometheus-stack/values.yaml +++ b/charts/kube-prometheus-stack/values.yaml @@ -1294,6 +1294,10 @@ kubeApiServer: additionalLabels: {} # foo: bar + ## defines the labels which are transferred from the associated Kubernetes Service object onto the ingested metrics. + ## https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#servicemonitor + targetLabels: [] + ## Component scraping the kubelet and kubelet-hosted cAdvisor ## kubelet: @@ -1500,6 +1504,10 @@ kubelet: additionalLabels: {} # foo: bar + ## defines the labels which are transferred from the associated Kubernetes Service object onto the ingested metrics. + ## https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#servicemonitor + targetLabels: [] + ## Component scraping the kube controller manager ## kubeControllerManager: @@ -1603,6 +1611,10 @@ kubeControllerManager: additionalLabels: {} # foo: bar + ## defines the labels which are transferred from the associated Kubernetes Service object onto the ingested metrics. + ## https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#servicemonitor + targetLabels: [] + ## Component scraping coreDns. Use either this or kubeDns ## coreDns: @@ -1681,6 +1693,10 @@ coreDns: additionalLabels: {} # foo: bar + ## defines the labels which are transferred from the associated Kubernetes Service object onto the ingested metrics. + ## https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#servicemonitor + targetLabels: [] + ## Component scraping kubeDns. Use either this or coreDns ## kubeDns: @@ -1775,6 +1791,10 @@ kubeDns: additionalLabels: {} # foo: bar + ## defines the labels which are transferred from the associated Kubernetes Service object onto the ingested metrics. + ## https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#servicemonitor + targetLabels: [] + ## Component scraping etcd ## kubeEtcd: @@ -1880,6 +1900,10 @@ kubeEtcd: additionalLabels: {} # foo: bar + ## defines the labels which are transferred from the associated Kubernetes Service object onto the ingested metrics. + ## https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#servicemonitor + targetLabels: [] + ## Component scraping kube scheduler ## kubeScheduler: @@ -1982,6 +2006,10 @@ kubeScheduler: additionalLabels: {} # foo: bar + ## defines the labels which are transferred from the associated Kubernetes Service object onto the ingested metrics. + ## https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#servicemonitor + targetLabels: [] + ## Component scraping kube proxy ## kubeProxy: @@ -2070,6 +2098,10 @@ kubeProxy: additionalLabels: {} # foo: bar + ## defines the labels which are transferred from the associated Kubernetes Service object onto the ingested metrics. + ## https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#servicemonitor + targetLabels: [] + ## Component scraping kube state metrics ## kubeStateMetrics: @@ -2742,6 +2774,11 @@ prometheusOperator: ## Create EndpointSlice objects for kubelet targets. kubeletEndpointSliceEnabled: false + ## Extra arguments to pass to prometheusOperator + # https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/operator.md + extraArgs: [] + # - --labels="cluster=talos-cluster" + ## Create a servicemonitor for the operator ## serviceMonitor: