Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be able to have more that one PodMonitor endpoint on a pod #216

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions templates/podmonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ metadata:
spec:
selector:
matchLabels: {{- include "common.selectorLabels" ( dict "root" $ "service" $serviceDefinition "serviceName" $serviceName ) | nindent 6 }}
{{- with $serviceDefinition.podMonitor.endpoint }}
{{- with $serviceDefinition.podMonitor.podMetricsEndpoints }}
podMetricsEndpoints:
- {{ . | toYaml | nindent 6 }}
{{- include "common.dictToList" ( dict "keyName" "port" "contents" . ) | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
Expand Down
6 changes: 4 additions & 2 deletions tests/expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1544,7 +1544,9 @@ spec:
app.kubernetes.io/instance: custom
app.kubernetes.io/component: with-service-name
podMetricsEndpoints:
-
- port: config-prometheus
honorLabels: true
interval: 10s
- port: prometheus
honorLabels: true
interval: 10s
port: prometheus
11 changes: 7 additions & 4 deletions tests/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,13 @@ services:
path: /one
podMonitor:
enabled: true
endpoint:
port: prometheus
interval: 10s
honorLabels: true
podMetricsEndpoints:
prometheus:
interval: 10s
honorLabels: true
config-prometheus:
interval: 10s
honorLabels: true
replicaCount: 1
nodeSelector: {}
affinity:
Expand Down
3 changes: 2 additions & 1 deletion values.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@
- **`ports`** _(array)_
- **`podMonitor`** _(object)_: The Prometheus Pod monitor configuration. Cannot contain additional properties.
- **`enabled`** _(boolean)_: Enable the Pod monitor for this service.
- **`endpoint`** _(object)_: The endpoint of the Pod monitor.
- **`podMetricsEndpoints`** _(object)_: The endpoints of the Pod monitor by port. Can contain additional properties.
- **Additional properties** _(object)_: The endpoint of the Pod monitor.

## Definitions

Expand Down
8 changes: 6 additions & 2 deletions values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1083,9 +1083,13 @@
"type": "boolean",
"description": "Enable the Pod monitor for this service"
},
"endpoint": {
"podMetricsEndpoints": {
"type": "object",
"description": "The endpoint of the Pod monitor"
"description": "The endpoints of the Pod monitor by port",
"additionalProperties": {
"type": "object",
"description": "The endpoint of the Pod monitor"
}
}
}
}
Expand Down
Loading