prometheus-community / helm-charts

Prometheus community Helm charts
Apache License 2.0
5.06k stars 5.01k forks source link

[prometheus-kube-stack] Daemonset templates don't set priorityClass when specifying PriorityClassName #2671

Closed ivanfavi closed 1 year ago

ivanfavi commented 1 year ago

Describe the bug a clear and concise description of what the bug is.

I'm using prometheus-node-exporter.priorityClassName to set prometheus-node-exporter's priorityClass to its Daemonset. I'm trying to add this value to the template [daemonset.yaml(https://github.com/prometheus-community/helm-charts/blob/e52a1f6347f5f0c2865c69ed9a9bf1c01efcc521/charts/prometheus-node-exporter/templates/daemonset.yaml#L29-L31) by referencing in the helm values.yaml, however, it is not working.

There are the values that I'm passing to the prometheus-node-exporter subchart through my values.yaml

prometheus-node-exporter:
  fullnameOverride: "kube-prometheus-stack-prometheus-node-exporter"
  extraArgs:
    - --no-collector.powersupplyclass
    - --no-collector.mdadm
  prometheus:
    monitor:
      additionalLabels:
        prometheus.io/domain: infrastructure
  updateStrategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 25%
  ## Assign a PriorityClassName to pods if set
  priorityClassName: high-priority

What's your helm version?

version.BuildInfo{Version:"v3.7.0", GitCommit:"eeac83883cb4014fe60267ec6373570374ce770b", GitTreeState:"clean", GoVersion:"go1.16.8"}

What's your kubectl version?

W1110 12:30:45.495663 257055 gcp.go:119] WARNING: the gcp auth plugin is deprecated in v1.22+, unavailable in v1.26+; use gcloud instead. To learn more, consult https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version. Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.0", GitCommit:"a866cbe2e5bbaa01cfd5e969aa3e033f3282a8a2", GitTreeState:"clean", BuildDate:"2022-08-23T17:44:59Z", GoVersion:"go1.19", Compiler:"gc", Platform:"linux/amd64"} Kustomize Version: v4.5.7 Server Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.3-gke.2100", GitCommit:"25d7334511e90d0b636707059c955baebce769cd", GitTreeState:"clean", BuildDate:"2022-08-16T09:24:54Z", GoVersion:"go1.18.3b7", Compiler:"gc", Platform:"linux/amd64"}

Which chart?

kube-prometheus-stack

What's the chart version?

39.12.1

What happened?

Impossible to set the priorityClassName for the prometheus-node-exporter's pods through the values of kube-prometheus-stack chart.

What you expected to happen?

set the priorityClassName for the prometheus-node-exporter's pods through its daemonset

How to reproduce it?

Apply the configuration mentioned above.

Enter the changed values of values.yaml?

fullnameOverride: "kube-prometheus-stack"

global:
  rbac:
    create: true
    pspEnabled: false

## Default rules for monitoring the cluster
## https://github.com/prometheus-community/helm-charts/blob/master/charts/kube-prometheus-stack/values.yaml#L31
defaultRules:
  labels:
    role: thanos-rules-selector
  additionalRuleLabels:
    domain: infrastructure
    environment: testing
    service: KubePrometheusStack

# https://github.com/kubernetes/kube-state-metrics#compatibility-matrix
kube-state-metrics:
  fullnameOverride: "kube-prometheus-stack-kube-state-metrics"

  collectors:
    - certificatesigningrequests
    - configmaps
    - cronjobs
    - daemonsets
    - deployments
    - endpoints
    - horizontalpodautoscalers
    - ingresses
    - jobs
    - limitranges
    - namespaces
    - networkpolicies
    - nodes
    #- mutatingwebhookconfigurations
    - persistentvolumeclaims
    - persistentvolumes
    - poddisruptionbudgets
    - pods
    - replicasets
    - replicationcontrollers
    - resourcequotas
    - secrets
    - services
    - statefulsets
    - storageclasses
    #- validatingwebhookconfigurations
    #- verticalpodautoscalers
    - volumeattachments
  prometheus:
    monitor:
      additionalLabels:
        prometheus.io/domain: infrastructure

prometheus-node-exporter:
  fullnameOverride: "kube-prometheus-stack-prometheus-node-exporter"
  extraArgs:
    - --no-collector.powersupplyclass
    - --no-collector.mdadm
  prometheus:
    monitor:
      additionalLabels:
        prometheus.io/domain: infrastructure
  updateStrategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 25%
  ## Assign a PriorityClassName to pods if set
  priorityClassName: high-priority

prometheusOperator:
  enabled: true
  prometheusSpec:
    priorityClassName: high-priority

alertmanager:
  enabled: false

prometheus:
  enabled: false

grafana:
  enabled: false

coreDns:
  enabled: false

kubeDns:
  enabled: true

kubeApiServer:
  enabled: false

kubeControllermanager:
  enabled: false

kubeScheduler:
  enabled: false

kubeEtcd:
  enabled: false

kubelet:
  enabled: true

kubeStateMetrics:
  enabled: true

nodeExporter:
  enabled: true

Enter the command that you execute and failing/misfunctioning.

helm install prometheus prometheus-community/kube-prometheus-stack --version 39.12.1 --values values.yaml

Anything else we need to know?

Note that I'm using argocd to apply the helm chart, not helm command.

AlissonRS commented 1 year ago

@ivanfavi were you able to find a fix (as you closed the issue)? I'm having the same issue.

jaepetto commented 1 year ago

@ivanfavi were you able to find a fix (as you closed the issue)? I'm having the same issue.

+1

ivanfavi commented 1 year ago

I reviewed it, and we were able to set the PriorityClass few months ago using this version of the helm chart 41.9.1. Now we are using 48.2.3.

Due to the fact that I cannot find or remember anything special, we created our own Kubernetes priority classes and we use them, thus I closed this PR.