This example shows how to make a static provisioned Mountpoint for S3 persistent volume (PV) mounted inside container.
static_provisioning.yaml
- spawning a pod which creates a file with name as the current date/timenon_root.yaml
- same as above, but the pod is spawned as non-root (uid1000
, gid2000
)s3_express_specify_az.yaml
- same as above, but this uses a S3 Express One Zone directory bucket and shows how to specify the availability zone (AZ) of the persistent volume to co-locate the pods with the bucket for lower latency accessmultiple_buckets_one_pod.yaml
- same as above, with multiple buckets mounted in one pod. Note: when mounting multiple buckets in the same pod, thevolumeHandle
must be unique as specified in the CSI documentation.
Edit Persistent Volume
Note: This example assumes your S3 bucket has already been created. If you need to create a bucket, follow the S3 documentation for a general purpose bucket or the S3 Express One Zone documentation for a directory bucket.
- Bucket name (required):
PersistentVolume -> csi -> volumeAttributes -> bucketName
- Bucket region (if bucket and cluster are in different regions):
PersistentVolume -> csi -> mountOptions
- Mountpoint configurations can be added in the
mountOptions
of the Persistent Volume spec.
kubectl apply -f examples/kubernetes/static_provisioning/static_provisioning.yaml
kubectl get pod s3-app
$ aws s3 ls <bucket_name>
> 2023-09-18 17:36:17 26 Mon Sep 18 17:36:14 UTC 2023.txt
kubectl delete -f examples/kubernetes/static_provisioning/static_provisioning.yaml