2016-07-20 675 views
5

根據用戶指南,應該有可能update a deployment's imagekubectl set/edit,仍然可以得到一個有意義的historyKubernetes kubectl設置圖像部署不能夠 - 記錄歷史?

但是我得到一些錯誤,而沒有有意義的歷史,這可能是一個錯誤?

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

謝謝!

回答

1

這是由於更新部署的註釋(用於記錄其更改歷史記錄)時發生更新衝突。這意味着當kubectl更新部署更改歷史記錄時,部署對象被修改(很可能由服務器)。 kubectl set image目前不會在衝突時重試更改歷史記錄更新。

我已經提交了一個fix來減輕這一點。

+0

我在1.3.0中遇到了這個問題,但我可以證實這個問題現在已經用1.3.4修復了。 – Sion

+0

我在1.3.6上遇到這個問題。 – Zhomart

+0

我也在1.3.6上遇到這個問題。 – Nopik