Skip to content

Commit

Permalink
feat: add pdb for making pixxel services fault tolerant (#116)
Browse files Browse the repository at this point in the history
* feat: add pdb for making pixxel services fault tolerant

* fix: added additional pod labels to deployment so that pdb can target only deployment pods

* fix: replaced to non org specific labels

* feat: bump in minor version for new feature addition

* feat: added min available condition, also added a condition such that pdb can only attach to deployment whose replica count > 1, added flag to switch on/off pdb

* fix: removed minAvailable
  • Loading branch information
ajinkya6 authored Aug 26, 2024
1 parent 7785f08 commit 85fe05a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion stable/app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.5.4
version: 0.6.0
3 changes: 2 additions & 1 deletion stable/app/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ spec:
{{- end }}
labels:
{{- include "app.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: "deployment"
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down Expand Up @@ -113,4 +114,4 @@ spec:
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
12 changes: 12 additions & 0 deletions stable/app/templates/poddisruptionbudget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if and .Values.pdb.enabled (gt .Values.replicaCount 1) }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: "{{ template "app.fullname" . }}-pdb"
spec:
maxUnavailable: {{ .Values.pdb.maxUnavailable }}
selector:
matchLabels:
{{- include "app.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: "deployment"
{{- end }}
4 changes: 4 additions & 0 deletions stable/app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ resources: {}
# -- cpu: 100m
# -- memory: 128Mi

pdb:
enabled: false
maxUnavailable: 1

nodeSelector: {}

tolerations: []
Expand Down

0 comments on commit 85fe05a

Please sign in to comment.