Skip to content

Commit 531fdee

Browse files
chore: Add relabeling and metricRelabeling to Service Monitor in Karpenter Helm Chart (#7794)
Co-authored-by: Jonathan Innis <[email protected]>
1 parent d8b577d commit 531fdee

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

charts/karpenter/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ cosign verify public.ecr.aws/karpenter/karpenter:1.4.0 \
8888
| serviceMonitor.additionalLabels | object | `{}` | Additional labels for the ServiceMonitor. |
8989
| serviceMonitor.enabled | bool | `false` | Specifies whether a ServiceMonitor should be created. |
9090
| serviceMonitor.endpointConfig | object | `{}` | Configuration on `http-metrics` endpoint for the ServiceMonitor. Not to be used to add additional endpoints. See the Prometheus operator documentation for configurable fields https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#endpoint |
91+
| serviceMonitor.metricRelabelings | list | `[]` | Metric relabelings for the `http-metrics` endpoint on the ServiceMonitor. For more details on metric relabelings, see: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs |
92+
| serviceMonitor.relabelings | list | `[]` | Relabelings for the `http-metrics` endpoint on the ServiceMonitor. For more details on relabelings, see: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config |
9193
| settings | object | `{"batchIdleDuration":"1s","batchMaxDuration":"10s","clusterCABundle":"","clusterEndpoint":"","clusterName":"","eksControlPlane":false,"featureGates":{"nodeRepair":false,"reservedCapacity":false,"spotToSpotConsolidation":false},"interruptionQueue":"","isolatedVPC":false,"preferencePolicy":"Respect","reservedENIs":"0","vmMemoryOverheadPercent":0.075}` | Global Settings to configure Karpenter |
9294
| settings.batchIdleDuration | string | `"1s"` | The maximum amount of time with no new ending pods that if exceeded ends the current batching window. If pods arrive faster than this time, the batching window will be extended up to the maxDuration. If they arrive slower, the pods will be batched separately. |
9395
| settings.batchMaxDuration | string | `"10s"` | The maximum length of a batch window. The longer this is, the more pods we can consider for provisioning at one time which usually results in fewer but larger nodes. |

charts/karpenter/templates/servicemonitor.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ spec:
2323
endpoints:
2424
- port: http-metrics
2525
path: /metrics
26+
{{- with .Values.serviceMonitor.relabelings }}
27+
relabelings:
28+
{{- toYaml . | nindent 6 }}
29+
{{- end }}
30+
{{- with .Values.serviceMonitor.metricRelabelings }}
31+
metricRelabelings:
32+
{{- toYaml . | nindent 6 }}
33+
{{- end }}
2634
{{- with .Values.serviceMonitor.endpointConfig }}
2735
{{- toYaml . | nindent 6 }}
2836
{{- end }}

charts/karpenter/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ serviceMonitor:
3030
enabled: false
3131
# -- Additional labels for the ServiceMonitor.
3232
additionalLabels: {}
33+
# -- Relabelings for the `http-metrics` endpoint on the ServiceMonitor.
34+
# For more details on relabelings, see: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
35+
relabelings: []
36+
# -- Metric relabelings for the `http-metrics` endpoint on the ServiceMonitor.
37+
# For more details on metric relabelings, see: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs
38+
metricRelabelings: []
3339
# -- Configuration on `http-metrics` endpoint for the ServiceMonitor.
3440
# Not to be used to add additional endpoints.
3541
# See the Prometheus operator documentation for configurable fields https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api-reference/api.md#endpoint

0 commit comments

Comments
 (0)