Skip to content

Commit

Permalink
use single pvc and soft links
Browse files Browse the repository at this point in the history
  • Loading branch information
romnn committed Apr 28, 2023
1 parent 6213c74 commit c1a14ab
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ spec:
containerPort: 636
protocol: TCP

{{- if .Values.persistence.enabled }}
# use single pvc for data and config using soft-links
lifecycle:
postStart:
exec:
command:
- /bin/bash
- -c
- rm -rf /etc/ldap/slapd.d /var/lib/ldap && ln /pvc/etc/ldap/slapd.d /etc/ldap/slapd.d && ln /pvc/var/lib/ldap /var/lib/ldap
{{- end }}

envFrom:
- configMapRef:
name: {{ template "openldap.fullname" . }}-env
Expand All @@ -52,11 +63,7 @@ spec:
{{- if .Values.persistence.enabled }}
volumeMounts:
- name: data
mountPath: /var/lib/ldap
subPath: data
- name: data
mountPath: /etc/ldap/slapd.d
subPath: config-data
mountPath: /pvc
{{- if .Values.tls.enabled }}
- name: certs
mountPath: /container/service/slapd/assets/certs
Expand Down Expand Up @@ -108,7 +115,6 @@ spec:
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim | default (include "openldap.fullname" .) }}
{{- else }}
emptyDir:
medium: Memory
emptyDir: {}
{{- end -}}
{{- end -}}

0 comments on commit c1a14ab

Please sign in to comment.