-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create static_provisioning_with_shared_cache.yaml
Signed-off-by: Renan Magagnin <[email protected]>
- Loading branch information
1 parent
2ef1a6e
commit b922f6c
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
examples/kubernetes/static_provisioning/static_provisioning_with_shared_cache.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
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 |