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

Commit 77f9a87

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 af3cb60 commit 77f9a87

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
@@ -158,6 +158,7 @@ storage:
158158
--insecure-options=image \
159159
--net=host \
160160
--dns=host \
161+
--hosts-entry=host \
161162
--exec=/bootkube -- start --asset-dir=/assets "$@"
162163
- path: /opt/etcd-rejoin
163164
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
@@ -158,6 +158,7 @@ storage:
158158
--insecure-options=image \
159159
--net=host \
160160
--dns=host \
161+
--hosts-entry=host \
161162
--exec=/bootkube -- start --asset-dir=/assets "$@"
162163
passwd:
163164
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
@@ -173,6 +173,7 @@ storage:
173173
--insecure-options=image \
174174
--net=host \
175175
--dns=host \
176+
--hosts-entry=host \
176177
--exec=/bootkube -- start --asset-dir=/assets "$@"
177178
- path: /etc/kubernetes/configure-kubelet-cgroup-driver
178179
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
@@ -159,6 +159,7 @@ storage:
159159
--insecure-options=image \
160160
--net=host \
161161
--dns=host \
162+
--hosts-entry=host \
162163
--exec=/bootkube -- start --asset-dir=/assets "$@"
163164
passwd:
164165
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
@@ -169,6 +169,7 @@ storage:
169169
--insecure-options=image \
170170
--net=host \
171171
--dns=host \
172+
--hosts-entry=host \
172173
--exec=/bootkube -- start --asset-dir=/assets "$@"
173174
- path: /etc/kubernetes/configure-kubelet-cgroup-driver
174175
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
@@ -208,6 +208,7 @@ storage:
208208
--insecure-options=image \
209209
--net=host \
210210
--dns=host \
211+
--hosts-entry=host \
211212
--exec=/bootkube -- start --asset-dir=/assets "$@"
212213
- path: /opt/etcd-rejoin
213214
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)