[bitnami/grafana-operator] Add some pod scheduling directives (#28861)

* [bitnami/grafana-operator] Allow topologySpreadConstraints to be configured for a grafana instance.

Signed-off-by: Darren Oakley <darren.oakley@hmrc.gov.uk>

* [bitnami/grafana-operator] Add a PDB resource for a configured grafana instance.

Signed-off-by: Darren Oakley <darren.oakley@hmrc.gov.uk>

* [bitnami/grafana-operator] Bump the chart version

Signed-off-by: Darren Oakley <darren.oakley@hmrc.gov.uk>

* Update CHANGELOG.md

Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>

* Update README.md with readme-generator-for-helm

Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>

* Update CHANGELOG.md

Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>

---------

Signed-off-by: Darren Oakley <darren.oakley@hmrc.gov.uk>
Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>
Co-authored-by: Bitnami Containers <bitnami-bot@vmware.com>
This commit is contained in:
Darren Oakley
2024-08-20 12:12:52 +01:00
committed by GitHub
parent 57ddfc5bf9
commit 6cf09bebec
9 changed files with 57 additions and 7 deletions

View File

@@ -1,8 +1,12 @@
# Changelog
## 4.5.0 (2024-08-09)
## 4.6.0 (2024-08-14)
* [bitnami/grafana-operator] Add missing CRD + RBAC ([#28780](https://github.com/bitnami/charts/pull/28780))
* [bitnami/grafana-operator] Add some pod scheduling directives ([#28861](https://github.com/bitnami/charts/pull/28861))
## 4.5.0 (2024-08-12)
* [bitnami/grafana-operator] Add missing CRD + RBAC (#28780) ([d9075fa](https://github.com/bitnami/charts/commit/d9075fa4000414377ae8b2be67cc8a5616894fff)), closes [#28780](https://github.com/bitnami/charts/issues/28780)
## <small>4.4.15 (2024-08-08)</small>

View File

@@ -1,6 +1,6 @@
dependencies:
- name: common
repository: oci://registry-1.docker.io/bitnamicharts
version: 2.21.0
digest: sha256:aad727fb6bd333a7ebb22f06f1edcb53349acdbffaa1baffa0266d9a33162dbd
generated: "2024-08-07T02:25:55.329899808Z"
version: 2.22.0
digest: sha256:a8fb2fc887ead658a89598a48acde5324196fbc0509503a3eaed50a710fbfe74
generated: "2024-08-13T10:32:47.216451157+01:00"

View File

@@ -29,5 +29,5 @@ maintainers:
url: https://github.com/bitnami/charts
name: grafana-operator
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/grafana-operator
version: 4.5.0
- https://github.com/bitnami/charts/tree/main/bitnami/grafana-operator
version: 4.6.0

View File

@@ -363,6 +363,9 @@ extraDeploy:
| `grafana.affinity` | Affinity for controller pod assignment | `{}` |
| `grafana.nodeSelector` | Node labels for controller pod assignment | `{}` |
| `grafana.tolerations` | Tolerations for controller pod assignment | `[]` |
| `grafana.pdb.create` | Enable/disable a Pod Disruption Budget creation | `false` |
| `grafana.pdb.minAvailable` | Minimum number/percentage of pods that should remain scheduled | `""` |
| `grafana.pdb.maxUnavailable` | Maximum number/percentage of pods that may be made unavailable. Defaults to `1` if both `grafana.pdb.minAvailable` and `grafana.pdb.maxUnavailable` are empty. | `""` |
| `grafana.envFrom` | Extra environment variable to pass to the running container | `[]` |
| `grafana.client.timeout` | The timeout in seconds for the Grafana Rest API on that instance | `5` |
| `grafana.labels` | Add additional labels to the grafana deployment, service and ingress resources | `{}` |

View File

@@ -10,6 +10,7 @@ metadata:
name: {{ include "common.names.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: operator
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
@@ -24,6 +25,7 @@ spec:
template:
metadata:
labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
app.kubernetes.io/component: operator
{{- if .Values.operator.podAnnotations }}
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.operator.podAnnotations "context" $) | nindent 8 }}
{{- end }}

View File

@@ -0,0 +1,27 @@
{{- /*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if and .Values.grafana.enabled .Values.grafana.pdb.create }}
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ printf "%s-grafana" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
namespace: {{ include "common.names.namespace" . | quote }}
{{- $grafanaLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.grafana.labels .Values.commonLabels ) "context" . ) }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $grafanaLabels "context" $ ) | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if .Values.grafana.pdb.minAvailable }}
minAvailable: {{ .Values.grafana.pdb.minAvailable }}
{{- end }}
{{- if or .Values.grafana.pdb.maxUnavailable (not .Values.grafana.pdb.minAvailable) }}
maxUnavailable: {{ .Values.grafana.pdb.maxUnavailable | default 1 }}
{{- end }}
selector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $grafanaLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: grafana
{{- end }}

View File

@@ -102,6 +102,9 @@ spec:
{{- if .Values.grafana.tolerations }}
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.grafana.tolerations "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.grafana.topologySpreadConstraints }}
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.grafana.topologySpreadConstraints "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.grafana.nodeSelector }}
nodeSelector: {{ toYaml .Values.grafana.nodeSelector | nindent 12 }}
{{- end }}

View File

@@ -23,4 +23,5 @@ spec:
{{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.operator.podLabels .Values.commonLabels) "context" .) }}
selector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: operator
{{- end }}

View File

@@ -656,6 +656,16 @@ grafana:
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
##
tolerations: []
## Pod Disruption Budget configuration for the grafana instance
## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb
## @param grafana.pdb.create Enable/disable a Pod Disruption Budget creation
## @param grafana.pdb.minAvailable Minimum number/percentage of pods that should remain scheduled
## @param grafana.pdb.maxUnavailable Maximum number/percentage of pods that may be made unavailable. Defaults to `1` if both `grafana.pdb.minAvailable` and `grafana.pdb.maxUnavailable` are empty.
##
pdb:
create: false
minAvailable: ""
maxUnavailable: ""
## @param grafana.envFrom Extra environment variable to pass to the running container
## Ref: https://github.com/integr8ly/grafana-operator/blob/master/documentation/deploy_grafana.md#configuring-the-deployment
## e.g: