zoukankan      html  css  js  c++  java
  • 九、授权apiserver访问kubelet

    1、创建一个授权的yaml文件

    [root@k8s-master01 yaml]# cat apiserver-to-kubelet-rbac.yaml 
    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRole
    metadata:
      annotations:
        rbac.authorization.kubernetes.io/autoupdate: "true"
      labels:
        kubernetes.io/bootstrapping: rbac-defaults
      name: system:kube-apiserver-to-kubelet
    rules:
      - apiGroups:
          - ""
        resources:
          - nodes/proxy
          - nodes/stats
          - nodes/log
          - nodes/spec
          - nodes/metrics
          - pods/log
        verbs:
          - "*"
    ---
    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRoleBinding
    metadata:
      name: system:kube-apiserver
      namespace: ""
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: ClusterRole
      name: system:kube-apiserver-to-kubelet
    subjects:
      - apiGroup: rbac.authorization.k8s.io
        kind: User
        name: kubernetes

    2、执行

    [root@k8s-master01 yaml]# kubectl apply -f apiserver-to-kubelet-rbac.yaml 
    clusterrole.rbac.authorization.k8s.io/system:kube-apiserver-to-kubelet created
    clusterrolebinding.rbac.authorization.k8s.io/system:kube-apiserver created
  • 相关阅读:
    Feign Ribbon Hystrix 关系剖析
    Activiti 分布式方案实现探讨
    Flink任务架构分析
    Activiti 数据库表梳理
    负载均衡方案优缺点探讨
    公文流转系统
    css美化界面
    动手动脑(二)
    csslayui树练习
    css点名
  • 原文地址:https://www.cnblogs.com/xw115428/p/11956257.html
Copyright © 2011-2022 走看看