Skip to content

Commit

Permalink
Add oxia_cluster label to all the pods (#345)
Browse files Browse the repository at this point in the history
Depending on the Prometheus/VictoriaMetrics scraper, the labels attached
to the "service" are attached to the metrics scraped from the pods. It's
safer to also have the labels on the pods, so that they will be present
on the metrics
  • Loading branch information
merlimat authored Jun 7, 2023
1 parent 98cdbf0 commit 062c5b1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ spec:
prometheus.io/port: "{{ .Values.coordinator.ports.metrics }}"
prometheus.io/scrape: "{{ .Values.monitoringEnabled }}"
labels:
oxia_cluster: {{ .Release.Name }}
{{- include "oxia-cluster.coordinator.labels" . | nindent 8 }}
name: {{ .Release.Name }}-coordinator
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ spec:
prometheus.io/port: "{{ .Values.server.ports.metrics }}"
prometheus.io/scrape: "{{ .Values.monitoringEnabled }}"
labels:
oxia_cluster: {{ .Release.Name }}
{{- include "oxia-cluster.server.labels" . | nindent 8 }}
name: {{ .Release.Name }}
spec:
Expand Down
1 change: 1 addition & 0 deletions kubernetes/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func selectorLabels(component Component, name string) map[string]string {
"app.kubernetes.io/name": "oxia-cluster",
"app.kubernetes.io/Component": string(component),
"app.kubernetes.io/instance": _resourceName,
"oxia_cluster": name,
}
}
func additionalLabels(version string) map[string]string {
Expand Down

0 comments on commit 062c5b1

Please sign in to comment.