容器编排技术 -- 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. 【部分原创】python实现视频内的face swap(换脸)
  2. 服务器架构及实战(架构篇)- PHP建站
  3. 第10讲:高效存储 MongoDB 的用法
  4. qt的项目中单个文件加载样式表
  5. python解析response的json_从HTML responseTex解析JSON
  6. 推荐--jQuery使用手册
  7. 大数据之-Hadoop环境搭建_hadoop官网手册---大数据之hadoop工作笔记0020
  8. java jni编译_从源码编译Android系统的Java类库和JNI动态库的方法
  9. 数据集.npy格式与png格式互换
  10. Dz插件-Discuz插件-免费Discuz采集伪原创发布插件
  11. Acer e5-571g 完美黑苹果10.13
  12. Linux -Spark安装
  13. 开源力量 Linux内核源码深度解析与开发实战
  14. excel 链接sql server数据库,并使用sql语句导出自己想要的数据
  15. Tinyxml一一利用tinyxml读取节点元素属性值
  16. 解决金山词霸和有道词典不能对pdf文档屏幕取词的方法
  17. 一个栈的入栈序列是 a,b,c,d,e,则栈的不可能的输出序列是( ) 。
  18. 从零开始的Unity萌导书#1:Hello,Unity! 1
  19. 电子现金 圈存、补登
  20. Xcode菜单及常用快捷键大全

热门文章

  1. IE和FireFox中的event事件
  2. 手机firebug查看网页代码 How to View Website Source Codes on iPad / iPhone
  3. 大数据量的存储分表常见算法
  4. MySQL常用函数 二
  5. jquery1.4 API 区别与更新中文版(beta)
  6. 208.实现Trie(前缀树)
  7. Elasticsearch整理笔记(三)
  8. Linux开启路由转发功能
  9. centos7 使用sendmail 发送邮件
  10. Kubernetes-NodePort(十七)