Error from server (Forbidden): error when creating .. : clusterroles.rbac.authorization.k8s.io …: attempt to grant extra privileges:

前端 未结 2 595
小鲜肉
小鲜肉 2021-02-04 02:14

Failed to create clusterroles. <> already assigned as the roles of \"container engine admin\" & \"container engine cluster admin\"

Error from server (Forb         


        
2条回答
  •  不思量自难忘°
    2021-02-04 02:36

    I've got the same problem on Google Kubernetes Engine.

    According to the answer of enj and the comment of ccyang2005 please find the following snipet who solve my problem :)

    Step 1 : Get your identity

    gcloud info | grep Account
    

    Will output you something like Account: [myname@example.org]

    Step 2 : grant cluster-admin to your current identity

    kubectl create clusterrolebinding myname-cluster-admin-binding \
      --clusterrole=cluster-admin \
      --user=myname@example.org
    

    Will output somthing like Clusterrolebinding "myname-cluster-admin-binding" created


    After that, you'll be able to create CusterRoles

提交回复
热议问题