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

  • 1 kubectl scale
  • 2 语法
  • 3 示例
  • 4 Flags

kubectl scale

扩容或缩容 Deployment、ReplicaSet、Replication Controller或 Job 中Pod数量。

scale也可以指定多个前提条件,如:当前副本数量或 --resource-version ,进行伸缩比例设置前,系统会先验证前提条件是否成立。

语法

$ scale [--resource-version=version] [--current-replicas=count] --replicas=COUNT (-f FILENAME | TYPE NAME)

示例

将名为foo中的pod副本数设置为3。

kubectl scale --replicas=3 rs/foo

将由“foo.yaml”配置文件中指定的资源对象和名称标识的Pod资源副本设为3。

kubectl scale --replicas=3 -f foo.yaml

如果当前副本数为2,则将其扩展至3。

kubectl scale --current-replicas=2 --replicas=3 deployment/mysql

设置多个RC中Pod副本数量。

kubectl scale --replicas=5 rc/foo rc/bar rc/baz

Flags

Name Shorthand Default Usage
current-replicas   -1 Precondition for current size. Requires that the current size of the resource match this value in order to scale.
filename f [] Filename, directory, or URL to files identifying the resource to set a new size
include-extended-apis   true If true, include definitions of new APIs via calls to the API server. [default true]
output o   Output mode. Use "-o name" for shorter output (resource/name).
record   false Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.
recursive R false Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.
replicas   -1 The new desired number of replicas. Required.
resource-version     Precondition for resource version. Requires that the current resource version match this value in order to scale.
timeout   0s The length of time to wait before giving up on a scale operation, zero means don't wait. Any other values should contain a corresponding time unit (e.g. 1s, 2m, 3h).

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

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

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

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

    容器编排技术 -- Kubernetes kubectl replace 命令详解 1 kubectl replace 2 语法 3 示例 4 Flags kubectl replace 使用配置文件 ...

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

    容器编排技术 -- Kubernetes kubectl patch 命令详解 1 kubectl patch 2 语法 3 示例 4 Flags kubectl patch 使用(patch)补丁修 ...

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

    容器编排技术 -- Kubernetes kubectl label 命令详解 1 kubectl label 2 语法 3 示例 4 Flags kubectl label 更新(增加.修改或删除) ...

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

    容器编排技术 -- Kubernetes kubectl get 命令详解 1 kubectl get 2 语法 3 示例 4 Flags kubectl get 获取列出一个或多个资源的信息. 可以 ...

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

    容器编排技术 -- Kubernetes kubectl edit 命令详解 1 kubectl edit 2 语法 3 示例 4 Flags kubectl edit 使用默认编辑器 编辑服务器上定 ...

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

    容器编排技术 -- Kubernetes kubectl delete 命令详解 1 kubectl delete 2 语法 3 示例 4 Flags kubectl delete 通过配置文件名.s ...

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

    容器编排技术 -- Kubernetes kubectl create 命令详解 1 kubectl create 2 语法 3 示例 4 Flags kubectl create 通过配置文件名或s ...

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

    容器编排技术  - Kubernetes kubectl convert 命令详解 1 kubectl convert 2 语法 3 示例 4 Flags kubectl convert 转换配置文件 ...

最新文章

  1. NS_ASSUME_NONNULL_BEGIN 延伸
  2. 基于R的混合线性模型的实现
  3. 编程珠玑第三章习题答案
  4. 没附上语音包资源的python文字转语音
  5. GestureDetector.OnGestureListener 详解
  6. 30分钟正则表达式指导
  7. matlab 分隔线,matlab字符分割方法
  8. JSK-16501 扫雷游戏【谜题】
  9. hdu1263 简单模拟
  10. 运维 ansible工具
  11. 01Python可视化开发环境之Pycharm+Anaconda3安装配置详细步骤
  12. 如何更改电脑开机密码
  13. 2021百度之星报名开启 特设“小星星”奖项鼓励少年AI人才
  14. java字符转换成16进制_java 16进制与字符串直接相互转换
  15. dnf时装补丁教程_DNF补丁教程:就 是 这 么 简 单
  16. OpenGL图形旋转
  17. Survey Report on CDMA ——Learning Triggered by GSM Hijacking
  18. 2022商业地产百货零售行业IT及数字化转型分析
  19. Hexo + Butterfly 从零开始搭建个人博客(五)
  20. 【信号检测】基于matlab自适应滤波法微弱信号检测【含Matlab源码 2308期】

热门文章

  1. 如何优雅的使用 phpStorm
  2. Anti-AdBlock 反AdBlock
  3. 从零开始构建HTML 5 Web页面
  4. Zclip:复制页面内容到剪贴板兼容各浏览器
  5. Objective-C 2.0 with Cocoa Foundation--- 8,类方法以及私有方法
  6. Kinect1和Kinect2的区别
  7. Visual Studio—— IntelliSense: #error 指令: Please use the /MD switch for _AFXDLL builds
  8. MySQL—用户和权限管控
  9. 案例 体检套餐管理系统 需求一览 c# 1614099219
  10. StringBuilder类的对象 c#