helm: support of annotations to deployments and statefulsets (#9509)

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

Allows annotating loki components with custom annotations. For instance:

```yaml
loki:
  annotations:
    secret.reloader.stakater.com/reload: loki-aws-credentials
```

**Which issue(s) this PR fixes**:
No issue

**Special notes for your reviewer**:

**Checklist**
- [x] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
  - Helm chart section is empty.
- [x] Documentation added
- [ ] Tests updated
- [ ] `CHANGELOG.md` updated
- [x] N/A Changes that require user attention or interaction to upgrade
are documented in `docs/sources/upgrading/_index.md`

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
pull/9510/head helm-loki-5.5.8
risson 2 years ago committed by GitHub
parent bb96326953
commit 41c19ec747
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 63
      docs/sources/installation/helm/reference.md
  2. 4
      production/helm/loki/CHANGELOG.md
  3. 2
      production/helm/loki/Chart.yaml
  4. 2
      production/helm/loki/README.md
  5. 7
      production/helm/loki/templates/backend/statefulset-backend.yaml
  6. 7
      production/helm/loki/templates/gateway/deployment-gateway.yaml
  7. 7
      production/helm/loki/templates/read/deployment-read.yaml
  8. 7
      production/helm/loki/templates/single-binary/statefulset.yaml
  9. 7
      production/helm/loki/templates/table-manager/deployment-table-manager.yaml
  10. 7
      production/helm/loki/templates/write/statefulset-write.yaml
  11. 14
      production/helm/loki/values.yaml

@ -38,6 +38,15 @@ This is the generated reference for the Loki Helm Chart values.
<td><pre lang="">
Hard node and soft zone anti-affinity
</pre>
</td>
</tr>
<tr>
<td>backend.annotations</td>
<td>object</td>
<td>Annotations for backend StatefulSet</td>
<td><pre lang="json">
{}
</pre>
</td>
</tr>
<tr>
@ -827,6 +836,15 @@ null
<td><pre lang="">
Hard node and soft zone anti-affinity
</pre>
</td>
</tr>
<tr>
<td>gateway.annotations</td>
<td>object</td>
<td>Annotations for gateway deployment</td>
<td><pre lang="json">
{}
</pre>
</td>
</tr>
<tr>
@ -1693,6 +1711,15 @@ null
<td><pre lang="json">
{}
</pre>
</td>
</tr>
<tr>
<td>loki.annotations</td>
<td>object</td>
<td>Common annotations for all deployments/StatefulSets</td>
<td><pre lang="json">
{}
</pre>
</td>
</tr>
<tr>
@ -2850,6 +2877,15 @@ false
<td><pre lang="">
Hard node and soft zone anti-affinity
</pre>
</td>
</tr>
<tr>
<td>read.annotations</td>
<td>object</td>
<td>Annotations for read deployment</td>
<td><pre lang="json">
{}
</pre>
</td>
</tr>
<tr>
@ -3201,6 +3237,15 @@ null
<td><pre lang="">
Hard node and soft zone anti-affinity
</pre>
</td>
</tr>
<tr>
<td>singleBinary.annotations</td>
<td>object</td>
<td>Annotations for single binary StatefulSet</td>
<td><pre lang="json">
{}
</pre>
</td>
</tr>
<tr>
@ -3480,6 +3525,15 @@ null
<td><pre lang="">
Hard node and soft zone anti-affinity
</pre>
</td>
</tr>
<tr>
<td>tableManager.annotations</td>
<td>object</td>
<td>Annotations for table-manager deployment</td>
<td><pre lang="json">
{}
</pre>
</td>
</tr>
<tr>
@ -3787,6 +3841,15 @@ null
<td><pre lang="">
Hard node and soft zone anti-affinity
</pre>
</td>
</tr>
<tr>
<td>write.annotations</td>
<td>object</td>
<td>Annotations for write StatefulSet</td>
<td><pre lang="json">
{}
</pre>
</td>
</tr>
<tr>

@ -13,6 +13,10 @@ 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.5.8
- [CHANGE] Add support for annotations on all Deployments and StatefulSets
## 5.5.7
- [BUGFIX] Fix breaking helm upgrade by changing sts podManagementPolicy from Parallel to OrderedReady which fails since that field cannot be modified on sts.

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

@ -1,6 +1,6 @@
# loki
![Version: 5.5.7](https://img.shields.io/badge/Version-5.5.7-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.5.8](https://img.shields.io/badge/Version-5.5.8-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

@ -9,6 +9,13 @@ metadata:
labels:
{{- include "loki.backendLabels" . | nindent 4 }}
app.kubernetes.io/part-of: memberlist
annotations:
{{- with .Values.loki.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.backend.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.backend.autoscaling.enabled }}
replicas: {{ .Values.backend.replicas }}

@ -6,6 +6,13 @@ metadata:
namespace: {{ $.Release.Namespace }}
labels:
{{- include "loki.gatewayLabels" . | nindent 4 }}
annotations:
{{- with .Values.loki.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.gateway.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.gateway.autoscaling.enabled }}
replicas: {{ .Values.gateway.replicas }}

@ -9,6 +9,13 @@ metadata:
labels:
app.kubernetes.io/part-of: memberlist
{{- include "loki.readLabels" . | nindent 4 }}
annotations:
{{- with .Values.loki.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.read.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.read.autoscaling.enabled }}
replicas: {{ .Values.read.replicas }}

@ -9,6 +9,13 @@ metadata:
labels:
{{- include "loki.singleBinaryLabels" . | nindent 4 }}
app.kubernetes.io/part-of: memberlist
annotations:
{{- with .Values.loki.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.singleBinary.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
replicas: {{ include "loki.singleBinaryReplicas" . }}
podManagementPolicy: Parallel

@ -5,10 +5,13 @@ metadata:
name: {{ include "loki.tableManagerFullname" . }}
labels:
{{- include "loki.tableManagerLabels" . | nindent 4 }}
{{- with .Values.loki.annotations }}
annotations:
{{- with .Values.loki.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- with .Values.tableManager.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
replicas: 1
revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }}

@ -8,6 +8,13 @@ metadata:
labels:
{{- include "loki.writeLabels" . | nindent 4 }}
app.kubernetes.io/part-of: memberlist
annotations:
{{- with .Values.loki.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.write.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.write.autoscaling.enabled }}
replicas: {{ .Values.write.replicas }}

@ -50,6 +50,8 @@ loki:
digest: null
# -- Docker image pull policy
pullPolicy: IfNotPresent
# -- Common annotations for all deployments/StatefulSets
annotations: {}
# -- Common annotations for all pods
podAnnotations: {}
# -- Common labels for all pods
@ -679,6 +681,8 @@ write:
tag: null
# -- The name of the PriorityClass for write pods
priorityClassName: null
# -- Annotations for write StatefulSet
annotations: {}
# -- Annotations for write pods
podAnnotations: {}
# -- Additional labels for each `write` pod
@ -761,6 +765,8 @@ tableManager:
priorityClassName: null
# -- Labels for table-manager pods
podLabels: {}
# -- Annotations for table-manager deployment
annotations: {}
# -- Annotations for table-manager pods
podAnnotations: {}
# -- Labels for table-manager service
@ -839,6 +845,8 @@ read:
tag: null
# -- The name of the PriorityClass for read pods
priorityClassName: null
# -- Annotations for read deployment
annotations: {}
# -- Annotations for read pods
podAnnotations: {}
# -- Additional labels for each `read` pod
@ -935,6 +943,8 @@ backend:
tag: null
# -- The name of the PriorityClass for backend pods
priorityClassName: null
# -- Annotations for backend StatefulSet
annotations: {}
# -- Annotations for backend pods
podAnnotations: {}
# -- Additional labels for each `backend` pod
@ -1015,6 +1025,8 @@ singleBinary:
tag: null
# -- The name of the PriorityClass for single binary pods
priorityClassName: null
# -- Annotations for single binary StatefulSet
annotations: {}
# -- Annotations for single binary pods
podAnnotations: {}
# -- Additional labels for each `single binary` pod
@ -1164,6 +1176,8 @@ gateway:
pullPolicy: IfNotPresent
# -- The name of the PriorityClass for gateway pods
priorityClassName: null
# -- Annotations for gateway deployment
annotations: {}
# -- Annotations for gateway pods
podAnnotations: {}
# -- Additional labels for gateway pods

Loading…
Cancel
Save