Skip to content

Commit

Permalink
Create static_provisioning_with_shared_cache.yaml (#356)
Browse files Browse the repository at this point in the history
Resolves #330

Creation of a new example including shared cache usage and based on the
existing `static_provisioning.yaml`.

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

---------

Signed-off-by: Renan Magagnin <[email protected]>
  • Loading branch information
renanmagagnin authored Jan 24, 2025
1 parent 2ef1a6e commit 6855491
Showing 1 changed file with 53 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: s3-pv
spec:
capacity:
storage: 1200Gi # Ignored, required
accessModes:
- ReadWriteMany # Supported options: ReadWriteMany / ReadOnlyMany
storageClassName: "" # Required for static provisioning
claimRef: # To ensure no other PVCs can claim this PV
namespace: default # Namespace is required even though it's in "default" namespace.
name: s3-pvc # Name of your PVC
mountOptions:
- allow-delete
- region us-west-2
- cache-xz s3-csi-driver--usw2-az1--x-s3 # Must be an Express One Zone bucket. More information: https://github.com/awslabs/mountpoint-s3/blob/main/doc/CONFIGURATION.md#shared-cache
csi:
driver: s3.csi.aws.com # Required
volumeHandle: s3-csi-driver-volume
volumeAttributes:
bucketName: s3-csi-driver
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: s3-pvc
spec:
accessModes:
- ReadWriteMany # Supported options: ReadWriteMany / ReadOnlyMany
storageClassName: "" # Required for static provisioning
resources:
requests:
storage: 1200Gi # Ignored, required
volumeName: s3-pv # Name of your PV
---
apiVersion: v1
kind: Pod
metadata:
name: s3-app
spec:
containers:
- name: app
image: centos
command: ["/bin/sh"]
args: ["-c", "echo 'Hello from the container!' >> /data/$(date -u).txt; echo 'Shared cache test' >> /data/shared_cache_test.txt; cat /data/shared_cache_test.txt; tail -f /dev/null"]
volumeMounts:
- name: persistent-storage
mountPath: /data
volumes:
- name: persistent-storage
persistentVolumeClaim:
claimName: s3-pvc

0 comments on commit 6855491

Please sign in to comment.