• 网关路由
  • ks-apiserver 无法启动,求大佬们帮忙看看!

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

操作系统信息
例如:虚拟机/物理机,Centos7.5/Ubuntu18.04,4C/8G

Kubernetes版本信息

$$
Client Version: version.Info{Major:“1”, Minor:“22”, GitVersion:“v1.22.12”, GitCommit:“b058e1760c79f46a834ba59bd7a3486ecf28237d”, GitTreeState:“clean”, BuildDate:“2022-07-13T14:59:18Z”, GoVersion:“go1.16.15”, Compiler:“gc”, Platform:“linux/amd64”}

Server Version: version.Info{Major:“1”, Minor:“22”, GitVersion:“v1.22.12”, GitCommit:“b058e1760c79f46a834ba59bd7a3486ecf28237d”, GitTreeState:“clean”, BuildDate:“2022-07-13T14:53:39Z”, GoVersion:“go1.16.15”, Compiler:“gc”, Platform:“linux/amd64”}
$$

容器运行时
docker version

$$
Client: Docker Engine - Community
Version: 20.10.21
API version: 1.41
Go version: go1.18.7
Git commit: baeda1f
Built: Tue Oct 25 18:04:24 2022
OS/Arch: linux/amd64
Context: default
Experimental: true

Server: Docker Engine - Community
Engine:
Version: 20.10.21
API version: 1.41 (minimum version 1.12)
Go version: go1.18.7
Git commit: 3056208
Built: Tue Oct 25 18:02:38 2022
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.10
GitCommit: 770bd0108c32f3fb5c73ae1264f7e503fe7b2661
runc:
Version: 1.1.4
GitCommit: v1.1.4-0-g5fd4c4d
docker-init:
Version: 0.19.0
GitCommit: de40ad0
$$

KubeSphere版本信息

$$
v3.4.1
$$

问题是什么

[root@master1 kubernetes]# kubectl logs -f ks-apiserver-8648477df6-d5r9s  -n kubesphere-system
W0808 15:17:53.405592       1 client_config.go:618] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
W0808 15:17:53.406643       1 client_config.go:618] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
I0808 15:17:53.423510       1 interface.go:50] start helm repo informer
I0808 15:17:53.590546       1 apiserver.go:428] Start cache objects
W0808 15:17:53.595465       1 apiserver.go:405] group version autoscaling/v2 not exists in the cluster
E0808 15:17:56.151995       1 runtime.go:79] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference)
goroutine 1096 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic({0x3919e80?, 0x6c18e40})
	/workspace/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:75 +0x99
k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0xc000444460?})
	/workspace/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:49 +0x75
panic({0x3919e80, 0x6c18e40})
	/usr/local/go/src/runtime/panic.go:884 +0x212
kubesphere.io/kubesphere/pkg/simple/client/openpitrix/helmrepoindex.HelmVersionWrapper.GetName(...)
	/workspace/pkg/simple/client/openpitrix/helmrepoindex/load_package.go:48
kubesphere.io/kubesphere/pkg/utils/reposcache.(*cachedRepos).addRepo(0xc000444460, 0xc0027708b8, 0x3?)
	/workspace/pkg/utils/reposcache/repo_cahes.go:272 +0xbcb
kubesphere.io/kubesphere/pkg/utils/reposcache.(*cachedRepos).AddRepo(0xc000444460, 0xc0010481e0?)
	/workspace/pkg/utils/reposcache/repo_cahes.go:194 +0x7c
kubesphere.io/kubesphere/pkg/models/openpitrix.NewOpenpitrixOperator.func1({0x3eebf00?, 0xc0027708b8?})
	/workspace/pkg/models/openpitrix/interface.go:56 +0x3b
k8s.io/client-go/tools/cache.ResourceEventHandlerFuncs.OnAdd(...)
	/workspace/vendor/k8s.io/client-go/tools/cache/controller.go:232
k8s.io/client-go/tools/cache.(*processorListener).run.func1()
	/workspace/vendor/k8s.io/client-go/tools/cache/shared_informer.go:911 +0x134
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0x7d7d7d7d7b?)
	/workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:157 +0x3e
