创建部署问题时,请参考下面模板,你提供的信息越多,越容易及时获得解答。如果未按模板创建问题,管理员有权关闭问题。
确保帖子格式清晰易读,用 markdown code block 语法格式化代码块。
你只花一分钟创建的问题,不能指望别人花上半个小时给你解答。

操作系统信息
虚拟机Ubuntu22.04,4C/8G

Kubernetes版本信息
Client Version: v1.28.7+k3s1

Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3

Server Version: v1.28.7+k3s1

容器运行时
Version: 0.1.0

RuntimeName: containerd

RuntimeVersion: v1.7.11-k3s2

RuntimeApiVersion: v1

KubeSphere版本信息

v3.4.1。在线安装。在已有K8s上安装。

问题是什么

在已安装ArgoCD 2.10.5的情况下,在KubeSphere启用DevOps,通过如下命令查看安装日志,发现安装失败

kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l 'app in (ks-install, ks-installer)' -o jsonpath='{.items[0].metadata.name}') -f

这是日志中的报错

Task 'devops' failed:
******************************************************************************************************************************************************
{
  "counter": 141,
  "created": "2024-04-18T10:17:06.363418",
  "end_line": 171,
  "event": "runner_on_failed",
  "event_data": {
    "duration": 48.710853,
    "end": "2024-04-18T10:17:06.363273",
    "event_loop": null,
    "host": "localhost",
    "ignore_errors": null,
    "play": "localhost",
    "play_pattern": "localhost",
    "play_uuid": "fec67b4d-df19-7429-19c8-000000000005",
    "playbook": "/kubesphere/playbooks/devops.yaml",
    "playbook_uuid": "72ca6e88-890b-4078-a48d-46f427392264",
    "remote_addr": "127.0.0.1",
    "res": {
      "_ansible_no_log": false,
      "attempts": 3,
      "changed": true,
      "cmd": "/usr/local/bin/helm upgrade --install devops /kubesphere/kubesphere/ks-devops/charts/argo-cd-4.4.0.tgz -n argocd --create-namespace --reuse-values -f /kubesphere/kubesphere/ks-devops/argo-cd-values.yaml\n",
      "delta": "0:00:04.501670",
      "end": "2024-04-18 18:17:06.262785",
      "invocation": {
        "module_args": {
          "_raw_params": "/usr/local/bin/helm upgrade --install devops /kubesphere/kubesphere/ks-devops/charts/argo-cd-4.4.0.tgz -n argocd --create-namespace --reuse-values -f /kubesphere/kubesphere/ks-devops/argo-cd-values.yaml\n",
          "_uses_shell": true,
          "argv": null,
          "chdir": null,
          "creates": null,
          "executable": "/bin/bash",
          "removes": null,
          "stdin": null,
          "stdin_add_newline": true,
          "strip_empty_ends": true,
          "warn": true
        }
      },
      "msg": "non-zero return code",
      "rc": 1,
      "start": "2024-04-18 18:17:01.761115",
      "stderr": "Error: rendered manifests contain a resource that already exists. Unable to continue with install: ServiceAccount \"argocd-application-controller\" in namespace \"argocd\" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key \"app.kubernetes.io/managed-by\": must be set to \"Helm\"; annotation validation error: missing key \"meta.helm.sh/release-name\": must be set to \"devops\"; annotation validation error: missing key \"meta.helm.sh/release-namespace\": must be set to \"argocd\"",
      "stderr_lines": [
        "Error: rendered manifests contain a resource that already exists. Unable to continue with install: ServiceAccount \"argocd-application-controller\" in namespace \"argocd\" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key \"app.kubernetes.io/managed-by\": must be set to \"Helm\"; annotation validation error: missing key \"meta.helm.sh/release-name\": must be set to \"devops\"; annotation validation error: missing key \"meta.helm.sh/release-namespace\": must be set to \"argocd\""
      ],
      "stdout": "Release \"devops\" does not exist. Installing it now.",
      "stdout_lines": [
        "Release \"devops\" does not exist. Installing it now."
      ]
    },
    "resolved_action": "command",
    "role": "ks-devops",
    "start": "2024-04-18T10:16:17.652420",
    "task": "ks-devops | Upgrading or installing Argo CD",
    "task_action": "command",
    "task_args": "",
    "task_path": "/kubesphere/installer/roles/ks-devops/tasks/main.yaml:176",
    "task_uuid": "fec67b4d-df19-7429-19c8-000000000041",
    "uuid": "dfbb3e57-af03-4fe9-8503-7ec5b565b1ad"
  },
  "parent_uuid": "fec67b4d-df19-7429-19c8-000000000041",
  "pid": 10111,
  "runner_ident": "devops",
  "start_line": 170,
  "stdout": "fatal: [localhost]: FAILED! => {\"attempts\": 3, \"changed\": true, \"cmd\": \"/usr/local/bin/helm upgrade --install devops /kubesphere/kubesphere/ks-devops/charts/argo-cd-4.4.0.tgz -n argocd --create-namespace --reuse-values -f /kubesphere/kubesphere/ks-devops/argo-cd-values.yaml\\n\", \"delta\": \"0:00:04.501670\", \"end\": \"2024-04-18 18:17:06.262785\", \"msg\": \"non-zero return code\", \"rc\": 1, \"start\": \"2024-04-18 18:17:01.761115\", \"stderr\": \"Error: rendered manifests contain a resource that already exists. Unable to continue with install: ServiceAccount \\\"argocd-application-controller\\\" in namespace \\\"argocd\\\" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key \\\"app.kubernetes.io/managed-by\\\": must be set to \\\"Helm\\\"; annotation validation error: missing key \\\"meta.helm.sh/release-name\\\": must be set to \\\"devops\\\"; annotation validation error: missing key \\\"meta.helm.sh/release-namespace\\\": must be set to \\\"argocd\\\"\", \"stderr_lines\": [\"Error: rendered manifests contain a resource that already exists. Unable to continue with install: ServiceAccount \\\"argocd-application-controller\\\" in namespace \\\"argocd\\\" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key \\\"app.kubernetes.io/managed-by\\\": must be set to \\\"Helm\\\"; annotation validation error: missing key \\\"meta.helm.sh/release-name\\\": must be set to \\\"devops\\\"; annotation validation error: missing key \\\"meta.helm.sh/release-namespace\\\": must be set to \\\"argocd\\\"\"], \"stdout\": \"Release \\\"devops\\\" does not exist. Installing it now.\", \"stdout_lines\": [\"Release \\\"devops\\\" does not exist. Installing it now.\"]}",
  "uuid": "dfbb3e57-af03-4fe9-8503-7ec5b565b1ad"
}

