kops icon indicating copy to clipboard operation
kops copied to clipboard

Is it possible to use an external etcd cluster

Open egalano opened this issue 9 years ago • 25 comments

Would it provide additional stability to run Etcd outside of the Kubernetes cluster? If so, how can we customize the etcd member list for kops would we be able to modify this with a kops edit cluster?

egalano avatar Mar 28 '17 17:03 egalano

We do hot have the functionality at this point. Always happy to have contributions!

chrislovecnm avatar May 01 '17 00:05 chrislovecnm

@chrislovecnm : This is a nice feature to have and much needed. Lots of people are having problems with etcd being filled to capacity and crashing and losing all of their data.

Could someone point me to the areas of the code and the files that need to be changed to make this feature possible?

Cryptophobia avatar Jun 29 '17 15:06 Cryptophobia

@Cryptophobia if you want to ping me on slack you can.

Quick brain dump.

We would need to do the following items:

  1. Do you want kops to create the cluster as well or just use an external cluster?
  2. We would need to provide the capability for a kops / nodeup / protokube to not create an etcd cluster.
    • API changes - /pkg/apis/kops
    • protokube changes /protokube
    • nodeup changes /nodeup
  3. Ensure that all components such as kubeAPIServer have needed configurations for connecting to etcd.
  4. Integration testing
  5. Unit tests
  6. Documentation

I would like have kops to maintain, and upgrade etcd only servers as well.

chrislovecnm avatar Jun 29 '17 22:06 chrislovecnm

I would love to see some priority on this. The Kubernetes documentation explicitly recommends that Kubernetes' state be kept on a separate, dedicated etcd cluster.

Keeping stable etcd clusters is critical to the stability of Kubernetes clusters. Therefore, run etcd clusters on dedicated machines or isolated environments for guaranteed resource requirements.

I was also perplexed to find that the etcd static pods created by kops are not even storing their state in PersistentVolumes, instead storing their state directly on the root volume of the master node. Although I guess that's a chicken-and-egg problem, since you need Kubernetes for PersistentVolumes, and you need etcd for Kubernetes.

I was also noticing that kops installed etcd 2.2.1. At some point, etcd 2 will be end-of-lifed, and then everyone will have to move their etcds to etcd v3. In my experience, their migration process just doesn't work, so it behooves everyone to start on etcd 3.

geekofalltrades avatar Oct 12 '17 00:10 geekofalltrades

@geekofalltrades how do we get PVC's before k8s is started? We have a chicken and the egg problem with k8s, in both a recovery and bootstrapping situation. We already support etcd3, but install etcd2 by default.

We are completely open to having etcd externalized in kops, but there has never been someone who wants to code it. It is not even that complex. The one thing I would love to see is hard data on why having etcd is recommended. I have had many conversations about it, but nobody can example from a production stand-point or data-driven standpoint why I should be recommending putting etcd off of the cluster.

chrislovecnm avatar Oct 12 '17 00:10 chrislovecnm

@chrislovecnm how do I change the etcd version?

geekofalltrades avatar Oct 12 '17 17:10 geekofalltrades

@chrislovecnm , I would be willing to contribute in my free time and will ping you on slack to follow up on this.

The main argument is that all of k8s is dependent on the state of etcd cluster and when it is filled beyond capacity it crashes. It becomes a single point of failure for the whole cluster. Not to mention that routing and DNS other configurations depend on it.

Cryptophobia avatar Oct 14 '17 21:10 Cryptophobia

@geekofalltrades we have etcd 3 version stuff under docs, it is not released quite yet. We do not support upgrading etcd yet.

chrislovecnm avatar Oct 14 '17 21:10 chrislovecnm

External etcd is a requirement for my company's K8S setups, so this would be a very convenient little feature to have.

As long as I'm not stepping on any toes, I'll try to carve out some time to take a crack at it as well.

clockworksoul avatar Oct 23 '17 20:10 clockworksoul

@clockworksoul have at it. A good place to start is an external etcd section in our API. I would just PR that and get feedback.

Any auto information will need to be handled as secrets.

chrislovecnm avatar Oct 23 '17 20:10 chrislovecnm

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta. /lifecycle stale

fejta-bot avatar Jan 21 '18 21:01 fejta-bot

/remove-lifecycle stale

Cryptophobia avatar Jan 27 '18 14:01 Cryptophobia

/remove-lifecycle stale

Cryptophobia avatar Jan 27 '18 14:01 Cryptophobia

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

fejta-bot avatar Apr 27 '18 14:04 fejta-bot

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle rotten /remove-lifecycle stale

fejta-bot avatar May 27 '18 15:05 fejta-bot

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /close

fejta-bot avatar Jun 26 '18 16:06 fejta-bot

/remove-lifecycle rotten

I think this is still relevant.

idealhack avatar Sep 13 '18 05:09 idealhack

/reopen /lifecycle frozen

idealhack avatar Sep 13 '18 05:09 idealhack

@idealhack: Reopening this issue.

In response to this:

/reopen /lifecycle frozen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Sep 13 '18 05:09 k8s-ci-robot

Where etcd is kept. I do an aws installation. It creates some files on S3. What are them ? And where real etcd is kept ?

lonynamer avatar Oct 08 '18 12:10 lonynamer