Alex
Alex

Reputation: 59

How can I resolve minikube hello-world?

I have a problem running hello-minikube in kubernetes. This is the command:

run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=8080

This the result:

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}}

This is my version of 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"}

I'm tried to uninstall kubectl because I red that I have an older version on kubectl(client version), but I don't know how can I uninstall It

Can anyone please help me?

Upvotes: 1

Views: 578

Answers (1)

Crou
Crou

Reputation: 11388

Like already stated in comments by Mr. J

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

You can read the 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.

You should upgrade the client. You can read documentation about 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.

Upvotes: 1

Related Questions