其他分享
首页 > 其他分享> > [k8s] 创建sa类型的kubeconfig

[k8s] 创建sa类型的kubeconfig

作者:互联网

123

---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: my-configmap-updater

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: configmap-updater
rules:
  - apiGroups: [""]
    resources: ["configmaps"]
    verbs: ["create", "update", "patch", "get", "list"]

---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: configmap-updater
  namespace: my-namesapce
subjects:
- kind: ServiceAccount
  name: spf-configmap-updater
  namespace: default
  apiGroup: ""
roleRef:
  kind: ClusterRole
  name: configmap-updater
  apiGroup: rbac.authorization.k8s.io

 

 

参考:https://stackoverflow.com/questions/42170380/how-to-add-users-to-kubernetes-kubectl

标签:configmap,kind,name,kubeconfig,---,updater,sa,k8s
来源: https://www.cnblogs.com/hjfeng1988/p/16095038.html