gpt4 book ai didi

image - Kubernetes kubectl 设置镜像部署无法--记录历史记录?

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

根据用户指南,应该可以update a deployment's image使用 kubectl set/edit 仍然得到有意义的 history .

但是我收到了一些错误,并且没有有意义的历史记录,这可能是一个错误吗?

$ kubectl create -f kubernetes/deployment.yml --record
deployment "nginx" created

$ kubectl set image deployment/nginx nginx=nginx:0.2.0
deployment "nginx" image updated
changes to deployments/nginx can't be recorded: Operation cannot be fulfilled on deployments.extensions "nginx": the object has been modified; please apply your changes to the latest version and try againc

$ kubectl set image deployment/nginx nginx=nginx:0.2.1
deployment "nginx" image updated
changes to deployments/nginx can't be recorded: Operation cannot be fulfilled on deployments.extensions "nginx": the object has been modified; please apply your changes to the latest version and try again

$ kb rollout history deployment/nginx
deployments "nginx":
REVISION CHANGE-CAUSE
1 kubectl create -f kubernetes/deployment.yml --record
2 kubectl create -f kubernetes/deployment.yml --record
3 kubectl create -f kubernetes/deployment.yml --record

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.0+2831379", GitCommit:"283137936a498aed572ee22af6774b6fb6e9fd94", GitTreeState:"not a git tree", BuildDate:"2016-07-05T15:40:13Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.0", GitCommit:"283137936a498aed572ee22af6774b6fb6e9fd94", GitTreeState:"clean", BuildDate:"2016-07-01T19:19:19Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"linux/amd64"}

谢谢!

最佳答案

这是由于我们更新部署的注释(用于记录其更改历史记录)时发生更新冲突。这意味着当 kubectl 更新部署更改历史记录时,部署对象会被修改(很可能由服务器修改)。 kubectl set image 目前不会为您重试冲突时的更改历史记录更新。

我已提交 fix以减轻这种情况。

关于image - Kubernetes kubectl 设置镜像部署无法--记录历史记录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38476531/

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