Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

Commit

Permalink
Set node IP on start of kubelet
Browse files Browse the repository at this point in the history
This is a workaround for the bug described at
kubernetes/kubernetes#68270, where nodes
lose their IP address. A fix is supposed to be in 1.11.6, but this
should overcome the issue for the time being.
  • Loading branch information
rjosephwright committed Dec 17, 2018
1 parent 73e8999 commit f77c5b7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Expand Up @@ -24,6 +24,10 @@ ExecStart=/bin/sh -c ' \
--retry 10 \
--retry-delay 2 \
http://169.254.169.254/latest/meta-data/local-hostname` && \
myip=`curl -s \
--retry 10 \
--retry-delay 2 \
http://169.254.169.254/latest/meta-data/local-ipv4` && \
/usr/bin/keights template \
-t /usr/share/keights/kubeadm-join-config.yaml.template \
-D /var/lib/kubeadm/config.yaml \
Expand All @@ -34,6 +38,7 @@ ExecStart=/bin/sh -c ' \
-v ImageRepository=${KEIGHTS_IMAGE_REPOSITORY} \
-v NodeLabels=${KEIGHTS_NODE_LABELS} \
-v NodeName=$${node_name} \
-v MyIP=$${myip} \
'

[Install]
Expand Down
Expand Up @@ -163,6 +163,7 @@ nodeRegistration:
kubeletExtraArgs:
cloud-provider: aws
pod-infra-container-image: {{ .ImageRepository }}/pause:3.1
node-ip: {{ .MyIP }}
name: {{ .NodeName }}
taints:
- effect: NoSchedule
Expand Down
Expand Up @@ -11,4 +11,5 @@ nodeRegistration:
cloud-provider: aws
pod-infra-container-image: {{ .ImageRepository }}/pause:3.1
node-labels: kubernetes.io/role=node,node-role.kubernetes.io/node=,{{ range $label := .NodeLabels }}{{ $label }},{{ end }}
node-ip: {{ .MyIP }}
name: {{ .NodeName }}

0 comments on commit f77c5b7

Please sign in to comment.