Skip to content

Commit

Permalink
feat: allow to define pod disruption budgets
Browse files Browse the repository at this point in the history
  • Loading branch information
bameda committed Sep 9, 2024
1 parent 40d8e8c commit 6f15a79
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 0 deletions.
2 changes: 2 additions & 0 deletions charts/penpot/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ annotations:
url: https://penpot.app/dev-diaries.html
artifacthub.io/containsSecurityUpdates: "false"
artifacthub.io/changes: |
- kind: added
description: Allow to define pod disruption budgets.
- kind: changed
description: Bump penpot to 2.1.4.
- kind: changed
Expand Down
12 changes: 12 additions & 0 deletions charts/penpot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ helm install my-release -f values.yaml penpot/penpot
| backend.image.repository | string | `"penpotapp/backend"` | The Docker repository to pull the image from. |
| backend.image.tag | string | `"2.1.4"` | The image tag to use. |
| backend.nodeSelector | object | `{}` | Node labels for Penpot pods assignment. Check [the official doc](https://kubernetes.io/docs/user-guide/node-selection/) |
| backend.pdb | object | `{"enabled":false,"maxUnavailable":null,"minAvailable":null}` | Configure Pod Disruption Budget for the backend pods. Check [the official doc](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) |
| backend.pdb.enabled | bool | `false` | Enable Pod Disruption Budget for the backend pods. |
| backend.pdb.maxUnavailable | int,string | `nil` | The number or percentage of pods from that set that can be unavailable after the eviction (e.g.: 3, "10%"). |
| backend.pdb.minAvailable | int,string | `nil` | The number or percentage of pods from that set that must still be available after the eviction (e.g.: 3, "10%"). |
| backend.podAnnotations | object | `{}` | An optional map of annotations to be applied to the controller Pods |
| backend.podLabels | object | `{}` | An optional map of labels to be applied to the controller Pods |
| backend.podSecurityContext | object | `{"fsGroup":1001}` | Configure Pods Security Context. Check [the official doc](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) |
Expand All @@ -177,6 +181,10 @@ helm install my-release -f values.yaml penpot/penpot
| frontend.image.repository | string | `"penpotapp/frontend"` | The Docker repository to pull the image from. |
| frontend.image.tag | string | `"2.1.4"` | The image tag to use. |
| frontend.nodeSelector | object | `{}` | Node labels for Penpot pods assignment. Check [the official doc](https://kubernetes.io/docs/user-guide/node-selection/) |
| frontend.pdb | object | `{"enabled":false,"maxUnavailable":null,"minAvailable":null}` | Configure Pod Disruption Budget for the frontend pods. Check [the official doc](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) |
| frontend.pdb.enabled | bool | `false` | Enable Pod Disruption Budget for the frontend pods. |
| frontend.pdb.maxUnavailable | int,string | `nil` | The number or percentage of pods from that set that can be unavailable after the eviction (e.g.: 3, "10%"). |
| frontend.pdb.minAvailable | int,string | `nil` | The number or percentage of pods from that set that must still be available after the eviction (e.g.: 3, "10%"). |
| frontend.podAnnotations | object | `{}` | An optional map of annotations to be applied to the controller Pods |
| frontend.podLabels | object | `{}` | An optional map of labels to be applied to the controller Pods |
| frontend.podSecurityContext | object | `{}` | Configure Pods Security Context. Check [the official doc](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) |
Expand All @@ -199,6 +207,10 @@ helm install my-release -f values.yaml penpot/penpot
| exporter.image.repository | string | `"penpotapp/exporter"` | The Docker repository to pull the image from. |
| exporter.image.tag | string | `"2.1.4"` | The image tag to use. |
| exporter.nodeSelector | object | `{}` | Node labels for Penpot pods assignment. Check [the official doc](https://kubernetes.io/docs/user-guide/node-selection/) |
| exporter.pdb | object | `{"enabled":false,"maxUnavailable":null,"minAvailable":null}` | Configure Pod Disruption Budget for the exporter pods. Check [the official doc](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) |
| exporter.pdb.enabled | bool | `false` | Enable Pod Disruption Budget for the exporter pods. |
| exporter.pdb.maxUnavailable | int,string | `nil` | The number or percentage of pods from that set that can be unavailable after the eviction (e.g.: 3, "10%"). |
| exporter.pdb.minAvailable | int,string | `nil` | The number or percentage of pods from that set that must still be available after the eviction (e.g.: 3, "10%"). |
| exporter.podAnnotations | object | `{}` | An optional map of annotations to be applied to the controller Pods |
| exporter.podLabels | object | `{}` | An optional map of labels to be applied to the controller Pods |
| exporter.podSecurityContext | object | `{"fsGroup":1001}` | Configure Pods Security Context. Check [the official doc](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) |
Expand Down
20 changes: 20 additions & 0 deletions charts/penpot/templates/backend-deployment-pdb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if .Values.backend.pdb.enabled -}}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "penpot.fullname" . }}-backend
namespace: {{ .Release.Namespace }}
labels:
{{- include "penpot.labels" . | nindent 4 }}
spec:
{{- if .Values.backend.pdb.minAvailable }}
minAvailable: {{ .Values.backend.pdb.minAvailable }}
{{- else if .Values.backend.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.backend.pdb.maxUnavailable }}
{{- else }}
minAvailable: 0
{{- end }}
selector:
matchLabels:
app: penpot-backend
{{- end -}}
20 changes: 20 additions & 0 deletions charts/penpot/templates/exporter-deployment-pdb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if .Values.exporter.pdb.enabled -}}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "penpot.fullname" . }}-exporter
namespace: {{ .Release.Namespace }}
labels:
{{- include "penpot.labels" . | nindent 4 }}
spec:
{{- if .Values.exporter.pdb.minAvailable }}
minAvailable: {{ .Values.exporter.pdb.minAvailable }}
{{- else if .Values.exporter.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.exporter.pdb.maxUnavailable }}
{{- else }}
minAvailable: 0
{{- end }}
selector:
matchLabels:
app: penpot-exporter
{{- end -}}
20 changes: 20 additions & 0 deletions charts/penpot/templates/frontend-deployment-pdb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if .Values.frontend.pdb.enabled -}}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "penpot.fullname" . }}-frontend
namespace: {{ .Release.Namespace }}
labels:
{{- include "penpot.labels" . | nindent 4 }}
spec:
{{- if .Values.frontend.pdb.minAvailable }}
minAvailable: {{ .Values.frontend.pdb.minAvailable }}
{{- else if .Values.frontend.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.frontend.pdb.maxUnavailable }}
{{- else }}
minAvailable: 0
{{- end }}
selector:
matchLabels:
app: penpot-frontend
{{- end -}}
36 changes: 36 additions & 0 deletions charts/penpot/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,18 @@ backend:
# -- The requested resources for the Penpot backend containers
# @section -- Backend parameters
requests: {}
# -- Configure Pod Disruption Budget for the backend pods. Check [the official doc](https://kubernetes.io/docs/tasks/run-application/configure-pdb/)
# @section -- Backend parameters
pdb:
# -- Enable Pod Disruption Budget for the backend pods.
# @section -- Backend parameters
enabled: false
# -- (int,string) The number or percentage of pods from that set that must still be available after the eviction (e.g.: 3, "10%").
# @section -- Backend parameters
minAvailable:
# -- (int,string) The number or percentage of pods from that set that can be unavailable after the eviction (e.g.: 3, "10%").
# @section -- Backend parameters
maxUnavailable:

