Kubernetes受限服务帐户

问题描述 投票:0回答:1

我想创建一个服务帐户,该帐户应具有对k8s api的0访问权限。是否可以创建这样的帐户?什么是角色定义?

kubernetes rbac
1个回答
0
投票

您可以尝试定义一个这样的角色:

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: nothing
rules: []

创建它:

kubectl apply -f nothing.yaml

然后将其绑定到您的ServiceAccount:

kubectl create rolebinding nothing --serviceaccount my-serviceaccount --role nothing
© www.soinside.com 2019 - 2024. All rights reserved.