kubernetes pod with s3 object mount in container

1/9/2019

Team, I need to create a pod spec that mounts s3 folder on to container and performs cat command on the file on that mount.

is my below approach right? Because what i don't get is where do i specify the destination mount point? i know the source mount point is s3 but not sure how to use it in pod.yaml below.

---
apiVersion: v1
kind: Pod
metadata:
  name: test-pod-s3-mount-and-cat-file
  namespace: test-space
spec:
  containers:
  - name: main
  image:
  mountPath: s3://aws-s3-folder-test/files/
  command: ["bash"]
  args: ["-xc",  "cat aws-s3-folder-test/files/test.txt "]
  resources:
    requests:
      cpu: "1"
      memory: 1Gi
      domain.com/gpu: "1"
     limits:
       cpu: "20"
       memory: 4Gi
       domain.com/gpu: "1"
imagePullSecrets:
- name: "awsecr-cred" 
nodeSelector:
  kubernetes.io/hostname: node1
-- AhmFM
amazon-s3
kubernetes
kubernetes-pod

0 Answers