Skip to content

Commit

Permalink
[kube-state-metrics] added pod labels (#4752)
Browse files Browse the repository at this point in the history
Signed-off-by: drfaust92 <[email protected]>
  • Loading branch information
DrFaust92 authored Jul 29, 2024
1 parent 815d9f7 commit 873f183
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/kube-state-metrics/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ keywords:
- prometheus
- kubernetes
type: application
version: 5.24.0
version: 5.25.0
appVersion: 2.13.0
home: https://github.com/kubernetes/kube-state-metrics/
sources:
Expand Down
5 changes: 4 additions & 1 deletion charts/kube-state-metrics/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ spec:
metadata:
labels:
{{- include "kube-state-metrics.labels" . | indent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.podAnnotations }}
annotations:
{{ toYaml .Values.podAnnotations | indent 8 }}
{{ toYaml .Values.podAnnotations | indent 8 }}
{{- end }}
spec:
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
Expand Down
3 changes: 3 additions & 0 deletions charts/kube-state-metrics/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ annotations: {}
# Annotations to be added to the pod
podAnnotations: {}

# Labels to be added to the pod
podLabels: {}

## Assign a PriorityClassName to pods if set
# priorityClassName: ""

Expand Down

3 comments on commit 873f183

@sumeet-zuora
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

873f183#diff-964657bf9c31e2d1338046dc10aff7a7d28dc34813c6cd09d84228512e966132R39 this introduced a bug

WARNING: helm repo add "stable" "https://charts.helm.sh/stable" --force-update
Error: YAML parse error on kube-state-metrics/templates/deployment.yaml: error converting YAML to JSON: yaml: line 36: did not find expected key

@tl-eirik-albrigtsen
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirmed, using podAnnotations break now;

Error: YAML parse error on promstack/charts/kube-prometheus-stack/charts/kube-state-metrics/templates/deployment.yaml: error converting YAML to JSON: yaml: line 36: did not find expected key
helm.go:84: [debug] error converting YAML to JSON: yaml: line 36: did not find expected key
YAML parse error on promstack/charts/kube-prometheus-stack/charts/kube-state-metrics/templates/deployment.yaml
helm.sh/helm/v3/pkg/releaseutil.(*manifestFile).sort
        helm.sh/helm/v3/pkg/releaseutil/manifest_sorter.go:146
helm.sh/helm/v3/pkg/releaseutil.SortManifests
        helm.sh/helm/v3/pkg/releaseutil/manifest_sorter.go:106
helm.sh/helm/v3/pkg/action.(*Configuration).renderResources
        helm.sh/helm/v3/pkg/action/action.go:168
helm.sh/helm/v3/pkg/action.(*Install).RunWithContext
        helm.sh/helm/v3/pkg/action/install.go:312
main.runInstall
        helm.sh/helm/v3/cmd/helm/install.go:314
main.newTemplateCmd.func2
        helm.sh/helm/v3/cmd/helm/template.go:95
github.com/spf13/cobra.(*Command).execute
        github.com/spf13/[email protected]/command.go:983
github.com/spf13/cobra.(*Command).ExecuteC
        github.com/spf13/[email protected]/command.go:1115
github.com/spf13/cobra.(*Command).Execute
        github.com/spf13/[email protected]/command.go:1039
main.main
        helm.sh/helm/v3/cmd/helm/helm.go:83
runtime.main
        runtime/proc.go:271
runtime.goexit
        runtime/asm_arm64.s:1222

@tl-eirik-albrigtsen
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, fixed in next patch release: 9f6ff30

Please sign in to comment.