Skip to content

Commit bd558a5

Browse files
authored
fix(helm,podmonitor): add podMonitorSelector for gateway metrics configuration (alibaba#3022)
1 parent ae3105b commit bd558a5

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

helm/core/templates/podmonitor.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ metadata:
55
namespace: {{ .Release.Namespace }}
66
labels:
77
{{- include "gateway.labels" . | nindent 4}}
8+
{{- with .Values.gateway.metrics.podMonitorSelector }}
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
811
annotations:
912
{{- .Values.gateway.annotations | toYaml | nindent 4 }}
1013
spec:

helm/core/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,11 @@ gateway:
530530
metrics:
531531
# -- If true, create PodMonitor or VMPodScrape for gateway
532532
enabled: false
533+
# -- Selector for PodMonitor
534+
# When using monitoring.coreos.com/v1.PodMonitor, the selector must match
535+
# the label "release: kube-prome" is the default for kube-prometheus-stack
536+
podMonitorSelector:
537+
release: kube-prome
533538
# -- provider group name for CustomResourceDefinition, can be monitoring.coreos.com or operator.victoriametrics.com
534539
provider: monitoring.coreos.com
535540
interval: ""

helm/higress/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ The command removes all the Kubernetes components associated with the chart and
104104
| gateway.metrics.interval | string | `""` | |
105105
| gateway.metrics.metricRelabelConfigs | list | `[]` | for operator.victoriametrics.com/v1beta1.VMPodScrape |
106106
| gateway.metrics.metricRelabelings | list | `[]` | for monitoring.coreos.com/v1.PodMonitor |
107+
| gateway.metrics.podMonitorSelector | object | `{"release":"kube-prome"}` | Selector for PodMonitor When using monitoring.coreos.com/v1.PodMonitor, the selector must match the label "release: kube-prome" is the default for kube-prometheus-stack |
107108
| gateway.metrics.provider | string | `"monitoring.coreos.com"` | provider group name for CustomResourceDefinition, can be monitoring.coreos.com or operator.victoriametrics.com |
108109
| gateway.metrics.rawSpec | object | `{}` | some more raw podMetricsEndpoints spec |
109110
| gateway.metrics.relabelConfigs | list | `[]` | |

helm/higress/README.zh.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ helm delete higress -n higress-system
112112
| gateway.metrics.rawSpec | object | `{}` | 额外的度量规范 |
113113
| gateway.metrics.relabelConfigs | list | `[]` | 重新标签配置 |
114114
| gateway.metrics.relabelings | list | `[]` | 重新标签项 |
115+
| gateway.metrics.podMonitorSelector | object | `{"release":"kube-prometheus-stack"}` | PodMonitor 选择器,当使用 prometheus stack 的podmonitor自动发现时,选择器必须匹配标签 "release: kube-prome",这是 kube-prometheus-stack 的默认设置 |
115116
| gateway.metrics.scrapeTimeout | string | `""` | 抓取的超时时间 |
116117
| gateway.name | string | `"higress-gateway"` | 网关名称 |
117118
| gateway.networkGateway | string | `""` | 网络网关指定 |

0 commit comments

Comments
 (0)