-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove
ip addr add "${U7S_HOST_IP}" dev eth0
Fix issue 296 Also fix issue 293, 297 Signed-off-by: Akihiro Suda <[email protected]>
- Loading branch information
1 parent
a0ce8e3
commit f48d92f
Showing
7 changed files
with
63 additions
and
263 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,20 +1,7 @@ | ||
#!/bin/bash | ||
set -eux -o pipefail | ||
|
||
# Append "---node-ip=${U7S_HOST_IP}" to "KUBELET_EXTRA_ARGS=..." in /etc/default/kubelet | ||
sed -e "s/\(^KUBELET_EXTRA_ARGS=.*\)/\\1 --node-ip=${U7S_HOST_IP}/" </etc/default/kubelet | sponge /etc/default/kubelet | ||
|
||
# Let kubelet recognize ${U7S_HOST_IP} as its IP: | ||
# https://github.com/kubernetes/kubernetes/issues/54337#issuecomment-363597985 | ||
ip addr add "${U7S_HOST_IP}" dev eth0 | ||
|
||
cat <<EOF >/u7s-flanneld-wrapper.sh | ||
#!/bin/sh | ||
# Usage: /u7s-flanneld-wrapper.sh /opt/bin/flanneld --ip-masq --kube-subnet-mgr ... | ||
# This script is expected to be mounted inside a "docker.io/flannel/flannel" container. | ||
set -eux | ||
"\$@" --public-ip="${U7S_HOST_IP}" | ||
EOF | ||
chmod +x /u7s-flanneld-wrapper.sh | ||
# Append "KUBELET_EXTRA_ARGS=..." in /etc/default/kubelet | ||
sed -e "s!\(^KUBELET_EXTRA_ARGS=.*\)!\\1 --cloud-provider=external --node-labels=usernetes/host-ip=${U7S_HOST_IP}!" </etc/default/kubelet | sponge /etc/default/kubelet | ||
|
||
exec "$@" |
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
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,19 @@ | ||
#!/bin/bash | ||
set -eu -o pipefail | ||
|
||
for node in $(kubectl get nodes -o name); do | ||
# Set ExternalIP | ||
host_ip="$(kubectl get "${node}" -o jsonpath='{.metadata.labels.usernetes/host-ip}')" | ||
kubectl patch "${node}" --type=merge --subresource status --patch \ | ||
"\"status\": {\"addresses\": [{\"type\":\"ExternalIP\", \"address\": \"${host_ip}\"}]}" | ||
|
||
# Propagate ExternalIP to flannel | ||
# https://github.com/flannel-io/flannel/blob/v0.24.4/Documentation/kubernetes.md#annotations | ||
kubectl annotate "${node}" flannel.alpha.coreos.com/public-ip-overwrite=${host_ip} | ||
|
||
# Remove taints | ||
taints="$(kubectl get "${node}" -o jsonpath='{.spec.taints}')" | ||
if echo "${taints}" | grep -q node.cloudprovider.kubernetes.io/uninitialized; then | ||
kubectl taint nodes "${node}" node.cloudprovider.kubernetes.io/uninitialized- | ||
fi | ||
done |
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
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
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
This file was deleted.
Oops, something went wrong.