Skip to content

Commit

Permalink
[bitnami/grafana-operator] Add some pod scheduling directives (#28861)
Browse files Browse the repository at this point in the history
* [bitnami/grafana-operator] Allow topologySpreadConstraints to be configured for a grafana instance.

Signed-off-by: Darren Oakley <[email protected]>

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

Signed-off-by: Darren Oakley <[email protected]>

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

Signed-off-by: Darren Oakley <[email protected]>

* Update CHANGELOG.md

Signed-off-by: Bitnami Containers <[email protected]>

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

Signed-off-by: Bitnami Containers <[email protected]>

* Update CHANGELOG.md

Signed-off-by: Bitnami Containers <[email protected]>

---------

Signed-off-by: Darren Oakley <[email protected]>
Signed-off-by: Bitnami Containers <[email protected]>
Co-authored-by: Bitnami Containers <[email protected]>
  • Loading branch information
dazoakley and bitnami-bot authored Aug 20, 2024
1 parent 57ddfc5 commit 6cf09be
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 7 deletions.
8 changes: 6 additions & 2 deletions bitnami/grafana-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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>

Expand Down
6 changes: 3 additions & 3 deletions bitnami/grafana-operator/Chart.lock
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 2 additions & 2 deletions bitnami/grafana-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions bitnami/grafana-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | `{}` |
Expand Down
2 changes: 2 additions & 0 deletions bitnami/grafana-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand Down
27 changes: 27 additions & 0 deletions bitnami/grafana-operator/templates/grafana-pdb.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
3 changes: 3 additions & 0 deletions bitnami/grafana-operator/templates/grafana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
1 change: 1 addition & 0 deletions bitnami/grafana-operator/templates/pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
10 changes: 10 additions & 0 deletions bitnami/grafana-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6cf09be

Please sign in to comment.