Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2121 from danwinship/upi-runtimecfg-node-ip
Bug 1872632: templates: add nodeip-configuration.service for bare metal UPI
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
templates/common/_base/units/nodeip-configuration.service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: nodeip-configuration.service | ||
enabled: {{if eq .Infra.Status.PlatformStatus.Type "None"}}true{{else}}false{{end}} | ||
contents: | | ||
[Unit] | ||
Description=Writes IP address configuration so that kubelet and crio services select a valid node IP | ||
Wants=network-online.target | ||
After=network-online.target ignition-firstboot-complete.service | ||
Before=kubelet.service crio.service | ||
[Service] | ||
# Need oneshot to delay kubelet | ||
Type=oneshot | ||
# Would prefer to do Restart=on-failure instead of this bash retry loop, but | ||
# the version of systemd we have right now doesn't support it. It should be | ||
# available in systemd v244 and higher. | ||
ExecStart=/bin/bash -c " \ | ||
until \ | ||
/usr/bin/podman run --rm \ | ||
--authfile /var/lib/kubelet/config.json \ | ||
--net=host \ | ||
--volume /etc/systemd/system:/etc/systemd/system:z \ | ||
{{ .Images.baremetalRuntimeCfgImage }} \ | ||
node-ip \ | ||
set --retry-on-failure \ | ||
; \ | ||
do \ | ||
sleep 5; \ | ||
done" | ||
{{if .Proxy -}} | ||
{{if .Proxy.HTTPProxy -}} | ||
Environment=HTTP_PROXY={{.Proxy.HTTPProxy}} | ||
{{end -}} | ||
{{if .Proxy.HTTPSProxy -}} | ||
Environment=HTTPS_PROXY={{.Proxy.HTTPSProxy}} | ||
{{end -}} | ||
{{if .Proxy.NoProxy -}} | ||
Environment=NO_PROXY={{.Proxy.NoProxy}} | ||
{{end -}} | ||
{{end -}} | ||
[Install] | ||
RequiredBy=kubelet.service |