2016-07-20 14 views
5

ユーザーガイドによると、update a deployment's imagekubectl set/editとの間で可能であり、依然として意味のあるhistoryが得られるはずです。Kubernetes kubectlイメージの展開を設定できません--record 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"} 

ありがとう!

答えて

1

これは、(変更履歴の記録用に)デプロイメントの注釈を更新するときに、更新の競合が発生したためです。つまり、kubectlが展開の変更履歴を更新すると、展開オブジェクトが変更されます(ほとんどの場合、サーバーによって変更されます)。 kubectl set imageは現在、競合時に変更履歴の更新を再試行しません。

私はこれを軽減するためfixを提出しました。

+0

この問題は1.3.0で発生しましたが、これは1.3.4で修正されています。 – Sion

+0

この問題は1.3.6で発生しています。 – Zhomart

+0

私はこの問題も1.3.6で取り上げています。 – Nopik

関連する問題