生成特定权限和配额的kubeconfig
Last updated
Was this helpful?
Last updated
Was this helpful?
注:所有步骤的一键生成脚本可以在下载。
找到一台可以访问集群apiserver并且对集群有admin操作权限的机器,以下的操作是直接在master节点上进行的。
创建namespace,并在该namespace时创建一个service account
获取该service account对应的secret
获取secret对应的token
获取集群信息,并存到cluster-cert.txt文件里。
用以上信息按照下面的格式生成kubeconfig
权限控制
创建一个新的namepsace和role,并通过rbac控制上面生成的service account只能访问该namespace里的资源。
为新建的namespace设置quota
Creating a kubeconfig file for a self-hosted Kubernetes cluster:
Kubernetes: Creating Service Accounts and Kubeconfigs:
Resource Quotas: