本文介绍了GKE traefik无法创建rbac权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将traefik作为入口控制器安装在GKE(谷歌云kubernetes引擎)上,并且在尝试时安装:

I am trying to install traefik as an ingress controller on GKE (google cloud kubernetes engine) and when I try:

kubectl apply -f https://raw.githubusercontent.com/containous/traefik/master/examples/k8s/traefik-rbac.yaml

我有此错误:

问题仅在于此部分,另一个已成功创建:

The problem is this part only, the other one is created successfully:

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: traefik-ingress-controller
rules:
  - apiGroups:
      - ""
    resources:
      - services
      - endpoints
      - secrets
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - extensions
    resources:
      - ingresses
    verbs:
      - get
      - list
      - watch

基于文档( https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control )我尝试执行此命令,但仍然收到相同的错误

Based on docs ( https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control) I tried executing this command but I still get the same error

kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=MY_EMAIL_THAT_I_LOGIN_INTO_GCP

有人能解决这个问题吗?还是不起作用?

Has anyone ever manage to fix this? or it just does not work ?

我试图在没有loadBalancer的情况下创建一个kubernetes集群,以便在我的本地机器(minikube)上便宜,我没有这样的问题.

I am trying to make a kubernetes cluster without loadBalancer in order to be cheap on my local machine (minikube), I have no such problems.

推荐答案

因此,对于所有尝试在GKE上安装traefik的人,如果您遇到该错误消息,只需先执行https://stackoverflow.com/a/46316672/1747159

So for everyone who is trying to install traefik on GKE, and you get stuck with that error message, just do that first https://stackoverflow.com/a/46316672/1747159

# Get password value
$ gcloud container clusters describe CUSTER_NAME --zone ZONE_NAME | grep password

# Pass username and password parameters
$ kubectl apply -f https://raw.githubusercontent.com/containous/traefik/master/examples/k8s/traefik-rbac.yaml --username=admin --password=PASSWORD

感谢Nicola Ben帮助我弄清楚了

Thanks Nicola Ben for helping me figure it out

这篇关于GKE traefik无法创建rbac权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 23:22