看日志似乎是在尝试安装ArgoCD的时候发现ArgoCD已存在,导致安装失败。如果是这个原因导致的话,我们应该如何让DevOps组件使用我们已有的ArgoCD呢,或者我们能不能禁用掉这个GitOps模块?

DevOps组件安装失败后,KubeSphere页面也无法登录了

还有一个问题是,我又创建了一个测试集群来测试DevOps默认安装的ArgoCD,发现无法使用SSH方式添加Git仓库,KubeSphere 3.4.1 DevOps安装的ArgoCD是2.3,存在这个问题。

我们原先使用的ArgoCD是2.10,可以正常用SSH方式添加仓库

这是KubeSphere无法访问后apiserver的日志

I0419 10:30:53.191262       1 interface.go:50] start helm repo informer
I0419 10:30:53.455090       1 apiserver.go:428] Start cache objects
W0419 10:30:53.682230       1 apiserver.go:405] group version devops.kubesphere.io/v1alpha3 not exists in the cluster
W0419 10:30:53.686575       1 apiserver.go:405] group version devops.kubesphere.io/v1alpha1 not exists in the cluster
W0419 10:30:53.688221       1 reflector.go:424] pkg/client/informers/externalversions/factory.go:129: failed to list *v1alpha3.DevOpsProject: the server could not find the requested resource (get devopsprojects.devops.kubesphere.io)
E0419 10:30:53.688375       1 reflector.go:140] pkg/client/informers/externalversions/factory.go:129: Failed to watch *v1alpha3.DevOpsProject: failed to list *v1alpha3.DevOpsProject: the server could not find the requested resource (get devopsprojects.devops.kubesphere.io)
W0419 10:30:54.782406       1 reflector.go:424] pkg/client/informers/externalversions/factory.go:129: failed to list *v1alpha3.DevOpsProject: the server could not find the requested resource (get devopsprojects.devops.kubesphere.io)
E0419 10:30:54.782448       1 reflector.go:140] pkg/client/informers/externalversions/factory.go:129: Failed to watch *v1alpha3.DevOpsProject: failed to list *v1alpha3.DevOpsProject: the server could not find the requested resource (get devopsprojects.devops.kubesphere.io)
W0419 10:30:57.365825       1 reflector.go:424] pkg/client/informers/externalversions/factory.go:129: failed to list *v1alpha3.DevOpsProject: the server could not find the requested resource (get devopsprojects.devops.kubesphere.io)
E0419 10:30:57.365862       1 reflector.go:140] pkg/client/informers/externalversions/factory.go:129: Failed to watch *v1alpha3.DevOpsProject: failed to list *v1alpha3.DevOpsProject: the server could not find the requested resource (get devopsprojects.devops.kubesphere.io)
W0419 10:31:02.787329       1 reflector.go:424] pkg/client/informers/externalversions/factory.go:129: failed to list *v1alpha3.DevOpsProject: the server could not find the requested resource (get devopsprojects.devops.kubesphere.io)
E0419 10:31:02.787390       1 reflector.go:140] pkg/client/informers/externalversions/factory.go:129: Failed to watch *v1alpha3.DevOpsProject: failed to list *v1alpha3.DevOpsProject: the server could not find the requested resource (get devopsprojects.devops.kubesphere.io)
W0419 10:31:10.970889       1 reflector.go:424] pkg/client/informers/externalversions/factory.go:129: failed to list *v1alpha3.DevOpsProject: the server could not find the requested resource (get devopsprojects.devops.kubesphere.io)
E0419 10:31:10.970939       1 reflector.go:140] pkg/client/informers/externalversions/factory.go:129: Failed to watch *v1alpha3.DevOpsProject: failed to list *v1alpha3.DevOpsProject: the server could not find the requested resource (get devopsprojects.devops.kubesphere.io)

或者有没有什么办法升级DevOps附带的ArgoCD版本?

使用经验是,devops 组件没那么好用,你可以考虑自建 jenkins 或者其他 CI 工具 + 自建 argocd 代替

    KubeSphere还在维护吗,怎么KubeSphere给人的感觉是与开源社区越走越偏了?这些可插拔组件也不怎么维护了?之前答应的Tekton集成,我看了devops的仓库,已经3年没更新了。

    更离谱的是devops里的持续部署还选择不了其他集群

    官网上也确实说了可以选择集群,所以问题出在哪呢?

    argocd的UI上也可以看到添加的集群