apiVersion: batch/v1
kind: Job
metadata:
  name: app-image-rsync
spec:
  template:
    metadata:
      name: app-image-rsync
    spec:
      containers:
        - image: "registry.ng.bluemix.net/alexanderallen/app-image:latest"
          name: app-sidecar
          imagePullPolicy: IfNotPresent
          env:
            # Location inside the application image containing desired code.
            - name: RSYNC_SOURCE
              value: /app
            # Shared volume where to copy the data to (could be emptyDir, PV/NFS, etc.).
            - name: RSYNC_DEST
              value: /www/app
          volumeMounts:

            - mountPath: /www
              name: sites-local-storage
              readOnly: false

            - mountPath: /www-data
              name: shared-volume
              readOnly: false

            # Development.
            - mountPath: /root/app-sync.sh
              name: sites-local-storage
              subPath: nginx-php-container-cluster/k8-minikube/build/app-image/app-sync.sh

      restartPolicy: Never

      volumes:
        -
          name: sites-local-storage
          persistentVolumeClaim:
            claimName: local-sites-claim

        # Ephemeral tmpfs (ramdisk) volume for sharing code.
        - name: shared-volume
          emptyDir: {}
#  backoffLimit: 1

Add App image rsync job.
Add App image rsync job.
