Created
December 7, 2023 02:39
-
-
Save hustshawn/5179e62efb2fe3d62ea3d41c72332828 to your computer and use it in GitHub Desktop.
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
--- | |
apiVersion: v1 | |
kind: PersistentVolume | |
metadata: | |
name: s3-express-pv | |
spec: | |
capacity: | |
storage: 100Gi # ignored, required | |
accessModes: | |
- ReadWriteMany # supported options: ReadWriteMany / ReadOnlyMany | |
mountOptions: | |
- allow-delete | |
- region us-east-1 | |
csi: | |
driver: s3.csi.aws.com # required | |
volumeHandle: s3-csi-driver-volume | |
volumeAttributes: | |
bucketName: s3-express-us-east-1a--use1-az4--x-s3 | |
--- | |
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: s3-express-claim | |
spec: | |
accessModes: | |
- ReadWriteMany # supported options: ReadWriteMany / ReadOnlyMany | |
storageClassName: "" # required for static provisioning | |
resources: | |
requests: | |
storage: 100Gi # ignored, required | |
volumeName: s3-express-pv | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: s3-express-app | |
spec: | |
selector: | |
matchLabels: | |
name: s3-express-app | |
template: | |
metadata: | |
labels: | |
name: s3-express-app | |
spec: | |
affinity: | |
nodeAffinity: | |
requiredDuringSchedulingIgnoredDuringExecution: | |
nodeSelectorTerms: | |
- matchExpressions: | |
- key: topology.kubernetes.io/zone | |
operator: In | |
values: | |
- us-east-1a # specify az where bucket lives, note: the code of the availability zone (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html) must be used here (the AZ ID won't work) | |
containers: | |
- name: app | |
image: nginx:latest | |
command: ["/bin/sh"] | |
args: ["-c", "echo 'Hello from the container!' >> /data/$(date -u).txt; tail -f /dev/null"] | |
volumeMounts: | |
- name: persistent-storage | |
mountPath: /data | |
volumes: | |
- name: persistent-storage | |
persistentVolumeClaim: | |
claimName: s3-express-claim | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment