diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 156aee91395d..059d64c82cc6 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -22,6 +22,7 @@ /charts/prometheus-druid-exporter/ @iamabhishek-dubey @sandy724 /charts/prometheus-elasticsearch-exporter/ @desaintmartin @svenmueller @zeritti /charts/prometheus-fastly-exporter/ @arslanbekov +/charts/prometheus-ipmi-exporter/ @lexfrei /charts/prometheus-json-exporter/ @schmiddim @xiu @zanhsieh /charts/prometheus-kafka-exporter/ @gkarthiks @golgoth31 @zeritti /charts/prometheus-modbus-exporter/ @openenergyprojects diff --git a/.github/workflows/check-codeowners.yaml b/.github/workflows/check-codeowners.yaml index 10a59fb3aa15..b47c63f502c0 100644 --- a/.github/workflows/check-codeowners.yaml +++ b/.github/workflows/check-codeowners.yaml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: install yq run: | diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index de1645ebbf93..c3cfc367fe10 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a8f4b4d50fa3..4610830803a1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Fetch history run: git fetch --prune --unshallow @@ -44,7 +44,7 @@ jobs: # see https://github.com/helm/chart-releaser/issues/183 - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} diff --git a/.github/workflows/superlinter.yml b/.github/workflows/superlinter.yml index 889cc94988d8..718e2e981d0e 100644 --- a/.github/workflows/superlinter.yml +++ b/.github/workflows/superlinter.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/sync-readme.yaml b/.github/workflows/sync-readme.yaml index 3da2b7bb6902..74c1e1c84c4b 100644 --- a/.github/workflows/sync-readme.yaml +++ b/.github/workflows/sync-readme.yaml @@ -12,10 +12,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: | cp -f README.md ${{ runner.temp }}/README.md - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: gh-pages - run: | diff --git a/charts/alertmanager/Chart.yaml b/charts/alertmanager/Chart.yaml index ae7eead0f44d..4b0884111b8d 100644 --- a/charts/alertmanager/Chart.yaml +++ b/charts/alertmanager/Chart.yaml @@ -6,7 +6,7 @@ icon: https://raw.githubusercontent.com/prometheus/prometheus.github.io/master/a sources: - https://github.com/prometheus/alertmanager type: application -version: 1.6.0 +version: 1.7.0 appVersion: v0.26.0 kubeVersion: ">=1.19.0-0" keywords: diff --git a/charts/alertmanager/templates/ingress.yaml b/charts/alertmanager/templates/ingress.yaml index 02910330ede0..e729a8ad3bab 100644 --- a/charts/alertmanager/templates/ingress.yaml +++ b/charts/alertmanager/templates/ingress.yaml @@ -13,7 +13,9 @@ metadata: {{- end }} namespace: {{ include "alertmanager.namespace" . }} spec: + {{- if .Values.ingress.className }} ingressClassName: {{ .Values.ingress.className }} + {{- end }} {{- if .Values.ingress.tls }} tls: {{- range .Values.ingress.tls }} diff --git a/charts/alertmanager/templates/ingressperreplica.yaml b/charts/alertmanager/templates/ingressperreplica.yaml new file mode 100644 index 000000000000..6f5a023500c5 --- /dev/null +++ b/charts/alertmanager/templates/ingressperreplica.yaml @@ -0,0 +1,56 @@ +{{- if and .Values.servicePerReplica.enabled .Values.ingressPerReplica.enabled }} +{{- $pathType := .Values.ingressPerReplica.pathType }} +{{- $count := .Values.replicaCount | int -}} +{{- $servicePort := .Values.service.port -}} +{{- $ingressValues := .Values.ingressPerReplica -}} +{{- $fullName := include "alertmanager.fullname" . }} +apiVersion: v1 +kind: List +metadata: + name: {{ $fullName }}-ingressperreplica + namespace: {{ include "alertmanager.namespace" . }} +items: +{{- range $i, $e := until $count }} + - kind: Ingress + apiVersion: {{ include "alertmanager.ingress.apiVersion" $ }} + metadata: + name: {{ $fullName }}-{{ $i }} + namespace: {{ include "alertmanager.namespace" $ }} + labels: + {{- include "alertmanager.labels" $ | nindent 8 }} + {{- if $ingressValues.labels }} +{{ toYaml $ingressValues.labels | indent 8 }} + {{- end }} + {{- if $ingressValues.annotations }} + annotations: +{{ toYaml $ingressValues.annotations | indent 8 }} + {{- end }} + spec: + {{- if $ingressValues.className }} + ingressClassName: {{ $ingressValues.className }} + {{- end }} + rules: + - host: {{ $ingressValues.hostPrefix }}-{{ $i }}.{{ $ingressValues.hostDomain }} + http: + paths: + {{- range $p := $ingressValues.paths }} + - path: {{ tpl $p $ }} + pathType: {{ $pathType }} + backend: + service: + name: {{ $fullName }}-{{ $i }} + port: + name: http + {{- end -}} + {{- if or $ingressValues.tlsSecretName $ingressValues.tlsSecretPerReplica.enabled }} + tls: + - hosts: + - {{ $ingressValues.hostPrefix }}-{{ $i }}.{{ $ingressValues.hostDomain }} + {{- if $ingressValues.tlsSecretPerReplica.enabled }} + secretName: {{ $ingressValues.tlsSecretPerReplica.prefix }}-{{ $i }} + {{- else }} + secretName: {{ $ingressValues.tlsSecretName }} + {{- end }} + {{- end }} +{{- end -}} +{{- end -}} diff --git a/charts/alertmanager/templates/serviceperreplica.yaml b/charts/alertmanager/templates/serviceperreplica.yaml new file mode 100644 index 000000000000..faa75b3ba2e3 --- /dev/null +++ b/charts/alertmanager/templates/serviceperreplica.yaml @@ -0,0 +1,44 @@ +{{- if and .Values.servicePerReplica.enabled }} +{{- $count := .Values.replicaCount | int -}} +{{- $serviceValues := .Values.servicePerReplica -}} +apiVersion: v1 +kind: List +metadata: + name: {{ include "alertmanager.fullname" . }}-serviceperreplica + namespace: {{ include "alertmanager.namespace" . }} +items: +{{- range $i, $e := until $count }} + - apiVersion: v1 + kind: Service + metadata: + name: {{ include "alertmanager.fullname" $ }}-{{ $i }} + namespace: {{ include "alertmanager.namespace" $ }} + labels: + {{- include "alertmanager.labels" $ | nindent 8 }} + {{- if $serviceValues.annotations }} + annotations: +{{ toYaml $serviceValues.annotations | indent 8 }} + {{- end }} + spec: + {{- if $serviceValues.clusterIP }} + clusterIP: {{ $serviceValues.clusterIP }} + {{- end }} + {{- if $serviceValues.loadBalancerSourceRanges }} + loadBalancerSourceRanges: + {{- range $cidr := $serviceValues.loadBalancerSourceRanges }} + - {{ $cidr }} + {{- end }} + {{- end }} + {{- if ne $serviceValues.type "ClusterIP" }} + externalTrafficPolicy: {{ $serviceValues.externalTrafficPolicy }} + {{- end }} + ports: + - name: http + port: {{ $.Values.service.port }} + targetPort: http + selector: + {{- include "alertmanager.selectorLabels" $ | nindent 8 }} + statefulset.kubernetes.io/pod-name: {{ include "alertmanager.fullname" $ }}-{{ $i }} + type: "{{ $serviceValues.type }}" +{{- end }} +{{- end }} diff --git a/charts/alertmanager/values.yaml b/charts/alertmanager/values.yaml index 5c4ce58599b7..fa3b355a5114 100644 --- a/charts/alertmanager/values.yaml +++ b/charts/alertmanager/values.yaml @@ -114,6 +114,24 @@ service: # Optionally specify extra list of additional ports exposed on both services extraPorts: [] +# Configuration for creating a separate Service for each statefulset Alertmanager replica +# +servicePerReplica: + enabled: false + annotations: {} + + # Loadbalancer source IP ranges + # Only used if servicePerReplica.type is "LoadBalancer" + loadBalancerSourceRanges: [] + + # Denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints + # + externalTrafficPolicy: Cluster + + # Service type + # + type: ClusterIP + ingress: enabled: false className: "" @@ -130,6 +148,50 @@ ingress: # hosts: # - alertmanager.domain.com +# Configuration for creating an Ingress that will map to each Alertmanager replica service +# alertmanager.servicePerReplica must be enabled +# +ingressPerReplica: + enabled: false + + # className for the ingresses + # + className: "" + + annotations: {} + labels: {} + + # Final form of the hostname for each per replica ingress is + # {{ ingressPerReplica.hostPrefix }}-{{ $replicaNumber }}.{{ ingressPerReplica.hostDomain }} + # + # Prefix for the per replica ingress that will have `-$replicaNumber` + # appended to the end + hostPrefix: "alertmanager" + # Domain that will be used for the per replica ingress + hostDomain: "domain.com" + + # Paths to use for ingress rules + # + paths: + - / + + # PathType for ingress rules + # + pathType: ImplementationSpecific + + # Secret name containing the TLS certificate for alertmanager per replica ingress + # Secret must be manually created in the namespace + tlsSecretName: "" + + # Separated secret for each per replica Ingress. Can be used together with cert-manager + # + tlsSecretPerReplica: + enabled: false + # Final form of the secret for each per replica ingress is + # {{ tlsSecretPerReplica.prefix }}-{{ $replicaNumber }} + # + prefix: "alertmanager" + resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little diff --git a/charts/kube-prometheus-stack/Chart.yaml b/charts/kube-prometheus-stack/Chart.yaml index b57ddcdddfdf..c6a759c6d8a8 100644 --- a/charts/kube-prometheus-stack/Chart.yaml +++ b/charts/kube-prometheus-stack/Chart.yaml @@ -21,7 +21,7 @@ name: kube-prometheus-stack sources: - https://github.com/prometheus-community/helm-charts - https://github.com/prometheus-operator/kube-prometheus -version: 51.0.3 +version: 51.2.0 appVersion: v0.68.0 kubeVersion: ">=1.19.0-0" home: https://github.com/prometheus-operator/kube-prometheus diff --git a/charts/kube-prometheus-stack/templates/exporters/kubelet/servicemonitor.yaml b/charts/kube-prometheus-stack/templates/exporters/kubelet/servicemonitor.yaml index 10de33955e2b..e5ad637ebba1 100644 --- a/charts/kube-prometheus-stack/templates/exporters/kubelet/servicemonitor.yaml +++ b/charts/kube-prometheus-stack/templates/exporters/kubelet/servicemonitor.yaml @@ -12,6 +12,10 @@ metadata: {{- include "kube-prometheus-stack.labels" . | indent 4 }} spec: {{- include "servicemonitor.scrapeLimits" .Values.kubelet.serviceMonitor | nindent 2 }} + {{- with .Values.kubelet.serviceMonitor.attachMetadata }} + attachMetadata: + {{- toYaml . | nindent 4 }} + {{- end }} endpoints: {{- if .Values.kubelet.serviceMonitor.https }} - port: https-metrics diff --git a/charts/kube-prometheus-stack/templates/prometheus-operator/deployment.yaml b/charts/kube-prometheus-stack/templates/prometheus-operator/deployment.yaml index 1017a00bea5b..67d0024d1428 100644 --- a/charts/kube-prometheus-stack/templates/prometheus-operator/deployment.yaml +++ b/charts/kube-prometheus-stack/templates/prometheus-operator/deployment.yaml @@ -91,10 +91,10 @@ spec: {{- else }} - --prometheus-config-reloader={{ $configReloaderRegistry }}/{{ .Values.prometheusOperator.prometheusConfigReloader.image.repository }}:{{ .Values.prometheusOperator.prometheusConfigReloader.image.tag | default .Chart.AppVersion }} {{- end }} - - --config-reloader-cpu-request={{ .Values.prometheusOperator.prometheusConfigReloader.resources.requests.cpu }} - - --config-reloader-cpu-limit={{ .Values.prometheusOperator.prometheusConfigReloader.resources.limits.cpu }} - - --config-reloader-memory-request={{ .Values.prometheusOperator.prometheusConfigReloader.resources.requests.memory }} - - --config-reloader-memory-limit={{ .Values.prometheusOperator.prometheusConfigReloader.resources.limits.memory }} + - --config-reloader-cpu-request={{ (((.Values.prometheusOperator.prometheusConfigReloader.resources).requests).cpu) | default 0 }} + - --config-reloader-cpu-limit={{ (((.Values.prometheusOperator.prometheusConfigReloader.resources).limits).cpu) | default 0 }} + - --config-reloader-memory-request={{ (((.Values.prometheusOperator.prometheusConfigReloader.resources).requests).memory) | default 0 }} + - --config-reloader-memory-limit={{ (((.Values.prometheusOperator.prometheusConfigReloader.resources).limits).memory) | default 0 }} {{- if .Values.prometheusOperator.prometheusConfigReloader.enableProbe }} - --enable-config-reloader-probes=true {{- end }} diff --git a/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/windows.node.rules.yaml b/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/windows.node.rules.yaml index 5a240947a3ba..42bcb1c8d883 100644 --- a/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/windows.node.rules.yaml +++ b/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/windows.node.rules.yaml @@ -26,41 +26,41 @@ spec: rules: - expr: |- count ( - windows_system_system_up_time{job="{{ .Values.windowsMonitoring.job }}"} + windows_system_system_up_time{job="windows-exporter"} ) record: node:windows_node:sum - expr: |- count by (instance) (sum by (instance, core) ( - windows_cpu_time_total{job="{{ .Values.windowsMonitoring.job }}"} + windows_cpu_time_total{job="windows-exporter"} )) record: node:windows_node_num_cpu:sum - - expr: 1 - avg(rate(windows_cpu_time_total{job="{{ .Values.windowsMonitoring.job }}",mode="idle"}[1m])) + - expr: 1 - avg(rate(windows_cpu_time_total{job="windows-exporter",mode="idle"}[1m])) record: :windows_node_cpu_utilisation:avg1m - expr: |- 1 - avg by (instance) ( - rate(windows_cpu_time_total{job="{{ .Values.windowsMonitoring.job }}",mode="idle"}[1m]) + rate(windows_cpu_time_total{job="windows-exporter",mode="idle"}[1m]) ) record: node:windows_node_cpu_utilisation:avg1m - expr: |- 1 - - sum(windows_memory_available_bytes{job="{{ .Values.windowsMonitoring.job }}"}) + sum(windows_memory_available_bytes{job="windows-exporter"}) / - sum(windows_os_visible_memory_bytes{job="{{ .Values.windowsMonitoring.job }}"}) + sum(windows_os_visible_memory_bytes{job="windows-exporter"}) record: ':windows_node_memory_utilisation:' - - expr: sum(windows_memory_available_bytes{job="{{ .Values.windowsMonitoring.job }}"} + windows_memory_cache_bytes{job="{{ .Values.windowsMonitoring.job }}"}) + - expr: sum(windows_memory_available_bytes{job="windows-exporter"} + windows_memory_cache_bytes{job="windows-exporter"}) record: :windows_node_memory_MemFreeCached_bytes:sum - - expr: (windows_memory_cache_bytes{job="{{ .Values.windowsMonitoring.job }}"} + windows_memory_modified_page_list_bytes{job="{{ .Values.windowsMonitoring.job }}"} + windows_memory_standby_cache_core_bytes{job="{{ .Values.windowsMonitoring.job }}"} + windows_memory_standby_cache_normal_priority_bytes{job="{{ .Values.windowsMonitoring.job }}"} + windows_memory_standby_cache_reserve_bytes{job="{{ .Values.windowsMonitoring.job }}"}) + - expr: (windows_memory_cache_bytes{job="windows-exporter"} + windows_memory_modified_page_list_bytes{job="windows-exporter"} + windows_memory_standby_cache_core_bytes{job="windows-exporter"} + windows_memory_standby_cache_normal_priority_bytes{job="windows-exporter"} + windows_memory_standby_cache_reserve_bytes{job="windows-exporter"}) record: node:windows_node_memory_totalCached_bytes:sum - - expr: sum(windows_os_visible_memory_bytes{job="{{ .Values.windowsMonitoring.job }}"}) + - expr: sum(windows_os_visible_memory_bytes{job="windows-exporter"}) record: :windows_node_memory_MemTotal_bytes:sum - expr: |- sum by (instance) ( - (windows_memory_available_bytes{job="{{ .Values.windowsMonitoring.job }}"}) + (windows_memory_available_bytes{job="windows-exporter"}) ) record: node:windows_node_memory_bytes_available:sum - expr: |- sum by (instance) ( - windows_os_visible_memory_bytes{job="{{ .Values.windowsMonitoring.job }}"} + windows_os_visible_memory_bytes{job="windows-exporter"} ) record: node:windows_node_memory_bytes_total:sum - expr: |- @@ -70,43 +70,43 @@ spec: record: node:windows_node_memory_utilisation:ratio - expr: 1 - (node:windows_node_memory_bytes_available:sum / node:windows_node_memory_bytes_total:sum) record: 'node:windows_node_memory_utilisation:' - - expr: irate(windows_memory_swap_page_operations_total{job="{{ .Values.windowsMonitoring.job }}"}[5m]) + - expr: irate(windows_memory_swap_page_operations_total{job="windows-exporter"}[5m]) record: node:windows_node_memory_swap_io_pages:irate - expr: |- - avg(irate(windows_logical_disk_read_seconds_total{job="{{ .Values.windowsMonitoring.job }}"}[1m]) + - irate(windows_logical_disk_write_seconds_total{job="{{ .Values.windowsMonitoring.job }}"}[1m]) + avg(irate(windows_logical_disk_read_seconds_total{job="windows-exporter"}[1m]) + + irate(windows_logical_disk_write_seconds_total{job="windows-exporter"}[1m]) ) record: :windows_node_disk_utilisation:avg_irate - expr: |- avg by (instance) ( - (irate(windows_logical_disk_read_seconds_total{job="{{ .Values.windowsMonitoring.job }}"}[1m]) + - irate(windows_logical_disk_write_seconds_total{job="{{ .Values.windowsMonitoring.job }}"}[1m])) + (irate(windows_logical_disk_read_seconds_total{job="windows-exporter"}[1m]) + + irate(windows_logical_disk_write_seconds_total{job="windows-exporter"}[1m])) ) record: node:windows_node_disk_utilisation:avg_irate - expr: |- max by (instance,volume)( - (windows_logical_disk_size_bytes{job="{{ .Values.windowsMonitoring.job }}"} - - windows_logical_disk_free_bytes{job="{{ .Values.windowsMonitoring.job }}"}) - / windows_logical_disk_size_bytes{job="{{ .Values.windowsMonitoring.job }}"} + (windows_logical_disk_size_bytes{job="windows-exporter"} + - windows_logical_disk_free_bytes{job="windows-exporter"}) + / windows_logical_disk_size_bytes{job="windows-exporter"} ) record: 'node:windows_node_filesystem_usage:' - - expr: max by (instance, volume) (windows_logical_disk_free_bytes{job="{{ .Values.windowsMonitoring.job }}"} / windows_logical_disk_size_bytes{job="{{ .Values.windowsMonitoring.job }}"}) + - expr: max by (instance, volume) (windows_logical_disk_free_bytes{job="windows-exporter"} / windows_logical_disk_size_bytes{job="windows-exporter"}) record: 'node:windows_node_filesystem_avail:' - - expr: sum(irate(windows_net_bytes_total{job="{{ .Values.windowsMonitoring.job }}"}[1m])) + - expr: sum(irate(windows_net_bytes_total{job="windows-exporter"}[1m])) record: :windows_node_net_utilisation:sum_irate - expr: |- sum by (instance) ( - (irate(windows_net_bytes_total{job="{{ .Values.windowsMonitoring.job }}"}[1m])) + (irate(windows_net_bytes_total{job="windows-exporter"}[1m])) ) record: node:windows_node_net_utilisation:sum_irate - expr: |- - sum(irate(windows_net_packets_received_discarded_total{job="{{ .Values.windowsMonitoring.job }}"}[1m])) + - sum(irate(windows_net_packets_outbound_discarded_total{job="{{ .Values.windowsMonitoring.job }}"}[1m])) + sum(irate(windows_net_packets_received_discarded_total{job="windows-exporter"}[1m])) + + sum(irate(windows_net_packets_outbound_discarded_total{job="windows-exporter"}[1m])) record: :windows_node_net_saturation:sum_irate - expr: |- sum by (instance) ( - (irate(windows_net_packets_received_discarded_total{job="{{ .Values.windowsMonitoring.job }}"}[1m]) + - irate(windows_net_packets_outbound_discarded_total{job="{{ .Values.windowsMonitoring.job }}"}[1m])) + (irate(windows_net_packets_received_discarded_total{job="windows-exporter"}[1m]) + + irate(windows_net_packets_outbound_discarded_total{job="windows-exporter"}[1m])) ) record: node:windows_node_net_saturation:sum_irate {{- end }} diff --git a/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/windows.pod.rules.yaml b/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/windows.pod.rules.yaml index e953a493fb49..5ce2f0371f59 100644 --- a/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/windows.pod.rules.yaml +++ b/charts/kube-prometheus-stack/templates/prometheus/rules-1.14/windows.pod.rules.yaml @@ -24,17 +24,17 @@ spec: groups: - name: windows.pod.rules rules: - - expr: windows_container_available{job="{{ .Values.windowsMonitoring.job }}"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) + - expr: windows_container_available{job="windows-exporter"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) record: windows_pod_container_available - - expr: windows_container_cpu_usage_seconds_total{job="{{ .Values.windowsMonitoring.job }}"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) + - expr: windows_container_cpu_usage_seconds_total{job="windows-exporter"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) record: windows_container_total_runtime - - expr: windows_container_memory_usage_commit_bytes{job="{{ .Values.windowsMonitoring.job }}"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) + - expr: windows_container_memory_usage_commit_bytes{job="windows-exporter"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) record: windows_container_memory_usage - - expr: windows_container_memory_usage_private_working_set_bytes{job="{{ .Values.windowsMonitoring.job }}"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) + - expr: windows_container_memory_usage_private_working_set_bytes{job="windows-exporter"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) record: windows_container_private_working_set_usage - - expr: windows_container_network_receive_bytes_total{job="{{ .Values.windowsMonitoring.job }}"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) + - expr: windows_container_network_receive_bytes_total{job="windows-exporter"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) record: windows_container_network_received_bytes_total - - expr: windows_container_network_transmit_bytes_total{job="{{ .Values.windowsMonitoring.job }}"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) + - expr: windows_container_network_transmit_bytes_total{job="windows-exporter"} * on(container_id) group_left(container, pod, namespace) max(kube_pod_container_info{job="kube-state-metrics"}) by(container, container_id, pod, namespace) record: windows_container_network_transmitted_bytes_total - expr: |- max by (namespace, pod, container) ( diff --git a/charts/kube-prometheus-stack/values.yaml b/charts/kube-prometheus-stack/values.yaml index 611ce608bbc5..2ad07b069cb6 100644 --- a/charts/kube-prometheus-stack/values.yaml +++ b/charts/kube-prometheus-stack/values.yaml @@ -201,10 +201,30 @@ global: # - "image-pull-secret" windowsMonitoring: - ## Deploys the windows-exporter and Windows-specific dashboards and rules + ## Deploys the windows-exporter and Windows-specific dashboards and rules (job name must be 'windows-exporter') enabled: false - ## Job must match jobLabel in the PodMonitor/ServiceMonitor and is used for the rules - job: prometheus-windows-exporter + +## Configuration for prometheus-windows-exporter +## ref: https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus-windows-exporter +## +prometheus-windows-exporter: + ## Enable ServiceMonitor and set Kubernetes label to use as a job label + ## + prometheus: + monitor: + enabled: true + jobLabel: jobLabel + + ## Set job label to 'windows-exporter' as required by the default Prometheus rules and Grafana dashboards + ## + podLabels: + jobLabel: windows-exporter + + ## Enable memory and container metrics as required by the default Prometheus rules and Grafana dashboards + ## + config: |- + collectors: + enabled: '[defaults],memory,container' ## Configuration for alertmanager ## ref: https://prometheus.io/docs/alerting/alertmanager/ @@ -1130,6 +1150,11 @@ kubelet: namespace: kube-system serviceMonitor: + ## Attach metadata to discovered targets. Requires Prometheus v2.45 for endpoints created by the operator. + ## + attachMetadata: + node: false + ## Scrape interval. If not set, the Prometheus default scrape interval is used. ## interval: "" @@ -2377,13 +2402,13 @@ prometheusOperator: enableProbe: false # resource config for prometheusConfigReloader - resources: - requests: - cpu: 200m - memory: 50Mi - limits: - cpu: 200m - memory: 50Mi + resources: {} + # requests: + # cpu: 200m + # memory: 50Mi + # limits: + # cpu: 200m + # memory: 50Mi ## Thanos side-car image when configured ## diff --git a/charts/prometheus-adapter/Chart.yaml b/charts/prometheus-adapter/Chart.yaml index f4c7fcdbcbcf..5be8fed94dee 100644 --- a/charts/prometheus-adapter/Chart.yaml +++ b/charts/prometheus-adapter/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: prometheus-adapter -version: 4.5.1 +version: 4.6.1 appVersion: v0.11.1 description: A Helm chart for k8s prometheus adapter home: https://github.com/kubernetes-sigs/prometheus-adapter diff --git a/charts/prometheus-adapter/templates/deployment.yaml b/charts/prometheus-adapter/templates/deployment.yaml index 8dfae245503b..0ea707606b0f 100644 --- a/charts/prometheus-adapter/templates/deployment.yaml +++ b/charts/prometheus-adapter/templates/deployment.yaml @@ -108,6 +108,9 @@ spec: name: volume-serving-cert readOnly: true {{- end }} + {{- with .Values.extraContainers }} + {{- toYaml . | nindent 6 }} + {{- end }} nodeSelector: {{- toYaml .Values.nodeSelector | nindent 8 }} affinity: diff --git a/charts/prometheus-adapter/values.yaml b/charts/prometheus-adapter/values.yaml index 495a5c764f3c..7e19862c01e0 100644 --- a/charts/prometheus-adapter/values.yaml +++ b/charts/prometheus-adapter/values.yaml @@ -213,6 +213,9 @@ extraArguments: [] # - --tls-private-key-file=/etc/tls/tls.key # - --tls-cert-file=/etc/tls/tls.crt +# Additional containers to add to the pod +extraContainers: [] + # Any extra volumes extraVolumes: [] # - name: example-name diff --git a/charts/prometheus-blackbox-exporter/Chart.yaml b/charts/prometheus-blackbox-exporter/Chart.yaml index c54ca67e0b2f..99ef4f326632 100644 --- a/charts/prometheus-blackbox-exporter/Chart.yaml +++ b/charts/prometheus-blackbox-exporter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 description: Prometheus Blackbox Exporter name: prometheus-blackbox-exporter -version: 8.3.0 +version: 8.4.0 appVersion: v0.24.0 home: https://github.com/prometheus/blackbox_exporter sources: diff --git a/charts/prometheus-blackbox-exporter/templates/_helpers.tpl b/charts/prometheus-blackbox-exporter/templates/_helpers.tpl index 9cb28d28e2b9..072dfcc661ee 100644 --- a/charts/prometheus-blackbox-exporter/templates/_helpers.tpl +++ b/charts/prometheus-blackbox-exporter/templates/_helpers.tpl @@ -101,3 +101,148 @@ The image to use {{- .Values.image.repository -}}:{{- .Values.image.tag | default .Chart.AppVersion -}} {{- with .Values.image.digest -}}@{{ .}}{{- end -}} {{- end -}} + +{{/* +Define pod spec to be reused by highlevel resources (deployment, daemonset) +*/}} +{{- define "prometheus-blackbox-exporter.podSpec" -}} +automountServiceAccountToken: {{ .Values.automountServiceAccountToken }} +serviceAccountName: {{ template "prometheus-blackbox-exporter.serviceAccountName" . }} +{{- with .Values.topologySpreadConstraints }} +topologySpreadConstraints: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- with .Values.nodeSelector }} +nodeSelector: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- with .Values.affinity }} +affinity: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- with .Values.tolerations }} +tolerations: + {{- toYaml . | nindent 2 }} +{{- end }} +{{- if .Values.image.pullSecrets }} +imagePullSecrets: +{{- range .Values.image.pullSecrets }} +- name: {{ . }} +{{- end }} +{{- end }} +{{- if .Values.hostAliases }} +hostAliases: +{{- range .Values.hostAliases }} +- ip: {{ .ip }} + hostnames: + {{- range .hostNames }} + - {{ . }} + {{- end }} +{{- end }} +{{- end }} +restartPolicy: {{ .Values.restartPolicy }} +{{- with .Values.priorityClassName }} +priorityClassName: "{{ . }}" +{{- end }} +{{- with .Values.podSecurityContext }} +securityContext: +{{ toYaml . | indent 2 }} +{{- end }} +{{- with .Values.extraInitContainers }} +initContainers: + {{- toYaml . | indent 2 }} +{{- end }} +containers: +{{- with .Values.extraContainers }} + {{- toYaml . }} +{{- end }} +- name: blackbox-exporter + image: {{ include "prometheus-blackbox-exporter.image" . }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- with .Values.securityContext }} + securityContext: + {{- toYaml . | nindent 4 }} + {{- end }} + env: + {{- range $key, $value := .Values.extraEnv }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + args: + {{- if .Values.config }} + {{- if .Values.configPath }} + - "--config.file={{ .Values.configPath }}" + {{- else }} + - "--config.file=/config/blackbox.yaml" + {{- end }} + {{- else }} + - "--config.file=/etc/blackbox_exporter/config.yml" + {{- end }} + {{- with .Values.extraArgs }} +{{ toYaml . | indent 2 }} + {{- end }} + {{- with .Values.resources }} + resources: +{{ toYaml . | indent 4 }} + {{- end }} + ports: + - containerPort: {{ .Values.containerPort }} + name: http + livenessProbe: + {{- toYaml .Values.livenessProbe | trim | nindent 4 }} + readinessProbe: + {{- toYaml .Values.readinessProbe | trim | nindent 4 }} + volumeMounts: + - mountPath: /config + name: config + {{- range .Values.extraConfigmapMounts }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + subPath: {{ .subPath | default "" }} + readOnly: {{ .readOnly }} + {{- end }} + {{- range .Values.extraSecretMounts }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + subPath: {{ .subPath }} + readOnly: {{ .readOnly }} + {{- end }} + {{- if .Values.extraVolumeMounts }} +{{ toYaml .Values.extraVolumeMounts | indent 2 }} + {{- end }} + {{- if .Values.dnsPolicy }} +dnsPolicy: {{ .Values.dnsPolicy | toString }} +{{- end }} +hostNetwork: {{ .Values.hostNetwork }} +{{- with .Values.dnsConfig }} +dnsConfig: + {{- toYaml . | nindent 2 }} +{{- end }} +volumes: +{{- if .Values.extraVolumes }} +{{ toYaml .Values.extraVolumes }} +{{- end }} +- name: config +{{- if .Values.secretConfig }} + secret: + secretName: {{ template "prometheus-blackbox-exporter.fullname" . }} +{{- else if .Values.configExistingSecretName }} + secret: + secretName: {{ .Values.configExistingSecretName }} +{{- else }} + configMap: + name: {{ template "prometheus-blackbox-exporter.fullname" . }} +{{- end }} +{{- range .Values.extraConfigmapMounts }} +- name: {{ .name }} + configMap: + name: {{ .configMap }} + defaultMode: {{ .defaultMode }} +{{- end }} +{{- range .Values.extraSecretMounts }} +- name: {{ .name }} + secret: + secretName: {{ .secretName }} + defaultMode: {{ .defaultMode }} +{{- end }} +{{- end -}} diff --git a/charts/prometheus-blackbox-exporter/templates/daemonset.yaml b/charts/prometheus-blackbox-exporter/templates/daemonset.yaml index 7dad52ce3b43..c43513c8df97 100644 --- a/charts/prometheus-blackbox-exporter/templates/daemonset.yaml +++ b/charts/prometheus-blackbox-exporter/templates/daemonset.yaml @@ -23,124 +23,5 @@ spec: {{ toYaml .Values.podAnnotations | indent 8 }} {{- end }} spec: - serviceAccountName: {{ template "prometheus-blackbox-exporter.serviceAccountName" . }} - {{- if .Values.nodeSelector }} - nodeSelector: -{{ toYaml .Values.nodeSelector | indent 8 }} - {{- end }} - {{- if .Values.affinity }} - affinity: -{{ toYaml .Values.affinity | indent 8 }} - {{- end }} - {{- if .Values.tolerations }} - tolerations: -{{ toYaml .Values.tolerations | indent 6 }} - {{- end }} - {{- if .Values.image.pullSecrets }} - imagePullSecrets: - {{- range .Values.image.pullSecrets }} - - name: {{ . }} - {{- end }} - {{- end }} - {{- if .Values.hostAliases }} - hostAliases: - {{- range .Values.hostAliases }} - - ip: {{ .ip }} - hostnames: - {{- range .hostNames }} - - {{ . }} - {{- end }} - {{- end }} - {{- end }} - restartPolicy: {{ .Values.restartPolicy }} - - {{- if .Values.priorityClassName }} - priorityClassName: "{{ .Values.priorityClassName }}" - {{- end }} - {{- if .Values.extraInitContainers }} - initContainers: -{{ toYaml .Values.extraInitContainers | indent 8 }} - {{- end }} - containers: - - name: blackbox-exporter - image: {{ include "prometheus-blackbox-exporter.image" . }} - imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- with .Values.securityContext }} - securityContext: - {{- toYaml . | nindent 12 }} - {{- end }} - env: - {{- range $key, $value := .Values.extraEnv }} - - name: {{ $key }} - value: {{ $value | quote }} - {{- end }} - args: -{{- if (or .Values.config .Values.configExistingSecretName) }} - {{- if .Values.configPath }} - - "--config.file={{ .Values.configPath }}" - {{- else }} - - "--config.file=/config/blackbox.yaml" - {{- end }} -{{- else }} - - "--config.file=/etc/blackbox_exporter/config.yml" -{{- end }} - {{- if .Values.extraArgs }} -{{ toYaml .Values.extraArgs | indent 12 }} - {{- end }} - resources: -{{ toYaml .Values.resources | indent 12 }} - ports: - - containerPort: {{ .Values.service.port }} - name: http - livenessProbe: - {{- toYaml .Values.livenessProbe | trim | nindent 12 }} - readinessProbe: - {{- toYaml .Values.readinessProbe | trim | nindent 12 }} - volumeMounts: - - mountPath: /config - name: config - {{- range .Values.extraConfigmapMounts }} - - name: {{ .name }} - mountPath: {{ .mountPath }} - subPath: {{ .subPath | default "" }} - readOnly: {{ .readOnly }} - {{- end }} - {{- range .Values.extraSecretMounts }} - - name: {{ .name }} - mountPath: {{ .mountPath }} - subPath: {{ .subPath }} - readOnly: {{ .readOnly }} - {{- end }} -{{- if .Values.dnsPolicy }} - dnsPolicy: {{ .Values.dnsPolicy | toString }} -{{- end }} - hostNetwork: {{ .Values.hostNetwork }} -{{- if .Values.dnsConfig }} - dnsConfig: - {{- toYaml .Values.dnsConfig | nindent 8 }} -{{- end }} - volumes: - - name: config -{{- if .Values.secretConfig }} - secret: - secretName: {{ template "prometheus-blackbox-exporter.fullname" . }} -{{- else if .Values.configExistingSecretName }} - secret: - secretName: {{ .Values.configExistingSecretName }} -{{- else }} - configMap: - name: {{ template "prometheus-blackbox-exporter.fullname" . }} -{{- end }} - {{- range .Values.extraConfigmapMounts }} - - name: {{ .name }} - configMap: - name: {{ .configMap }} - defaultMode: {{ .defaultMode }} - {{- end }} - {{- range .Values.extraSecretMounts }} - - name: {{ .name }} - secret: - secretName: {{ .secretName }} - defaultMode: {{ .defaultMode }} - {{- end }} + {{- include "prometheus-blackbox-exporter.podSpec" . | nindent 6 }} {{- end }} diff --git a/charts/prometheus-blackbox-exporter/templates/deployment.yaml b/charts/prometheus-blackbox-exporter/templates/deployment.yaml index 79413b96e552..594bd8cbe8f8 100644 --- a/charts/prometheus-blackbox-exporter/templates/deployment.yaml +++ b/charts/prometheus-blackbox-exporter/templates/deployment.yaml @@ -26,140 +26,5 @@ spec: {{ toYaml .Values.podAnnotations | indent 8 }} {{- end }} spec: - automountServiceAccountToken: {{ .Values.automountServiceAccountToken }} - serviceAccountName: {{ template "prometheus-blackbox-exporter.serviceAccountName" . }} - {{- with .Values.topologySpreadConstraints }} - topologySpreadConstraints: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- if .Values.image.pullSecrets }} - imagePullSecrets: - {{- range .Values.image.pullSecrets }} - - name: {{ . }} - {{- end }} - {{- end }} - {{- if .Values.hostAliases }} - hostAliases: - {{- range .Values.hostAliases }} - - ip: {{ .ip }} - hostnames: - {{- range .hostNames }} - - {{ . }} - {{- end }} - {{- end }} - {{- end }} - restartPolicy: {{ .Values.restartPolicy }} - - {{- if .Values.priorityClassName }} - priorityClassName: "{{ .Values.priorityClassName }}" - {{- end }} - securityContext: -{{ toYaml .Values.podSecurityContext | indent 8 }} - {{- if .Values.extraInitContainers }} - initContainers: -{{ toYaml .Values.extraInitContainers | indent 8 }} - {{- end }} - containers: - {{- if .Values.extraContainers }} -{{ toYaml .Values.extraContainers | indent 8 }} - {{- end }} - - name: blackbox-exporter - image: {{ include "prometheus-blackbox-exporter.image" . }} - imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- with .Values.securityContext }} - securityContext: - {{- toYaml . | nindent 12 }} - {{- end }} - env: - {{- range $key, $value := .Values.extraEnv }} - - name: {{ $key }} - value: {{ $value | quote }} - {{- end }} - args: -{{- if .Values.config }} - {{- if .Values.configPath }} - - "--config.file={{ .Values.configPath }}" - {{- else }} - - "--config.file=/config/blackbox.yaml" - {{- end }} -{{- else }} - - "--config.file=/etc/blackbox_exporter/config.yml" -{{- end }} - {{- if .Values.extraArgs }} -{{ toYaml .Values.extraArgs | indent 12 }} - {{- end }} - resources: -{{ toYaml .Values.resources | indent 12 }} - ports: - - containerPort: {{ .Values.containerPort }} - name: http - livenessProbe: - {{- toYaml .Values.livenessProbe | trim | nindent 12 }} - readinessProbe: - {{- toYaml .Values.readinessProbe | trim | nindent 12 }} - volumeMounts: - - mountPath: /config - name: config - {{- range .Values.extraConfigmapMounts }} - - name: {{ .name }} - mountPath: {{ .mountPath }} - subPath: {{ .subPath | default "" }} - readOnly: {{ .readOnly }} - {{- end }} - {{- range .Values.extraSecretMounts }} - - name: {{ .name }} - mountPath: {{ .mountPath }} - subPath: {{ .subPath }} - readOnly: {{ .readOnly }} - {{- end }} - {{- if .Values.extraVolumeMounts }} -{{ toYaml .Values.extraVolumeMounts | indent 12 }} - {{- end }} -{{- if .Values.dnsPolicy }} - dnsPolicy: {{ .Values.dnsPolicy | toString }} -{{- end }} - hostNetwork: {{ .Values.hostNetwork }} -{{- if .Values.dnsConfig }} - dnsConfig: - {{- toYaml .Values.dnsConfig | nindent 8 }} -{{- end }} - volumes: - {{- if .Values.extraVolumes }} -{{ toYaml .Values.extraVolumes | indent 8 }} - {{- end }} - - name: config -{{- if .Values.secretConfig }} - secret: - secretName: {{ template "prometheus-blackbox-exporter.fullname" . }} -{{- else if .Values.configExistingSecretName }} - secret: - secretName: {{ .Values.configExistingSecretName }} -{{- else }} - configMap: - name: {{ template "prometheus-blackbox-exporter.fullname" . }} -{{- end }} - {{- range .Values.extraConfigmapMounts }} - - name: {{ .name }} - configMap: - name: {{ .configMap }} - defaultMode: {{ .defaultMode }} - {{- end }} - {{- range .Values.extraSecretMounts }} - - name: {{ .name }} - secret: - secretName: {{ .secretName }} - defaultMode: {{ .defaultMode }} - {{- end }} + {{- include "prometheus-blackbox-exporter.podSpec" . | nindent 6 }} {{- end }} diff --git a/charts/prometheus-elasticsearch-exporter/Chart.yaml b/charts/prometheus-elasticsearch-exporter/Chart.yaml index 10cc69ac72eb..860e79fd3c60 100644 --- a/charts/prometheus-elasticsearch-exporter/Chart.yaml +++ b/charts/prometheus-elasticsearch-exporter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Elasticsearch stats exporter for Prometheus name: prometheus-elasticsearch-exporter -version: 5.3.0 +version: 5.3.1 kubeVersion: ">=1.10.0-0" appVersion: "v1.6.0" home: https://github.com/prometheus-community/elasticsearch_exporter diff --git a/charts/prometheus-elasticsearch-exporter/templates/deployment.yaml b/charts/prometheus-elasticsearch-exporter/templates/deployment.yaml index 05e6573631ff..96db3fff8a2e 100644 --- a/charts/prometheus-elasticsearch-exporter/templates/deployment.yaml +++ b/charts/prometheus-elasticsearch-exporter/templates/deployment.yaml @@ -161,7 +161,7 @@ spec: lifecycle: preStop: exec: - command: ["/bin/bash", "-c", "sleep 20"] + command: ["/bin/sleep", "20"] volumeMounts: {{- if and .Values.es.ssl.enabled (eq .Values.es.ssl.useExistingSecrets false) }} - mountPath: /ssl diff --git a/charts/prometheus-ipmi-exporter/.helmignore b/charts/prometheus-ipmi-exporter/.helmignore new file mode 100644 index 000000000000..0e8a0eb36f4c --- /dev/null +++ b/charts/prometheus-ipmi-exporter/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/prometheus-ipmi-exporter/Chart.yaml b/charts/prometheus-ipmi-exporter/Chart.yaml new file mode 100644 index 000000000000..410ad6fd7f8a --- /dev/null +++ b/charts/prometheus-ipmi-exporter/Chart.yaml @@ -0,0 +1,20 @@ +apiVersion: v2 +name: prometheus-ipmi-exporter +description: This is an IPMI exporter for Prometheus. + +type: application + +version: 0.1.0 + +appVersion: "1.6.1" + +keywords: + - metrics + - ipmi + - monitoring + +home: https://github.com/prometheus-community/ipmi_exporter + +maintainers: + - name: lexfrei + email: f@lex.la diff --git a/charts/prometheus-ipmi-exporter/templates/NOTES.txt b/charts/prometheus-ipmi-exporter/templates/NOTES.txt new file mode 100644 index 000000000000..9695ea1d1bd0 --- /dev/null +++ b/charts/prometheus-ipmi-exporter/templates/NOTES.txt @@ -0,0 +1,22 @@ +Thank you for installing prometheus-ipmi-exporter! + +Your release is named: {{ .Release.Name }} + +To view the IPMI Exporter service within your cluster, you can run: + + kubectl get svc {{ .Release.Name }}-ipmi-exporter-service + +{{- if .Values.serviceMonitor.enabled }} +ServiceMonitor has been installed. Make sure you've installed Prometheus Operator in your cluster and then verify that the target is up in your Prometheus instance. +{{- else }} +Note: ServiceMonitor is disabled. If you want to enable monitoring through Prometheus Operator, please set `serviceMonitor.enabled` to `true` in the values.yaml file or via --set flag. +{{- end }} + +{{- if .Values.resources }} +Resource requests and limits are set as follows: + + CPU Requests: {{ .Values.resources.requests.cpu }} + Memory Requests: {{ .Values.resources.requests.memory }} + CPU Limits: {{ .Values.resources.limits.cpu }} + Memory Limits: {{ .Values.resources.limits.memory }} +{{- end }} diff --git a/charts/prometheus-ipmi-exporter/templates/_helpers.tpl b/charts/prometheus-ipmi-exporter/templates/_helpers.tpl new file mode 100644 index 000000000000..f608f7621dbc --- /dev/null +++ b/charts/prometheus-ipmi-exporter/templates/_helpers.tpl @@ -0,0 +1,85 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "prometheus-ipmi-exporter.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "prometheus-ipmi-exporter.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "prometheus-ipmi-exporter.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "prometheus-ipmi-exporter.labels" -}} +helm.sh/chart: {{ include "prometheus-ipmi-exporter.chart" . }} +{{ include "prometheus-ipmi-exporter.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "prometheus-ipmi-exporter.selectorLabels" -}} +app.kubernetes.io/name: {{ include "prometheus-ipmi-exporter.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "prometheus-ipmi-exporter.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} +{{- default (include "prometheus-ipmi-exporter.fullname" .) .Values.serviceAccount.name }} +{{- else -}} +{{- default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} + +{{/* +Return the appropriate apiVersion for rbac. +*/}} +{{- define "rbac.apiVersion" -}} +{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} +{{- print "rbac.authorization.k8s.io/v1" -}} +{{- else -}} +{{- print "rbac.authorization.k8s.io/v1beta1" -}} +{{- end -}} +{{- end -}} + +{{/* +Determine secret name, can either be the self-created of an existing one +*/}} +{{- define "prometheus-ipmi-exporter.secretName" -}} +{{- if .Values.existingSecret.name -}} + {{- .Values.existingSecret.name -}} +{{- else -}} + {{ include "prometheus-ipmi-exporter.fullname" . }} +{{- end -}} +{{- end -}} diff --git a/charts/prometheus-ipmi-exporter/templates/configmap.yaml b/charts/prometheus-ipmi-exporter/templates/configmap.yaml new file mode 100644 index 000000000000..fabf77404ca6 --- /dev/null +++ b/charts/prometheus-ipmi-exporter/templates/configmap.yaml @@ -0,0 +1,13 @@ +{{- if not .Values.configMapFile -}} +{{- $fullName := include "prometheus-ipmi-exporter.fullname" . -}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ $fullName }} + labels: + {{- include "prometheus-ipmi-exporter.labels" . | nindent 4 }} +data: + config.yml: | + modules: +{{- toYaml .Values.modules | nindent 6 }} +{{- end }} diff --git a/charts/prometheus-ipmi-exporter/templates/deployment.yaml b/charts/prometheus-ipmi-exporter/templates/deployment.yaml new file mode 100644 index 000000000000..1868cc877764 --- /dev/null +++ b/charts/prometheus-ipmi-exporter/templates/deployment.yaml @@ -0,0 +1,62 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "prometheus-ipmi-exporter.fullname" . }} + labels: + {{- include "prometheus-ipmi-exporter.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "prometheus-ipmi-exporter.selectorLabels" . | nindent 6 }} + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + type: RollingUpdate + template: + metadata: + labels: + {{- include "prometheus-ipmi-exporter.selectorLabels" . | nindent 8 }} + {{- with .Values.additionalAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + containers: + - name: ipmi-exporter + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + args: + - "--config.file" + - "/config.yml" + volumeMounts: + - name: config-volume + mountPath: /config.yml + subPath: config.yml + readOnly: true + ports: + - name: http + containerPort: {{ .Values.service.port }} + protocol: TCP + resources: + limits: + cpu: {{ .Values.resources.limits.cpu }} + memory: {{ .Values.resources.limits.memory }} + requests: + cpu: {{ .Values.resources.requests.cpu }} + memory: {{ .Values.resources.requests.memory }} + volumes: + - name: config-volume + configMap: + name: {{ template "prometheus-ipmi-exporter.fullname" . }} + {{- with .Values.nodeSelector }} + nodeSelector: {{ toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: {{ toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: {{ toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/prometheus-ipmi-exporter/templates/service.yaml b/charts/prometheus-ipmi-exporter/templates/service.yaml new file mode 100644 index 000000000000..1682f0d9f0a2 --- /dev/null +++ b/charts/prometheus-ipmi-exporter/templates/service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "prometheus-ipmi-exporter.fullname" . }} + labels: + {{- include "prometheus-ipmi-exporter.labels" . | nindent 4 }} + annotations: +{{ toYaml .Values.service.annotations | indent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "prometheus-ipmi-exporter.selectorLabels" . | nindent 4 }} diff --git a/charts/prometheus-ipmi-exporter/templates/servicemonitor.yaml b/charts/prometheus-ipmi-exporter/templates/servicemonitor.yaml new file mode 100644 index 000000000000..2ffcd72970e4 --- /dev/null +++ b/charts/prometheus-ipmi-exporter/templates/servicemonitor.yaml @@ -0,0 +1,44 @@ +{{- if $.Values.serviceMonitor }} +{{- if and ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) ( .Values.serviceMonitor.enabled ) }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: +{{- if .Values.serviceMonitor.labels }} + labels: +{{ toYaml .Values.serviceMonitor.labels | indent 4}} +{{- end }} + name: {{ template "prometheus-ipmi-exporter.fullname" . }} +{{- if .Values.serviceMonitor.namespace }} + namespace: {{ .Values.serviceMonitor.namespace }} +{{- end }} +spec: + endpoints: + - targetPort: {{ .Values.service.port }} +{{- if .Values.serviceMonitor.interval }} + interval: {{ .Values.serviceMonitor.interval }} +{{- end }} +{{- if .Values.serviceMonitor.telemetryPath }} + path: {{ .Values.serviceMonitor.telemetryPath }} +{{- end }} +{{- if .Values.serviceMonitor.timeout }} + scrapeTimeout: {{ .Values.serviceMonitor.timeout }} +{{- end }} +{{- if .Values.serviceMonitor.metricRelabelings }} + metricRelabelings: +{{ toYaml .Values.serviceMonitor.metricRelabelings | indent 4 }} +{{- end }} + jobLabel: {{ template "prometheus-ipmi-exporter.fullname" . }} + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + selector: + matchLabels: + {{- include "prometheus-ipmi-exporter.selectorLabels" . | nindent 6 }} +{{- if .Values.serviceMonitor.targetLabels }} + targetLabels: +{{- range .Values.serviceMonitor.targetLabels }} + - {{ . }} +{{- end }} +{{- end }} +{{- end }} +{{- end }} diff --git a/charts/prometheus-ipmi-exporter/values.yaml b/charts/prometheus-ipmi-exporter/values.yaml new file mode 100644 index 000000000000..a51795cb842c --- /dev/null +++ b/charts/prometheus-ipmi-exporter/values.yaml @@ -0,0 +1,139 @@ +# Default values for prometheus-ipmi-exporter. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: registry.hub.docker.com/prometheuscommunity/ipmi-exporter + tag: v1.6.1 + pullPolicy: IfNotPresent + +# Name of an externally managed secret (in the same namespace) containing the ipmi credentials as keys `ipmi-user` and `ipmi-password`. +nodeSelector: {} + +# Name of an externally managed secret (in the same namespace) containing the ipmi credentials as keys `ipmi-user` and `ipmi-password`. +tolerations: [] + +# Name of an externally managed secret (in the same namespace) containing the ipmi credentials as keys `ipmi-user` and `ipmi-password`. +affinity: {} + +# Name of an externally managed secret (in the same namespace) containing the ipmi credentials as keys `ipmi-user` and `ipmi-password`. +service: + type: ClusterIP + port: 9290 + annotations: {} + +resources: + limits: + cpu: 100m + memory: 128Mi + requests: + cpu: 100m + memory: 128Mi + +additionalAnnotations: {} + +serviceMonitor: + # When set true then use a ServiceMonitor to configure scraping + enabled: false + # Set the namespace the ServiceMonitor should be deployed + # namespace: monitoring + # Set how frequently Prometheus should scrape + # interval: 30s + # Set path to ipmi-exporter telemtery-path + # telemetryPath: /metrics + # Set labels for the ServiceMonitor, use this to define your scrape label for Prometheus Operator + # labels: + # Set timeout for scrape + # timeout: 10s + # Set of labels to transfer on the Kubernetes Service onto the target. + # targetLabels: [] + # metricRelabelings: [] + + # Configuration file for ipmi_exporter + +# This is an example config for scraping remote hosts via IPMI. +# Information required to access remote IPMI interfaces can be supplied in the +# 'modules' section. A scrape can request the usage of a given config by +# setting the `module` URL parameter. +modules: + default: + # These settings are used if no module is specified, the + # specified module doesn't exist, or of course if + # module=default is specified. + user: "default_user" + pass: "example_pw" + # The below settings correspond to driver-type, privilege-level, and + # session-timeout respectively, see `man 5 freeipmi.conf` (and e.g. + # `man 8 ipmi-sensors` for a list of driver types). + driver: "LAN_2_0" + privilege: "user" + # The session timeout is in milliseconds. Note that a scrape can take up + # to (session-timeout * #-of-collectors) milliseconds, so set the scrape + # timeout in Prometheus accordingly. + # Must be larger than the retransmission timeout, which defaults to 1000. + timeout: 10000 + # Available collectors are bmc, ipmi, chassis, dcmi, sel, and sm-lan-mode + # If _not_ specified, bmc, ipmi, chassis, and dcmi are used + collectors: + - bmc + - ipmi + - chassis + # Got any sensors you don't care about? Add them here. + exclude_sensor_ids: + - 2 + - 29 + - 32 + - 50 + - 52 + - 55 + dcmi: + # Use these settings when scraped with module=dcmi. + user: "admin_user" + pass: "another_pw" + privilege: "admin" + driver: "LAN_2_0" + collectors: + - dcmi + thatspecialhost: + # Use these settings when scraped with module=thatspecialhost. + user: "some_user" + pass: "secret_pw" + privilege: "admin" + driver: "LAN" + collectors: + - ipmi + - sel + # Need any special workaround flags set? Add them here. + # Workaround flags might be needed to address issues with specific vendor implementations + # e.g. https://www.gnu.org/software/freeipmi/freeipmi-faq.html#Why-is-the-output-from-FreeIPMI-different-than-another-software_003f + # For a full list of flags, refer to: + # https://www.gnu.org/software/freeipmi/manpages/man8/ipmi-sensors.8.html#lbAL + workaround_flags: + - discretereading + # If you require additional command line arguments (e.g. --bridge-sensors for ipmimonitoring), + # you can specify them per collector - BE CAREFUL, you can easily break the exporter with this! + custom_args: + ipmi: + - "--bridge-sensors" + advanced: + # Use these settings when scraped with module=advanced. + user: "some_user" + pass: "secret_pw" + privilege: "admin" + driver: "LAN" + collectors: + - ipmi + - sel + # USING ANY OF THE BELOW VOIDS YOUR WARRANTY! YOU MAY GET BITTEN BY SHARKS! + # You can override the command to be executed for a collector. Paired with + # custom_args, this can be used to e.g. execute the IPMI tools with sudo: + collector_cmd: + ipmi: sudo + sel: sudo + custom_args: + ipmi: + - "ipmimonitoring" + sel: + - "ipmi-sel" diff --git a/charts/prometheus-kafka-exporter/Chart.yaml b/charts/prometheus-kafka-exporter/Chart.yaml index 6019f8c9f161..9368f97aae55 100644 --- a/charts/prometheus-kafka-exporter/Chart.yaml +++ b/charts/prometheus-kafka-exporter/Chart.yaml @@ -3,7 +3,7 @@ appVersion: "v1.7.0" description: A Helm chart to export the metrics from Kafka in Prometheus format using the kafka-exporter from https://github.com/danielqsj/kafka_exporter name: prometheus-kafka-exporter home: https://github.com/danielqsj/kafka_exporter -version: 2.5.0 +version: 2.7.0 kubeVersion: ">=1.19.0-0" sources: - https://gkarthiks.github.io/helm-charts/charts/prometheus-kafka-exporter diff --git a/charts/prometheus-kafka-exporter/templates/service.yaml b/charts/prometheus-kafka-exporter/templates/service.yaml index b0e77e6b5ea3..404572dae516 100644 --- a/charts/prometheus-kafka-exporter/templates/service.yaml +++ b/charts/prometheus-kafka-exporter/templates/service.yaml @@ -14,11 +14,17 @@ metadata: {{- end }} spec: type: {{ .Values.service.type }} +{{- if and (eq .Values.service.type "LoadBalancer") (.Values.service.loadBalancerIP) }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} +{{- end }} ports: - port: {{ .Values.service.port }} targetPort: exporter-port protocol: TCP name: exporter-port + {{- if (and (eq .Values.service.type "NodePort") .Values.service.nodePort) }} + nodePort: {{ .Values.service.nodePort }} + {{- end }} selector: app: {{ template "prometheus-kafka-exporter.name" . }} release: {{ .Release.Name }} diff --git a/charts/prometheus-kafka-exporter/values.yaml b/charts/prometheus-kafka-exporter/values.yaml index 9244a9e14b48..7ba874594563 100644 --- a/charts/prometheus-kafka-exporter/values.yaml +++ b/charts/prometheus-kafka-exporter/values.yaml @@ -71,6 +71,11 @@ service: port: 9308 labels: {} annotations: {} + # Specifies a custom nodePort for external use. Used with service.type=NodePort. + nodePort: null + # Specifies a reserved static IP. Used with service.type=LoadBalancer. + # The field is deprecated, implementation-specific annotations should be set instead. + loadBalancerIP: null liveness: enabled: false diff --git a/charts/prometheus-node-exporter/Chart.yaml b/charts/prometheus-node-exporter/Chart.yaml index 76b9a7ecc0e5..5ec6a9076803 100644 --- a/charts/prometheus-node-exporter/Chart.yaml +++ b/charts/prometheus-node-exporter/Chart.yaml @@ -6,7 +6,7 @@ keywords: - prometheus - exporter type: application -version: 4.23.1 +version: 4.23.2 appVersion: 1.6.1 home: https://github.com/prometheus/node_exporter/ sources: diff --git a/charts/prometheus-node-exporter/README.md b/charts/prometheus-node-exporter/README.md index 5dbfa328977c..ef8384410240 100644 --- a/charts/prometheus-node-exporter/README.md +++ b/charts/prometheus-node-exporter/README.md @@ -1,18 +1,18 @@ -# Prometheus `Node Exporter` +# Prometheus Node Exporter Prometheus exporter for hardware and OS metrics exposed by *NIX kernels, written in Go with pluggable metric collectors. -This chart bootstraps a prometheus [`Node Exporter`](http://github.com/prometheus/node_exporter) daemonset on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. +This chart bootstraps a Prometheus [Node Exporter](http://github.com/prometheus/node_exporter) daemonset on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. ## Get Repository Info - + ```console helm repo add prometheus-community https://prometheus-community.github.io/helm-charts helm repo update ``` -_See [`helm repo`](https://helm.sh/docs/helm/helm_repo/) for command documentation._ - +_See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation._ + ## Install Chart ```console @@ -36,15 +36,11 @@ _See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command doc ## Upgrading Chart ```console -helm upgrade [RELEASE_NAME] [CHART] --install +helm upgrade [RELEASE_NAME] prometheus-community/prometheus-node-exporter --install ``` _See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._ -### 4.16 to 4.17+ - -`containerSecurityContext.readOnlyRootFilesystem` is set to `true` by default. - ### 3.x to 4.x Starting from version 4.0.0, the `node exporter` chart is using the [Kubernetes recommended labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/). Therefore you have to delete the daemonset before you upgrade. diff --git a/charts/prometheus-node-exporter/templates/clusterrole.yaml b/charts/prometheus-node-exporter/templates/clusterrole.yaml index 1fd91150f489..c256dba73dbb 100644 --- a/charts/prometheus-node-exporter/templates/clusterrole.yaml +++ b/charts/prometheus-node-exporter/templates/clusterrole.yaml @@ -3,7 +3,6 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: {{ include "prometheus-node-exporter.fullname" . }} - namespace: {{ include "prometheus-node-exporter.namespace" . }} labels: {{- include "prometheus-node-exporter.labels" . | nindent 4 }} rules: diff --git a/charts/prometheus-postgres-exporter/Chart.yaml b/charts/prometheus-postgres-exporter/Chart.yaml index f71cd028b7a4..2b4496f92eb3 100644 --- a/charts/prometheus-postgres-exporter/Chart.yaml +++ b/charts/prometheus-postgres-exporter/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 -appVersion: "v0.13.2" +appVersion: "v0.14.0" description: A Helm chart for prometheus postgres-exporter name: prometheus-postgres-exporter -version: 5.0.0 +version: 5.1.0 home: https://github.com/prometheus-community/postgres_exporter sources: - https://github.com/prometheus-community/postgres_exporter diff --git a/charts/prometheus-rabbitmq-exporter/Chart.yaml b/charts/prometheus-rabbitmq-exporter/Chart.yaml index 60c0279f5a9d..3c4cbd801721 100644 --- a/charts/prometheus-rabbitmq-exporter/Chart.yaml +++ b/charts/prometheus-rabbitmq-exporter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Rabbitmq metrics exporter for prometheus name: prometheus-rabbitmq-exporter -version: 1.8.0 +version: 1.8.1 appVersion: v0.29.0 home: https://github.com/kbudde/rabbitmq_exporter sources: diff --git a/charts/prometheus-rabbitmq-exporter/templates/deployment.yaml b/charts/prometheus-rabbitmq-exporter/templates/deployment.yaml index 7c4bfd0b6c8f..83aedf52df00 100644 --- a/charts/prometheus-rabbitmq-exporter/templates/deployment.yaml +++ b/charts/prometheus-rabbitmq-exporter/templates/deployment.yaml @@ -47,15 +47,27 @@ spec: {{- if .Values.rabbitmq.configMapOverrideReference }} - configMapRef: name: {{ .Values.rabbitmq.configMapOverrideReference }} - {{- end }} + {{- end }} env: - {{- if .Values.rabbitmq.existingPasswordSecret }} - - name: RABBIT_PASSWORD - valueFrom: - secretKeyRef: - name: "{{ .Values.rabbitmq.existingPasswordSecret }}" - key: {{ .Values.rabbitmq.existingPasswordSecretKey }} - {{- end }} + {{- if .Values.rabbitmq.existingPasswordSecret }} + - name: RABBIT_PASSWORD + valueFrom: + secretKeyRef: + name: "{{ .Values.rabbitmq.existingPasswordSecret }}" + key: "{{ .Values.rabbitmq.existingPasswordSecretKey }}" + {{- else if .Values.rabbitmq.password }} + - name: RABBIT_PASSWORD + value: {{ .Values.rabbitmq.password }} + {{- end }} + + {{- if .Values.rabbitmq.user }} + - name: RABBIT_USER + value: {{ .Values.rabbitmq.user }} + {{- end }} + {{- if .Values.rabbitmq.url }} + - name: RABBIT_URL + value: {{ .Values.rabbitmq.url }} + {{- end }} ports: - containerPort: {{ .Values.service.internalPort }} name: publish diff --git a/charts/prometheus-redis-exporter/Chart.yaml b/charts/prometheus-redis-exporter/Chart.yaml index 3119e1071740..969c24054b48 100644 --- a/charts/prometheus-redis-exporter/Chart.yaml +++ b/charts/prometheus-redis-exporter/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: v1.54.0 description: Prometheus exporter for Redis metrics name: prometheus-redis-exporter -version: 5.6.0 +version: 6.0.0 home: https://github.com/oliver006/redis_exporter sources: - https://github.com/oliver006/redis_exporter diff --git a/charts/prometheus-redis-exporter/templates/deployment.yaml b/charts/prometheus-redis-exporter/templates/deployment.yaml index bbc31c698024..2e12783872d5 100644 --- a/charts/prometheus-redis-exporter/templates/deployment.yaml +++ b/charts/prometheus-redis-exporter/templates/deployment.yaml @@ -55,9 +55,13 @@ spec: - name: REDIS_ADDR {{- if .Values.redisAddressConfig.enabled }} valueFrom: + {{- if .Values.redisAddressConfig.isSecret }} + secretKeyRef: + {{- else }} configMapKeyRef: - name: {{ .Values.redisAddressConfig.configmap.name }} - key: {{ .Values.redisAddressConfig.configmap.key }} + {{- end }} + name: {{ .Values.redisAddressConfig.source.name }} + key: {{ .Values.redisAddressConfig.source.key }} {{- else }} value: {{ .Values.redisAddress }} {{- end }} diff --git a/charts/prometheus-redis-exporter/values.yaml b/charts/prometheus-redis-exporter/values.yaml index 305d076f1de9..d113dcc15ad9 100644 --- a/charts/prometheus-redis-exporter/values.yaml +++ b/charts/prometheus-redis-exporter/values.yaml @@ -61,10 +61,12 @@ labels: {} # prometheus.io/scrape: "true" redisAddressConfig: - # Use config from configmap + # configure `REDIS_ADDR` from a configmap enabled: false - # Use existing configmap (ignores redisAddress) - configmap: + # if `true` the `REDIS_ADDR` is sourced on a secret instead of a configmap + isSecret: false + # Use an existing configmap or secret will ignore redisAddress + source: name: "" key: "" diff --git a/charts/prometheus-stackdriver-exporter/Chart.yaml b/charts/prometheus-stackdriver-exporter/Chart.yaml index c21f5cc9a21b..226320c86d57 100644 --- a/charts/prometheus-stackdriver-exporter/Chart.yaml +++ b/charts/prometheus-stackdriver-exporter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Stackdriver exporter for Prometheus name: prometheus-stackdriver-exporter -version: 4.3.0 +version: 4.3.1 appVersion: 0.13.0 home: https://www.stackdriver.com/ sources: diff --git a/charts/prometheus-stackdriver-exporter/values.yaml b/charts/prometheus-stackdriver-exporter/values.yaml index b6f063655aae..71fc217cb336 100644 --- a/charts/prometheus-stackdriver-exporter/values.yaml +++ b/charts/prometheus-stackdriver-exporter/values.yaml @@ -137,10 +137,10 @@ serviceMonitor: # How long until a scrape request times out. scrapeTimeout: '10s' # 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) + 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) honorLabels: true - ## Whether Prometheus should use the timestamps of the metrics exposed by stackdriver-exporter + # Whether Prometheus should use the timestamps of the metrics exposed by stackdriver-exporter honorTimestamps: true # MetricRelabelConfigs to apply to samples before ingestion https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#relabelconfig metricRelabelings: [] diff --git a/charts/prometheus-statsd-exporter/Chart.yaml b/charts/prometheus-statsd-exporter/Chart.yaml index 2551f880289e..48092f9ab19c 100644 --- a/charts/prometheus-statsd-exporter/Chart.yaml +++ b/charts/prometheus-statsd-exporter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: prometheus-statsd-exporter description: A Helm chart for prometheus stats-exporter -version: 0.10.0 +version: 0.10.1 appVersion: v0.24.0 home: https://github.com/prometheus/statsd_exporter sources: diff --git a/charts/prometheus-statsd-exporter/templates/hpa.yaml b/charts/prometheus-statsd-exporter/templates/hpa.yaml index 4d04994993dc..9c0fa614b072 100644 --- a/charts/prometheus-statsd-exporter/templates/hpa.yaml +++ b/charts/prometheus-statsd-exporter/templates/hpa.yaml @@ -13,6 +13,24 @@ spec: minReplicas: {{ .Values.autoscaling.minReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }} metrics: + {{- if eq (include "prometheus-statsd-exporter.hpa.apiVersion" .) "autoscaling/v2" -}} + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} + {{- else -}} {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - type: Resource resource: @@ -24,5 +42,6 @@ spec: resource: name: memory targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end -}} {{- end }} {{- end }} diff --git a/charts/prometheus/Chart.yaml b/charts/prometheus/Chart.yaml index 53571bbfab10..72f5413a0141 100644 --- a/charts/prometheus/Chart.yaml +++ b/charts/prometheus/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: prometheus appVersion: v2.47.0 -version: 24.5.0 +version: 25.1.0 kubeVersion: ">=1.19.0-0" description: Prometheus is a monitoring system and time series database. home: https://prometheus.io/ diff --git a/charts/prometheus/README.md b/charts/prometheus/README.md index 3246e3712b86..2cb744ce8f52 100644 --- a/charts/prometheus/README.md +++ b/charts/prometheus/README.md @@ -65,6 +65,12 @@ helm upgrade [RELEASE_NAME] prometheus-community/prometheus --install _See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._ +### To 25.0 + +The `server.remoteRead[].url` and `server.remoteWrite[].url` fields now support templating. Allowing for `url` values such as `https://{{ .Release.Name }}.example.com`. + +Any entries in these which previously included `{{` or `}}` must be escaped with `{{ "{{" }}` and `{{ "}}" }}` respectively. Entries which did not previously include the template-like syntax will not be affected. + ### To 24.0 Require Kubernetes 1.19+ diff --git a/charts/prometheus/templates/_helpers.tpl b/charts/prometheus/templates/_helpers.tpl index 0f4c631867bd..daec18e28052 100644 --- a/charts/prometheus/templates/_helpers.tpl +++ b/charts/prometheus/templates/_helpers.tpl @@ -211,3 +211,26 @@ Define template prometheus.namespaces producing a list of namespaces to monitor {{- end -}} {{ mustToJson $namespaces }} {{- end -}} + +{{/* +Define prometheus.server.remoteWrite producing a list of remoteWrite configurations with URL templating +*/}} +{{- define "prometheus.server.remoteWrite" -}} +{{- $remoteWrites := list }} +{{- range $remoteWrite := .Values.server.remoteWrite }} + {{- $remoteWrites = tpl $remoteWrite.url $ | set $remoteWrite "url" | append $remoteWrites }} +{{- end -}} +{{ toYaml $remoteWrites }} +{{- end -}} + +{{/* +Define prometheus.server.remoteRead producing a list of remoteRead configurations with URL templating +*/}} +{{- define "prometheus.server.remoteRead" -}} +{{- $remoteReads := list }} +{{- range $remoteRead := .Values.server.remoteRead }} + {{- $remoteReads = tpl $remoteRead.url $ | set $remoteRead "url" | append $remoteReads }} +{{- end -}} +{{ toYaml $remoteReads }} +{{- end -}} + diff --git a/charts/prometheus/templates/clusterrole.yaml b/charts/prometheus/templates/clusterrole.yaml index 1ca509e38fa1..25e3cec45d75 100644 --- a/charts/prometheus/templates/clusterrole.yaml +++ b/charts/prometheus/templates/clusterrole.yaml @@ -41,6 +41,14 @@ rules: - get - list - watch + - apiGroups: + - "discovery.k8s.io" + resources: + - endpointslices + verbs: + - get + - list + - watch - nonResourceURLs: - "/metrics" verbs: diff --git a/charts/prometheus/templates/cm.yaml b/charts/prometheus/templates/cm.yaml index a702b527ee32..4e1ba70b84d1 100644 --- a/charts/prometheus/templates/cm.yaml +++ b/charts/prometheus/templates/cm.yaml @@ -22,11 +22,11 @@ data: {{ $root.Values.server.global | toYaml | trimSuffix "\n" | indent 6 }} {{- if $root.Values.server.remoteWrite }} remote_write: -{{ $root.Values.server.remoteWrite | toYaml | indent 4 }} +{{- include "prometheus.server.remoteWrite" $root | nindent 4 }} {{- end }} {{- if $root.Values.server.remoteRead }} remote_read: -{{ $root.Values.server.remoteRead | toYaml | indent 4 }} +{{- include "prometheus.server.remoteRead" $root | nindent 4 }} {{- end }} {{- if or $root.Values.server.tsdb $root.Values.server.exemplars }} storage: