“kubectl label pod” 命令执行出错。

huangapple go评论56阅读模式
英文:

the command "kubectl label pod" execute error

问题

我想要将一个Pod从其部署中隔离开来。所以我执行了以下命令“kubeclt label pod app= --overwrite” 就像这样:

✘ yanchampion@yanchampiondeMacBook-Pro  ~  kubectl -n test1 label pod myapp-deploy-848987f4fb-wc5v2 app=newname-debug --overwrite
Error from server (InternalError): Internal error occurred: replace operation does not apply: doc is missing key: /spec/containers/0/env/ : missing value

这是部署Pod的信息:

 yanchampion@yanchampiondeMacBook-Pro  ~  kubectl -n test1 get pod |grep myapp-deploy
myapp-deploy-848987f4fb-wc5v2                         1/1     Running            0                5d8h

所以问题是什么?

我只是想将Pod从其部署中隔离开!有人可以告诉我如何修复它吗?

英文:

I want to isolate a pod from its deployment. So I execute the command “kubeclt label pod <pod-name> app=<newname> --overwrite” Just like

 ✘ yanchampion@yanchampiondeMacBook-Pro  ~  kubectl -n test1 label pod myapp-deploy-848987f4fb-wc5v2 app=newname-debug --overwrite
Error from server (InternalError): Internal error occurred: replace operation does not apply: doc is missing key: /spec/containers/0/env/	: missing value

Here is the deployment pod info

 yanchampion@yanchampiondeMacBook-Pro  ~  kubectl -n test1 get pod |grep myapp-deploy
myapp-deploy-848987f4fb-wc5v2                         1/1     Running            0                5d8h

So What's the problem?

I just want to isolate the pod from its deployment!
Someone can tell me how to fix it?

答案1

得分: 1

你可以尝试编辑或删除其 Pod 规范中的标签:

kubectl edit pod myapp-deploy-848987f4fb-wc5v2

英文:

You could also try to edit or remove the label from its pod spec:


kubectl edit pod myapp-deploy-848987f4fb-wc5v2

huangapple
  • 本文由 发表于 2023年6月12日 19:25:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/76456199.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定