Skip to content

Commit

Permalink
Merge pull request #71 from thriqon/add-pdb
Browse files Browse the repository at this point in the history
Add Pod Disruption Budget for Stateful Set
  • Loading branch information
jp-gouin authored Sep 5, 2022
2 parents 1e38aff + 839f46f commit e7f9269
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ Parameters related to Kubernetes.
| `podAnnotations` | Enable the multi-master replication | `true` |
| `podAffinityPreset` | podAffinityPreset Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard`| `` |
| `podAntiAffinityPreset` | podAntiAffinityPreset Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` |
| `pdb.enabled` | Enable Pod Disruption Budget | `false` |
| `pdb.minAvailable` | Configure PDB to have at least this many health replicas. | `1` |
| `pdb.maxUnavailable` | Configure PDB to have at most this many unhealth replicas. | `<unset>` |
| `nodeAffinityPreset` | nodeAffinityPreset.type Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `true` |
| `affinity` | affinity Affinity for OPENLDAP pods assignment | `` |
| `nodeSelector` | nodeSelector Node labels for OPENLDAP pods assignment | `` |
Expand Down
25 changes: 25 additions & 0 deletions templates/pod-disruption-budget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- if .Values.pdb.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ template "openldap.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/component: {{ template "openldap.fullname" . }}
chart: {{ template "openldap.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.extraLabels }}
{{ toYaml .Values.extraLabels | indent 4 }}
{{- end }}
spec:
{{- if .Values.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.pdb.maxUnavailable }}
{{- end }}
{{- if .Values.pdb.minAvailable }}
minAvailable: {{ .Values.pdb.minAvailable }}
{{- end }}
selector:
app.kubernetes.io/component: {{ template "openldap.fullname" . }}
release: {{ .Release.Name }}
{{- end }}
7 changes: 7 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ env:
LDAP_TLS_PROTOCOL_MIN: "3.0"
LDAP_TLS_CIPHER_SUITE: "NORMAL"

# Pod Disruption Budget for Stateful Set
# Disabled by default, to ensure backwards compatibility
pdb:
enabled: false
minAvailable: 1
maxUnavailable: ""

# Custom openldap configuration files used to override default settings
# customLdifFiles:
# 01-default-users.ldif: |-
Expand Down

0 comments on commit e7f9269

Please sign in to comment.