diff --git a/install/kubernetes/github-actions-cache-server/templates/poddisruptionbudget.yaml b/install/kubernetes/github-actions-cache-server/templates/poddisruptionbudget.yaml new file mode 100644 index 0000000..9b59951 --- /dev/null +++ b/install/kubernetes/github-actions-cache-server/templates/poddisruptionbudget.yaml @@ -0,0 +1,21 @@ +{{- if .Values.pdb.enabled }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "github-actions-cache-server.fullname" . }} + labels: + {{- include "github-actions-cache-server.labels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "github-actions-cache-server.selectorLabels" . | nindent 6 }} + {{- if hasKey .Values.pdb "minAvailable" }} + minAvailable: {{ .Values.pdb.minAvailable }} + {{- else if hasKey .Values.pdb "maxUnavailable" }} + maxUnavailable: {{ .Values.pdb.maxUnavailable }} + {{- else }} + minAvailable: 1 + {{- end }} +{{- end }} + + diff --git a/install/kubernetes/github-actions-cache-server/values.yaml b/install/kubernetes/github-actions-cache-server/values.yaml index acc45f8..28e1ffd 100644 --- a/install/kubernetes/github-actions-cache-server/values.yaml +++ b/install/kubernetes/github-actions-cache-server/values.yaml @@ -135,3 +135,13 @@ sidecars: [] # Init containers to run before the main cache server container starts initContainers: [] +# +# Pod Disruption Budget (PDB) +# Helps ensure not all Pods are evicted simultaneously during voluntary disruptions. +# Disabled by default to avoid blocking evictions on single-replica setups. +# +pdb: + enabled: false + minAvailable: 1 + # maxUnavailable: 1 +