My goal is to attach a dynamic volume claim to a deployment on EKS cluster, I am using this tutorial
https://aws.amazon.com/blogs/storage/persistent-storage-for-kubernetes/
My manifests are storage class, volume claim and a deployment : ( Same as from tutorial)
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: efs-sc
provisioner: efs.csi.aws.com
parameters:
provisioningMode: efs-ap
fileSystemId: fs-XXXX
directoryPerms: "700"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: efs-claim-1
spec:
accessModes:
- ReadWriteMany
storageClassName: efs-sc
resources:
requests:
storage: 5Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
name: debug-app
spec:
replicas: 1
selector:
matchLabels:
component: debug-app
template:
metadata:
labels:
app: debug-app
component: debug-app
spec:
containers:
- image: ubuntu:20.04
imagePullPolicy: IfNotPresent
name: debug-app
command: ["/bin/sh","-c"]
args:
- sleep 3650d
#command: ["/bin/sh","-c", "sleep 365d"]
ports:
- containerPort: 8000
resources:
limits:
cpu: 2
memory: 4Gi
requests:
cpu: 10m
memory: 16Mi
volumeMounts:
- name: persistent-storage
mountPath: /data
volumes:
- name: persistent-storage
persistentVolumeClaim:
claimName: efs-claim-1
Storage class is well created, but
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
efs-sc efs.csi.aws.com Delete Immediate false 5m17s
persistent volume claim is on pending
state with the following description
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ExternalProvisioning 2m18s (x17 over 6m18s) persistentvolume-controller waiting for a volume to be created, either by external provisioner "efs.csi.aws.com" or manually created by system administrator
It’s clear the efs storage can’t create the persisted volume, I went back and tried with newly created efs storage following
https://docs.aws.amazon.com/eks/latest/userguide/efs-csi.html
But the same issue persisted,
Any possible fixes here please?
Thanks
PS: Just mentioning here, I’m using no Fargate Profile
2
Answers
Well, I checked the csi driver installation on namespace
kube-system
, which had anImagePullBack
error,The tutorial https://docs.aws.amazon.com/eks/latest/userguide/efs-csi.html#efs-install-driver is mentionning an image
eks/aws-efs-csi-driver
, which doesn't exist.The correct image name from docker hub is
amazon/aws-efs-csi-driver
https://hub.docker.com/r/amazon/aws-efs-csi-driverI pushed this image to my repository, then re-installed csi driver with helm:
Now, volume is well attached and all is good, Thanks,
But you didn’t install the driver. Hence you get
...waiting for a volume to be created, either by external provisioner "efs.csi.aws.com"
.