-
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 (#356)
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
1 parent
2ef1a6e
commit 6855491
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 # 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 |