Moving data
Whichever method you use, write to a path backed by a PVC. Anything written elsewhere in the container is lost when the Pod restarts or is rescheduled.
kubectl cp (small files)
Section titled “kubectl cp (small files)”kubectl cp ./input.csv <tenant>-prod/my-pod:/data/input.csv # local → Podkubectl cp <tenant>-prod/my-pod:/data/output.csv ./output.csv # Pod → localkubectl cp streams a tar archive through the API server, so the container image needs tar. It has no resume, progress or delta transfer, and a dropped connection restarts the copy from zero. Keep it to files under about 500 MB.
PVC-backed Job (bulk import)
Section titled “PVC-backed Job (bulk import)”For large datasets, run a Job that pulls from the source (object store, HTTP endpoint, database dump) straight into a PVC. The transfer stays on the cluster network, retries on failure, and doesn’t depend on your machine staying connected. Download once into a PVC and mount that PVC in your workloads, rather than downloading in an initContainer on every Pod start.
apiVersion: batch/v1kind: Jobmetadata: name: data-import namespace: <tenant>-prodspec: template: spec: restartPolicy: OnFailure securityContext: runAsNonRoot: true runAsUser: 1000 runAsGroup: 1000 fsGroup: 1000 fsGroupChangePolicy: OnRootMismatch seccompProfile: type: RuntimeDefault containers: - name: import image: curlimages/curl:latest command: - sh - -c - "curl -fSL https://example.com/dataset.tar.gz | tar xz -C /data" securityContext: allowPrivilegeEscalation: false capabilities: drop: [ALL] volumeMounts: - name: data mountPath: /data volumes: - name: data persistentVolumeClaim: claimName: my-data- The
securityContextfields are required by PodSecurityrestricted. Without them the Job is created but its Pods are denied, and the error shows only in the Job’s events (kubectl describe job data-import). fsGroupmakes the fresh volume writable by the non-root user; see Mounting a PVC in a Pod.- Outbound traffic is not restricted by default. If you add an egress NetworkPolicy that selects these Pods, it must allow the source and DNS (a ports-only rule for UDP and TCP 53); see NetworkPolicy.
- For resource requests, deadlines and TTL cleanup, see Jobs and CronJobs.
rsync (large, resumable transfers)
Section titled “rsync (large, resumable transfers)”For large or unreliable transfers from your own machine, run an rsync daemon as a sidecar in the Pod that mounts the PVC and reach it with kubectl port-forward. You get resume, delta transfer and progress reporting. The sidecar must meet PodSecurity restricted like any other container. Ask RCS if you want help setting one up.
RWX volume from outside the cluster
Section titled “RWX volume from outside the cluster”A CephFS share stays in your Arbutus project, so a VM there can mount it at the same time as your Pods and move data in or out with no Kubernetes API in the path.
For a shared volume that RCS arranged, ask RCS whether its backing storage can also be mounted outside Kestrel. It isn’t available by default.