• 安装部署
  • helm upgrade --install -n 安装时我改了 namespace,安装失败

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

安装命令:

helm upgrade –install -n test-kubesphere –create-namespace ks-core https://charts.kubesphere.io/main/ks-core-1.1.1.tgz –debug –wait \

--set global.imageRegistry=swr.cn-southwest-2.myhuaweicloud.com/ks \

--set extension.imageRegistry=swr.cn-southwest-2.myhuaweicloud.com/ks

我将默认的 namespace kubesphere-system 改为了:test-kubesphere 执行了以上命令,结果说命名空间不对,然后我将 namespace 改回 kubesphere-system 重新执行以上命令,还是错误….

错误信息如下:

Error: Unable to continue with install: ClusterRole “cluster-admin” in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key “meta.helm.sh/release-namespace” must equal “kubesphere-system”: current value is “gqr-kubesphere”

helm.go:86: 2024-12-14 13:34:40.55887146 +0800 CST m=+6.574597673 [debug] ClusterRole “cluster-admin” in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key “meta.helm.sh/release-namespace” must equal “kubesphere-system”: current value is “test-kubesphere”

我要怎么弄呢?

    nowtman

    目前不支持修改部署 KubeSphere 的 namespace,其他扩展组件和配置可能会依赖于 kubesphere-system 这个名称。一个稳定的名称有助于避免由不可预测的配置更改引起的问题,还可以降低调试和故障排除的成本。

    资源冲突了你需要先卸载之前未成功安装的 helm release,helm -n test-kubesphere del ks-core --debug

      hongming

      执行以下命令:

      helm uninstall ks-core -n test-kubesphere

      Error: uninstall: Release not loaded: ks-core: release: not found

      helm -n test-kubesphere del ks-core

      Error: uninstall: Release not loaded: ks-core: release: not found

      kubectl get ns test-kubesphere

      Error from server (NotFound): namespaces “test-kubesphere” not found

      helm upgrade --install -n kubesphere-system --create-namespace ks-core https://charts.kubesphere.io/main/ks-core-1.1.1.tgz --debug --wait --set global.imageRegistry=swr.cn-southwest-2.myhuaweicloud.com/ks --set extension.imageRegistry=swr.cn-southwest-2.myhuaweicloud.com/ks

      helm.go:86: 2024-12-19 13:50:47.963586326 +0800 CST m=+14.758831861 [debug] ClusterRole “cluster-admin” in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key “meta.helm.sh/release-namespace” must equal “kubesphere-system”: current value is “test-kubesphere”

      Unable to continue with install

      helm.sh/helm/v3/pkg/action.(*Install).RunWithContext

      helm.sh/helm/v3/pkg/action/install.go:356

      main.runInstall

      helm.sh/helm/v3/cmd/helm/install.go:316

      main.newUpgradeCmd.func2

      helm.sh/helm/v3/cmd/helm/upgrade.go:159

      github.com/spf13/cobra.(*Command).execute

      github.com/spf13/cobra@v1.8.1/command.go:985

      github.com/spf13/cobra.(*Command).ExecuteC

      github.com/spf13/cobra@v1.8.1/command.go:1117

      github.com/spf13/cobra.(*Command).Execute

      github.com/spf13/cobra@v1.8.1/command.go:1041

      main.main

      helm.sh/helm/v3/cmd/helm/helm.go:85

      runtime.main

      runtime/proc.go:271

      runtime.goexit

      runtime/asm_amd64.s:1695

      nowtman

      ClusterRole “cluster-admin” in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key “meta.helm.sh/release-namespace” must equal “kubesphere-system”: current value is “test-kubesphere”

      你这也没把 helm release 删掉,手动改一下冲突的资源吧,或者在 test-kubesphere 这个 ns 安装一遍之后再卸载一次

        hongming 您好,感谢回复!在 test-kubesphere 再执行一遍安装就会反向报

        error: key “meta.helm.sh/release-namespace” must equal “test-kubesphere”: current value is “kubesphere-system”

        在执行

        # helm -n test-kubesphere del ks-core

        Error: uninstall: Release not loaded: ks-core: release: not found

        # helm uninstall ks-core -n test-kubesphere

        Error: uninstall: Release not loaded: ks-core: release: not found

        # kubectl get ns test-kubesphere

        Error from server (NotFound): namespaces “test-kubesphere” not found

        一样的问题 。

        手动改冲突的资源,该如何改呢?

        hongming

        执行

        helm list --all --all-namespaces

        也没有 test-kubesphere 与 kubesphere-system 相关的资源