容器编排技术 -- Kubernetes kubectl rolling-update 命令详解

  • 1 kubectl rolling-update
  • 2 语法
  • 3 示例
  • 4 Flags

kubectl rolling-update

执行指定ReplicationController的滚动更新。

该命令创建了一个新的RC, 然后一次更新一个pod方式逐步使用新的PodTemplate,最终实现Pod滚动更新,new-controller.json需要与之前RC在相同的namespace下。

!http://kubernetes.io/images/docs/kubectl_rollingupdate.svg

语法

$ rolling-update OLD_CONTROLLER_NAME ([NEW_CONTROLLER_NAME] --image=NEW_CONTAINER_IMAGE | -f NEW_CONTROLLER_SPEC)

示例

使用frontend-v2.json中的新RC数据更新frontend-v1的pod。

kubectl rolling-update frontend-v1 -f frontend-v2.json

使用JSON数据更新frontend-v1的pod。

cat frontend-v2.json | kubectl rolling-update frontend-v1 -f -

其他

kubectl rolling-update frontend-v1 frontend-v2 --image=image:v2kubectl rolling-update frontend --image=image:v2kubectl rolling-update frontend-v1 frontend-v2 --rollback

Flags

Name Shorthand Default Usage
allow-missing-template-keys   true If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.
container     Container name which will have its image upgraded. Only relevant when --image is specified, ignored otherwise. Required when using --image on a multi-container pod
deployment-label-key   deployment The key to use to differentiate between two different controllers, default 'deployment'. Only relevant when --image is specified, ignored otherwise
dry-run   false If true, only print the object that would be sent, without sending it.
filename f [] Filename or URL to file to use to create the new replication controller.
image     Image to use for upgrading the replication controller. Must be distinct from the existing image (either new image or new image tag). Can not be used with --filename/-f
image-pull-policy     Explicit policy for when to pull container images. Required when --image is same as existing image, ignored otherwise.
include-extended-apis   true If true, include definitions of new APIs via calls to the API server. [default true]
no-headers   false When using the default or custom-column output format, don't print headers (default print headers).
output o   Output format. One of: json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See custom columns [http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns], golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://kubernetes.io/docs/user-guide/jsonpath].
output-version     DEPRECATED: To use a specific API version, fully-qualify the resource, version, and group (for example: 'jobs.v1.batch/myjob').
poll-interval   3s Time delay between polling for replication controller status after the update. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
rollback   false If true, this is a request to abort an existing rollout that is partially rolled out. It effectively reverses current and next and runs a rollout
schema-cache-dir   ~/.kube/schema If non-empty, load/store cached API schemas in this directory, default is '$HOME/.kube/schema'
show-all a false When printing, show all resources (default hide terminated pods.)
show-labels   false When printing, show all labels as the last column (default hide labels column)
sort-by     If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
template     Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].
timeout   5m0s Max time to wait for a replication controller to update before giving up. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
update-period   1m0s Time to wait between updating pods. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
validate   true If true, use a schema to validate the input before sending it

容器编排技术 -- Kubernetes kubectl rolling-update 命令详解相关推荐

  1. 容器编排技术 -- Kubernetes kubectl rollout resume 命令详解

    容器编排技术 -- Kubernetes kubectl rollout resume 命令详解 1 kubectl rollout resume 2 语法 3 示例 4 Flags kubectl ...

  2. 容器编排技术 -- Kubernetes kubectl rollout undo 命令详解

    容器编排技术 -- Kubernetes kubectl rollout undo 命令详解 1 kubectl rollout undo 2 语法 3 示例 4 Flags kubectl roll ...

  3. 容器编排技术 -- Kubernetes kubectl rollout status 命令详解

    容器编排技术 -- Kubernetes kubectl rollout status 命令详解 1 kubectl rollout status 2 语法 3 示例 4 Flags kubectl ...

  4. 容器编排技术 -- Kubernetes kubectl rollout pause 命令详解

    容器编排技术 -- Kubernetes kubectl rollout pause 命令详解 1 kubectl rollout pause 2 语法 3 示例 4 Flags kubectl ro ...

  5. 容器编排技术 -- Kubernetes kubectl rollout history 命令详解

    容器编排技术 -- Kubernetes kubectl rollout history 命令详解 1 kubectl history 2 语法 3 示例 4 Flags kubectl histor ...

  6. 容器编排技术 -- Kubernetes kubectl create clusterrolebinding 命令详解

    容器编排技术 -- Kubernetes kubectl create clusterrolebinding 命令详解 1 kubectl create clusterrolebinding 2 语法 ...

  7. 容器编排技术 -- Kubernetes kubectl create secret 命令详解

    容器编排技术 -- Kubernetes kubectl create secret 命令详解 1 kubectl create secret 2 语法 3 参考: kubectl create se ...

  8. 容器编排技术 -- Kubernetes kubectl create serviceaccount 命令详解

    容器编排技术 -- Kubernetes kubectl create serviceaccount 命令详解 1 kubectl create serviceaccount 2 语法 3 示例 4  ...

  9. 容器编排技术 -- Kubernetes kubectl create service 命令详解

    容器编排技术 -- Kubernetes kubectl create service 命令详解 1 kubectl create service 2 语法 3 参考 kubectl create s ...

  10. 容器编排技术 -- Kubernetes kubectl create rolebinding 命令详解

    容器编排技术 -- Kubernetes kubectl create rolebinding 命令详解 1 kubectl create rolebinding 2 语法 3 示例 4 Flags ...

最新文章

  1. js调用html5cookie,CSS+JS+Cookie实现页脚固定广告展示
  2. jquery的each()详细介绍
  3. html 弹窗被拦截,window.open()弹窗被浏览器拦截的解决方法
  4. 2012年12月第二个周末
  5. SpringMVC 的执行流程
  6. linux中fopen和open的区别,Linux下open与fopen的区别
  7. 在没有Docker容器的Ubuntu上安装SQL Server 2019
  8. [Linux]磁盘端口I/O
  9. java 线程condition_(七)java多线程之Condition
  10. Spring源码之idea导入Spring源码
  11. Android最新flash播放器----支持安卓5.0+系统。
  12. 降低AI开发门槛,飞桨重启“软件定义硬件”浪潮
  13. 现代程序设计 homework-06
  14. 普通人现在入局做抖音短视频晚么 选择项目的标准是什么
  15. USB开发-USB从启动到运行
  16. 几个opencv自带测试视频
  17. Java 蜡烛图_7-13 日K蜡烛图 - osc_9vrg5zhs的个人空间 - OSCHINA - 中文开源技术交流社区...
  18. 组合电路中的竞争与冒险
  19. CocosCreator之KUOKUO带你做音乐可视化
  20. 知网论文免费下载,请速度存好!

热门文章

  1. jquery在线预览PDF文件,打开PDF文件
  2. Table被web编程弃用的原因
  3. 并查集——食物链(poj1182)
  4. 动态规划——数塔(hdu2084)
  5. AIDE --Linux高级入侵检测
  6. linux chcon命令详解
  7. Spring、SpringMVC、Spring Boot、Spring Cloud 概念、关系及区别
  8. 【今日CS 视觉论文速览】 27 Dec 2018
  9. linux 命令行使用wget下载百度云资源
  10. 【设计模式】设计模式C++编程实现之策略模式(Strategy Pattern)