zoukankan      html  css  js  c++  java
  • 【转】k8s集群自定义clusterRole样例

    对pod资源可以删除,进入终端执行命令,其他资源只读权限

    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRole
    metadata:
      annotations:
        rbac.authorization.kubernetes.io/autoupdate: "true"
      creationTimestamp: "2019-10-29T14:21:54Z"
      labels:
        kubernetes.io/bootstrapping: rbac-defaults
      name: uki-view
    rules:
    - apiGroups:
      - ""
      resources:
      - pods
      - pods/attach
      - pods/exec
      - pods/portforward
      - pods/proxy
      verbs:
      - create
      - delete
      - deletecollection
      - patch
      - update
    - apiGroups:
      - ""
      resources:
      - configmaps
      - endpoints
      - persistentvolumeclaims
      - pods
      - replicationcontrollers
      - replicationcontrollers/scale
      - serviceaccounts
      - services
      - nodes
      verbs:
      - get
      - list
      - watch
    - apiGroups:
      - ""
      resources:
      - bindings
      - events
      - limitranges
      - namespaces/status
      - pods/log
      - pods/status
      - replicationcontrollers/status
      - resourcequotas
      - resourcequotas/status
      verbs:
      - get
      - list
      - watch
    - apiGroups:
      - ""
      resources:
      - namespaces
      verbs:
      - get
      - list
      - watch
    - apiGroups:
      - apps
      resources:
      - controllerrevisions
      - daemonsets
      - deployments
      - deployments/scale
      - replicasets
      - replicasets/scale
      - statefulsets
      - statefulsets/scale
      verbs:
      - get
      - list
      - watch
    - apiGroups:
      - autoscaling
      resources:
      - horizontalpodautoscalers
      verbs:
      - get
      - list
      - watch
      - patch
      - update
    - apiGroups:
      - extensions
      resources:
      - daemonsets
      - deployments
      - deployments/scale
      - ingresses
      - networkpolicies
      - replicasets
      - replicasets/scale
      - replicationcontrollers/scale
      verbs:
      - get
      - list
      - watch
    - apiGroups:
      - policy
      resources:
      - poddisruptionbudgets
      verbs:
      - get
      - list
      - watch
    - apiGroups:
      - networking.k8s.io
      resources:
      - networkpolicies
      verbs:
      - get
      - list
      - watch
    - apiGroups:
      - networking.k8s.io
      resources:
      - ingresses
      verbs:
      - get
    - apiGroups:
      - networking.k8s.io
      resources:
      - ingresses
      verbs:
      - list
    - apiGroups:
      - networking.k8s.io
      resources:
      - ingresses
      verbs:
      - watch
    

      

    对集群资源具有增删改查的权限

    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRole
    metadata:
      annotations:
        rbac.authorization.kubernetes.io/autoupdate: "true"
      creationTimestamp: "2019-10-29T14:21:54Z"
      labels:
        kubernetes.io/bootstrapping: rbac-defaults
      name: uki-namespace-all
    rules:
    - apiGroups:
      - ""
      resources:
      - pods
      - pods/attach
      - pods/exec
      - pods/portforward
      - pods/proxy
      verbs:
      - create
      - delete
      - deletecollection
      - patch
      - update
    - apiGroups:
      - ""
      resources:
      - configmaps
      - endpoints
      - persistentvolumeclaims
      - pods
      - replicationcontrollers
      - replicationcontrollers/scale
      - serviceaccounts
      - services
      verbs:
      - get
      - list
      - watch
      - create
      - patch
      - delete
    - apiGroups:
      - ""
      resources:
      - bindings
      - events
      - limitranges
      - namespaces/status
      - pods/log
      - pods/status
      - replicationcontrollers/status
      - resourcequotas
      - resourcequotas/status
      verbs:
      - get
      - list
      - watch
    - apiGroups:
      - ""
      resources:
      - namespaces
      verbs:
      - get
      - list
      - watch
    - apiGroups:
      - apps
      resources:
      - controllerrevisions
      - daemonsets
      - deployments
      - deployments/scale
      - replicasets
      - replicasets/scale
      - statefulsets
      - statefulsets/scale
      verbs:
      - get
      - list
      - watch
      - create
      - patch
      - delete
    - apiGroups:
      - autoscaling
      resources:
      - horizontalpodautoscalers
      verbs:
      - get
      - list
      - watch
      - patch
      - update
      - create
      - delete
    - apiGroups:
      - extensions
      resources:
      - daemonsets
      - deployments
      - deployments/scale
      - ingresses
      - networkpolicies
      - replicasets
      - replicasets/scale
      - replicationcontrollers/scale
      verbs:
      - get
      - list
      - watch
      - patch
      - create
      - delete
    - apiGroups:
      - policy
      resources:
      - poddisruptionbudgets
      verbs:
      - get
      - list
      - watch
    - apiGroups:
      - networking.k8s.io
      resources:
      - networkpolicies
      verbs:
      - get
      - list
      - watch
    - apiGroups:
      - networking.k8s.io
      resources:
      - ingresses
      verbs:
      - get
    - apiGroups:
      - networking.k8s.io
      resources:
      - ingresses
      verbs:
      - list
    - apiGroups:
      - networking.k8s.io
      resources:
      - ingresses
      verbs:
      - watch
      - create
    

    转:https://blog.csdn.net/qq_23191379/article/details/108811404

    ============================= 提升自己 ==========================
    > > > 1、咨询交流,请加微信,备注来意: ren168632201
    > > > 2、【性能测试实战】jmeter+k8s+微服务+skywalking+efk,测试都在学的热门技术: https://www.cnblogs.com/uncleyong/p/15475614.html
    > > > 3、【热门测试技术,建议收藏备用】项目实战、简历、笔试题、面试题、职业规划: https://www.cnblogs.com/uncleyong/p/15777706.html
    > > > 4、【全栈测试题库】常见测试笔试题、面试题汇总(持续更新中。。。): https://www.cnblogs.com/uncleyong/p/11119489.html
    > > > 5、测试基础汇总: https://www.cnblogs.com/uncleyong/p/10530261.html
    > > > 6、声明:如有侵权,请联系删除。
    ============================= 升职加薪 ==========================
  • 相关阅读:
    2019年春季第四周作业
    第三周作业
    第二周作业
    最大值及其下标
    查找整数
    PTA3
    币值转换
    三位老师
    自我介绍
    poj 3278 Catch That Cow(bfs)
  • 原文地址:https://www.cnblogs.com/uncleyong/p/15692654.html
Copyright © 2011-2022 走看看