Files

35 lines
830 B
YAML

apiVersion: v1
kind: Pod
metadata:
name: config-migration
namespace: nextcloud
spec:
volumes:
- name: old-config
persistentVolumeClaim:
claimName: nextcloud-config-pvc
- name: new-config
persistentVolumeClaim:
claimName: nextcloud-config-pvc-longhorn
containers:
- name: migrator
image: alpine:3.18
volumeMounts:
- name: old-config
mountPath: /old
- name: new-config
mountPath: /new
command: ['sh']
args:
- -c
- |
echo "Copying config data..."
if [ "$(ls -A /old)" ]; then
cp -rv /old/* /new/ 2>/dev/null || true
echo "Config migration completed"
else
echo "Old config is empty"
fi
sleep infinity
restartPolicy: Never