如何在高浪县获得Kubectl得到po -o yaml
运行此代码Go客户端示例
其中预期的输出是
./app
There are 3 pods in the cluster
There are 3 pods in the cluster
There are 3 pods in the cluster但是当我运行它的时候
go build -o app .
./app
panic: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"
goroutine 1 [running]:
main.main()
/Users/padmanabanpr/Documents/client-go/examples/out-of-cluster-client-configuration/main.go:61 +0x5b6发布于 2022-05-31 09:35:16
这可能是由于您的k8s客户机/服务器版本高于1.24+ https://github.com/aws/aws-cli/issues/6920,请参阅此以进一步澄清。
发布于 2022-06-01 04:52:40
以下步骤解决了这个问题
$ cd client-go/examples/out-of-cluster-client-configuration
$ go mod init example.com/m
$ go mod tidy
$ go build -o app .
$ ./apphttps://stackoverflow.com/questions/72445271
复制相似问题