由于 efs 驱动程序问题,Jenkins 应用程序未启动
Jenkins application is not starting because of efs driver issue
我有一个由 2 个节点组成的 EKS 集群,它是通过以下命令创建的
time eksctl create cluster --name=eks-spinnaker --ssh-access=true --ssh-public-key=testkeyG --nodes=2 --region=ap-southeast-2 --write-kubeconfig=false
然后我通过 ssh 连接到两个新创建的 VM 并添加了 EFS,如下所示,这样我就可以将它用于 PersistenceVolume
sudo yum update -y
EFS_FILE_SYSTEM_DNS_NAME=fs-efb24ad7.efs.ap-southeast-2.amazonaws.com
sudo mkdir /efs-data
sudo mount -t nfs -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport $EFS_FILE_SYSTEM_DNS_NAME:/ /efs-data
df -Ph
cd /efs-data/
chmod -R 777 .
touch abc
我清楚地看到两个节点上的以下内容:
Node01
[ec2-user@ip-192-168-74-31 efs-data]$ df -Ph |grep -i efs
fs-efb24ad7.efs.ap-southeast-2.amazonaws.com:/ 8.0E 0 8.0E 0% /efs-data
[ec2-user@ip-192-168-74-31 efs-data]$
Node02
[ec2-user@ip-192-168-21-167 efs-data]$ df -Ph |grep -i efs
fs-efb24ad7.efs.ap-southeast-2.amazonaws.com:/ 8.0E 0 8.0E 0% /efs-data
[ec2-user@ip-192-168-21-167 efs-data]$
我现在正在启动我的 Jenkins 作为 k8s 部署,并将 /efs-data 用作 PV 但没有运气。
[centos@ip-10-0-0-61 storage]$ kubectl get pv,pvc -n jenkins
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
persistentvolume/efs-pv 5Gi RWX Retain Bound jenkins/efs-claim efs-sc 7h6m
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
persistentvolumeclaim/efs-claim Bound efs-pv 5Gi RWX efs-sc 7h6m
[centos@ip-10-0-0-61 storage]$
添加了 helm 仓库并安装了它
helm repo add jenkinsci https://charts.jenkins.io
helm install jenkins jenkinsci/jenkins --set rbac.create=true,master.servicePort=8081,master.serviceType=LoadBalancer,persistence.existingClaim=efs-claim -n jenkins
不幸的是,kubectl describe pods <od name> -n jenkins
没有给出任何问题的线索
kubectl describe pods jenkins-c7498bcdf-4jk9w -n jenkins
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedMount 26m (x6 over 117m) kubelet, ip-192-168-21-167.ap-southeast-2.compute.internal Unable to attach or mount volumes: unmounted volumes=[jenkins-home], unattached volumes=[plugin-dir jenkins-token-xgzf4 sc-config-volume tmp jenkins-home jenkins-config plugins]: timed out waiting for the condition
Warning FailedMount 17m (x8 over 110m) kubelet, ip-192-168-21-167.ap-southeast-2.compute.internal Unable to attach or mount volumes: unmounted volumes=[jenkins-home], unattached volumes=[plugins plugin-dir jenkins-token-xgzf4 sc-config-volume tmp jenkins-home jenkins-config]: timed out waiting for the condition
Warning FailedMount 6m12s (x11 over 128m) kubelet, ip-192-168-21-167.ap-southeast-2.compute.internal Unable to attach or mount volumes: unmounted volumes=[jenkins-home], unattached volumes=[tmp jenkins-home jenkins-config plugins plugin-dir jenkins-token-xgzf4 sc-config-volume]: timed out waiting for the condition
Warning FailedMount 110s (x72 over 132m) kubelet, ip-192-168-21-167.ap-southeast-2.compute.internal MountVolume.SetUp failed for volume "efs-pv" : kubernetes.io/csi: mounter.SetupAt failed: rpc error: code = Internal desc = Could not mount "fs-efb24ad7:/efs-data" at "/var/lib/kubelet/pods/66e53953-8678-404c-beb6-d21908cc8dee/volumes/kubernetes.io~csi/efs-pv/mount": mount failed: exit status 32
Mounting command: mount
Mounting arguments: -t efs fs-efb24ad7:/efs-data /var/lib/kubelet/pods/66e53953-8678-404c-beb6-d21908cc8dee/volumes/kubernetes.io~csi/efs-pv/mount
Output: mount.nfs4: mounting fs-efb24ad7.efs.ap-southeast-2.amazonaws.com:/efs-data failed, reason given by server: No such file or directory
所以,我在其中一个安装了 EFS 的 EKS 集群上使用 ssh,我也遇到了同样的错误
Sep 5 16:19:17 ip-192-168-21-167 kubelet: {"level":"info","ts":"2020-09-05T16:19:17.390Z","caller":"/usr/local/go/src/runtime/proc.go:203","msg":"CNI Plugin version: v1.6.3 ..."}
Sep 5 16:19:22 ip-192-168-21-167 kubelet: {"level":"info","ts":"2020-09-05T16:19:22.415Z","caller":"/usr/local/go/src/runtime/proc.go:203","msg":"CNI Plugin version: v1.6.3 ..."}
Sep 5 16:19:22 ip-192-168-21-167 su: (to root) ec2-user on pts/0
Sep 5 16:19:27 ip-192-168-21-167 kubelet: {"level":"info","ts":"2020-09-05T16:19:27.440Z","caller":"/usr/local/go/src/runtime/proc.go:203","msg":"CNI Plugin version: v1.6.3 ..."}
Sep 5 16:19:27 ip-192-168-21-167 kubelet: I0905 16:19:27.732162 3861 csi_attacher.go:310] kubernetes.io/csi: attacher.MountDevice STAGE_UNSTAGE_VOLUME capability not set. Skipping MountDevice...
Sep 5 16:19:27 ip-192-168-21-167 kubelet: I0905 16:19:27.732616 3861 operation_generator.go:587] MountVolume.MountDevice succeeded for volume "efs-pv" (UniqueName: "kubernetes.io/csi/efs.csi.aws.com^fs-efb24ad7:/efs-data") pod "jenkins-c7498bcdf-4jk9w" (UID: "66e53953-8678-404c-beb6-d21908cc8dee") device mount path "/var/lib/kubelet/plugins/kubernetes.io/csi/pv/efs-pv/globalmount"
Sep 5 16:19:29 ip-192-168-21-167 kubelet: E0905 16:19:29.715185 3861 nestedpendingoperations.go:301] Operation for "{volumeName:kubernetes.io/csi/efs.csi.aws.com^fs-efb24ad7:/efs-data podName: nodeName:}" failed. No retries permitted until 2020-09-05 16:21:31.715151408 +0000 UTC m=+86869.996160364 (durationBeforeRetry 2m2s). Error: "MountVolume.SetUp failed for volume \"efs-pv\" (UniqueName: \"kubernetes.io/csi/efs.csi.aws.com^fs-efb24ad7:/efs-data\") pod \"jenkins-c7498bcdf-4jk9w\" (UID: \"66e53953-8678-404c-beb6-d21908cc8dee\") : kubernetes.io/csi: mounter.SetupAt failed: rpc error: code = Internal desc = Could not mount \"fs-efb24ad7:/efs-data\" at \"/var/lib/kubelet/pods/66e53953-8678-404c-beb6-d21908cc8dee/volumes/kubernetes.io~csi/efs-pv/mount\": mount failed: exit status 32\nMounting command: mount\nMounting arguments: -t efs fs-efb24ad7:/efs-data /var/lib/kubelet/pods/66e53953-8678-404c-beb6-d21908cc8dee/volumes/kubernetes.io~csi/efs-pv/mount\nOutput: mount.nfs4: mounting fs-efb24ad7.efs.ap-southeast-2.amazonaws.com:/efs-data failed, reason given by server: No such file or directory\n"
Sep 5 16:19:32 ip-192-168-21-167 kubelet: {"level":"info","ts":"2020-09-05T16:19:32.458Z","caller":"/usr/local/go/src/runtime/proc.go:203","msg":"CNI Plugin version: v1.6.3 ..."}
Sep 5 16:19:35 ip-192-168-21-167 dhclient[2857]: XMT: Solicit on eth0, interval 111090ms.
Sep 5 16:19:37 ip-192-168-21-167 kubelet: {"level":"info","ts":"2020-09-05T16:19:37.477Z","caller":"/usr/local/go/src/runtime/proc.go:203","msg":"CNI Plugin version: v1.6.3 ..."}
/efs-data 的权限如下:
[root@ip-192-168-21-167 ~]# ls -ld /efs-data/
drwxrwxrwx 4 root root 6144 Sep 5 13:19 /efs-data/
[root@ip-192-168-21-167 ~]#
筋疲力尽...请让我知道问题是什么以及如何解决...
问题是 /efs-data
实际上并不存在于您的 EFS 驱动器中。 Jenkins 正在尝试挂载该目录(从日志输出):
-t efs fs-efb24ad7:/efs-data /var/lib/kubelet/pods/66e53953-8678-404c-beb6-d21908cc8dee/volumes/kubernetes.io~csi/efs-pv/mount
所以消息:
Output: mount.nfs4: mounting fs-efb24ad7.efs.ap-southeast-2.amazonaws.com:/efs-data failed, reason given by server: No such file or directory
正确。
当你运行:
sudo mount -t nfs -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport $EFS_FILE_SYSTEM_DNS_NAME:/ /efs-data
它实际上将 /
挂载到您的本地 /efs-data
目录,但那不是 EFS 目录。为此,您只需 运行:
cd /efs-data
mkdir efs-data
那么/efs-data
就会实际存在于EFS卷中
✌️
我有一个由 2 个节点组成的 EKS 集群,它是通过以下命令创建的
time eksctl create cluster --name=eks-spinnaker --ssh-access=true --ssh-public-key=testkeyG --nodes=2 --region=ap-southeast-2 --write-kubeconfig=false
然后我通过 ssh 连接到两个新创建的 VM 并添加了 EFS,如下所示,这样我就可以将它用于 PersistenceVolume
sudo yum update -y
EFS_FILE_SYSTEM_DNS_NAME=fs-efb24ad7.efs.ap-southeast-2.amazonaws.com
sudo mkdir /efs-data
sudo mount -t nfs -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport $EFS_FILE_SYSTEM_DNS_NAME:/ /efs-data
df -Ph
cd /efs-data/
chmod -R 777 .
touch abc
我清楚地看到两个节点上的以下内容: Node01
[ec2-user@ip-192-168-74-31 efs-data]$ df -Ph |grep -i efs
fs-efb24ad7.efs.ap-southeast-2.amazonaws.com:/ 8.0E 0 8.0E 0% /efs-data
[ec2-user@ip-192-168-74-31 efs-data]$
Node02
[ec2-user@ip-192-168-21-167 efs-data]$ df -Ph |grep -i efs
fs-efb24ad7.efs.ap-southeast-2.amazonaws.com:/ 8.0E 0 8.0E 0% /efs-data
[ec2-user@ip-192-168-21-167 efs-data]$
我现在正在启动我的 Jenkins 作为 k8s 部署,并将 /efs-data 用作 PV 但没有运气。
[centos@ip-10-0-0-61 storage]$ kubectl get pv,pvc -n jenkins
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
persistentvolume/efs-pv 5Gi RWX Retain Bound jenkins/efs-claim efs-sc 7h6m
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
persistentvolumeclaim/efs-claim Bound efs-pv 5Gi RWX efs-sc 7h6m
[centos@ip-10-0-0-61 storage]$
添加了 helm 仓库并安装了它
helm repo add jenkinsci https://charts.jenkins.io
helm install jenkins jenkinsci/jenkins --set rbac.create=true,master.servicePort=8081,master.serviceType=LoadBalancer,persistence.existingClaim=efs-claim -n jenkins
不幸的是,kubectl describe pods <od name> -n jenkins
没有给出任何问题的线索
kubectl describe pods jenkins-c7498bcdf-4jk9w -n jenkins
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedMount 26m (x6 over 117m) kubelet, ip-192-168-21-167.ap-southeast-2.compute.internal Unable to attach or mount volumes: unmounted volumes=[jenkins-home], unattached volumes=[plugin-dir jenkins-token-xgzf4 sc-config-volume tmp jenkins-home jenkins-config plugins]: timed out waiting for the condition
Warning FailedMount 17m (x8 over 110m) kubelet, ip-192-168-21-167.ap-southeast-2.compute.internal Unable to attach or mount volumes: unmounted volumes=[jenkins-home], unattached volumes=[plugins plugin-dir jenkins-token-xgzf4 sc-config-volume tmp jenkins-home jenkins-config]: timed out waiting for the condition
Warning FailedMount 6m12s (x11 over 128m) kubelet, ip-192-168-21-167.ap-southeast-2.compute.internal Unable to attach or mount volumes: unmounted volumes=[jenkins-home], unattached volumes=[tmp jenkins-home jenkins-config plugins plugin-dir jenkins-token-xgzf4 sc-config-volume]: timed out waiting for the condition
Warning FailedMount 110s (x72 over 132m) kubelet, ip-192-168-21-167.ap-southeast-2.compute.internal MountVolume.SetUp failed for volume "efs-pv" : kubernetes.io/csi: mounter.SetupAt failed: rpc error: code = Internal desc = Could not mount "fs-efb24ad7:/efs-data" at "/var/lib/kubelet/pods/66e53953-8678-404c-beb6-d21908cc8dee/volumes/kubernetes.io~csi/efs-pv/mount": mount failed: exit status 32
Mounting command: mount
Mounting arguments: -t efs fs-efb24ad7:/efs-data /var/lib/kubelet/pods/66e53953-8678-404c-beb6-d21908cc8dee/volumes/kubernetes.io~csi/efs-pv/mount
Output: mount.nfs4: mounting fs-efb24ad7.efs.ap-southeast-2.amazonaws.com:/efs-data failed, reason given by server: No such file or directory
所以,我在其中一个安装了 EFS 的 EKS 集群上使用 ssh,我也遇到了同样的错误
Sep 5 16:19:17 ip-192-168-21-167 kubelet: {"level":"info","ts":"2020-09-05T16:19:17.390Z","caller":"/usr/local/go/src/runtime/proc.go:203","msg":"CNI Plugin version: v1.6.3 ..."}
Sep 5 16:19:22 ip-192-168-21-167 kubelet: {"level":"info","ts":"2020-09-05T16:19:22.415Z","caller":"/usr/local/go/src/runtime/proc.go:203","msg":"CNI Plugin version: v1.6.3 ..."}
Sep 5 16:19:22 ip-192-168-21-167 su: (to root) ec2-user on pts/0
Sep 5 16:19:27 ip-192-168-21-167 kubelet: {"level":"info","ts":"2020-09-05T16:19:27.440Z","caller":"/usr/local/go/src/runtime/proc.go:203","msg":"CNI Plugin version: v1.6.3 ..."}
Sep 5 16:19:27 ip-192-168-21-167 kubelet: I0905 16:19:27.732162 3861 csi_attacher.go:310] kubernetes.io/csi: attacher.MountDevice STAGE_UNSTAGE_VOLUME capability not set. Skipping MountDevice...
Sep 5 16:19:27 ip-192-168-21-167 kubelet: I0905 16:19:27.732616 3861 operation_generator.go:587] MountVolume.MountDevice succeeded for volume "efs-pv" (UniqueName: "kubernetes.io/csi/efs.csi.aws.com^fs-efb24ad7:/efs-data") pod "jenkins-c7498bcdf-4jk9w" (UID: "66e53953-8678-404c-beb6-d21908cc8dee") device mount path "/var/lib/kubelet/plugins/kubernetes.io/csi/pv/efs-pv/globalmount"
Sep 5 16:19:29 ip-192-168-21-167 kubelet: E0905 16:19:29.715185 3861 nestedpendingoperations.go:301] Operation for "{volumeName:kubernetes.io/csi/efs.csi.aws.com^fs-efb24ad7:/efs-data podName: nodeName:}" failed. No retries permitted until 2020-09-05 16:21:31.715151408 +0000 UTC m=+86869.996160364 (durationBeforeRetry 2m2s). Error: "MountVolume.SetUp failed for volume \"efs-pv\" (UniqueName: \"kubernetes.io/csi/efs.csi.aws.com^fs-efb24ad7:/efs-data\") pod \"jenkins-c7498bcdf-4jk9w\" (UID: \"66e53953-8678-404c-beb6-d21908cc8dee\") : kubernetes.io/csi: mounter.SetupAt failed: rpc error: code = Internal desc = Could not mount \"fs-efb24ad7:/efs-data\" at \"/var/lib/kubelet/pods/66e53953-8678-404c-beb6-d21908cc8dee/volumes/kubernetes.io~csi/efs-pv/mount\": mount failed: exit status 32\nMounting command: mount\nMounting arguments: -t efs fs-efb24ad7:/efs-data /var/lib/kubelet/pods/66e53953-8678-404c-beb6-d21908cc8dee/volumes/kubernetes.io~csi/efs-pv/mount\nOutput: mount.nfs4: mounting fs-efb24ad7.efs.ap-southeast-2.amazonaws.com:/efs-data failed, reason given by server: No such file or directory\n"
Sep 5 16:19:32 ip-192-168-21-167 kubelet: {"level":"info","ts":"2020-09-05T16:19:32.458Z","caller":"/usr/local/go/src/runtime/proc.go:203","msg":"CNI Plugin version: v1.6.3 ..."}
Sep 5 16:19:35 ip-192-168-21-167 dhclient[2857]: XMT: Solicit on eth0, interval 111090ms.
Sep 5 16:19:37 ip-192-168-21-167 kubelet: {"level":"info","ts":"2020-09-05T16:19:37.477Z","caller":"/usr/local/go/src/runtime/proc.go:203","msg":"CNI Plugin version: v1.6.3 ..."}
/efs-data 的权限如下:
[root@ip-192-168-21-167 ~]# ls -ld /efs-data/
drwxrwxrwx 4 root root 6144 Sep 5 13:19 /efs-data/
[root@ip-192-168-21-167 ~]#
筋疲力尽...请让我知道问题是什么以及如何解决...
问题是 /efs-data
实际上并不存在于您的 EFS 驱动器中。 Jenkins 正在尝试挂载该目录(从日志输出):
-t efs fs-efb24ad7:/efs-data /var/lib/kubelet/pods/66e53953-8678-404c-beb6-d21908cc8dee/volumes/kubernetes.io~csi/efs-pv/mount
所以消息:
Output: mount.nfs4: mounting fs-efb24ad7.efs.ap-southeast-2.amazonaws.com:/efs-data failed, reason given by server: No such file or directory
正确。
当你运行:
sudo mount -t nfs -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport $EFS_FILE_SYSTEM_DNS_NAME:/ /efs-data
它实际上将 /
挂载到您的本地 /efs-data
目录,但那不是 EFS 目录。为此,您只需 运行:
cd /efs-data
mkdir efs-data
那么/efs-data
就会实际存在于EFS卷中
✌️