gpt4 book ai didi

ssl - 如何使用 Kubernetes 集群中已有的证书

转载 作者:太空宇宙 更新时间:2023-11-03 13:14:55 26 4
gpt4 key购买 nike

我对导入现有证书有一些疑问。

  1. 证书如何在 Kubernetes 内部使用(例如在 api 服务器和 worker、主 Controller 等之间)?Kubernetes 有 CA 吗? (如何)生成供内部使用的证书?

  2. 每一层都需要什么证书?

最佳答案

Kubernetes 中的证书主要用于保护与 API 服务器之间的通信。取自official Kubernetes documentation :

Every Kubernetes cluster has a cluster root Certificate Authority (CA). The CA is generally used by cluster components to validate the API server’s certificate, by the API server to validate kubelet client certificates, etc. To support this, the CA certificate bundle is distributed to every node in the cluster and is distributed as a secret attached to default service accounts. Optionally, your workloads can use this CA to establish trust. Your application can request a certificate signing using the certificates.k8s.io API using a protocol that is similar to the ACME draft.

使用 kubeadm 创建集群时,该工具首先在 /etc/kubernetes/pki 中创建一个 CA,并使用其私钥签署所有后续证书。 ca 稍后分发到所有节点上进行验证,并且还在 /etc/kubernetes/admin.conf 中找到了 base64 编码,用于通过 kubectl 对 api server 进行验证。

通过将您自己的 CA 和您的私钥作为 ca.crtca.key 放置在 /etc/中,可以使用您自己的 CA 来创建集群kubernetes/pki 在调用 kubeadm init 或之后使用 --cert-dir 指定的任何文件夹之前。

还有许多其他安装 Kubernetes 的方法,但它们本质上都是在任何实际 Kubernetes 代码运行之前创建一个 CA,或者要求一个 CA 预先存在。

关于ssl - 如何使用 Kubernetes 集群中已有的证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46337806/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com