k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0xc003d79f38?, {0x476a2a0, 0xc001b10d20}, 0x1, 0xc00022e660)
	/workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:158 +0xb6
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0x65626f7250747361?, 0x3b9aca00, 0x0, 0x54?, 0xc003d79f88?)
	/workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:135 +0x89
k8s.io/apimachinery/pkg/util/wait.Until(...)
	/workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:92
k8s.io/client-go/tools/cache.(*processorListener).run(0xc00016e880?)
	/workspace/vendor/k8s.io/client-go/tools/cache/shared_informer.go:905 +0x6b
k8s.io/apimachinery/pkg/util/wait.(*Group).Start.func1()
	/workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:75 +0x5a
created by k8s.io/apimachinery/pkg/util/wait.(*Group).Start
	/workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:73 +0x85
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x21ea58b]

goroutine 1096 [running]:
k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0xc000444460?})
	/workspace/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:56 +0xd7
panic({0x3919e80, 0x6c18e40})
	/usr/local/go/src/runtime/panic.go:884 +0x212
kubesphere.io/kubesphere/pkg/simple/client/openpitrix/helmrepoindex.HelmVersionWrapper.GetName(...)
	/workspace/pkg/simple/client/openpitrix/helmrepoindex/load_package.go:48
kubesphere.io/kubesphere/pkg/utils/reposcache.(*cachedRepos).addRepo(0xc000444460, 0xc0027708b8, 0x3?)
	/workspace/pkg/utils/reposcache/repo_cahes.go:272 +0xbcb
kubesphere.io/kubesphere/pkg/utils/reposcache.(*cachedRepos).AddRepo(0xc000444460, 0xc0010481e0?)
	/workspace/pkg/utils/reposcache/repo_cahes.go:194 +0x7c
kubesphere.io/kubesphere/pkg/models/openpitrix.NewOpenpitrixOperator.func1({0x3eebf00?, 0xc0027708b8?})
	/workspace/pkg/models/openpitrix/interface.go:56 +0x3b
k8s.io/client-go/tools/cache.ResourceEventHandlerFuncs.OnAdd(...)
	/workspace/vendor/k8s.io/client-go/tools/cache/controller.go:232
k8s.io/client-go/tools/cache.(*processorListener).run.func1()
	/workspace/vendor/k8s.io/client-go/tools/cache/shared_informer.go:911 +0x134
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0x7d7d7d7d7b?)
	/workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:157 +0x3e
k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0xc003d79f38?, {0x476a2a0, 0xc001b10d20}, 0x1, 0xc00022e660)
	/workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:158 +0xb6
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0x65626f7250747361?, 0x3b9aca00, 0x0, 0x54?, 0xc003d79f88?)
	/workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:135 +0x89
k8s.io/apimachinery/pkg/util/wait.Until(...)
	/workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:92
k8s.io/client-go/tools/cache.(*processorListener).run(0xc00016e880?)
	/workspace/vendor/k8s.io/client-go/tools/cache/shared_informer.go:905 +0x6b
k8s.io/apimachinery/pkg/util/wait.(*Group).Start.func1()
	/workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:75 +0x5a
created by k8s.io/apimachinery/pkg/util/wait.(*Group).Start
	/workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:73 +0x85
poet 更改标题为「ks-apiserver 无法启动,求大佬们帮忙看看!

我也遇到了,即使我从3.3.1升级到3.3.2 还是报这个错误,我k8s版本是1.21

我另一个集群1.20版本 就没有问题

