Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions helm/flowfuse/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ For other values please refer to the documentation below.
- `forge.revisionHistoryLimit` global default for number of old ReplicaSets/ControllerRevisions to retain for rollback across all Deployments and StatefulSets managed by this chart (default `10`). Can be overridden per component.
- `forge.tolerations` allows to configure [tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) for the core application deployment (default `[]`)
- `forge.priorityClassName` allows to set [priorityClassName](https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/) for all deployments created by this Helm chart (default not set)
- `forge.podDisruptionBudget.enabled` enables a [PodDisruptionBudget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for the core application deployment (default `false`)
- `forge.podDisruptionBudget.minAvailable` minimum number/percentage of pods that must remain available during voluntary disruption (default `1`). Mutually exclusive with `maxUnavailable`.
- `forge.podDisruptionBudget.maxUnavailable` maximum number/percentage of pods unavailable during voluntary disruption (default not set). Mutually exclusive with `minAvailable`.
- `forge.service.type` allows to set the service type for the core application service (default `ClusterIP`)
- `forge.service.nodePort` allows to set custom nodePort value when `forge.service.type` value is set to `NodePort` (default not set)
- `forge.logging.level` sets logging level for the Forge app (default: `info` from "info", "error", "debug", "warn", "trace", "fatal")
Expand Down
22 changes: 22 additions & 0 deletions helm/flowfuse/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{- if .Values.forge.podDisruptionBudget.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: flowfuse
namespace: {{ .Release.Namespace }}
labels:
{{- include "forge.labels" . | nindent 4 }}
{{- with .Values.forge.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.forge.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.forge.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.forge.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.forge.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels:
{{- include "forge.forgeSelectorLabels" . | nindent 6 }}
{{- end }}
42 changes: 42 additions & 0 deletions helm/flowfuse/tests/pdb_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: test forge PodDisruptionBudget
templates:
- pdb.yaml
set:
forge.domain: "chart-unit-tests.com"
tests:
- it: should not render PDB by default
asserts:
- hasDocuments:
count: 0

- it: should render PDB when enabled with minAvailable
set:
forge.podDisruptionBudget.enabled: true
asserts:
- isKind:
of: PodDisruptionBudget
- equal:
path: metadata.name
value: flowfuse
- equal:
path: spec.minAvailable
value: 1
- notExists:
path: spec.maxUnavailable
- equal:
path: spec.selector.matchLabels.app
value: flowforge

- it: should render maxUnavailable when set
set:
forge.podDisruptionBudget:
enabled: true
minAvailable: null
maxUnavailable: 1
asserts:
- equal:
path: spec.maxUnavailable
value: 1
- notExists:
path: spec.minAvailable
14 changes: 14 additions & 0 deletions helm/flowfuse/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,20 @@
"tolerations": {
"type": "array"
},
"podDisruptionBudget": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"minAvailable": {
"type": ["integer", "string"]
},
"maxUnavailable": {
"type": ["integer", "string"]
}
}
},
"logPassthrough": {
"type": "boolean"
},
Expand Down
5 changes: 5 additions & 0 deletions helm/flowfuse/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ forge:

priorityClassName: ""

podDisruptionBudget:
enabled: false
minAvailable: 1
# maxUnavailable: 1 # set instead of minAvailable (mutually exclusive)

logPassthrough: false
customHostname:
enabled: false
Expand Down
Loading