Access S3 bucket without running aws configure with kubernetes Access S3 bucket without running aws configure with kubernetes kubernetes kubernetes

Access S3 bucket without running aws configure with kubernetes


I think you should consider mounting S3 bucket inside the pod.

This can be achieved by for example s3fs-fuse.

There are two nice articled about Mounting a S3 bucket inside a Kubernetes pod and Kubernetes shared storage with S3 backend, I do recommend reading both to understand how this works.

You basically have to build your own image from Dockerfile and supply necessary S3 bucket info and AWS security credentials.

Once you have the storage mounted you will be able to call scripts from it in a following way:

apiVersion: v1kind: Podmetadata:  name: test-worldspec:  # specification of the pod’s contents  restartPolicy: Never  containers:  - name: hello    image: debian    command: ["/bin/sh","-c"]    args: ["command one; command two && command three"]