Skip to content

Commit

Permalink
Merge pull request #331 from the-technat/master
Browse files Browse the repository at this point in the history
feat(helm): add topologySpreadConstraints and PDB
  • Loading branch information
stefanprodan authored Feb 28, 2024
2 parents 357009a + 6a0bbda commit 47090ad
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions charts/podinfo/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,7 @@ spec:
secret:
secretName: {{ template "podinfo.tlsSecretName" . }}
{{- end }}
{{- with .Values.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
14 changes: 14 additions & 0 deletions charts/podinfo/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if and .Values.podDisruptionBudget (gt (int .Values.replicaCount) 1) }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "podinfo.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "podinfo.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "podinfo.selectorLabels" . | nindent 6 }}
{{- toYaml .Values.podDisruptionBudget | nindent 2 }}
{{- end }}
7 changes: 7 additions & 0 deletions charts/podinfo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ affinity: {}

podAnnotations: {}

# https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
topologySpreadConstraints: []

# Disruption budget will be configured only when the replicaCount is greater than 1
podDisruptionBudget: {}
# maxUnavailable: 1

# https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
probes:
readiness:
Expand Down

0 comments on commit 47090ad

Please sign in to comment.