Skip to content
Open
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
42 changes: 42 additions & 0 deletions kubernetes/glpi/templates/glpi-poddisruptionbudget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{{- if .Values.glpi.phpfpm.pdb.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: php-fpm
namespace: {{ include "glpi.namespace" . }}
labels:
{{- include "glpi.labels" . | nindent 4 }}
app.kubernetes.io/component: php-fpm
spec:
{{- if .Values.glpi.phpfpm.pdb.minAvailable }}
minAvailable: {{ .Values.glpi.phpfpm.pdb.minAvailable }}
{{- else }}
maxUnavailable: {{ .Values.glpi.phpfpm.pdb.maxUnavailable }}
{{- end }}
selector:
matchLabels:
{{- include "glpi.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: php-fpm
{{- end }}

---
{{- if .Values.glpi.nginx.pdb.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: nginx
namespace: {{ include "glpi.namespace" . }}
labels:
{{- include "glpi.labels" . | nindent 4 }}
app.kubernetes.io/component: nginx
spec:
{{- if .Values.glpi.nginx.pdb.minAvailable }}
minAvailable: {{ .Values.glpi.nginx.pdb.minAvailable }}
{{- else }}
maxUnavailable: {{ .Values.glpi.nginx.pdb.maxUnavailable }}
{{- end }}
selector:
matchLabels:
{{- include "glpi.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: nginx
{{- end }}
22 changes: 22 additions & 0 deletions kubernetes/glpi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,20 @@ glpi:
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 3

# -- Pod Disruption Budget
# Only meaningful when phpfpm.replicaCount > 1: with a single replica, a PDB
# requiring minAvailable: 1 (or maxUnavailable: 0) will block voluntary node
# drains/evictions entirely, since Kubernetes can never satisfy it. Defaults to
# disabled for that reason; enable once you scale replicaCount up.
pdb:
enabled: false
# Minimum number/percentage of pods that must remain available (e.g. 1 or "50%").
# Leave empty to use maxUnavailable instead.
minAvailable: ""
# Maximum number/percentage of pods that may be unavailable (e.g. 1 or "50%").
# Ignored if minAvailable is set.
maxUnavailable: 1

# Nginx container configuration
nginx:
Expand Down Expand Up @@ -125,6 +139,14 @@ glpi:
port: 80
# Target port on the container
targetPort: 8080

# -- Pod Disruption Budget
# Only meaningful when nginx.replicaCount > 1 - see the equivalent note under
# glpi.phpfpm.pdb.
pdb:
enabled: false
minAvailable: ""
maxUnavailable: 1

# GLPI directory paths configuration
paths:
Expand Down