# This mounts the nfs volume claim into /mnt and continuously
# overwrites /mnt/index.html with the time and hostname of the pod.

apiVersion: v1
kind: ReplicationController
metadata:
  name: nfs-ubuntu
spec:
  replicas: 1
  selector:
    name: nfs-ubuntu
  template:
    metadata:
      labels:
        name: nfs-ubuntu
    spec:
      containers:
      - image: ubuntu:xenial
        command:
          - sh
          - -c
          - 'tail -f /dev/null'
        imagePullPolicy: IfNotPresent
        name: busybox
        volumeMounts:
          # name must match the volume name below
          - name: nfs
            mountPath: "/mnt/k8s"
          - name: nfs-byo
            mountPath: "/mnt/vm"
      volumes:
      - name: nfs
        persistentVolumeClaim:
          claimName: nfs
      - name: nfs-byo
        persistentVolumeClaim:
          claimName: nfs-byo
