[英]How to perform Rolling update and Rollback of deployment in Kubernetes using fabric8 java client API?
I'm using fabric8 java client library for kubernetes in my project. 我在我的项目中将fabric8 java客户端库用于kubernetes。 I am not able to find the best way to perform rolling update and rollback of deployment to previous version using their APIs.
我找不到使用其API执行滚动更新和部署回滚到以前版本的最佳方法。
I tried some of their APIs but don't think it is correct. 我尝试了他们的一些API,但认为这是不正确的。
Config config = new ConfigBuilder().build();
KubernetesClient client = new DefaultKubernetesClient(config);
client.apps().deployments().inNamespace("default").withName("nginx").createOrReplace(deployment);
What is the best way to do it? 最好的方法是什么? Any help is much appreciated.
任何帮助深表感谢。
I think you can do rolling update like this(available since v4.1.3): 我认为您可以像这样进行滚动更新(自v4.1.3起可用):
client.apps().deployments().inNamespace("default")
.withName("nginx")
.rolling()
.withTimeout(5, TimeUnit.MINUTES)
.updateImage("");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.