oidc和k8s的显式配置

时间:2017-08-07 08:39:01

标签: kubernetes kubectl kubeadm

我已经使用kubeadm设置了k8s单节点集群。我已经用它配置了oidc并对〜/ .kube / config文件进行了更改。是否有任何必须对kubectl上下文或凭证进行的显式配置?

我已将用户,client-id,client-secret,id_token和refresh id添加到/.kube/config文件中。 除此之外,我已将oidc-issuer-url,oidc-username-claim和oidc-client-id添加到kube-apiserver.yaml文件中。

除此之外还有什么必须添加的吗?我假设我错过了一些东西,因为当我尝试命令时error: You must be logged in to the server (the server has asked for the client to provide credentials) kubectl --user=name@gmail.com get nodes

1 个答案:

答案 0 :(得分:0)

您可以查看apiserver的日志,以检查在身份验证期间获得的错误。

您应该在apiserver.yaml中添加oidc-issuer-url,oidc-username-claim,oidc-client-id和--oidc-ca-file。