Skip to content

Commit 10a972d

Browse files
author
Ilan Zerath
committed
feat: Add PDB
Signed-off-by: Ilan Zerath <[email protected]>
1 parent 174eb0e commit 10a972d

File tree

6 files changed

+97
-2
lines changed

6 files changed

+97
-2
lines changed

charts/backstage/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ sources:
3838
# This is the chart version. This version number should be incremented each time you make changes
3939
# to the chart and its templates, including the app version.
4040
# Versions are expected to follow Semantic Versioning (https://semver.org/)
41-
version: 2.3.1
41+
version: 2.3.2

charts/backstage/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Backstage Helm Chart
33

44
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/backstage)](https://artifacthub.io/packages/search?repo=backstage)
5-
![Version: 2.3.1](https://img.shields.io/badge/Version-2.3.1-informational?style=flat-square)
5+
![Version: 2.3.2](https://img.shields.io/badge/Version-2.3.2-informational?style=flat-square)
66
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
77

88
A Helm chart for deploying a Backstage application
@@ -139,6 +139,7 @@ Kubernetes: `>= 1.19.0-0`
139139
| backstage.installDir | Directory containing the backstage installation | string | `"/app"` |
140140
| backstage.livenessProbe | Liveness Probe Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes <!-- E.g. livenessProbe: failureThreshold: 3 httpGet: path: /.backstage/health/v1/liveness port: 7007 scheme: HTTP initialDelaySeconds: 60 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 2 | object | `{"httpGet":{"path":"/.backstage/health/v1/liveness","port":7007,"scheme":"HTTP"}}` |
141141
| backstage.nodeSelector | Node labels for pod assignment <br /> Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector | object | `{}` |
142+
| backstage.pdb | Pod Disruption Budget configuration ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/ | object | `{"create":false,"maxUnavailable":"","minAvailable":""}` |
142143
| backstage.podAnnotations | Annotations to add to the backend deployment pods | object | `{}` |
143144
| backstage.podLabels | Labels to add to the backend deployment pods | object | `{}` |
144145
| backstage.podSecurityContext | Security settings for a Pod. The security settings that you specify for a Pod apply to all Containers in the Pod. <br /> Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod | object | `{}` |

charts/backstage/templates/pdb.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{{- if .Values.backstage.pdb.create }}
2+
apiVersion: policy/v1
3+
kind: PodDisruptionBudget
4+
metadata:
5+
name: {{ include "common.names.fullname" . }}
6+
namespace: {{ .Release.Namespace | quote }}
7+
labels: {{ include "common.labels.standard" . | nindent 4 }}
8+
app.kubernetes.io/component: backstage
9+
{{- if .Values.commonLabels }}
10+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
11+
{{- end }}
12+
annotations:
13+
{{- if .Values.commonAnnotations }}
14+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
15+
{{- end }}
16+
{{- if .Values.backstage.annotations }}
17+
{{- include "common.tplvalues.render" ( dict "value" .Values.backstage.annotations "context" $) | nindent 4 }}
18+
{{- end }}
19+
spec:
20+
{{- if .Values.backstage.pdb.minAvailable }}
21+
minAvailable: {{ .Values.backstage.pdb.minAvailable }}
22+
{{- end }}
23+
{{- if or .Values.backstage.pdb.maxUnavailable ( not .Values.backstage.pdb.minAvailable ) }}
24+
maxUnavailable: {{ .Values.backstage.pdb.maxUnavailable | default 1 }}
25+
{{- end }}
26+
selector:
27+
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
28+
app.kubernetes.io/component: backstage
29+
{{- end }}

charts/backstage/values.schema.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5511,6 +5511,35 @@
55115511
"title": "Node labels for pod assignment",
55125512
"type": "object"
55135513
},
5514+
"pdb": {
5515+
"additionalProperties": false,
5516+
"properties": {
5517+
"create": {
5518+
"default": false,
5519+
"description": "Create a PDB",
5520+
"title": "Backstage PDB",
5521+
"type": "boolean"
5522+
},
5523+
"maxUnavailable": {
5524+
"default": "",
5525+
"title": "Backstage PDB maxUnavailable",
5526+
"type": [
5527+
"string",
5528+
"integer"
5529+
]
5530+
},
5531+
"minAvailable": {
5532+
"default": "",
5533+
"title": "Backstage PDB minAvailable",
5534+
"type": [
5535+
"string",
5536+
"integer"
5537+
]
5538+
}
5539+
},
5540+
"title": "PDB parameters",
5541+
"type": "object"
5542+
},
55145543
"podAnnotations": {
55155544
"additionalProperties": {
55165545
"type": "string"

charts/backstage/values.schema.tmpl.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,35 @@
275275
}
276276
}
277277
},
278+
"pdb": {
279+
"title": "PDB parameters",
280+
"type": "object",
281+
"additionalProperties": false,
282+
"properties": {
283+
"create": {
284+
"description": "Create a PDB",
285+
"title": "Backstage PDB",
286+
"type": "boolean",
287+
"default": false
288+
},
289+
"minAvailable": {
290+
"title": "Backstage PDB minAvailable",
291+
"type": [
292+
"string",
293+
"integer"
294+
],
295+
"default": ""
296+
},
297+
"maxUnavailable": {
298+
"title": "Backstage PDB maxUnavailable",
299+
"type": [
300+
"string",
301+
"integer"
302+
],
303+
"default": ""
304+
}
305+
}
306+
},
278307
"containerPorts": {
279308
"title": "Container ports on the Deployment",
280309
"type": "object",

charts/backstage/values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,13 @@ backstage:
133133
# <br /> E.g: `pullSecrets: [myRegistryKeySecretName]`
134134
pullSecrets: []
135135

136+
# -- Pod Disruption Budget configuration
137+
# ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/
138+
pdb:
139+
create: false
140+
minAvailable: ""
141+
maxUnavailable: ""
142+
136143
# -- Container ports on the Deployment
137144
containerPorts:
138145
backend: 7007

0 commit comments

Comments
 (0)