Kubernetes

[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

这篇关于[k8s] 创建sa类型的kubeconfig的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!