# Deploying HA kubernetes clusters

**URL:** https://forums.suse.com/t/deploying-ha-kubernetes-clusters/12119
**Category:** SUSE Rancher Prime
**Created:** [October 22, 2018, 4:48pm UTC](https://forums.suse.com/t/deploying-ha-kubernetes-clusters/12119 "2018-10-22T16:48:20Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Daniel\_Petersen](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/daniel_petersen/32/4211_2.png) [@Daniel\_Petersen](https://forums.suse.com/u/Daniel_Petersen)
#### Post date: [October 22, 2018, 4:48pm UTC](https://forums.suse.com/t/deploying-ha-kubernetes-clusters/12119/1 "2018-10-22T16:48:20Z")

</div>

I’m not seeing any mention of how to deploy kubernetes HA clusters in the 2.x docs (only how to deploy HA rancher). I currently have a single node with the ‘Control Plane’ and ‘etcd’ roles; is it as simple as re-running the docker run command on a few more nodes w/ the ‘etcd’ and ‘Control Plane’ params added? e.g.

`sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.0.8 --server https://rancher.mydomain.com:443 --token blahblah --etcd --controlplane`

Any gotchas or caveats I should be aware of? This seems deceptively simple…

Also, how can I determine when a new control plane or etcd node is fully up, data synced and functional? (e.g. I could take the other control nodes down and the cluster would still function)

---

<div class="post-metadata">

### Author: ![shubbard343](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@shubbard343](https://forums.suse.com/u/shubbard343)
#### Post date: [October 22, 2018, 8:27pm UTC](https://forums.suse.com/t/deploying-ha-kubernetes-clusters/12119/2 "2018-10-22T20:27:44Z")

</div>

“High Availability” in Rancher 2.0 means installing Rancher into a Kubernetes cluster that is already “HA” meaning 3 or more nodes. The way I have done it is by using RKE to create a 3-node Kubernetes cluster, and then use Helm to install Rancher into the Kubernetes cluster.

Once you have the 3-node cluster, follow steps 3 (Helm) and 4 (Install Rancher) and you have HA rancher in Kubernetes.

[https://rancher.com/docs/rancher/v2.x/en/installation/ha/kubernetes-rke/](https://rancher.com/docs/rancher/v2.x/en/installation/ha/kubernetes-rke/)

---

<div class="post-metadata">

### Author: ![Daniel\_Petersen](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/daniel_petersen/32/4211_2.png) [@Daniel\_Petersen](https://forums.suse.com/u/Daniel_Petersen)
#### Post date: [October 25, 2018, 6:21pm UTC](https://forums.suse.com/t/deploying-ha-kubernetes-clusters/12119/3 "2018-10-25T18:21:43Z")

</div>

Hi shubbard343, thanks for your response.  
I am familiar with that documentation, but it’s not quite what I was looking for.

I basically had deployed a cluster via Rancher that looked like this:

nodeA - Control Plane, etcd, worker  
nodeB - worker  
nodeC - worker

And want to turn it into an HA cluster:

nodeA - Control Plane, etcd, worker  
nodeB - Control Plane, etcd, worker  
nodeC - Control Plane, etcd, worker

To get to this state, I tried running the docker run command with the added args on nodeA and nodeB to take on the etcd and control roles; this didn’t work - etcd never took, though it looked like it successfully setup the control plane components.

What did work for me was to delete nodeB and nodeC from the cluster, run a cleanup script on the nodes with:

> <https://gist.github.com/superseb/2cf186726807a012af59a027cb41270d>

And then add those nodes again with the docker run command with the all the desired roles from the get-go. Not sure if the cleanup script was needed since I didn’t try this approach without.

Based off my experience, it seems like it’s problematic to add roles after the initial ‘install’, for etcd at least. I wonder if that’s expected, or should it be possible to add and remove etcd after initial install?

---

<div class="post-metadata">

### Author: ![shubbard343](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@shubbard343](https://forums.suse.com/u/shubbard343)
#### Post date: [October 25, 2018, 7:52pm UTC](https://forums.suse.com/t/deploying-ha-kubernetes-clusters/12119/4 "2018-10-25T19:52:00Z")

</div>

I used RKE to create the cluster, and RKE has the option to specify the roles on each node. So if you use RKE, it’s just a matter of adding the `controlplane` and `etcd` to the nodes, and run `rke up` again to apply the new roles.
