Kubernetes RBAC-用户有权获取Pod,但显示“未经授权”

时间:2020-04-10 08:47:51

标签: kubernetes keycloak rbac

我已经为Kubernetes RBAC配置了密钥斗篷。

  • 有权访问广告连播的用户
vagrant@haproxy:~/.kube$ kubectl auth can-i get pods --user=oidc
Warning: the server doesn't have a resource type 'pods'
yes
vagrant@haproxy:~/.kube$ kubectl get pods --user=oidc
error: You must be logged in to the server (Unauthorized)

用户的我的kubeconfig文件如下所示

users:
- name: oidc
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args:
      - oidc-login
      - get-token
      - --oidc-issuer-url=https://test.example.com/auth/realms/kubernetes
      - --oidc-client-id=kubernetes
      - --oidc-client-secret=e479f74d-d9fd-415b-b1db-fd7946d3ad90
      - --username=test
      - --grant-type=authcode-keyboard
      command: kubectl

反正有办法使它正常工作吗?

1 个答案:

答案 0 :(得分:1)

问题出在群集的IP地址上。如果使用IP地址,则可能必须配置DNS名称。

相关问题