Skip to content

Commit

Permalink
✨(helm) add pdbs to deployments
Browse files Browse the repository at this point in the history
In order to avoid a service interruption during a Kubernetes (k8s)
upgrade, we add a Pod Disruption Budget (PDB) to deployments.
  • Loading branch information
rouja authored and lebaudantoine committed Feb 12, 2025
1 parent b5037db commit 2cd4a6e
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 8 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/release-helm-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ run-name: Release Chart

on:
push:
branches:
- 'main'
paths:
- ./src/helm/meet/**
- src/helm/meet/**

jobs:
release:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# Changelog

All notable changes to this project will be documented in this file.
Expand Down
2 changes: 1 addition & 1 deletion src/helm/meet/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v2
type: application
name: meet
version: 0.0.2
version: 0.0.3
4 changes: 4 additions & 0 deletions src/helm/meet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
| `backend.persistence.volume-name.mountPath` | Path where the volume should be mounted to | |
| `backend.extraVolumeMounts` | Additional volumes to mount on the backend. | `[]` |
| `backend.extraVolumes` | Additional volumes to mount on the backend. | `[]` |
| `backend.pdb.enabled` | Enable pdb on backend | `true` |

### frontend

Expand Down Expand Up @@ -131,6 +132,7 @@
| `frontend.persistence.volume-name.mountPath` | Path where the volume should be mounted to | |
| `frontend.extraVolumeMounts` | Additional volumes to mount on the frontend. | `[]` |
| `frontend.extraVolumes` | Additional volumes to mount on the frontend. | `[]` |
| `frontend.pdb.enabled` | Enable pdb on frontend | `true` |

### posthog

Expand Down Expand Up @@ -208,6 +210,7 @@
| `summary.persistence.volume-name.mountPath` | Path where the volume should be mounted to | |
| `summary.extraVolumeMounts` | Additional volumes to mount on the summary. | `[]` |
| `summary.extraVolumes` | Additional volumes to mount on the summary. | `[]` |
| `summary.pdb.enabled` | Enable pdb on summary | `true` |

### celery

Expand Down Expand Up @@ -255,3 +258,4 @@
| `celery.persistence.volume-name.mountPath` | Path where the volume should be mounted to | |
| `celery.extraVolumeMounts` | Additional volumes to mount on the celery. | `[]` |
| `celery.extraVolumes` | Additional volumes to mount on the celery. | `[]` |
| `celery.pdb.enabled` | Enable pdb on celery | `false` |
13 changes: 13 additions & 0 deletions src/helm/meet/templates/backend_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,16 @@ spec:
emptyDir: {}
{{- end }}
{{- end }}
---
{{ if .Values.backend.pdb.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ $fullName }}
namespace: {{ .Release.Namespace | quote }}
spec:
maxUnavailable: 1
selector:
matchLabels:
{{- include "meet.common.selectorLabels" (list . $component) | nindent 6 }}
{{ end }}
13 changes: 13 additions & 0 deletions src/helm/meet/templates/celery_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,16 @@ spec:
emptyDir: {}
{{- end }}
{{- end }}
---
{{ if .Values.celery.pdb.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ $fullName }}
namespace: {{ .Release.Namespace | quote }}
spec:
maxUnavailable: 1
selector:
matchLabels:
{{- include "meet.common.selectorLabels" (list . $component) | nindent 6 }}
{{ end }}
13 changes: 13 additions & 0 deletions src/helm/meet/templates/frontend_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,16 @@ spec:
emptyDir: {}
{{- end }}
{{- end }}
---
{{ if .Values.frontend.pdb.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ $fullName }}
namespace: {{ .Release.Namespace | quote }}
spec:
maxUnavailable: 1
selector:
matchLabels:
{{- include "meet.common.selectorLabels" (list . $component) | nindent 6 }}
{{ end }}
13 changes: 13 additions & 0 deletions src/helm/meet/templates/summary_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,16 @@ spec:
emptyDir: {}
{{- end }}
{{- end }}
---
{{ if .Values.summary.pdb.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ $fullName }}
namespace: {{ .Release.Namespace | quote }}
spec:
maxUnavailable: 1
selector:
matchLabels:
{{- include "meet.common.selectorLabels" (list . $component) | nindent 6 }}
{{ end }}
21 changes: 17 additions & 4 deletions src/helm/meet/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ backend:
targetPort: 8000
annotations: {}

## @param backend.migrate.command backend migrate command
## @param backend.migrate.restartPolicy backend migrate job restart policy
## @param backend.migrate.command backend migrate command
## @param backend.migrate.restartPolicy backend migrate job restart policy
migrate:
command:
- "python"
Expand All @@ -130,8 +130,8 @@ backend:
- "--no-input"
restartPolicy: Never

## @param backend.createsuperuser.command backend migrate command
## @param backend.createsuperuser.restartPolicy backend migrate job restart policy
## @param backend.createsuperuser.command backend migrate command
## @param backend.createsuperuser.restartPolicy backend migrate job restart policy
createsuperuser:
command:
- "/bin/sh"
Expand Down Expand Up @@ -184,6 +184,9 @@ backend:
## @param backend.extraVolumes Additional volumes to mount on the backend.
extraVolumes: []

## @param backend.pdb.enabled Enable pdb on backend
pdb:
enabled: true

## @section frontend

Expand Down Expand Up @@ -279,6 +282,10 @@ frontend:
## @param frontend.extraVolumes Additional volumes to mount on the frontend.
extraVolumes: []

## @param frontend.pdb.enabled Enable pdb on frontend
pdb:
enabled: true

## @section posthog

posthog:
Expand Down Expand Up @@ -443,6 +450,9 @@ summary:
## @param summary.extraVolumes Additional volumes to mount on the summary.
extraVolumes: []

## @param summary.pdb.enabled Enable pdb on summary
pdb:
enabled: true

## @section celery

Expand Down Expand Up @@ -533,3 +543,6 @@ celery:
## @param celery.extraVolumes Additional volumes to mount on the celery.
extraVolumes: []

## @param celery.pdb.enabled Enable pdb on celery
pdb:
enabled: false

0 comments on commit 2cd4a6e

Please sign in to comment.