Skip to content

Commit

Permalink
Merge pull request #2121 from danwinship/upi-runtimecfg-node-ip
Browse files Browse the repository at this point in the history
Bug 1872632: templates: add nodeip-configuration.service for bare metal UPI
  • Loading branch information
openshift-merge-robot committed Sep 30, 2020
2 parents bddec15 + 311ca8e commit 522f0fa
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions templates/common/_base/units/nodeip-configuration.service.yaml
@@ -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

0 comments on commit 522f0fa

Please sign in to comment.