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

  • 1 kubectl create clusterrole
  • 2 语法
  • 3 示例
  • 4 Flags

kubectl create clusterrole

创建一个ClusterRole。

语法

$ clusterrole NAME --verb=verb --resource=resource.group [--resource-name=resourcename] [--dry-run]

示例

创建一个名为“pod-reader”的ClusterRole,允许用户在pod上执行“get”,“watch”和“list”

kubectl create clusterrole pod-reader --verb=get,list,watch --resource=pods

创建一个名为“pod-reader”的ClusterRole,其中指定了ResourceName

kubectl create clusterrole pod-reader --verb=get,list,watch --resource=pods --resource-name=readablepod --resource-name=anotherpod

在指定的API Group中创建为"foo"的ClusterRole

kubectl create clusterrole foo --verb=get,list,watch --resource=rs.extensions

创建一个名为“foo”的ClusterRole,并指定SubResource

kubectl create clusterrole foo --verb=get,list,watch --resource=pods,pods/status

使用指定的NonResourceURL创建名称“foo”的ClusterRole

kubectl create clusterrole "foo" --verb=get --non-resource-url=/logs/*

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.
dry-run   false If true, only print the object that would be sent, without sending it.
no-headers   false When using the default or custom-column output format, don't print headers (default print headers).
non-resource-url   [] a partial url that user should have access to.
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').
resource   [] resource that the rule applies to
resource-name   [] resource in the white list that the rule applies to, repeat this flag for multiple items
save-config   false If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.
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].
validate   true If true, use a schema to validate the input before sending it
verb   [] verb that applies to the resources contained in the rule

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

最新文章

  1. 腾讯面试官:如何停止一个正在运行的线程?我蒙了。。。
  2. [收集] Web服务相关的, 介绍框架(framework)类的论文
  3. 阿里云服务器CentOS7版本yum方式安装mysql
  4. 如何用python和pip安装在txt文件中配置好版本的库包
  5. java 类的执行顺序_Java中类的执行顺序
  6. linux命令行界面下ctrl 常用组合键速查表
  7. SQL脚本修改数据库名称
  8. 【华为云技术分享】序列特征的处理方法之一:基于注意力机制方法
  9. gridview為什麼分頁後,GridView1_RowDataBound就運行不了
  10. APM中SBUS信号解析
  11. 语言-英语-美国英语:美国英语
  12. MATLAB 轮式机器人轨迹跟踪仿真
  13. 在使用mac和windows双系统中常见的移动硬盘的格式
  14. 小米手环如何连接苹果手机
  15. 虚拟机 host-only网络配置
  16. aqs clh java_Java并发编程:AQS对CLH锁的优化
  17. 痘印服务器维护,脸上有痘印怎么弄才能消除
  18. 查网站百度权重的工具
  19. java云同桌学习系列(十四)——JavaScript语言
  20. 一、RISC-V SoC内核——取指 代码讲解

热门文章

  1. iATKOSv7+硬盘安装助手+变色龙
  2. 提交表单到弹出窗口 Submit a form into a popup
  3. js页面文字选中后分享到新浪微博实现
  4. jquery user interface
  5. 深度学习(机器学习)模型压缩开源库整理
  6. UML学习-----类图
  7. Linux文件系统不是必须的,而是必要的!
  8. 【AI视野·今日CV 计算机视觉论文速览 第233期】Tue, 3 Aug 2021
  9. 生成名片二维码 python
  10. 爬虫-36kr-接口分析-191016