apiVersion: v1
kind: Pod
metadata:
  name: sample-fsx-app
spec:
  containers:
  - name: app
    image: amazonlinux:2
    command: ["/bin/sh"]
    securityContext:
      privileged: true
    args: ["-c", "while true; do echo $(date -u) >> /data/out.txt; sleep 5; done"]
    lifecycle:
      postStart:
        exec:
          command: ["amazon-linux-extras", "install", "lustre2.10", "-y"]
    volumeMounts:
    - name: persistent-storage
      mountPath: /data
  nodeSelector:
    kubernetes.io/os: linux
    kubernetes.io/arch: amd64
  volumes:
  - name: persistent-storage
    persistentVolumeClaim:
      claimName: fsx-claim
