Skip to content

Commit

Permalink
feat: PDB (#1871)
Browse files Browse the repository at this point in the history
Signed-off-by: OMPRAKASH MISHRA <[email protected]>
  • Loading branch information
mishraomp authored Mar 7, 2024
1 parent 3abf250 commit 8135292
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ jobs:
--set backend.deploymentStrategy=RollingUpdate
--set frontend.deploymentStrategy=RollingUpdate
--set global.autoscaling=true
--set frontend.pdb.enabled=true
--set backend.pdb.enabled=true
promote:
name: Promote Images
needs: [deploy-prod, vars]
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ Features:
* Helm Package Manager for atomic deployments
* Prometheus Metrics export from Backend/Frontend
* Resource Tuning with Horizontal Pod Autoscaler (in TEST/PROD).
* Affinity and Anti-Affinity for Scheduling on different worker nodes
* Rolling updates with zero downtime in PROD
* Database Migrations with Flyway
* Pod Disruption Budgets for High Availability
* Self Healing through Health checks
* Sample application stack:
* Database: Postgres, PostGIS, backups
* Database: Postgres, PostGIS, backups, Flyway
* Frontend: TypeScript, Caddy Server
* Backend: TypeScript, Nest.js
* Alternative backends for [Java/Quarkus, Go/Fiber and Python/FastAPI](https://github.com/bcgov/quickstart-openshift-backends)
Expand Down
2 changes: 1 addition & 1 deletion charts/app/templates/backend/templates/pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ metadata:
spec:
selector:
matchLabels:
app.kubernetes.io/name: {{ include "backend.fullname" . }}
{{- include "backend.selectorLabels" . | nindent 6 }}
minAvailable: {{ .Values.backend.pdb.minAvailable }}
{{- end }}
3 changes: 2 additions & 1 deletion charts/app/templates/frontend/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{{- if and .Values.frontend.pdb .Values.frontend.pdb.enabled }}
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "frontend.fullname" . }}
labels:
{{- include "frontend.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
app.kubernetes.io/name: {{ include "frontend.fullname" . }}
{{- include "frontend.selectorLabels" . | nindent 6 }}
minAvailable: {{ .Values.frontend.pdb.minAvailable }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ frontend:
ingress:
annotations:
route.openshift.io/termination: "edge"
pdb:
enabled: false # enable it in PRODUCTION for having pod disruption budget.
minAvailable: 1 # the minimum number of pods that must be available during the disruption budget.

crunchy: # enable it for TEST and PROD, for PR based pipelines simply use single postgres
enabled: false
Expand Down

0 comments on commit 8135292

Please sign in to comment.