最近開始學Kubernetes,為了方便佈署了Dashboard
期間碰到2個問題

1、deployments.apps is forbidden: User “system:serviceaccount:kube-system:namespace-controller” cannot create resource “deployments” in API group “apps” in the namespace “default”
解決辦法

kubectl create clusterrolebinding gitlab-cluster-admin --clusterrole=cluster-admin --group=system:serviceaccounts --namespace=default

2、登入Dashboard後,出現 configmaps is forbidden: User  system:anonymous cannot list resource configmaps in API g_wangmiaoyan
解決辦法

kubectl create clusterrolebinding test:anonymous --clusterrole=cluster-admin --user=system:anonymous

出處:
匿名用户被禁止访问configmaps is forbidden: User “system:anonymous” cannot list resource “configmaps” in API
kubernetes:pods is forbidden: User “system:serviceaccount:dev:default” cannot create resource “pods”

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *