I'm new to kubernetes and was able to set up EFS on my pods very easily, how ever I do have some questions. I will be updating the aws/efs documentation in an upcoming PR and this will be a FAQ at the end. Some of the questions might stem from my lack of knowledge with kubernetes.
I noticed the AWS EFS gets mounted to the efs-provisioner container directly. What happens when that pod goes down?
Why shouldn't we just mount the EFS directly to our apps? Why use the PVC's?
Can you run multiple pods for HA? Will that work?
What is best practice? Should I use multiple claims on 1 EFS to serve all my pods? Or multiple EFS drives with multiple efs-provisioner deployments/configmaps to server seperate pods?
Can I put my files in the root of the EFS?
Can I automate making the /persistentvolumes directory some how?
On some guides on the internet using PV's that come out of the box, I noticed some people would create a claim directly to the PV with out a StorageClass.
I have a claim of 5Mi but I wrote 20Gb's to it.
You can do that, it's just that using PVCs is the general "recommended" way of consuming storage. Typically only admins have permissions to specify volumes directly in pods whereas users should ideally be forced to go through the PVC->PV workflow to be made subject to certain quotas, StorageClasses, etc. So most of the work being done in Kubernetes storage (e.g. mount options which only work when using PVs) assumes people will be familiar with & use PVCs.
That said, only admins should have permission to create an EFS provisioner instance so it really doesn't matter in this case.
Thanks @wongma7 I will have a PR this weekend for you =)
I followed the guide to set up EFS storage for one deployment (prometheus), so for my next 2 deployments (different apps) I can make new claims but with different names, and reference the same storage class? This will create new "PVC" directories on my EFS but all three apps will be on the same EFS system but not be able to see each others files?
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: app3
annotations:
volume.beta.kubernetes.io/storage-class: "aws-efs"
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5Mi
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: app2
annotations:
volume.beta.kubernetes.io/storage-class: "aws-efs"
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5Mi
Yes, that's correct.
On Thu, Jul 13, 2017 at 5:32 PM, Levi Blaney notifications@github.com
wrote:
Thanks @wongma7 https://github.com/wongma7 I will have a PR this
weekend for you =)I followed the guide to set up EFS storage for one deployment
(prometheus), so for my next 2 deployments (different apps) I can make new
claims but with different names, and reference the same storage class? This
will create new "PVC" directories on my EFS but all three apps will be on
the same EFS system but not be able to see each others files?kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: app3
annotations:
volume.beta.kubernetes.io/storage-class: "aws-efs"
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5Mikind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: app2
annotations:
volume.beta.kubernetes.io/storage-class: "aws-efs"
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5Mi—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/kubernetes-incubator/external-storage/issues/241#issuecomment-315208197,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AMgP-CE9tniPDoRcMXSMxrFMnTw7lADlks5sNo0JgaJpZM4OXfis
.
re: 7
You can kinda "automate" the create of the folder. In fact you don't need to create the folder. you can just set the path on the pv-volume to / and in the mountPath use /persistentvolumes . Like this:
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: efs-provisioner
namespace: kube-system
spec:
replicas: 1
strategy:
type: Recreate
template:
metadata:
labels:
app: efs-provisioner
spec:
containers:
- name: efs-provisioner
image: quay.io/external_storage/efs-provisioner:v0.1.0
env:
- name: PROVISIONER_NAME
value: "aws-efs"
- name: FILE_SYSTEM_ID
valueFrom:
configMapKeyRef:
name: efs-provisioner
key: file.system.id
- name: AWS_REGION
valueFrom:
configMapKeyRef:
name: efs-provisioner
key: aws.region
volumeMounts:
- name: pv-volume
mountPath: /persistentvolumes
volumes:
- name: pv-volume
nfs:
server: {{ efs_file_system_id }}.efs.{{ aws_region }}.amazonaws.com
path: /
Can we specify where we can pass mountOptions?
@bhack try storageclass.mountoptions, may need to update your efs-provisioner image
@bhack actually mount options is not implemented yet, creating new issue https://github.com/kubernetes-incubator/external-storage/issues/810
Regarding question no.9. I'm using EKS cluster, so eks worker node being separated AZ, using EBS volume for EBS PV is not a good way. Is there any idea to limited storage with efs-provisioner?
re 6, I've noticed efs-provisioner creates an directory (with pv id as the name) on the root directory of the efs volume. Could you give more details on how to put files on the root directory instead of the sub-directory?
Most helpful comment
re: 7
You can kinda "automate" the create of the folder. In fact you don't need to create the folder. you can just set the path on the pv-volume to
/and in the mountPath use/persistentvolumes. Like this: