36 lines
No EOL
888 B
YAML
36 lines
No EOL
888 B
YAML
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: adguard-data-migration
|
|
namespace: adguard
|
|
spec:
|
|
template:
|
|
spec:
|
|
restartPolicy: Never
|
|
containers:
|
|
- name: migrate
|
|
image: busybox:1.36
|
|
command:
|
|
- sh
|
|
- -c
|
|
- |
|
|
echo "Starting AdGuard data migration..."
|
|
if [ -d /old-data/AdGuardHome ]; then
|
|
echo "Copying AdGuard data..."
|
|
cp -av /old-data/* /new-data/
|
|
else
|
|
echo "No data to migrate"
|
|
fi
|
|
echo "Migration complete!"
|
|
volumeMounts:
|
|
- name: old-data
|
|
mountPath: /old-data
|
|
- name: new-data
|
|
mountPath: /new-data
|
|
volumes:
|
|
- name: old-data
|
|
persistentVolumeClaim:
|
|
claimName: adguard-data
|
|
- name: new-data
|
|
persistentVolumeClaim:
|
|
claimName: adguard-data-rbd |