gpt4 book ai didi

kubernetes - 我该如何解决minikube hello-world?

转载 作者:行者123 更新时间:2023-12-02 12:28:07 25 4
gpt4 key购买 nike

我在kubernetes中运行hello-minikube有问题。
这是命令:
run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=8080
结果如下:

error: v1.ReplicationController: ObjectMeta: v1.ObjectMeta: readObjectFieldAsBytes: expect : after object field, parsing 740 ...:{},"k:{\"... at {"kind":"ReplicationController","apiVersion":"v1","metadata":{"name":"hello-minikube","namespace":"default","selfLink":"/api/v1/namespaces/default/replicationcontrollers/hello-minikube","uid":"8c3308f7-eae2-4638-93be-c2c60465629a","resourceVersion":"945","generation":1,"creationTimestamp":"2020-05-06T10:08:33Z","labels":{"run":"hello-minikube"},"managedFields":[{"manager":"kubectl","operation":"Update","apiVersion":"v1","time":"2020-05-06T10:08:33Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:run":{}}},"f:spec":{"f:replicas":{},"f:selector":{".":{},"f:run":{}},"f:template":{".":{},"f:metadata":{".":{},"f:creationTimestamp":{},"f:labels":{".":{},"f:run":{}}},"f:spec":{".":{},"f:containers":{".":{},"k:{\"name\":\"hello-minikube\"}":{".":{},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:ports":{".":{},"k:{\"containerPort\":8080,\"protocol\":\"TCP\"}":{".":{},"f:containerPort":{},"f:protocol":{}}},"f:resources":{},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{}}},"f:dnsPolicy":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:terminationGracePeriodSeconds":{}}}}}}]},"spec":{"replicas":1,"selector":{"run":"hello-minikube"},"template":{"metadata":{"creationTimestamp":null,"labels":{"run":"hello-minikube"}},"spec":{"containers":[{"name":"hello-minikube","image":"gcr.io/google_containers/echoserver:1.4","ports":[{"containerPort":8080,"protocol":"TCP"}],"resources":{},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"IfNotPresent"}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","securityContext":{},"schedulerName":"default-scheduler"}}},"status":{"replicas":0}}

这是我的kubectl版本:
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.0", GitCommit:"6e937839ac04a38cac63e6a7a306c5d035fe7b0a", GitTreeState:"clean", BuildDate:"2017-09-28T22:57:57Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.0", GitCommit:"9e991415386e4cf155a24b1da15becaa390438d8", GitTreeState:"clean", BuildDate:"2020-03-25T14:50:46Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"linux/amd64"}

我尝试卸载kubectl,因为我红色表示我在kubectl(客户端版本)上安装了较旧的版本,但是我不知道如何卸载它

谁能帮帮我吗?

最佳答案

就像Mr. J在评论中所述

The issue is with your kubectl version,you can easily download and replace kubectl binary ...



您可以阅读 Supported releases and component skew

Different components are expected to be compatible across different amounts of skew, all relative to the master version. Nodes may lag masters components by up to two minor versions but should be at a version no newer than the master; a client should be skewed no more than one minor version from the master, but may lead the master by up to one minor version. For example, a v1.3 master should work with v1.1, v1.2, and v1.3 nodes, and should work with v1.2, v1.3, and v1.4 clients.



您应该升级客户端。您可以阅读有关 Install kubectl on Windows的文档。

Install kubectl binary with curl on Windows

  1. Download the latest release v1.18.0 from this link.

    Or if you have curl installed, use this command:

curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/windows/amd64/kubectl.exe

To find out the latest stable version (for example, for scripting), take a look at https://storage.googleapis.com/kubernetes-release/release/stable.txt.

  1. Add the binary in to your PATH.

  2. Test to ensure the version of kubectl is the same as downloaded:

kubectl version --client

Note: Docker Desktop for Windows adds its own version of kubectl to PATH. If you have installed Docker Desktop before, you may need to place your PATH entry before the one added by the Docker Desktop installer or remove the Docker Desktop’s kubectl.

关于kubernetes - 我该如何解决minikube hello-world?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61633103/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com