Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unsupported value: "rbac.authorization.k8s.io"

Tags:

kubernetes

When I try to

kubectl create -f cloudflare-argo-rolebinding.yml

this RoleBinding

kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: cloudflare-argo-rolebinding
  namespace: default
subjects:
- kind: ServiceAccount
  name: cloudflare-argo
  apiGroup: rbac.authorization.k8s.io
roleRef:
  kind: Role
  name: cloudflare-argo-role
  apiGroup: rbac.authorization.k8s.io

I get this error :

The RoleBinding "cloudflare-argo-rolebinding" is invalid: subjects[0].apiGroup: Unsupported value: "rbac.authorization.k8s.io": supported values: ""

Any idea ? I'm on DigitalOcean using their new Kubernetes service if it helps.

like image 330
R.Kalbe Avatar asked Oct 29 '18 17:10

R.Kalbe


2 Answers

I think problem is using wrong apiGroup.

kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: cloudflare-argo-rolebinding
  namespace: default
subjects:
- kind: ServiceAccount
  name: cloudflare-argo
  # apiGroup is ""(core/v1) for service_account
  apiGroup: ""
roleRef:
  kind: Role
  name: cloudflare-argo-role
  apiGroup: rbac.authorization.k8s.io
like image 62
Shudipta Sharma Avatar answered Oct 19 '22 17:10

Shudipta Sharma


ServiceAccount subjects are in the v1 API, which is apiGroup ""

like image 42
Jordan Liggitt Avatar answered Oct 19 '22 16:10

Jordan Liggitt