参考文档: loongarch64架构下Kubernetes组件编译
编译环境
- OS: Kylin Linux Advanced Server V10 (Tercel)
- CPU 架构: loongarch64
- 平台: 龙芯
- go 版本: go version go1.19 linux/loong64
- 编译的 kubernetes 版本: v1.20.11
安装 golang 环境
下载 golang
1
wget http://ftp.loongnix.cn/toolchain/golang/go-1.19/go1.19.linux-loong64.tar.gz
安装 golang
1
2
3
4
5
6
7
8tar xf go1.19.linux-loong64.tar.gz -C /usr/local/
cat > /etc/profile.d/golang.sh <<EOF
#!/bin/bash
GO_HOME=/usr/local/go
PATH=\$PATH:\$GO_HOME/bin
EOF重新加载环境变量,检查 go 版本
1
2
3$ source /etc/profile.d/golang.sh
$ go version
go version go1.19 linux/loong64
编译 kubernetes
下载 kubernetes 源码
1
git clone -b v1.20.11 https://github.com/kubernetes/kubernetes.git
编译 kubernetes
1
2
3
4
5# 编译全部组件的方法
KUBE_BUILD_PLATFORMS=linux/loong64 make all
# 编译指定组件的方法
KUBE_BUILD_PLATFORMS=linux/loong64 make all WHAT=cmd/kubelet GOFLAGS=-v GOGCFLAGS="-N -l"编译后生成的二进制文件在
_output/bin
目录1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20cd _output/bin
$ ./kube-apiserver --version
Kubernetes v1.20.11-dirty
$ ./kube-controller-manager --version
Kubernetes v1.20.11-dirty
$ ./kube-scheduler --version
Kubernetes v1.20.11-dirty
$ ./kube-proxy --version
Kubernetes v1.20.11-dirty
$ ./kubelet --version
Kubernetes v1.20.11-dirty
$ ./kubectl version
Client Version: version.Info{Major:"1", Minor:"20+", GitVersion:"v1.20.11-dirty", GitCommit:"27522a29febbcc4badac257763044d0d90c11abd", GitTreeState:"dirty", BuildDate:"2022-10-27T04:02:05Z", GoVersion:"go1.19", Compiler:"gc", Platform:"linux/loong64"}
The connection to the server localhost:8080 was refused - did you specify the right host or port?
组件编译错误处理
错误1: 不支持架构
Unsupported host arch. Must be x86_64, 386, arm, arm64, s390x or ppc64le.
1
2
3
4
5
6
7
8
9
10!!! [1027 09:50:31] Unsupported host arch. Must be x86_64, 386, arm, arm64, s390x or ppc64le.
!!! [1027 09:50:33] Unsupported host arch. Must be x86_64, 386, arm, arm64, s390x or ppc64le.
!!! [1027 09:50:39] Unsupported host arch. Must be x86_64, 386, arm, arm64, s390x or ppc64le.
!!! [1027 09:50:39] Unsupported host arch. Must be x86_64, 386, arm, arm64, s390x or ppc64le.
!!! [1027 09:50:44] Unsupported host arch. Must be x86_64, 386, arm, arm64, s390x or ppc64le.
+++ [1027 09:50:44] Building go targets for linux/loong64:
./vendor/k8s.io/code-generator/cmd/prerelease-lifecycle-gen
touch: 无法创建 '_output/bin/prerelease-lifecycle-gen': 没有那个文件或目录
make[1]: *** [Makefile.generated_files:196:_output/bin/prerelease-lifecycle-gen] 错误 1
make: *** [Makefile:546:generated_files] 错误 2
解决方法
修改
hack/lib/golang.sh
文件,在以下配置中添加linux/loong64
配置- KUBE_SUPPORTED_SERVER_PLATFORMS
- KUBE_SUPPORTED_NODE_PLATFORMS
- KUBE_SUPPORTED_CLIENT_PLATFORMS
- KUBE_SUPPORTED_TEST_PLATFORMS
修改
hack/lib/util.sh
文件,在kube::util::host_arch()
里添加以下配置1
2
3loongarch64*)
host_arch=loongarch64
;;修改
hack/local-up-cluster.sh
文件,在 detect_binary 函数下面添加以下配置1
2
3loongarch64*)
host_arch=loongarch64
;;
错误2: unix 模块问题
# k8s.io/kubernetes/vendor/golang.org/x/sys/unix
1
2
3
4
5
6
7
8
9
10
11vendor/golang.org/x/sys/unix/affinity_linux.go:14:35: undefined: _NCPUBITS
vendor/golang.org/x/sys/unix/affinity_linux.go:17:25: undefined: cpuMask
vendor/golang.org/x/sys/unix/affinity_linux.go:50:27: undefined: cpuMask
vendor/golang.org/x/sys/unix/sockcmsg_unix.go:33:9: undefined: Cmsghdr
vendor/golang.org/x/sys/unix/ztypes_linux.go:22:11: undefined: Timespec
vendor/golang.org/x/sys/unix/ztypes_linux.go:23:11: undefined: Timespec
vendor/golang.org/x/sys/unix/ztypes_linux.go:1112:12: undefined: SockaddrStorage
vendor/golang.org/x/sys/unix/ztypes_linux.go:2284:8: undefined: Timespec
vendor/golang.org/x/sys/unix/ztypes_linux.go:2748:8: undefined: TIPCSubscr
vendor/golang.org/x/sys/unix/ztypes_linux.go:2968:10: undefined: PPSKInfo
vendor/golang.org/x/sys/unix/affinity_linux.go:50:27: too many errors
解决方法
方法1: 用 GOROOT 下的
golang.org/x/sys/unix
包替换vendor/golang.org/x/sys/
路径下面的 unix 包。1
2
3
4
5
6
7
8
9# 配置 go 代理
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct
# golang 安装最新的 sys 扩展模块
go install golang.org/x/sys@latest
# 替换 kubernetes 中的 unix 模块
/bin/cp -r ~/go/pkg/mod/golang.org/x/sys@v0.1.0/unix vendor/golang.org/x/sys/GOPATH 默认的路径为
~/go
,也可以通过go env
命令查看 GOPATH 对应的目录方法2: 在 go.mod 文件最下面追加以下内容
1
replace golang.org/x/sys => golang.org/x/sys v0.1.0
错误3: opencontainers/runc/libcontainer
# k8s.io/kubernetes/vendor/github.com/opencontainers/runc/libcontainer
1
2
3# k8s.io/kubernetes/vendor/github.com/opencontainers/runc/libcontainer
vendor/github.com/opencontainers/runc/libcontainer/init_linux.go:316:19: undefined: system.Setgid
vendor/github.com/opencontainers/runc/libcontainer/init_linux.go:319:19: undefined: system.Setuid
解决方法
修改
vendor/github.com/opencontainers/runc/libcontainer/system/syscall_linux_64.go
文件,第二行注释后面追加loong64
1
// +build arm64 amd64 mips mipsle mips64 mips64le ppc ppc64 ppc64le riscv64 s390x loong64
错误4: onsi/ginkgo/internal/remote
# k8s.io/kubernetes/vendor/github.com/onsi/ginkgo/internal/remote
1
2
3
4
5
6
7
8
9
10
11# k8s.io/kubernetes/vendor/github.com/onsi/ginkgo/internal/remote
vendor/github.com/onsi/ginkgo/internal/remote/syscall_dup_unix.go:11:17: undefined: syscall.Dup2
!!! [1027 10:55:36] Call tree:
!!! [1027 10:55:36] 1: /root/pkg/kubernetes/hack/lib/golang.sh:724 kube::golang::build_some_binaries(...)
!!! [1027 10:55:36] 2: /root/pkg/kubernetes/hack/lib/golang.sh:868 kube::golang::build_binaries_for_platform(...)
!!! [1027 10:55:36] 3: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
!!! [1027 10:55:36] Call tree:
!!! [1027 10:55:36] 1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
!!! [1027 10:55:36] Call tree:
!!! [1027 10:55:36] 1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
make: *** [Makefile:93:all] 错误 1
解决方法
修改
vendor/github.com/onsi/ginkgo/internal/remote/syscall_dup_unix.go
文件,添加一张注释// +build !linux !loong64
,如下所示:1
2
3
4
5// +build !linux !arm64
// +build !linux !riscv64
// +build !windows
// +build !solaris
// +build !linux !loong64新建
vendor/github.com/onsi/ginkgo/internal/remote/syscall_dup_linux_loong64.go
文件,内容如下1
2
3
4
5
6
7
8
9
10
11// +build linux,loong64
package remote
import "syscall"
// linux_loong64 doesn't have syscall.Dup2 which ginkgo uses, so
// use the nearly identical syscall.Dup3 instead
func syscallDup(oldfd int, newfd int) (err error) {
return syscall.Dup3(oldfd, newfd, 0)
}
错误5: net 模块问题
net/internal/socket
,net/ipv4
以及net/ipv6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38# k8s.io/kubernetes/vendor/golang.org/x/net/internal/socket
vendor/golang.org/x/net/internal/socket/mmsghdr_unix.go:11:17: undefined: mmsghdr
vendor/golang.org/x/net/internal/socket/cmsghdr.go:9:10: undefined: cmsghdr
vendor/golang.org/x/net/internal/socket/cmsghdr.go:10:10: undefined: cmsghdr
vendor/golang.org/x/net/internal/socket/cmsghdr.go:11:10: undefined: cmsghdr
vendor/golang.org/x/net/internal/socket/msghdr_linux.go:9:10: undefined: msghdr
vendor/golang.org/x/net/internal/socket/msghdr_linux.go:9:28: undefined: iovec
vendor/golang.org/x/net/internal/socket/msghdr_linux.go:23:10: undefined: msghdr
vendor/golang.org/x/net/internal/socket/msghdr_linux.go:30:10: undefined: msghdr
vendor/golang.org/x/net/internal/socket/msghdr_linux.go:34:10: undefined: msghdr
vendor/golang.org/x/net/internal/socket/sys_linux.go:14:31: undefined: mmsghdr
vendor/golang.org/x/net/internal/socket/sys_linux.go:14:31: too many errors
# k8s.io/kubernetes/vendor/golang.org/x/net/ipv4
vendor/golang.org/x/net/ipv4/icmp.go:34:2: undefined: icmpFilter
vendor/golang.org/x/net/ipv4/icmp_linux.go:7:10: undefined: icmpFilter
vendor/golang.org/x/net/ipv4/icmp_linux.go:11:10: undefined: icmpFilter
vendor/golang.org/x/net/ipv4/icmp_linux.go:15:10: undefined: icmpFilter
vendor/golang.org/x/net/ipv4/icmp_linux.go:23:10: undefined: icmpFilter
vendor/golang.org/x/net/ipv4/sys_linux.go:19:19: undefined: sysIP_TTL
vendor/golang.org/x/net/ipv4/sys_linux.go:20:19: undefined: sysIP_PKTINFO
vendor/golang.org/x/net/ipv4/sys_linux.go:20:34: undefined: sizeofInetPktinfo
vendor/golang.org/x/net/ipv4/sys_linux.go:24:79: undefined: sysIP_TOS
vendor/golang.org/x/net/ipv4/sys_linux.go:25:79: undefined: sysIP_TTL
vendor/golang.org/x/net/ipv4/sys_linux.go:25:79: too many errors
# k8s.io/kubernetes/vendor/golang.org/x/net/ipv6
vendor/golang.org/x/net/ipv6/icmp.go:37:2: undefined: icmpv6Filter
vendor/golang.org/x/net/ipv6/icmp_linux.go:7:10: undefined: icmpv6Filter
vendor/golang.org/x/net/ipv6/icmp_linux.go:11:10: undefined: icmpv6Filter
vendor/golang.org/x/net/ipv6/icmp_linux.go:15:10: undefined: icmpv6Filter
vendor/golang.org/x/net/ipv6/icmp_linux.go:25:10: undefined: icmpv6Filter
vendor/golang.org/x/net/ipv6/sys_linux.go:19:21: undefined: sysIPV6_TCLASS
vendor/golang.org/x/net/ipv6/sys_linux.go:20:21: undefined: sysIPV6_HOPLIMIT
vendor/golang.org/x/net/ipv6/sys_linux.go:21:21: undefined: sysIPV6_PKTINFO
vendor/golang.org/x/net/ipv6/sys_linux.go:21:38: undefined: sizeofInet6Pktinfo
vendor/golang.org/x/net/ipv6/sys_linux.go:22:21: undefined: sysIPV6_PATHMTU
vendor/golang.org/x/net/ipv6/sys_linux.go:22:21: too many errors
解决方法
方法1: 用 GOROOT 目录下的
golang.org/x/net/
相关包替换vendor/golang.org/x/net/
路径下面相关的包。1
2
3
4
5
6
7# 安装 golang 最新的 net 模块
go install golang.org/x/net@latest
# 替换 kubernetes 中的相关文件
/bin/cp -r ~/go/pkg/mod/golang.org/x/net@v0.1.0/internal/socket vendor/golang.org/x/net/internal
/bin/cp -r ~/go/pkg/mod/golang.org/x/net@v0.1.0/ipv4 vendor/golang.org/x/net/
/bin/cp -r ~/go/pkg/mod/golang.org/x/net@v0.1.0/ipv6 vendor/golang.org/x/net/GOPATH 默认的路径为
~/go
,也可以通过go env
命令查看 GOPATH 对应的目录方法2: 在 go.mod 文件最下面追加以下内容
1
replace golang.org/x/net => golang.org/x/net v0.1.0
错误6: bbolt 错误
# k8s.io/kubernetes/vendor/go.etcd.io/bbolt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18# k8s.io/kubernetes/vendor/go.etcd.io/bbolt
vendor/go.etcd.io/bbolt/db.go:127:13: undeclared name maxMapSize for array length
vendor/go.etcd.io/bbolt/db.go:400:12: undefined: maxMapSize
vendor/go.etcd.io/bbolt/db.go:418:10: undefined: maxMapSize
vendor/go.etcd.io/bbolt/db.go:419:8: undefined: maxMapSize
vendor/go.etcd.io/bbolt/db.go:885:2: pos declared but not used
vendor/go.etcd.io/bbolt/bolt_unix.go:66:15: undeclared name maxMapSize for array length
vendor/go.etcd.io/bbolt/tx.go:533:12: undefined: maxAllocSize
vendor/go.etcd.io/bbolt/tx.go:534:10: undefined: maxAllocSize
vendor/go.etcd.io/bbolt/unsafe.go:27:12: undeclared name maxAllocSize for array length
!!! [1027 11:58:44] Call tree:
!!! [1027 11:58:44] 1: /root/pkg/kubernetes/hack/lib/golang.sh:868 kube::golang::build_binaries_for_platform(...)
!!! [1027 11:58:44] 2: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
!!! [1027 11:58:44] Call tree:
!!! [1027 11:58:44] 1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
!!! [1027 11:58:44] Call tree:
!!! [1027 11:58:44] 1: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
make: *** [Makefile:93:all] 错误 1
解决方法
创建
vendor/go.etcd.io/bbolt/bolt_loong64.go
文件,文件内容如下:1
2
3
4
5
6
7
8
9// +build loong64
package bbolt
// maxMapSize represents the largest mmap size supported by Bolt.
const maxMapSize = 0xFFFFFFFFFFFF // 256TB
// maxAllocSize is the size used when creating array pointers.
const maxAllocSize = 0x7FFFFFFF
错误7. reflect2 错误
错误信息如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1ecd0]
goroutine 1 [running]:
reflect.mapiternext(0xc000000000)
/usr/local/go/src/runtime/map.go:1380 +0x30
k8s.io/kubernetes/vendor/github.com/modern-go/reflect2.(*UnsafeMapIterator).UnsafeNext(0xc0009181b8)
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/modern-go/reflect2/unsafe_map.go:136 +0x48
k8s.io/kubernetes/vendor/github.com/json-iterator/go.(*sortKeysMapEncoder).Encode(0xc00073d350, 0xc0006cb0a8, 0xc0006e50e0)
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/json-iterator/go/reflect_map.go:297 +0x374
k8s.io/kubernetes/vendor/github.com/json-iterator/go.(*placeholderEncoder).Encode(0xc000328f50, 0xc0006cb0a8, 0xc0006e50e0)
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/json-iterator/go/reflect.go:332 +0x4c
k8s.io/kubernetes/vendor/github.com/json-iterator/go.(*structFieldEncoder).Encode(0xc000878ed0, 0xc0006cb010, 0xc0006e50e0)
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/json-iterator/go/reflect_struct_encoder.go:110 +0x6c
k8s.io/kubernetes/vendor/github.com/json-iterator/go.(*structEncoder).Encode(0xc000879020, 0xc0006cb010, 0xc0006e50e0)
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/json-iterator/go/reflect_struct_encoder.go:158 +0x7dc
k8s.io/kubernetes/vendor/github.com/json-iterator/go.(*placeholderEncoder).Encode(0xc0003dc030, 0xc0006cb010, 0xc0006e50e0)
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/json-iterator/go/reflect.go:332 +0x4c
k8s.io/kubernetes/vendor/github.com/json-iterator/go.(*structFieldEncoder).Encode(0xc000879290, 0xc0006cb000, 0xc0006e50e0)
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/json-iterator/go/reflect_struct_encoder.go:110 +0x6c
k8s.io/kubernetes/vendor/github.com/json-iterator/go.(*structEncoder).Encode(0xc0008792f0, 0xc0006cb000, 0xc0006e50e0)
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/json-iterator/go/reflect_struct_encoder.go:158 +0x7dc
k8s.io/kubernetes/vendor/github.com/json-iterator/go.(*sliceEncoder).Encode(0xc0001825d0, 0xc0000d8ec8, 0xc0006e50e0)
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/json-iterator/go/reflect_slice.go:38 +0x354
k8s.io/kubernetes/vendor/github.com/json-iterator/go.(*structFieldEncoder).Encode(0xc000879e00, 0xc0000d8e70, 0xc0006e50e0)
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/json-iterator/go/reflect_struct_encoder.go:110 +0x6c
k8s.io/kubernetes/vendor/github.com/json-iterator/go.(*structEncoder).Encode(0xc000879ef0, 0xc0000d8e70, 0xc0006e50e0)
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/json-iterator/go/reflect_struct_encoder.go:158 +0x7dc
k8s.io/kubernetes/vendor/github.com/json-iterator/go.(*OptionalEncoder).Encode(0xc000428690, 0xc000692a40, 0xc0006e50e0)
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/json-iterator/go/reflect_optional.go:70 +0x100
k8s.io/kubernetes/vendor/github.com/json-iterator/go.(*onePtrEncoder).Encode(0xc0004286b0, 0xc0000d8e70, 0xc0006e50e0)
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/json-iterator/go/reflect.go:219 +0x98
k8s.io/kubernetes/vendor/github.com/json-iterator/go.(*Stream).WriteVal(0xc0006e50e0, {0x12ab9a0, 0xc0000d8e70})
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/json-iterator/go/reflect.go:98 +0x1dc
k8s.io/kubernetes/vendor/github.com/json-iterator/go.(*frozenConfig).Marshal(0xc00020e960, {0x12ab9a0, 0xc0000d8e70})
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/json-iterator/go/config.go:299 +0xc4
k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/serializer/json.(*Serializer).doEncode(0xc0003b0000, {0x1651190, 0xc0000d8e70}, {0x1648160, 0xc0006ed950})
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go:306 +0x68
k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/serializer/json.(*Serializer).Encode(0xc0003b0000, {0x1651190, 0xc0000d8e70}, {0x1648160, 0xc0006ed950})
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go:301 +0x130
k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/serializer/versioning.(*codec).doEncode(0xc0000b8f00, {0x1651140, 0xc0006e5080}, {0x1648160, 0xc0006ed950})
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning.go:244 +0x6c0
k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/serializer/versioning.(*codec).Encode(0xc0000b8f00, {0x1651140, 0xc0006e5080}, {0x1648160, 0xc0006ed950})
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning.go:184 +0x130
k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime.Encode({0xffcf05c980, 0xc0000b8f00}, {0x1651140, 0xc0006e5080})
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/codec.go:50 +0x70
k8s.io/kubernetes/vendor/k8s.io/client-go/tools/clientcmd.Write(...)
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/client-go/tools/clientcmd/loader.go:473
k8s.io/kubernetes/vendor/k8s.io/client-go/tools/clientcmd.WriteToFile({{0x0, 0x0}, {0x0, 0x0}, {0x0, 0xc0006ed4d0}, 0xc0006ed500, 0xc0006ed530, 0xc0006ed560, {0x0, ...}, ...}, ...)
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/client-go/tools/clientcmd/loader.go:426 +0xc4
k8s.io/kubernetes/vendor/k8s.io/client-go/tools/clientcmd.ModifyConfig({0x16608e0, 0xc00059e280}, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0xc0006ecbd0}, 0xc0006ecc00, 0xc0006ecc30, ...}, ...)
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/client-go/tools/clientcmd/config.go:294 +0xb14
k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/config.createAuthInfoOptions.run({{0x16608e0, 0xc00059e280}, {0xfffbe8b590, 0x1e}, {0x1, {0xfffbe8b5c4, 0x30}}, {0x1, {0xfffbe8b602, 0x34}}, ...})
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/config/create_authinfo.go:203 +0x1f4
k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/config.newCmdConfigSetAuthInfo.func1(0xc0005b1080, {0xc00059e3c0, 0x1, 0x5})
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/kubectl/pkg/cmd/config/create_authinfo.go:161 +0xc0
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).execute(0xc0005b1080, {0xc00059e370, 0x5, 0x5})
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:854 +0x684
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc00040cdc0)
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:958 +0x3f0
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).Execute(...)
/root/pkg/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:895
main.main()
_output/local/go/src/k8s.io/kubernetes/cmd/kubectl/kubectl.go:49 +0x220
解决方法
- 下载新版本的 reflect2 包替换掉自带的 reflect2 包,包目录为
kubernetes/vendor/github.com/modern-go/reflect2/
- 重新编译 kubernetes 组件