How to set RBAC for a user to submit Argo workflow in a specific namespace?

别来无恙 提交于 2019-12-11 19:35:25

问题


I'm checking Argo and I would like to grant a specific namespace for a user (or multiple users) to use Argo workflow (and let the users access features such as artifacts, outputs, access to secrets). I have set up a user and created a namespace (testing in minikube). How should I bind roles for the user, namespace and Argo workflow?

Here is role and rolebinding yaml files I have now.

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

Thank you!


回答1:


Great guide for you to have a step by step explanation how to create namespace, user and grant permissions to work with this user only in chosen 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



来源:https://stackoverflow.com/questions/55719049/how-to-set-rbac-for-a-user-to-submit-argo-workflow-in-a-specific-namespace

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!