Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: PDB #1871

Merged
merged 2 commits into from
Mar 7, 2024
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
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