upmc-enterprises/kubeadm-aws

Idea: Make it even easier

jbeda opened this issue · 2 comments

jbeda commented

You should be able to streamline this more.

  • You can specify the token up front. Perhaps have folks generate that with a short python program and pass that as a variable to terraform.
    • Generate token with python -c 'import random; print "%0x.%0x" % (random.SystemRandom().getrandbits(3*8), random.SystemRandom().getrandbits(8*8))'
    • Pass token to kubeadm init and kubeadm join with the --token flag.
  • If you can get a DNS name for the master (not sure how this works on EC2 lately) you can wait for that to resolve on the nodes before doing kubeadm join.
  • You can install networking before the nodes have joined. It shouldn't depend on order and should automatically configure the network on new nodes.

If we do this right you should be able to get a cluster up and running with no copy/paste or ssh.

Ahh nice! Didn't know you could do all that! Was just about to dig into the source to see how to accomplish some of this. I'll poke around and see if I can get it smoother.

I pushed some commits which does exactly what you suggested. After the terraform apply command completes, you can ssh to master node (which now outputs to screen), and do a kubectl get no and see 3 nodes (2 workers plus master).

I need to next put the workers in an autoscaling group since they could be scaled super easily with the current setup.