由于efs驱动程序问题,Jenkins应用程序无法启动

如何解决由于efs驱动程序问题,Jenkins应用程序无法启动

我有一个由以下命令创建的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 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,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,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","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","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","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","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卷中。

✌️

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-