Skip to content
This repository was archived by the owner on Jun 29, 2022. It is now read-only.

Commit a71cbcd

Browse files
committed
bootkube: use host's /etc/hosts entries
Currently, bare metal environment requires resolvable DNS names for API server and etcd servers. For user without running DNS server locally or for testing, it would be nice to be able have some workaround for it. One would be to populate /etc/hosts of nodes with required entries. This is almost possible, using CLC snippets for controller nodes, except the bootkube, which runs in rkt container and have it's own /etc/hosts file, so health check on static kube-apiserver pod never succeeds. To make it work, rkt parameter --hosts-entry=host needs to be added. I suggest we add --hosts-entry=host to bootkube, as potential breakage impact is minimal and this will save as from exposing general bootkube_rkt_extra_args in the Terraform module/lokocfg. By the issue, it is not required to be applied on all platforms, but again, the breakage chance seems minimal and generally we should be heading towards having quite unified configurations across all the platforms, so this commit adds it to all of them. Closes #408 Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
1 parent d6b9209 commit a71cbcd

File tree

7 files changed

+18
-12
lines changed

7 files changed

+18
-12
lines changed

assets/lokomotive-kubernetes/aws/flatcar-linux/kubernetes/cl/controller.yaml.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ storage:
160160
--insecure-options=image \
161161
--net=host \
162162
--dns=host \
163+
--hosts-entry=host \
163164
--exec=/bootkube -- start --asset-dir=/assets "$@"
164165
- path: /opt/etcd-rejoin
165166
filesystem: root

assets/lokomotive-kubernetes/azure/flatcar-linux/kubernetes/cl/controller.yaml.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ storage:
160160
--insecure-options=image \
161161
--net=host \
162162
--dns=host \
163+
--hosts-entry=host \
163164
--exec=/bootkube -- start --asset-dir=/assets "$@"
164165
passwd:
165166
users:

assets/lokomotive-kubernetes/bare-metal/flatcar-linux/kubernetes/cl/controller.yaml.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ storage:
175175
--insecure-options=image \
176176
--net=host \
177177
--dns=host \
178+
--hosts-entry=host \
178179
--exec=/bootkube -- start --asset-dir=/assets "$@"
179180
- path: /etc/kubernetes/configure-kubelet-cgroup-driver
180181
filesystem: root

assets/lokomotive-kubernetes/google-cloud/flatcar-linux/kubernetes/cl/controller.yaml.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ storage:
161161
--insecure-options=image \
162162
--net=host \
163163
--dns=host \
164+
--hosts-entry=host \
164165
--exec=/bootkube -- start --asset-dir=/assets "$@"
165166
passwd:
166167
users:

assets/lokomotive-kubernetes/kvm-libvirt/flatcar-linux/kubernetes/cl/controller.yaml.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ storage:
171171
--insecure-options=image \
172172
--net=host \
173173
--dns=host \
174+
--hosts-entry=host \
174175
--exec=/bootkube -- start --asset-dir=/assets "$@"
175176
- path: /etc/kubernetes/configure-kubelet-cgroup-driver
176177
filesystem: root

assets/lokomotive-kubernetes/packet/flatcar-linux/kubernetes/cl/controller.yaml.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ storage:
210210
--insecure-options=image \
211211
--net=host \
212212
--dns=host \
213+
--hosts-entry=host \
213214
--exec=/bootkube -- start --asset-dir=/assets "$@"
214215
- path: /opt/etcd-rejoin
215216
filesystem: root

pkg/assets/generated_assets.go

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)