-
Notifications
You must be signed in to change notification settings - Fork 466
mult-node/aws: Add support for HA controllers. #147
Conversation
Conflicts: multi-node/aws/pkg/cluster/cluster.go multi-node/aws/pkg/cluster/stack_template.go
The apiserver loadbalancer is internal and attached to the Kubernetes subnet. An internal hostname for the LB is registered with Route 53. It has the form "kubernetes.<cluster_name>.cluster.local". This LB name is added to the apiserver TLS server certificate. The worker kubelets are pointed to the LB name. Conflicts: multi-node/aws/pkg/cluster/cluster.go
Rather than use etcd's discovery mechanism or a static configuration, this makes use of the monsantoco/ectd-aws-cluster container, which makes use of AWS tools to discover the members of the controllers autoscale group. This container is capable not only of starting a new cluster, but of managing removal and addition of cluster members as the membership of the autoscale group changes, for a fully automated solution. References and access to etcd are removed from worker nodes, as my branch no longer makes use of flannel, which was the only etcd client on the workers.
|
||
units: | ||
- name: etcd-peers.service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were you able to explore any other options than this? Is there no way to assign static IPs at deploy time and have a static initial-cluster
option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't care much for using the etcd discovery service. I could have gone with elastic IPs, but after reading http://engineering.monsanto.com/2015/06/12/etcd-clustering/ this seemed like a better approach to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also seems like using the ASG would be racy, when we need absolute determinism to bootstrap this cluster. How does this work that makes it safe to run in parallel on several machines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that we want to run in HA mode, then by definition it has to work in parallel on several machines. ;-) So far we've had no issues with it, but I am guessing there may be some scenarios not handled. Alas, I've not explored them. Might want to ping the Monsanto folks that wrote it. They probably have some experience running it on larger cluster for far longer and can give you a better idea about failure scenarios.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, that's good to hear. I'm wary of relying on a tool for management of etcd that I have zero experience with, and haven't even begun to understand. I'm also thinking that the controller cluster should be separated from the etcd cluster soon. Have you considered this separation?
@bcwaldon I'm using the Monsanto approach in exactly the scenario you described. The etcd ASG spins up first, using the etcd-aws-cluster container for node registration. Then the Kubernetes controller cluster is started, which also makes use of the container. The etcd ASG is passed in through an environment variable, and etcd-aws-cluster configures proxy mode. Here's the relevant section of my controller cloud_config:
It's worked very well so far. There's another project out there that is using a single Go executable to do the same kind of dynamic bootstrapping; it was inspired by the Monsanto work. Not nearly as flexible, though. |
Is support for HA controllers coming soon? |
One step forward to achieve high-availability throught the cluster. This change allows you to specify multiple subnets in cluster.yaml to make workers' ASG spread instances over those subnets. Differentiating each subnet's availability zone results in H/A of workers. Beware that this change itself does nothing with H/A of masters. Possibly relates to coreos#147, coreos#100
One step forward to achieve high-availability throught the cluster. This change allows you to specify multiple subnets in cluster.yaml to make workers' ASG spread instances over those subnets. Differentiating each subnet's availability zone results in H/A of workers. Beware that this change itself does nothing with H/A of masters. Possibly relates to coreos#147, coreos#100
I am going to close this PR as the underlying functionality has changed significantly since the time this was proposed. If this should be re-opened, please let me know |
This
Podmaster was already configured in the controller, so the scheduler and controller-manager were already configured to support HA.
The monstantoco/etcd-aws-cluster is used rather than etcd's discovery mechanism or a static configuration as it makes use of AWS tools to discover the members of the controllers autoscale group. That allows the container to not only of starting a new cluster, but of managing removal and addition of cluster members as the membership of the autoscale group changes, for a fully automated solution.
You probably don't want to merge this as is. On my own branch I've moved to native AWS networking. Therefore, I've made no attempt to configure etcd on worker nodes. Flannel appeared to be the only etcd user on workers, and with it gone on my branch, I've removed reference of etcd from the worker's configuration. I've also closed incoming access over the Internet and use a VPN access server to access the cluster's VPC, so the load balancer and hostname assign to it are internal in this pull, whereas you probably want to make them both internal and external if you are keeping external access to the cluster.