Skip to content

Commit

Permalink
update helm chart to persist postfix configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mbussolotto committed Aug 30, 2023
1 parent 221f9e4 commit ea020f4
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 1 deletion.
6 changes: 6 additions & 0 deletions containers/doc/server-kubernetes/migration-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ spec:
/etc/salt \
/etc/tomcat \
/etc/cobbler \
/etc/postfix \
/etc/sysconfig;
do
rsync -avz uyuni.world-co.com:$folder/ $folder;
Expand Down Expand Up @@ -91,6 +92,8 @@ spec:
name: etc-cobbler
- mountPath: /etc/sysconfig
name: etc-sysconfig
- mountPath: /etc/postfix
name: etc-postfix
- mountPath: /root/keys
name: ssh-key
volumes:
Expand Down Expand Up @@ -157,6 +160,9 @@ spec:
- name: etc-sysconfig
persistentVolumeClaim:
claimName: etc-sysconfig
- name: etc-postfix
persistentVolumeClaim:
claimName: etc-postfix
- name: ssh-key
secret:
secretName: migration-ssh-key
Expand Down
25 changes: 25 additions & 0 deletions containers/doc/server-kubernetes/pvs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -529,3 +529,28 @@ spec:
operator: In
values:
- uyuni-dev
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: etc-postfix
labels:
data: etc-postfix
spec:
capacity:
storage: 1Mi
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
storageClassName: local-storage
local:
path: /var/uyuni/etc-postfix
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- uyuni-dev

21 changes: 21 additions & 0 deletions containers/server-helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,22 @@ spec:
volumeMounts:
- mountPath: /mnt
name: etc-sysconfig
- name: init-etc-postfix
image: {{- include "deployment.container.image" (dict "name" "server" "global" .) | indent 1}}
imagePullPolicy: {{ .Values.pullPolicy }}
command:
- sh
- -x
- -c
- >
chown --reference=/etc/postfix /mnt;
chmod --reference=/etc/postfix /mnt;
if [ -z "$(ls -A /mnt)" ]; then
cp -a /etc/postfix/. /mnt;
fi
volumeMounts:
- mountPath: /mnt
name: etc-postfix
containers:
- name: uyuni
image: {{- include "deployment.container.image" (dict "name" "server" "global" .) | indent 1}}
Expand Down Expand Up @@ -447,6 +463,8 @@ spec:
name: etc-sysconfig
- mountPath: /etc/pki/tls
name: etc-tls
- mountPath: /etc/postfix
name: etc-postfix
- name: ca-cert
mountPath: /etc/pki/trust/anchors/LOCAL-RHN-ORG-TRUSTED-SSL-CERT
readOnly: true
Expand Down Expand Up @@ -532,6 +550,9 @@ spec:
- name: etc-sysconfig
persistentVolumeClaim:
claimName: etc-sysconfig
- name: etc-postfix
persistentVolumeClaim:
claimName: etc-postfix
- name: ca-cert
configMap:
name: uyuni-ca
Expand Down
24 changes: 24 additions & 0 deletions containers/server-helm/templates/volumes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -549,3 +549,27 @@ spec:
matchLabels:
data: etc-tls
{{- end }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: etc-postfix
namespace: "{{ .Release.Namespace }}"
spec:
{{- if .Values.storageClass }}
{{- if (eq "-" .Values.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.storageClass }}"
{{- end }}
{{- end }}
accessModes:
{{ toYaml .Values.accessModes | indent 4 }}
resources:
requests:
storage: 1Mi
{{- if .Values.matchPvByLabel }}
selector:
matchLabels:
data: etc-postfix
{{- end }}
1 change: 0 additions & 1 deletion susemanager/susemanager.changes.mbussolotto.postfix

This file was deleted.

0 comments on commit ea020f4

Please sign in to comment.