Container image for a K8s cronJob to export a file from a PVC to an SMB share.
Expects a single directory from which the most recent file will be used.
SMB_USER_NAME=
SMB_USER_DOMAIN=
SMB_USER_PASSWORD=
SMB_SERVICE_NAME=
- doesn't end with
/
- eg:
//fileShareName/rootFolder
- doesn't end with
SMB_DIRECTORY=
- doesn't start or end with
/
- eg:
folder/anotherFolder/etcFolder
- doesn't start or end with
ARCHIVE_FILE_DIRECTORY=
- does start but doesn't end with
/
- this is the directory within the PVC
- eg:
/folder/anotherFolder/etcFolder
- does start but doesn't end with
Hosted on ghcr.io and Docker Hub.
docker pull ghcr.io/emerconn/k8s-cronjob-smb-export
# or
docker pull emerconn/k8s-cronjob-smb-export
apiVersion: v1
kind: ConfigMap
metadata:
name: smb-export
data:
ARCHIVE_FILE_DIRECTORY: /var/out-dir-example-app/instance/server/default/data/archive
SMB_DIRECTORY: example-app/prod
SMB_SERVICE_NAME: //fileserver.domain.com/backups
SMB_USER_DOMAIN: .domain.com
SMB_USER_NAME: smb_export_sa
---
apiVersion: v1
kind: Secret
metadata:
name: smb-export
type: Opaque
stringData:
SMB_USER_PASSWORD: p@ssword1234
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: smb-export
spec:
schedule: '@daily'
timeZone: America/Chicago
jobTemplate:
spec:
template:
spec:
containers:
name: smb-export
image: emerconn/k8s-cronjob-smb-export:latest
- envFrom:
- configMapRef:
name: smb-export
- secretRef:
name: smb-export
volumeMounts:
- mountPath: /var/out-dir-example-app
name: example-app-pvc
volumes:
- name: example-app-pvc
persistentVolumeClaim:
claimName: example-app-pvc