• DevOps未解决
  • 阿里云部署kubesphere后,添加devops组件,安装无法成功

阿里云部署kubesphere后,添加devops组件,安装无法成功

k8s环境:
kubectl version
Client Version: version.Info{Major:“1”, Minor:“18+”, GitVersion:“v1.18.8-aliyun.1”, GitCommit:“d2f5a0f”, GitTreeState:"", BuildDate:“2020-10-23T07:01:01Z”, GoVersion:“go1.13.15”, Compiler:“gc”, Platform:“linux/amd64”}
Server Version: version.Info{Major:“1”, Minor:“18+”, GitVersion:“v1.18.8-aliyun.1”, GitCommit:“d2f5a0f”, GitTreeState:"", BuildDate:“2020-10-23T06:48:31Z”, GoVersion:“go1.13.15”, Compiler:“gc”, Platform:“linux/amd64”}
[root@iZbp1inwk5hwifzoiuziacZ .kube]#

操作系统:
[root@iziacZ .kube]# cat /etc/redhat-release
Alibaba Cloud Linux (Aliyun Linux) release 2.1903 LTS (Hunting Beagle)

具体报错:

total: 7     completed:7
**************************************************

Task 'devops' failed:
******************************************************************************************************************************************************
{
  "counter": 110,
  "created": "2020-11-18T02:34:39.690807",
  "end_line": 109,
  "event": "runner_on_failed",
  "event_data": {
    "duration": 1.195336,
    "end": "2020-11-18T02:34:39.690523",
    "event_loop": null,
    "host": "localhost",
    "ignore_errors": null,
    "play": "localhost",
    "play_pattern": "localhost",
    "play_uuid": "0ad4314e-968b-acc8-d626-000000000005",
    "playbook": "/kubesphere/playbooks/devops.yaml",
    "playbook_uuid": "b0ec2c06-fa7b-4aa7-990b-4d562371f92b",
    "remote_addr": "127.0.0.1",
    "res": {
      "_ansible_no_log": false,
      "changed": true,
      "cmd": "/usr/local/bin/helm upgrade --install ks-jenkins /kubesphere/kubesphere/jenkins/jenkins -f /kubesphere/kubesphere/jenkins/custom-values-jenkins.yaml --namespace kubesphere-devops-system\n",
      "delta": "0:00:00.611492",
      "end": "2020-11-18 10:34:39.619204",
      "invocation": {
        "module_args": {
          "_raw_params": "/usr/local/bin/helm upgrade --install ks-jenkins /kubesphere/kubesphere/jenkins/jenkins -f /kubesphere/kubesphere/jenkins/custom-values-jenkins.yaml --namespace kubesphere-devops-system\n",
          "_uses_shell": true,
          "argv": null,
          "chdir": null,
          "creates": null,
          "executable": null,
          "removes": null,
          "stdin": null,
          "stdin_add_newline": true,
          "strip_empty_ends": true,
          "warn": true
        }
      },
      "msg": "non-zero return code",
      "rc": 1,
      "start": "2020-11-18 10:34:39.007712",
      "stderr": "coalesce.go:199: warning: destination for InitScripts is a table. Ignoring non-table value <nil>\nError: parse error at (jenkins/templates/config.yaml:223): unexpected EOF",
      "stderr_lines": [
        "coalesce.go:199: warning: destination for InitScripts is a table. Ignoring non-table value <nil>",
        "Error: parse error at (jenkins/templates/config.yaml:223): unexpected EOF"
      ],
      "stdout": "Release \"ks-jenkins\" does not exist. Installing it now.",
      "stdout_lines": [
        "Release \"ks-jenkins\" does not exist. Installing it now."
      ]
    },
    "role": "ks-devops/jenkins",
    "start": "2020-11-18T02:34:38.495187",
    "task": "Jenkins | Deploy Jenkins",
    "task_action": "command",
    "task_args": "",
    "task_path": "/kubesphere/installer/roles/ks-devops/jenkins/tasks/main.yaml:66",
    "task_uuid": "0ad4314e-968b-acc8-d626-00000000003a",
    "uuid": "e4ec2e63-b7d7-49fc-9368-5c2c9a18bae2"
  },
  "parent_uuid": "0ad4314e-968b-acc8-d626-00000000003a",
  "pid": 94717,
  "runner_ident": "devops",
  "start_line": 108,
  "stdout": "fatal: [localhost]: FAILED! => {\"changed\": true, \"cmd\": \"/usr/local/bin/helm upgrade --install ks-jenkins /kubesphere/kubesphere/jenkins/jenkins -f /kubesphere/kubesphere/jenkins/custom-values-jenkins.yaml --namespace kubesphere-devops-system\\n\", \"delta\": \"0:00:00.611492\", \"end\": \"2020-11-18 10:34:39.619204\", \"msg\": \"non-zero return code\", \"rc\": 1, \"start\": \"2020-11-18 10:34:39.007712\", \"stderr\": \"coalesce.go:199: warning: destination for InitScripts is a table. Ignoring non-table value <nil>\\nError: parse error at (jenkins/templates/config.yaml:223): unexpected EOF\", \"stderr_lines\": [\"coalesce.go:199: warning: destination for InitScripts is a table. Ignoring non-table value <nil>\", \"Error: parse error at (jenkins/templates/config.yaml:223): unexpected EOF\"], \"stdout\": \"Release \\\"ks-jenkins\\\" does not exist. Installing it now.\", \"stdout_lines\": [\"Release \\\"ks-jenkins\\\" does not exist. Installing it now.\"]}",
  "uuid": "e4ec2e63-b7d7-49fc-9368-5c2c9a18bae2"

更换k8s版本和操作系统版本,还是同样的问题
k8s环境:
Client Version: version.Info{Major:“1”, Minor:“16+”, GitVersion:“v1.16.9-aliyun.1”, GitCommit:“384801d”, GitTreeState:"", BuildDate:“2020-09-25T02:58:25Z”, GoVersion:“go1.13.9”, Compiler:“gc”, Platform:“linux/amd64”}
Server Version: version.Info{Major:“1”, Minor:“16+”, GitVersion:“v1.16.9-aliyun.1”, GitCommit:“4f7ea78”, GitTreeState:"", BuildDate:“2020-05-08T07:29:59Z”, GoVersion:“go1.13.9”, Compiler:“gc”, Platform:“linux/amd64”}

操作系统:
[root@iZbZ .kube]# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)

您好,可否进入ks-installer 容器 手动执行一下 ansible-playbook playbook/devops.yaml看一下日志?

    RolandMa1986
    具体报错内容:
    TASK [ks-devops/jenkins : Jenkins | Deploy Jenkins] ****************************************************************************************************************************************************************************************
    fatal: [localhost]: FAILED! => {“changed”: true, “cmd”: “/usr/local/bin/helm upgrade –install ks-jenkins /kubesphere/kubesphere/jenkins/jenkins -f /kubesphere/kubesphere/jenkins/custom-values-jenkins.yaml –namespace kubesphere-devops-system\n”, “delta”: “0:00:00.318379”, “end”: “2020-11-19 09:54:22.665566”, “msg”: “non-zero return code”, “rc”: 1, “start”: “2020-11-19 09:54:22.347187”, “stderr”: “coalesce.go:199: warning: destination for InitScripts is a table. Ignoring non-table value <nil>\nError: parse error at (jenkins/templates/config.yaml:223): unexpected EOF”, “stderr_lines”: [“coalesce.go:199: warning: destination for InitScripts is a table. Ignoring non-table value <nil>”, “Error: parse error at (jenkins/templates/config.yaml:223): unexpected EOF”], “stdout”: "Release \“ks-jenkins\” does not exist. Installing it now.", “stdout_lines”: ["Release \“ks-jenkins\” does not exist. Installing it now."]}

    PLAY RECAP *********************************************************************************************************************************************************************************************************************************
    localhost : ok=14 changed=9 unreachable=0 failed=1 skipped=14 rescued=0 ignored=0

      mycolo1983 麻烦你进入ks-installer 的容器,然后把kubesphere/jenkins 文件夹下的custom-values-jenkins.yaml copy出来。我们可以试一下能能不能本地重现

        mycolo1983

        我试了下,应该是用了ks-installer的latest版本, 可以换成v3.0.0的版本试试,v3.0.0应该没有这个问题。

        kubectl -n kubesphere-system set image deploy/ks-installer ks-installer=kubespehre/ks-installer:v3.0.0
        kubectl -n kubesphere-controls-system set image deploy/kubectl-admin kubectl=kubesphere/kubectl:v1.0.0

        再修改一下配置文件中的 kubectlImage, 重启ks-controller-manager

        kubectl -n kubesphere-system edit cm kubesphere-config
        kubectl -n kubesphere-system rollout restart deploy/ks-controller-manager

          @Rick 需要关注下这个问题,可能是改了 jenkins 部署方式导致的,master 分支

          @shaowenchen 没有latest版本呀

          docker pull kubesphere/ks-installer
          Using default tag: latest
          Error response from daemon: manifest for kubesphere/ks-installer:latest not found: manifest unknown: manifest unknown

          @mycolo1983 你看下 ks-installer 的镜像用的那个

            Rick
            [root@iZ .kube]# docker images | grep installer
            kubespheredev/ks-installer latest a66a9ca1e5e2 2 days ago 732MB
            kubesphere/ks-installer v3.0.0 2654183985d6 2 weeks ago 692MB
            [root@iZbp1gkh8uqa5jd42kfhunZ .kube]#

            Rick kubespheredev 下面的,合并代码之后,ci 马上就推送了镜像

            mycolo1983 收到,谢谢 阿里云ACK的那篇文章使用的是开发版的yaml文件,文档需要更新一下了~

              4 年 后

              Rick 大佬,我也遇到这个问题了。我本身的ks-installer的镜像版本是3.3.2。我按照这个帖子说的,把ks-installer的镜像换成3.0.0, 还是不可以。我的kubesphere的版本是3.3.2。