Helm: Add priorityClassName for Grafana Agent and Loki Canary (#8506)

**What this PR does / why we need it**:

- Allow configuring PriorityClassName for the GrafanaAgent daemonset
- Allow configuring PriorityClassName for the loki canary daemonset
without also configuring for read deployment
- Helpful when an administrator wants to prioritize logging on their
nodes

**Special notes for your reviewer**:

- Used _coalese_ style like it was already in the case of loki canary
- For loki canary, specifying on the canary takes higher precedence than
on the reader, but lower than global
- For grafana agent, global takes precedence over grafana agent to match
the existing style, but maintainers might consider flipping that around
so that most-specific is also most-prioritized

**Checklist**
- [x] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide

---------

Co-authored-by: Michel Hollands <42814411+MichelHollands@users.noreply.github.com>
pull/9780/head helm-loki-5.8.3
Steven Miller 2 years ago committed by GitHub
parent 4da0f63789
commit e1002624bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      docs/sources/installation/helm/reference.md
  2. 3
      production/helm/loki/CHANGELOG.md
  3. 2
      production/helm/loki/Chart.yaml
  4. 2
      production/helm/loki/README.md
  5. 4
      production/helm/loki/templates/loki-canary/_helpers.tpl
  6. 10
      production/helm/loki/templates/monitoring/_helpers-monitoring.tpl
  7. 1
      production/helm/loki/templates/monitoring/grafana-agent.yaml
  8. 4
      production/helm/loki/values.yaml

@ -2428,6 +2428,15 @@ null
<td><pre lang="json">
{}
</pre>
</td>
</tr>
<tr>
<td>monitoring.lokiCanary.priorityClassName</td>
<td>string</td>
<td>The name of the PriorityClass for loki-canary pods</td>
<td><pre lang="json">
null
</pre>
</td>
</tr>
<tr>
@ -2545,6 +2554,15 @@ true
<td><pre lang="json">
{}
</pre>
</td>
</tr>
<tr>
<td>monitoring.selfMonitoring.grafanaAgent.priorityClassName</td>
<td>string</td>
<td>The name of the PriorityClass for GrafanaAgent pods</td>
<td><pre lang="json">
null
</pre>
</td>
</tr>
<tr>

@ -13,6 +13,9 @@ Entries should include a reference to the pull request that introduced the chang
[//]: # (<AUTOMATED_UPDATES_LOCATOR> : do not remove this line. This locator is used by the CI pipeline to automatically create a changelog entry for each new Loki release. Add other chart versions and respective changelog entries bellow this line.)
## 5.8.3
- [ENHANCEMENT] Add priorityClassName for Grafana Agent and Loki Canary
## 5.8.2

@ -3,7 +3,7 @@ name: loki
description: Helm chart for Grafana Loki in simple, scalable mode
type: application
appVersion: 2.8.2
version: 5.8.2
version: 5.8.3
home: https://grafana.github.io/helm-charts
sources:
- https://github.com/grafana/loki

@ -1,6 +1,6 @@
# loki
![Version: 5.8.2](https://img.shields.io/badge/Version-5.8.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.8.2](https://img.shields.io/badge/AppVersion-2.8.2-informational?style=flat-square)
![Version: 5.8.3](https://img.shields.io/badge/Version-5.8.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.8.2](https://img.shields.io/badge/AppVersion-2.8.2-informational?style=flat-square)
Helm chart for Grafana Loki in simple, scalable mode

@ -30,10 +30,10 @@ Docker image name for loki-canary
{{- end -}}
{{/*
canry priority class name
canary priority class name
*/}}
{{- define "loki-canary.priorityClassName" -}}
{{- $pcn := coalesce .Values.global.priorityClassName .Values.read.priorityClassName -}}
{{- $pcn := coalesce .Values.global.priorityClassName .Values.monitoring.lokiCanary.priorityClassName .Values.read.priorityClassName -}}
{{- if $pcn }}
priorityClassName: {{ $pcn }}
{{- end }}

@ -35,3 +35,13 @@ Convert a recording rule group to yaml
{{- toYaml .rules | nindent 4 }}
{{- end }}
{{- end }}
{{/*
GrafanaAgent priority class name
*/}}
{{- define "grafana-agent.priorityClassName" -}}
{{- $pcn := coalesce .Values.global.priorityClassName .Values.monitoring.selfMonitoring.grafanaAgent.priorityClassName -}}
{{- if $pcn }}
priorityClassName: {{ $pcn }}
{{- end }}
{{- end }}

@ -16,6 +16,7 @@ metadata:
spec:
serviceAccountName: {{ include "loki.fullname" $ }}-grafana-agent
enableConfigReadAPI: {{ .enableConfigReadAPI }}
{{- include "grafana-agent.priorityClassName" $ | nindent 2 }}
logs:
instanceSelector:
matchLabels:

@ -608,6 +608,8 @@ monitoring:
labels: {}
# -- Enable the config read api on port 8080 of the agent
enableConfigReadAPI: false
# -- The name of the PriorityClass for GrafanaAgent pods
priorityClassName: null
# PodLogs configuration
podLogs:
# -- PodLogs annotations
@ -645,6 +647,8 @@ monitoring:
nodeSelector: {}
# -- Tolerations for canary pods
tolerations: []
# -- The name of the PriorityClass for loki-canary pods
priorityClassName: null
# -- Image to use for loki canary
image:
# -- The Docker registry

Loading…
Cancel
Save