我正在检查Argo,我想为一个用户(或多个用户)授予一个特定的命名空间,以使用Argo工作流程(并让用户访问诸如 Artifact ,输出,访问 secret 之类的功能)。我已经建立了一个用户并创建了一个命名空间(在minikube中进行测试)。我应该如何为用户, namespace 和Argo工作流绑定(bind)角色?

这是我现在拥有的角色和角色绑定(bind)yaml文件。

kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  namespace: default
  name: pod-reader
rules:
- apiGroups: [“”]
  resources: [“pods”]
  verbs: [“get”, “watch”, “list”]
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: read-pods
  namespace: default
subjects:
- kind: User
  name: user1
  apiGroup: rbac.authorization.k8s.io
roleRef:
  kind: Role
  name: pod-reader
  apiGroup: rbac.authorization.k8s.io

谢谢!

最佳答案

指导您逐步说明如何创建 namespace ,用户以及仅在所选 namespace 中与该用户一起使用的权限的出色指南:

https://docs.bitnami.com/kubernetes/how-to/configure-rbac-in-your-kubernetes-cluster/#use-case-1-create-user-with-limited-namespace-access

Step 1: Create the namespace

Step 2: Create the credentials

Step 3: Create the role for managing deployments

Step 4: Bind the role to the user

Step 5: Test the RBAC rule

关于kubernetes - 如何为用户设置RBAC以在特定 namespace 中提交Argo工作流?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/55719049/

10-11 10:33