Jenkinsci/Jenkins helm chart - jenkins 容器停留在开始从 war 文件中提取

Jenkinsci/Jenkins helm chart - jenkins container stucks at Beginning extraction from war file

我正在尝试使用持久卷将 jenkins 部署到 IBM Cloud Kubernetes Service。 Jenkins 容器卡在 Beginning extraction from war file

我试过没有持久化并且它按预期部署了。

persistence:
  storageClass: ibmc-file-bronze
serviceAccount:
  create: false
  name: jenkins
  annotations: {}
controller:
  customInitContainers:
    - name: "volume-mount-permission"
      image: "busybox"
      command: ["/bin/sh"]
      args:
      - -c
      - >-
          chgrp -R 1000 /var/jenkins_home && 
          chown -R 0 /var/jenkins_home &&
          chmod -R g+rwx /var/jenkins_home
      volumeMounts:
        - name: "jenkins-home"
          mountPath: "/var/jenkins_home"
      securityContext:
        runAsUser: 0
  serviceType: NodePort

这是我的 values.yaml 文件。我为文件夹权限配置了一个自定义初始化容器。没有这个,init 容器会因权限问题而失败。使用 volume-mount-permissions init 容器,所有其他容器都会成功终止。

jenkins_home 文件夹的权限如下。

jenkins@jenkins-pv-0:/$ ls -al /var/jenkins_home/
total 44
drwxrwxr-x 6 nobody  jenkins  4096 Nov 26 15:02 .
drwxr-xr-x 1 root    root     4096 Nov 26 15:01 ..
drwxr-xr-x 3 jenkins jenkins  4096 Nov 26 14:50 .cache
drwxrwsrwx 2 root    jenkins  4096 Nov 26 14:50 casc_configs
-rw-r--r-- 1 jenkins jenkins  3106 Nov 26 15:01 copy_reference_file.log
-rw-r--r-- 1 jenkins jenkins     8 Nov 26 14:50 jenkins.install.InstallUtil.lastExecVersion
-rw-r--r-- 1 jenkins jenkins     8 Nov 26 14:50 jenkins.install.UpgradeWizard.state
drwxr-xr-x 2 jenkins jenkins 16384 Nov 26 14:51 plugins
-rw-r--r-- 1 jenkins jenkins    78 Nov 26 14:50 plugins.txt
drwxr-xr-x 6 jenkins jenkins  4096 Nov 26 15:02 war

Jenkins容器的日志如下:

2020-11-26T15:01:49.195430822Z Running from: /usr/share/jenkins/jenkins.war
2020-11-26T15:01:49.199519383Z webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
2020-11-26T15:01:49.404752124Z 2020-11-26 15:01:49.388+0000 [id=1]  INFO    org.eclipse.jetty.util.log.Log#initialized: Logging initialized @522ms to org.eclipse.jetty.util.log.JavaUtilLog
2020-11-26T15:01:49.585199893Z 2020-11-26 15:01:49.584+0000 [id=1]  INFO    winstone.Logger#logInternal: Beginning extraction from war file

我遵循了 Jenkins official Kubernetes installation 的安装指南。

解决方案是安装 IBM Cloud Block Storage plug-in

在 IBM Cloud Kubernetes Service 上,我认为,Jenkins 无法安装在 file-storage