创建部署问题时,请参考下面模板,你提供的信息越多,越容易及时获得解答。如果未按模板创建问题,管理员有权关闭问题。
确保帖子格式清晰易读,用 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"
}