【发布时间】:2019-11-08 18:20:29
【问题描述】:
学习教程时:https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/ 我遇到了错误。以下命令失败:
kubectl patch sts web -p '{"spec":{"replicas":3}}'
Error from server (BadRequest): json: cannot unmarshal string into Go value of type map[string]interface {}
我该如何解决这个问题?
这是 pod 上的容器镜像:k8s.gcr.io/nginx-slim:0.8
我在 Windows 7 Pro 和标准 cmd shell 上使用 minikube。
kubectl 版本
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0",
GitCommit:"2bd9643cee5b3b3a5ecbd3af
9d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:36:53Z",
GoVersion:"go1.12.9", Compiler:"gc"
Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0",
GitCommit:"2bd9643cee5b3b3a5ecbd3af
9d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:27:17Z",
GoVersion:"go1.12.9", Compiler:"gc"
Platform:"linux/amd64"}
【问题讨论】:
-
您使用的是什么外壳,引用是否有可能令人伤心?
-
我已经编辑了问题。
标签: json kubernetes