-
Notifications
You must be signed in to change notification settings - Fork 31
/
pod_level_identity.yaml
87 lines (87 loc) · 2.02 KB
/
pod_level_identity.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
apiVersion: v1
kind: PersistentVolume
metadata:
name: s3-pv
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteMany
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
csi:
driver: s3.csi.aws.com
volumeHandle: s3-csi-driver-volume
volumeAttributes:
bucketName: amzn-s3-demo-bucket
authenticationSource: pod
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: s3-pvc
spec:
accessModes:
- ReadWriteMany # Supported options: ReadWriteMany / ReadOnlyMany
storageClassName: "" # Required for static provisioning
resources:
requests:
storage: 1Gi
volumeName: s3-pv # Name of your PV
---
apiVersion: v1
kind: Pod
metadata:
name: busybox-admin-pod-level
spec:
serviceAccountName: s3-csi-admin-sa
containers:
- name: busybox
image: busybox
command: ["sleep", "infinity"]
volumeMounts:
- mountPath: "/data"
name: persistent-storage
volumes:
- name: persistent-storage
persistentVolumeClaim:
claimName: s3-pvc
---
apiVersion: v1
kind: Pod
metadata:
name: busybox-read-only-pod-level
spec:
serviceAccountName: s3-csi-read-only-sa
containers:
- name: busybox
image: busybox
command: ["sleep", "infinity"]
volumeMounts:
- mountPath: "/data"
name: persistent-storage
volumes:
- name: persistent-storage
persistentVolumeClaim:
claimName: s3-pvc
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: s3-csi-admin-sa
labels:
app.kubernetes.io/name: aws-mountpoint-s3-csi-driver
annotations:
eks.amazonaws.com/role-arn: "arn:aws:iam::<user_id>:role/Admin"
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: s3-csi-read-only-sa
annotations:
eks.amazonaws.com/role-arn: "arn:aws:iam::<user_id>:role/ReadOnly"