首页 文章

oidc和k8s的显式配置

提问于
浏览
0

我用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文件中 .

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

1 回答

  • 0

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

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

相关问题