配置了这个helm repo源么, charts.bitnami.com/bitnami
可能有脏数据, 我验证一下

    方便在环境上执行一下这个命令, 然后把这个t.yaml文件传上来么, 应该比较大, 传附件

    kubectl get helmrepos.application.kubesphere.io -o yaml > t.yaml
    • poet 回复了此帖

      redscholar 那好像只是个告警,并不会对ks-apiserver有影响,我也升级到k8s 到1.23,但还是报错提示Observed a panic: “invalid memory address or nil pointer dereference” (runtime error: invalid memory address or nil pointer dereference)

      访问不了, 文件不存在

      • poet 回复了此帖

        文件下载到了, 我调试看下,
        临时解决办法, 可以把

        kubectl delete helmrepos.application.kubesphere.io xxx(bitnami源的名称)

        试一下

          W0808 16:59:24.533011 1 client_config.go:618] Neither --kubeconfig nor --master was specifie

          W0808 16:59:24.533903 1 client_config.go:618] Neither --kubeconfig nor --master was specifie

          W0808 16:59:24.540581 1 metricsserver.go:238] Metrics API not available.

          I0808 16:59:24.543659 1 interface.go:50] start helm repo informer

          I0808 16:59:24.779808 1 apiserver.go:428] Start cache objects

          E0808 16:59:26.480827 1 runtime.go:79] Observed a panic: "invalid memory address or nil poin

          goroutine 936 [running]:

          k8s.io/apimachinery/pkg/util/runtime.logPanic({0x3919e80?, 0x6c18e40})

          /workspace/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:75 +0x99

          k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0xc0002a8690?})

          /workspace/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:49 +0x75

          panic({0x3919e80, 0x6c18e40})

          /usr/local/go/src/runtime/panic.go:884 +0x212

          kubesphere.io/kubesphere/pkg/simple/client/openpitrix/helmrepoindex.HelmVersionWrapper.GetName(...

          /workspace/pkg/simple/client/openpitrix/helmrepoindex/load_package.go:48

          kubesphere.io/kubesphere/pkg/utils/reposcache.(*cachedRepos).addRepo(0xc0002a8690, 0xc001d40a28, 0

          /workspace/pkg/utils/reposcache/repo_cahes.go:272 +0xbcb

          kubesphere.io/kubesphere/pkg/utils/reposcache.(*cachedRepos).AddRepo(0xc0002a8690, 0xc0001685a0?)

          /workspace/pkg/utils/reposcache/repo_cahes.go:194 +0x7c

          kubesphere.io/kubesphere/pkg/models/openpitrix.NewOpenpitrixOperator.func1({0x3eebf00?, 0xc001d40a

          /workspace/pkg/models/openpitrix/interface.go:56 +0x3b

          k8s.io/client-go/tools/cache.ResourceEventHandlerFuncs.OnAdd(...)

          /workspace/vendor/k8s.io/client-go/tools/cache/controller.go:232

          k8s.io/client-go/tools/cache.(*processorListener).run.func1()

          /workspace/vendor/k8s.io/client-go/tools/cache/shared_informer.go:911 +0x134

          k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0x0?)

          /workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:157 +0x3e

          k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0xc003329f38?, {0x476a2a0, 0xc002d84c00}, 0x1, 0xc0

          /workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:158 +0xb6

          k8s.io/apimachinery/pkg/util/wait.JitterUntil(0x65726f632e676e69?, 0x3b9aca00, 0x0, 0x71?, 0xc0033

          /workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:135 +0x89

          k8s.io/apimachinery/pkg/util/wait.Until(...)

          /workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:92

          k8s.io/client-go/tools/cache.(*processorListener).run(0xc0003a5d80?)

          /workspace/vendor/k8s.io/client-go/tools/cache/shared_informer.go:905 +0x6b

          k8s.io/apimachinery/pkg/util/wait.(*Group).Start.func1()

          /workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:75 +0x5a

          created by k8s.io/apimachinery/pkg/util/wait.(*Group).Start

          /workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:73 +0x85

          panic: runtime error: invalid memory address or nil pointer dereference [recovered]

          panic: runtime error: invalid memory address or nil pointer dereference

          [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x21ea58b]

          goroutine 936 [running]:

          k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0xc0002a8690?})

          /workspace/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:56 +0xd7

          panic({0x3919e80, 0x6c18e40})

          /usr/local/go/src/runtime/panic.go:884 +0x212

          kubesphere.io/kubesphere/pkg/simple/client/openpitrix/helmrepoindex.HelmVersionWrapper.GetName(...

          /workspace/pkg/simple/client/openpitrix/helmrepoindex/load_package.go:48

          kubesphere.io/kubesphere/pkg/utils/reposcache.(*cachedRepos).addRepo(0xc0002a8690, 0xc001d40a28, 0

          /workspace/pkg/utils/reposcache/repo_cahes.go:272 +0xbcb

          kubesphere.io/kubesphere/pkg/utils/reposcache.(*cachedRepos).AddRepo(0xc0002a8690, 0xc0001685a0?)

          /workspace/pkg/utils/reposcache/repo_cahes.go:194 +0x7c

          kubesphere.io/kubesphere/pkg/models/openpitrix.NewOpenpitrixOperator.func1({0x3eebf00?, 0xc001d40a

          /workspace/pkg/models/openpitrix/interface.go:56 +0x3b

          k8s.io/client-go/tools/cache.ResourceEventHandlerFuncs.OnAdd(...)

          /workspace/vendor/k8s.io/client-go/tools/cache/controller.go:232

          k8s.io/client-go/tools/cache.(*processorListener).run.func1()

          /workspace/vendor/k8s.io/client-go/tools/cache/shared_informer.go:911 +0x134

          k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0x0?)

          /workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:157 +0x3e

          k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0xc003329f38?, {0x476a2a0, 0xc002d84c00}, 0x1, 0xc0

          /workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:158 +0xb6

          k8s.io/apimachinery/pkg/util/wait.JitterUntil(0x65726f632e676e69?, 0x3b9aca00, 0x0, 0x71?, 0xc0033

          /workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:135 +0x89

          k8s.io/apimachinery/pkg/util/wait.Until(...)

          /workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:92

          k8s.io/client-go/tools/cache.(*processorListener).run(0xc0003a5d80?)

          /workspace/vendor/k8s.io/client-go/tools/cache/shared_informer.go:905 +0x6b

          k8s.io/apimachinery/pkg/util/wait.(*Group).Start.func1()

          /workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:75 +0x5a

          created by k8s.io/apimachinery/pkg/util/wait.(*Group).Start

          /workspace/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:73 +0x85

          能不能帮忙看看,因为这个东西是开放的,不太确定是否因为同事进行了那种操作导致的.现在无法启动ks-apiserver

          inksnw

          kubectl get helmrepos.application.kubesphere.io

          NAME NAME WORKSPACE URL STATE AGE

          repo-17114xo13qyk4y charts.bitnami.com xrkj-workspace https://charts.bitnami.com/bitnami failed 323d

          repo-3k11vx00kk8w4z mysql.github.io base-workspace https://mysql.github.io/mysql-operator successful 283d

          repo-41q15v9l948y9r helm.elastic.co xrkj-workspace https://helm.elastic.co successful 322d

          repo-44xlnmzyq6zm9r helm.goharbor.io xrkj-workspace https://helm.goharbor.io successful 303d

          repo-5y225jy5lnon6j charts.gitlab.io xrkj-workspace http://charts.gitlab.io failed 323d

          repo-9m7r8yk81lon6j sonatype.github.io xrkj-workspace https://sonatype.github.io/helm3-charts successful 323d

          repo-jkmx23jn3j8w4y mysql.github.io xrkj-workspace https://mysql.github.io/mysql-operator successful 283d

          repo-mowwwrm863v96l harbor.us168168.com xrkj-workspace https://harbor.us168168.com/chartrepo/library failed 322d

          repo-mpolxyrpj9v96l mirror.azure.cn/kubernetes/charts xrkj-workspace http://mirror.azure.cn/kubernetes/charts successful 323d

          repo-mqxl06roo5vy93 charts.bitnami.com sugn-workspace https://charts.bitnami.com/bitnami successful 258d

          repo-r73wv5j99z0k7k a-nexus.wetok168.com xrkj-workspace https://a-nexus.wetok168.com/repository/helm-hosted successful 289d

          只需要删除bitnami就可以嘛