ansible-kubeadm-cluster icon indicating copy to clipboard operation
ansible-kubeadm-cluster copied to clipboard

Dynamic Terraform backend

Open VAdamec opened this issue 8 years ago • 2 comments

Just as an simple draft (it works for me, but it's limited to my setup with OpenStack) look at fork https://github.com/VAdamec/ansible-kubeadm-cluster/tree/develop

  • use Terraform output with dynamic backend (fqdn filter is used to get master and nodes)
  • task with Weave move before node join + add wait task for kube-dns pod state
  • add simple way how to install basic system pods (ui/metrics/weave scope)

I would suggest at least to add wait step for kube-dns pod and move weave installation before node join to avoid CNI deployment issue.

VAdamec avatar Jan 11 '17 14:01 VAdamec

When I wrote this initially, I was under the impression that step 3 was to join the nodes, and then step 4 was to start/enable the pod network. Either I was mistaken, or it changed later, clearly the order is as you describe. I will make this change, and add the wait for kube-dns per your change.

Thank you for these ideas/contributions!

What I have attempted to do in the latest version is to support existing inventories, and not insist on a custom inventory per cluster. Basically your cluster should be an Ansible group, with child groups of _master and _node. I am not a Terraform user, but presumably you could easily arrange for your Terraform dynamic inventory to provide this simple group structure for your cluster(s), and the latest playbooks then take the cluster_name as an argument/input. If you have any input/comments on this approach please let me know. I can imagine your fork is set up just the way you like now, so unlikely you will change back. No problem.

I also agree that providing a post-install method of installing desired cluster infrastructure is desirable. My initial crack at this is now the cluster-infra.yml playbook, but there is nothing special about it, it is just an initial draft.

Again, thank you for your input, and sharing your ideas and implementation.

dcj avatar Apr 03 '17 17:04 dcj

Today's commit includes the restructured ordering of tasks and the wait for kube-dns based on your fork.

The new cluster-infra.yml playbook adds the Dashboard and WeaveScope to the cluster...

dcj avatar Apr 05 '17 00:04 dcj