Chose Elastic File Storage over EBS (Elastic Block Storage) because the latter can only be mounted into a single node. This adds the RBAC config and deployment for managing EFS mounts within the cluster. Largely depends on this efs-provisioner config: https://github.com/kubernetes-incubator/external-storage/tree/master/aws/efs The config has been hard-copied into the repo and updated for future reference. Note that the config requires an environment variable substitution and cannot be applied directly to the cluster.
81 lines
2.0 KiB
YAML
81 lines
2.0 KiB
YAML
# from https://github.com/kubernetes-incubator/external-storage/blob/master/aws/efs/deploy/manifest.yaml
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: efs-provisioner
|
|
data:
|
|
file.system.id: $EFSID
|
|
aws.region: us-east-2
|
|
provisioner.name: example.com/aws-efs
|
|
dns.name: $EFSID.efs.us-east-2.amazonaws.com
|
|
---
|
|
kind: Deployment
|
|
apiVersion: extensions/v1beta1
|
|
metadata:
|
|
name: efs-provisioner
|
|
spec:
|
|
replicas: 1
|
|
strategy:
|
|
type: Recreate
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: efs-provisioner
|
|
spec:
|
|
serviceAccountName: efs-provisioner
|
|
containers:
|
|
- name: efs-provisioner
|
|
image: quay.io/external_storage/efs-provisioner:latest
|
|
env:
|
|
- name: FILE_SYSTEM_ID
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: efs-provisioner
|
|
key: file.system.id
|
|
- name: AWS_REGION
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: efs-provisioner
|
|
key: aws.region
|
|
- name: DNS_NAME
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: efs-provisioner
|
|
key: dns.name
|
|
optional: true
|
|
- name: PROVISIONER_NAME
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: efs-provisioner
|
|
key: provisioner.name
|
|
volumeMounts:
|
|
- name: pv-volume
|
|
mountPath: /persistentvolumes
|
|
volumes:
|
|
- name: pv-volume
|
|
nfs:
|
|
server: $EFSID.efs.us-east-2.amazonaws.com
|
|
path: /
|
|
---
|
|
kind: StorageClass
|
|
apiVersion: storage.k8s.io/v1
|
|
metadata:
|
|
name: aws-efs
|
|
provisioner: example.com/aws-efs
|
|
---
|
|
kind: PersistentVolumeClaim
|
|
apiVersion: v1
|
|
metadata:
|
|
name: efs
|
|
annotations:
|
|
volume.beta.kubernetes.io/storage-class: "aws-efs"
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteMany
|
|
storageClassName: aws-efs
|
|
resources:
|
|
requests:
|
|
storage: 1Mi
|
|
---
|