frontend:
image:
Expand Down Expand Up @@ -422,6 +434,18 @@ frontend:
# -- The requested resources for the Penpot frontend containers
# @section -- Frontend parameters
requests: {}
# -- Configure Pod Disruption Budget for the frontend pods. Check [the official doc](https://kubernetes.io/docs/tasks/run-application/configure-pdb/)
# @section -- Frontend parameters
pdb:
# -- Enable Pod Disruption Budget for the frontend pods.
# @section -- Frontend parameters
enabled: false
# -- (int,string) The number or percentage of pods from that set that must still be available after the eviction (e.g.: 3, "10%").
# @section -- Frontend parameters
minAvailable:
# -- (int,string) The number or percentage of pods from that set that can be unavailable after the eviction (e.g.: 3, "10%").
# @section -- Frontend parameters
maxUnavailable:

exporter:
image:
Expand Down Expand Up @@ -485,6 +509,18 @@ exporter:
# -- The requested resources for the Penpot frontend containers
# @section -- Exporter parameters
requests: {}
# -- Configure Pod Disruption Budget for the exporter pods. Check [the official doc](https://kubernetes.io/docs/tasks/run-application/configure-pdb/)
# @section -- Exporter parameters
pdb:
# -- Enable Pod Disruption Budget for the exporter pods.
# @section -- Exporter parameters
enabled: false
# -- (int,string) The number or percentage of pods from that set that must still be available after the eviction (e.g.: 3, "10%").
# @section -- Exporter parameters
minAvailable:
# -- (int,string) The number or percentage of pods from that set that can be unavailable after the eviction (e.g.: 3, "10%").
# @section -- Exporter parameters
maxUnavailable:

# @section -- Persistence parameters
persistence:
Expand Down

0 comments on commit 6f15a79

Please sign in to comment.