Hey,

In addition to what Alex said (both of us are in the Tectonic Installer team):

For an automated bootstrap process of k8s components you need to address two 
problems besides the infrastructure provisioning part:

1. executing the deployment on exactly one bootstrap node. We call this 
internally "bootstrap master election". This can be solved on:

a) the machine initiating the automated installation by choosing one machine 
and simply executing a remote command a la `ssh user@bootstrap-master 
bootstrap.sh` where `bootstrap.sh` includes your `kubectl apply's`. We use 
terraform to do this for us, see [1].

b) if the machine initiating the automated installation provisions the 
infrastructure, but does not have access to the actual nodes, the election 
process is more complex. On AWS for instance we have a small script being 
executed on each master which detects whether it is meant to be a bootstrap 
node, see [2]. Obviously the detection mechanism depends on the platform.

2. at-most-once execution on the bootstrap node itself. We solved this using a 
simple systemd trick, see [3] and [4] ;-)

I hope that helps a bit.

-
Sergiusz

[1] 
https://github.com/coreos/tectonic-installer/blob/5c4fd74/platforms/metal/remote.tf#L73-L100
[2] 
https://github.com/coreos/tectonic-installer/blob/5c4fd74/modules/aws/ignition/resources/detect-master.sh
[3] 
https://github.com/coreos/tectonic-installer/blob/5c4fd74/modules/bootkube/resources/bootkube.service#L3
[4] 
https://www.freedesktop.org/software/systemd/man/systemd.unit.html#ConditionArchitecture=

On Wednesday, August 16, 2017 at 3:52:59 AM UTC+2, Marcelo Andrade wrote:
> Hey folks!
> 
> I'm trying to put together some automation on the process of creating our 
> Kubernetes clusters and I got all the infrastructure/OS/master/nodes basic 
> installation covered.
> 
> 
> Then I figured I have no convenient way to automatize the launch of our 
> several services that already run under Kubernetes
> 
> 
> Is there a smart to "bootstrap" kubernetes elements on the startup of the 
> cluster, let's say tthe DNS addon (creating the SA, configmap, 
> deployment...), the ingress-controller components (deployment for 
> default-backend, configmaps and so) or whatever client-controlled deployment?
> 
> 
> I could work around scripting some kubectls or posts on the API but then 
> ocurred 'there must be an easier way"... Or there is not? :D

-- 
You received this message because you are subscribed to the Google Groups 
"Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to kubernetes-users+unsubscr...@googlegroups.com.
To post to this group, send email to kubernetes-users@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to