Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-1.1.1] fix: Ensure localhost maps to IPv4 address #15

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions controllers/cluster_scripts/cloud_init.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,18 @@ write_files:
# Exit on the first error. Does not apply to commad lists, or pipelines.
set -o errexit

# Our images do not require any network customization,
# but CAPVCD requires a successful status to finish bootstrapping.
# Begin network configuration
vmtoolsd --cmd "info-set guestinfo.postcustomization.networkconfiguration.status in_progress"
# Disable IPv6. CAPVCD does not yet support it.
echo '# Added by CAPVCD bootstrap' >> /etc/sysctl.conf
echo 'net.ipv6.conf.all.disable_ipv6 = 1' >> /etc/sysctl.conf
echo 'net.ipv6.conf.default.disable_ipv6 = 1' >> /etc/sysctl.conf
echo 'net.ipv6.conf.lo.disable_ipv6 = 1' >> /etc/sysctl.conf
sudo sysctl -p
# Kubeadm fails to reach kubelet metrics, because VMWare Guest Customization maps localhost to an
# IPv6 address (https://kb.vmware.com/s/article/83138), which does not resolve. This ensures localhost
# resolves to an IPv4 address.
sed -i 's/::1/127.0.0.1/g' /etc/hosts || true
vmtoolsd --cmd "info-set guestinfo.postcustomization.networkconfiguration.status successful"

# Our images do not ship the VCD metering service,
Expand Down Expand Up @@ -81,8 +91,6 @@ runcmd:
- bash /root/bootstrap.sh
timezone: UTC
disable_root: false
# Ensure we have an IPv4 address for localhost
manage_etc_hosts: localhost
# Ensure that cloud-init can override the hostname.
preserve_hostname: false
hostname: "{{ .MachineName }}"
Expand Down
Loading