本文介绍了访问Kubernetes Pod容器中的内置etcd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不想设置另一个etcd集群.

I don't want to setup another etcd cluster.

如何从kubernetes pod访问内置的etcd?

How can I access the built-in etcd from kubernetes pod?

我想首先我需要创建一个服务帐户并使用该帐户启动容器.

I suppose first I need create a service account and use this account to launch the pod.

那么该容器中的容器如何发现内置etcd的URI?

Then how can the container in this pod discover the URI of built-in etcd?

谢谢

推荐答案

Kubernetes apiserver使用的etcd实例通常被视为apiserver的实现细节,并且不能被用户应用程序重用.默认情况下,将其安装为仅侦听localhost上的连接,并在未计划任何用户应用程序的计算机上运行.

The etcd instance used by the Kubernetes apiserver is generally treated as an implementation detail of the apiserver and is not designed to be reused by user applications. By default it is installed to only listen for connections on localhost and run on a machine where no user applications are scheduled.

运行第二个etcd实例供自己使用并不难.例如,DNS群集附件包括 etcd的私有实例,该实例与apiserver使用的etcd分开.

It isn't difficult to run a second etcd instance for your own use. For example, the DNS cluster add-on includes a private instance of etcd that is separate from the etcd used by the apiserver.

这篇关于访问Kubernetes Pod容器中的内置etcd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-01 13:57