-
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 74c8546
Showing
11 changed files
with
89 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
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,5 @@ | ||
# Correct UDP checksums for VXLAN behind NAT | ||
# https://github.com/flannel-io/flannel/issues/1279 | ||
# https://github.com/kubernetes/kops/pull/9074 | ||
# https://github.com/karmab/kcli/commit/b1a8eff658d17cf4e28162f0fa2c8b2b10e5ad00 | ||
SUBSYSTEM=="net", ACTION=="add|change|move", ENV{INTERFACE}=="flannel.1", RUN+="/usr/sbin/ethtool -K flannel.1 tx-checksum-ip-generic off" |
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,10 @@ | ||
#!/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 | ||
# 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 | ||
|
||
# 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 | ||
# Import control plane hosts from previous boot | ||
[ -e /etc/hosts.u7s ] && cat /etc/hosts.u7s >>/etc/hosts | ||
|
||
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 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
Oops, something went wrong.