What happened:
I'm having issues with RBAC, granting the same access to my developers group I can only execute argo commands if using an admin account. Using a developer account, I have this problem:
argo submit --serviceaccount argo --namespace argo https://raw.githubusercontent.com/argoproj/argo/master/examples/artifact-passing.yaml
2018/02/08 15:47:05 Workflow manifest https://raw.githubusercontent.com/argoproj/argo/master/examples/artifact-passing.yaml failed submission: workflows.argoproj.io is forbidden: User "developers-staging" cannot create workflows.argoproj.io in the namespace "argo"
Couldn't find what kind of permissions I need to grant to my developers group. They can create/patch/update/get pods on the argo namespace. Tried a buch of different rules and still the same issue.
What you expected to happen:
This is what happens when I run the same command using an admin account.
argo submit --serviceaccount argo --namespace argo https://raw.githubusercontent.com/argoproj/argo/master/examples/artifact-passing.yaml
Name: artifact-passing-4qx6v
Namespace: argo
ServiceAccount: argo
Status: Pending
Created: Thu Feb 08 15:51:55 -0800 (now)
How to reproduce it (as minimally and precisely as possible):
I created a separeted namespace called argo and service account argo, as I didn't want to grant too much permissions to default.
Everything works fine when I run commands as an administrator, but if I change my kubectl context to developers, no matter what permissions I grant, it still can't submit.
Environment:
CRDs permissions are no different than regular kubernetes resource and you will need to edit the RBAC rules for that role binding appropriately to create/delete/update/patch/etc... resources of type workflows.argoproj.io.
Here is the example policy rule in go that the controller uses:
ArgoControllerPolicyRules = []rbacv1.PolicyRule{
...
{
APIGroups: []string{"argoproj.io"},
Resources: []string{"workflows"},
Verbs: []string{"get", "list", "watch", "update", "patch"},
},
}
That was it. Perfectly
This helped me, too, thanks @nelsonfassis @jessesuen!
Most helpful comment
Here is the example policy rule in go that the controller uses: