简体   繁体   English

TLS安全的etcd上的Kubernetes

[英]Kubernetes on TLS secured etcd

Running CoreOS, etcd is not secured by default. 默认情况下,不保护运行CoreOS等的安全性。 To secure it I can use TLS, which adds a level of complexity I'm willing to work on. 为了保护它,我可以使用TLS,它增加了我愿意努力的复杂程度。

Now, is Kubernetes able to use a TLS secured etcd cluster? 现在,Kubernetes能够使用受TLS保护的etcd集群吗?

In the config for the kubelet and various pods, Kubernetes passes the etcd endpoints as parameters, so they require etcd and will need the certificates to talk to it if it is secured. 在Kubelet和各种Pod的配置中,Kubernetes将etcd端点作为参数传递,因此它们需要etcd,并且如果安全,则需要证书与之对话。 If Kubernetes supports TLS connection to etcd, how does it get configured? 如果Kubernetes支持与etcd的TLS连接,如何配置它?

Thanks 谢谢

The API server is the only component that speaks directly to etcd. API服务器是直接与etcd对话的唯一组件。 When starting the API server, you can pass a --etcd-config=/path/to/client/config parameter instead of just pointing to an unsecured etcd server with --etcd-server 启动API服务器时,您可以传递--etcd-config=/path/to/client/config参数,而不仅仅是使用--etcd-server指向不安全的etcd --etcd-server

In that config file, you would specify the etcd servers, along with the client credentials (cert/key) to use to connect. 在该配置文件中,您将指定etcd服务器以及用于连接的客户端凭据(证书/密钥)。

The format is that expected by the go-etcd client NewClientFromFile function, which expects a JSON serialization of the Client struct, specifically the config and cluster keys 格式是go-etcd客户端NewClientFromFile函数所期望的格式,该函数期望Client结构的JSON序列化,特别是configcluster

digging further and asking on the github project, I was directed towards this post that I hope answers the question: 进一步挖掘并询问github项目,我被引导到这篇文章,希望我能回答这个问题:

https://groups.google.com/forum/#!topic/google-containers/bTfEcRQ3N28/discussion https://groups.google.com/forum/#!topic/google-containers/bTfEcRQ3N28/discussion

In short the config file should look like: 简而言之,配置文件应如下所示:

{
  "cluster": {
    "machines": [
          "https://kube-master.internal:2379",
          "https://kube-minion1.internal:2379",
          "https://kube-minion2.internal:2379"
    ]
  },
  "config": {
    "certFile": "/etc/etcd/kube-master.internal.pem",
    "keyFile": "/etc/etcd/kube-master.internal.key",
    "caCertFiles": [ "/etc/etcd/kubecluster-ca.pem" ],
    "consistency": "STRONG_CONSISTENCY"
  }
}

Haven't tried yet but will asap. 尚未尝试,但会尽快完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM