How to deploy an etcd cluster on a Kubernetes cluster with a previous etcd service

1/9/2019

I have been reading for several days about how to deploy a Kubernetes cluster from scratch. It's all ok until it comes to etcd.

I want to deploy the etcd nodes inside the Kubernetes cluster. It looks there are many options, like etcd-operator (https://github.com/coreos/etcd-operator).

But, to my knowledge, a StatefulSet or a ReplicaSet makes use of a etcd.

So, what is the right way to deploy such a cluster?

My first thought: start with a single member etcd, either as a pod or a local service in the master node and, when the Kubernetes cluster is up, deploy the etcd StatefulSet and move/change/migate the initial etcd to the new cluster.

The last part sounds weird to me: "and move/change/migate the initial etcd to the new cluster."

Am I wrong with this approach?

I don't find useful information on this topic.

-- Manel R. Doménech
etcd
kubernetes

1 Answer

1/10/2019

Kubernetes has 3 components: master components, node components and addons.

Master components

  • kube-apiserver
  • etcd
  • kube-scheduler
  • kube-controller-manager/cloud-controller-manager

Node components

  • kubelet
  • kube-proxy
  • Container Runtime

While implementing Kubernetes yu have to implement etcd as part of it. If it is multi node architecture you can use independent node or along with master node as per your requirement. You can find more details here. If you are looking for step by step guide follow this document if you need multi node architecture. If you need single node Kubernetes go for minikube.

-- Steephen
Source: StackOverflow