apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: cephfs-demo
    role: busybox
  name: cephfs-busybox
  namespace: default
spec:
  replicas: 2
  selector:
    matchLabels:
      app: cephfs-demo
      role: busybox
  template:
    metadata:
      labels:
        app: cephfs-demo
        role: busybox
    spec:
      containers:
        - image: busybox
          command:
            - sh
            - -c
            - "while true; do date >> /mnt/index.html; hostname >> /mnt/index.html; sleep $(($RANDOM % 5 + 5)); echo $'\n' ; done"
          imagePullPolicy: IfNotPresent
          name: busybox
          volumeMounts:
            # name must match the volume name below
            - name: cephfs
              mountPath: "/mnt"
      volumes:
        - name: cephfs
          persistentVolumeClaim:
            claimName: cephfs-pvc