From 9f27efba9b1100edba4f2e993e69909d9d50643c Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Sat, 17 Dec 2016 14:43:50 -0800 Subject: [PATCH] examples/ignition/bootkube: Wrap bootkube in systemd service * Start `bootkube start` via systemctl, don't require a persistent SSH connection during the script run --- Documentation/bootkube.md | 5 +++-- examples/ignition/bootkube-controller.yaml | 8 +++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Documentation/bootkube.md b/Documentation/bootkube.md index 5b53c9a8..1f3789fd 100644 --- a/Documentation/bootkube.md +++ b/Documentation/bootkube.md @@ -63,10 +63,11 @@ Secure copy the `kubeconfig` to `/etc/kubernetes/kubeconfig` on **every** node w Secure copy the `bootkube` generated assets to any controller node and run `bootkube-start`. scp -r assets core@node1.example.com:/home/core/assets - ssh core@node1.example.com 'sudo ./bootkube-start' + ssh core@node1.example.com 'sudo systemctl start bootkube' -Watch the temporary control plane logs until the scheduled kubelet takes over in place of the on-host kubelet. +Optionally watch the Kubernetes control plane bootstrapping with the bootkube temporary api-server. You will see quite a bit of output. + $ ssh core@node1.example.com 'journalctl -f -u bootkube' [ 299.241291] bootkube[5]: Pod Status: kube-api-checkpoint Running [ 299.241618] bootkube[5]: Pod Status: kube-apiserver Running [ 299.241804] bootkube[5]: Pod Status: kube-scheduler Running diff --git a/examples/ignition/bootkube-controller.yaml b/examples/ignition/bootkube-controller.yaml index 0c3c48da..6ecf405a 100644 --- a/examples/ignition/bootkube-controller.yaml +++ b/examples/ignition/bootkube-controller.yaml @@ -77,7 +77,13 @@ systemd: RestartSec=10 [Install] WantedBy=multi-user.target - + - name: bootkube.service + contents: | + [Unit] + Description=Bootstrap a Kubernetes control plane with a temp api-server + [Service] + Type=simple + ExecStart=/home/core/bootkube-start storage: {{ if index . "pxe" }} disks: