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

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

kubectl create role

使用单一规则创建Role。

语法

$ role NAME --verb=verb --resource=resource.group/subresource [--resource-name=resourcename] [--dry-run]

示例

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

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

创建名为“pod-reader”的Role,并指定ResourceName

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

使用指定的API Group 创建名为“foo”的Role

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

使用指定的SubResource创建名为“foo”的Role

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

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).
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 role 命令详解相关推荐

  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 quota 命令详解

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

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

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

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

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

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

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

最新文章

  1. mysql去掉两个最高分_从MySQL中的单列获取最高得分值,从两列获取最高得分值...
  2. SAPPHIRE NOW阿里云 - 国内传播
  3. CNCF推出云原生网络功能(CNF)Testbed
  4. SAP Spartacus Translation (翻译) 相关话题
  5. Qt|C++-OpenGL绘制三角形带
  6. Android 功耗(8)---如何找到阻止进入deep idle / SODI的元凶
  7. 传感器原理及工程应用第4版
  8. Django Book 中对于MVC的阐释
  9. 人工智能:博弈--人机中国象棋
  10. Ansible自动化采集数据并生成巡检报告
  11. git restore 和 git restore --staged 的区别
  12. build.sh脚本
  13. 【定位设备】蓝牙信标接近距离的计算方式及其部署原则
  14. 五、使用Python操作数据库
  15. 共模电感 | 磁芯选型
  16. 工具总结篇——vault
  17. android上调试H5小工具
  18. 考研英语唐叔的语法课笔记
  19. java aop面试_我想知道Spring在面试中应该怎么介绍,以及如何介绍他的aop?
  20. 有了他,和编程大牛面基不在话下

热门文章

  1. 15 个第三方Web 表单资源
  2. 优化MySQL,还是使用缓存?
  3. 常用JavaScript函数 71 -(自我总结)
  4. 获取远程文件内容之浏览器模拟器(BrowserEmulator)
  5. 【AI视野·今日NLP 自然语言处理论文速览 第十八期】Fri, 2 Jul 2021
  6. 【Latex】下标放在符号正下方
  7. 【设计模式】设计模式C++编程实现之单例模式(Singleton Pattern)
  8. 自定义播放器 winform
  9. 实体与标识符的理解 0125
  10. python快速体验课-2020年2月