Kubernetes cluster role error: at least one verb must be specified

4/26/2017

I have the following clusterrole

apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
  name: test
rules:
- apiGroups: [""]
  resources: ["crontabs"]
  verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]

with the following error on create

jonathan@sc-test-cluster:~$ kubectl create clusterrole role.yml
error: at least one verb must be specified
-- Jonathan
kubernetes

1 Answer

4/26/2017

You either create it from file using -f or by specifying the options using clusterrole, see also the docs, but not both. Try the following:

$ kubectl create -f role.yml
-- Michael Hausenblas
Source: StackOverflow