Kubernetes中的服务帐户令牌管理

时间:2017-10-21 21:22:03

标签: authentication authorization kubernetes

参考kubernetes文档,在"使用API​​ - >访问API - >验证 - >身份验证策略 - >服务帐户代币",它说如下;

 --service-account-key-file A file containing a PEM encoded key for signing bearer tokens. If unspecified, the API server’s TLS private key will be used.

和"使用API​​ - >访问API - >管理服务帐户 - >服务帐户自动化 - > Token Controller",它说如下;

You must pass a service account private key file to the token controller in the controller-manager by using the --service-account-private-key-file option. The private key will be used to sign generated service account tokens. Similarly, you must pass the corresponding public key to the kube-apiserver using the --service-account-key-file option. The public key will be used to verify the tokens during authentication.

我有点困惑,前者说标志(作为部分apiserver运行的准入控制器,对吗?)将用于签署令牌,但后者表示它将用于验证令牌和令牌将由控制器管理器签名。

请帮忙!

1 个答案:

答案 0 :(得分:1)

控制器管理器创建令牌,使用私钥对其进行签名并将其存储在Secret API对象中。

当令牌呈现给API服务器时,API服务器使用通过flags设置的公钥来验证签名。

入场与签署或验证令牌无关。它用于在创建pod时向pod规范添加Secret卷安装,以便将服务帐户令牌安装到pod中,供应用程序使用以与Kubernetes API通信

相关问题