Skip to content

Commit

Permalink
Fix dualstack IPv6 addr assignment issue in rockylinux and RHEL (#1442)
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Tiptur <[email protected]>

Signed-off-by: Sachin Tiptur <[email protected]>
Co-authored-by: Sachin Tiptur <[email protected]>
  • Loading branch information
kubermatic-bot and Sachin Tiptur authored Sep 26, 2022
1 parent abd0793 commit f7b9474
Show file tree
Hide file tree
Showing 20 changed files with 200 additions and 80 deletions.
14 changes: 10 additions & 4 deletions pkg/userdata/rhel/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,16 @@ write_files:
{{ .ContainerRuntimeScript | indent 4 }}
{{ safeDownloadBinariesScript .KubeletVersion | indent 4 }}
DEFAULT_IFC_NAME=$(ip -o route get 1 | grep -oP "dev \K\S+")
echo NETWORKING_IPV6=yes >> /etc/sysconfig/network
echo IPV6INIT=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
echo DHCPV6C=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
ifdown $DEFAULT_IFC_NAME && ifup $DEFAULT_IFC_NAME
IFC_CFG_FILE=/etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
# Enable IPv6 and DHCPv6 on the default interface
grep IPV6INIT $IFC_CFG_FILE && sed -i '/IPV6INIT*/c IPV6INIT=yes' $IFC_CFG_FILE || echo "IPV6INIT=yes" >> $IFC_CFG_FILE
grep DHCPV6C $IFC_CFG_FILE && sed -i '/DHCPV6C*/c DHCPV6C=yes' $IFC_CFG_FILE || echo "DHCPV6C=yes" >> $IFC_CFG_FILE
grep IPV6_AUTOCONF $IFC_CFG_FILE && sed -i '/IPV6_AUTOCONF*/c IPV6_AUTOCONF=yes' $IFC_CFG_FILE || echo "IPV6_AUTOCONF=yes" >> $IFC_CFG_FILE
# Restart NetworkManager to apply for IPv6 configs
systemctl restart NetworkManager
# Let NetworkManager apply the DHCPv6 configs
sleep 3
# set kubelet nodeip environment variable
mkdir -p /etc/systemd/system/kubelet.service.d/
Expand Down
14 changes: 10 additions & 4 deletions pkg/userdata/rhel/testdata/kubelet-v1.22-aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,16 @@ write_files:
fi
DEFAULT_IFC_NAME=$(ip -o route get 1 | grep -oP "dev \K\S+")
echo NETWORKING_IPV6=yes >> /etc/sysconfig/network
echo IPV6INIT=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
echo DHCPV6C=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
ifdown $DEFAULT_IFC_NAME && ifup $DEFAULT_IFC_NAME
IFC_CFG_FILE=/etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
# Enable IPv6 and DHCPv6 on the default interface
grep IPV6INIT $IFC_CFG_FILE && sed -i '/IPV6INIT*/c IPV6INIT=yes' $IFC_CFG_FILE || echo "IPV6INIT=yes" >> $IFC_CFG_FILE
grep DHCPV6C $IFC_CFG_FILE && sed -i '/DHCPV6C*/c DHCPV6C=yes' $IFC_CFG_FILE || echo "DHCPV6C=yes" >> $IFC_CFG_FILE
grep IPV6_AUTOCONF $IFC_CFG_FILE && sed -i '/IPV6_AUTOCONF*/c IPV6_AUTOCONF=yes' $IFC_CFG_FILE || echo "IPV6_AUTOCONF=yes" >> $IFC_CFG_FILE
# Restart NetworkManager to apply for IPv6 configs
systemctl restart NetworkManager
# Let NetworkManager apply the DHCPv6 configs
sleep 3
# set kubelet nodeip environment variable
mkdir -p /etc/systemd/system/kubelet.service.d/
Expand Down
14 changes: 10 additions & 4 deletions pkg/userdata/rhel/testdata/kubelet-v1.22-nutanix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,16 @@ write_files:
fi
DEFAULT_IFC_NAME=$(ip -o route get 1 | grep -oP "dev \K\S+")
echo NETWORKING_IPV6=yes >> /etc/sysconfig/network
echo IPV6INIT=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
echo DHCPV6C=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
ifdown $DEFAULT_IFC_NAME && ifup $DEFAULT_IFC_NAME
IFC_CFG_FILE=/etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
# Enable IPv6 and DHCPv6 on the default interface
grep IPV6INIT $IFC_CFG_FILE && sed -i '/IPV6INIT*/c IPV6INIT=yes' $IFC_CFG_FILE || echo "IPV6INIT=yes" >> $IFC_CFG_FILE
grep DHCPV6C $IFC_CFG_FILE && sed -i '/DHCPV6C*/c DHCPV6C=yes' $IFC_CFG_FILE || echo "DHCPV6C=yes" >> $IFC_CFG_FILE
grep IPV6_AUTOCONF $IFC_CFG_FILE && sed -i '/IPV6_AUTOCONF*/c IPV6_AUTOCONF=yes' $IFC_CFG_FILE || echo "IPV6_AUTOCONF=yes" >> $IFC_CFG_FILE
# Restart NetworkManager to apply for IPv6 configs
systemctl restart NetworkManager
# Let NetworkManager apply the DHCPv6 configs
sleep 3
# set kubelet nodeip environment variable
mkdir -p /etc/systemd/system/kubelet.service.d/
Expand Down
14 changes: 10 additions & 4 deletions pkg/userdata/rhel/testdata/kubelet-v1.23-aws-external.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,16 @@ write_files:
fi
DEFAULT_IFC_NAME=$(ip -o route get 1 | grep -oP "dev \K\S+")
echo NETWORKING_IPV6=yes >> /etc/sysconfig/network
echo IPV6INIT=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
echo DHCPV6C=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
ifdown $DEFAULT_IFC_NAME && ifup $DEFAULT_IFC_NAME
IFC_CFG_FILE=/etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
# Enable IPv6 and DHCPv6 on the default interface
grep IPV6INIT $IFC_CFG_FILE && sed -i '/IPV6INIT*/c IPV6INIT=yes' $IFC_CFG_FILE || echo "IPV6INIT=yes" >> $IFC_CFG_FILE
grep DHCPV6C $IFC_CFG_FILE && sed -i '/DHCPV6C*/c DHCPV6C=yes' $IFC_CFG_FILE || echo "DHCPV6C=yes" >> $IFC_CFG_FILE
grep IPV6_AUTOCONF $IFC_CFG_FILE && sed -i '/IPV6_AUTOCONF*/c IPV6_AUTOCONF=yes' $IFC_CFG_FILE || echo "IPV6_AUTOCONF=yes" >> $IFC_CFG_FILE
# Restart NetworkManager to apply for IPv6 configs
systemctl restart NetworkManager
# Let NetworkManager apply the DHCPv6 configs
sleep 3
# set kubelet nodeip environment variable
mkdir -p /etc/systemd/system/kubelet.service.d/
Expand Down
14 changes: 10 additions & 4 deletions pkg/userdata/rhel/testdata/kubelet-v1.23-aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,16 @@ write_files:
fi
DEFAULT_IFC_NAME=$(ip -o route get 1 | grep -oP "dev \K\S+")
echo NETWORKING_IPV6=yes >> /etc/sysconfig/network
echo IPV6INIT=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
echo DHCPV6C=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
ifdown $DEFAULT_IFC_NAME && ifup $DEFAULT_IFC_NAME
IFC_CFG_FILE=/etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
# Enable IPv6 and DHCPv6 on the default interface
grep IPV6INIT $IFC_CFG_FILE && sed -i '/IPV6INIT*/c IPV6INIT=yes' $IFC_CFG_FILE || echo "IPV6INIT=yes" >> $IFC_CFG_FILE
grep DHCPV6C $IFC_CFG_FILE && sed -i '/DHCPV6C*/c DHCPV6C=yes' $IFC_CFG_FILE || echo "DHCPV6C=yes" >> $IFC_CFG_FILE
grep IPV6_AUTOCONF $IFC_CFG_FILE && sed -i '/IPV6_AUTOCONF*/c IPV6_AUTOCONF=yes' $IFC_CFG_FILE || echo "IPV6_AUTOCONF=yes" >> $IFC_CFG_FILE
# Restart NetworkManager to apply for IPv6 configs
systemctl restart NetworkManager
# Let NetworkManager apply the DHCPv6 configs
sleep 3
# set kubelet nodeip environment variable
mkdir -p /etc/systemd/system/kubelet.service.d/
Expand Down
14 changes: 10 additions & 4 deletions pkg/userdata/rhel/testdata/kubelet-v1.23-vsphere-mirrors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,16 @@ write_files:
fi
DEFAULT_IFC_NAME=$(ip -o route get 1 | grep -oP "dev \K\S+")
echo NETWORKING_IPV6=yes >> /etc/sysconfig/network
echo IPV6INIT=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
echo DHCPV6C=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
ifdown $DEFAULT_IFC_NAME && ifup $DEFAULT_IFC_NAME
IFC_CFG_FILE=/etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
# Enable IPv6 and DHCPv6 on the default interface
grep IPV6INIT $IFC_CFG_FILE && sed -i '/IPV6INIT*/c IPV6INIT=yes' $IFC_CFG_FILE || echo "IPV6INIT=yes" >> $IFC_CFG_FILE
grep DHCPV6C $IFC_CFG_FILE && sed -i '/DHCPV6C*/c DHCPV6C=yes' $IFC_CFG_FILE || echo "DHCPV6C=yes" >> $IFC_CFG_FILE
grep IPV6_AUTOCONF $IFC_CFG_FILE && sed -i '/IPV6_AUTOCONF*/c IPV6_AUTOCONF=yes' $IFC_CFG_FILE || echo "IPV6_AUTOCONF=yes" >> $IFC_CFG_FILE
# Restart NetworkManager to apply for IPv6 configs
systemctl restart NetworkManager
# Let NetworkManager apply the DHCPv6 configs
sleep 3
# set kubelet nodeip environment variable
mkdir -p /etc/systemd/system/kubelet.service.d/
Expand Down
14 changes: 10 additions & 4 deletions pkg/userdata/rhel/testdata/kubelet-v1.23-vsphere-proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,16 @@ write_files:
fi
DEFAULT_IFC_NAME=$(ip -o route get 1 | grep -oP "dev \K\S+")
echo NETWORKING_IPV6=yes >> /etc/sysconfig/network
echo IPV6INIT=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
echo DHCPV6C=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
ifdown $DEFAULT_IFC_NAME && ifup $DEFAULT_IFC_NAME
IFC_CFG_FILE=/etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
# Enable IPv6 and DHCPv6 on the default interface
grep IPV6INIT $IFC_CFG_FILE && sed -i '/IPV6INIT*/c IPV6INIT=yes' $IFC_CFG_FILE || echo "IPV6INIT=yes" >> $IFC_CFG_FILE
grep DHCPV6C $IFC_CFG_FILE && sed -i '/DHCPV6C*/c DHCPV6C=yes' $IFC_CFG_FILE || echo "DHCPV6C=yes" >> $IFC_CFG_FILE
grep IPV6_AUTOCONF $IFC_CFG_FILE && sed -i '/IPV6_AUTOCONF*/c IPV6_AUTOCONF=yes' $IFC_CFG_FILE || echo "IPV6_AUTOCONF=yes" >> $IFC_CFG_FILE
# Restart NetworkManager to apply for IPv6 configs
systemctl restart NetworkManager
# Let NetworkManager apply the DHCPv6 configs
sleep 3
# set kubelet nodeip environment variable
mkdir -p /etc/systemd/system/kubelet.service.d/
Expand Down
14 changes: 10 additions & 4 deletions pkg/userdata/rhel/testdata/kubelet-v1.23-vsphere.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,16 @@ write_files:
fi
DEFAULT_IFC_NAME=$(ip -o route get 1 | grep -oP "dev \K\S+")
echo NETWORKING_IPV6=yes >> /etc/sysconfig/network
echo IPV6INIT=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
echo DHCPV6C=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
ifdown $DEFAULT_IFC_NAME && ifup $DEFAULT_IFC_NAME
IFC_CFG_FILE=/etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
# Enable IPv6 and DHCPv6 on the default interface
grep IPV6INIT $IFC_CFG_FILE && sed -i '/IPV6INIT*/c IPV6INIT=yes' $IFC_CFG_FILE || echo "IPV6INIT=yes" >> $IFC_CFG_FILE
grep DHCPV6C $IFC_CFG_FILE && sed -i '/DHCPV6C*/c DHCPV6C=yes' $IFC_CFG_FILE || echo "DHCPV6C=yes" >> $IFC_CFG_FILE
grep IPV6_AUTOCONF $IFC_CFG_FILE && sed -i '/IPV6_AUTOCONF*/c IPV6_AUTOCONF=yes' $IFC_CFG_FILE || echo "IPV6_AUTOCONF=yes" >> $IFC_CFG_FILE
# Restart NetworkManager to apply for IPv6 configs
systemctl restart NetworkManager
# Let NetworkManager apply the DHCPv6 configs
sleep 3
# set kubelet nodeip environment variable
mkdir -p /etc/systemd/system/kubelet.service.d/
Expand Down
14 changes: 10 additions & 4 deletions pkg/userdata/rhel/testdata/kubelet-v1.24-aws-external.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,16 @@ write_files:
fi
DEFAULT_IFC_NAME=$(ip -o route get 1 | grep -oP "dev \K\S+")
echo NETWORKING_IPV6=yes >> /etc/sysconfig/network
echo IPV6INIT=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
echo DHCPV6C=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
ifdown $DEFAULT_IFC_NAME && ifup $DEFAULT_IFC_NAME
IFC_CFG_FILE=/etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
# Enable IPv6 and DHCPv6 on the default interface
grep IPV6INIT $IFC_CFG_FILE && sed -i '/IPV6INIT*/c IPV6INIT=yes' $IFC_CFG_FILE || echo "IPV6INIT=yes" >> $IFC_CFG_FILE
grep DHCPV6C $IFC_CFG_FILE && sed -i '/DHCPV6C*/c DHCPV6C=yes' $IFC_CFG_FILE || echo "DHCPV6C=yes" >> $IFC_CFG_FILE
grep IPV6_AUTOCONF $IFC_CFG_FILE && sed -i '/IPV6_AUTOCONF*/c IPV6_AUTOCONF=yes' $IFC_CFG_FILE || echo "IPV6_AUTOCONF=yes" >> $IFC_CFG_FILE
# Restart NetworkManager to apply for IPv6 configs
systemctl restart NetworkManager
# Let NetworkManager apply the DHCPv6 configs
sleep 3
# set kubelet nodeip environment variable
mkdir -p /etc/systemd/system/kubelet.service.d/
Expand Down
14 changes: 10 additions & 4 deletions pkg/userdata/rhel/testdata/kubelet-v1.24-aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,16 @@ write_files:
fi
DEFAULT_IFC_NAME=$(ip -o route get 1 | grep -oP "dev \K\S+")
echo NETWORKING_IPV6=yes >> /etc/sysconfig/network
echo IPV6INIT=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
echo DHCPV6C=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
ifdown $DEFAULT_IFC_NAME && ifup $DEFAULT_IFC_NAME
IFC_CFG_FILE=/etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
# Enable IPv6 and DHCPv6 on the default interface
grep IPV6INIT $IFC_CFG_FILE && sed -i '/IPV6INIT*/c IPV6INIT=yes' $IFC_CFG_FILE || echo "IPV6INIT=yes" >> $IFC_CFG_FILE
grep DHCPV6C $IFC_CFG_FILE && sed -i '/DHCPV6C*/c DHCPV6C=yes' $IFC_CFG_FILE || echo "DHCPV6C=yes" >> $IFC_CFG_FILE
grep IPV6_AUTOCONF $IFC_CFG_FILE && sed -i '/IPV6_AUTOCONF*/c IPV6_AUTOCONF=yes' $IFC_CFG_FILE || echo "IPV6_AUTOCONF=yes" >> $IFC_CFG_FILE
# Restart NetworkManager to apply for IPv6 configs
systemctl restart NetworkManager
# Let NetworkManager apply the DHCPv6 configs
sleep 3
# set kubelet nodeip environment variable
mkdir -p /etc/systemd/system/kubelet.service.d/
Expand Down
14 changes: 10 additions & 4 deletions pkg/userdata/rhel/testdata/pod-cidr-azure-rhel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,16 @@ write_files:
fi
DEFAULT_IFC_NAME=$(ip -o route get 1 | grep -oP "dev \K\S+")
echo NETWORKING_IPV6=yes >> /etc/sysconfig/network
echo IPV6INIT=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
echo DHCPV6C=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
ifdown $DEFAULT_IFC_NAME && ifup $DEFAULT_IFC_NAME
IFC_CFG_FILE=/etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
# Enable IPv6 and DHCPv6 on the default interface
grep IPV6INIT $IFC_CFG_FILE && sed -i '/IPV6INIT*/c IPV6INIT=yes' $IFC_CFG_FILE || echo "IPV6INIT=yes" >> $IFC_CFG_FILE
grep DHCPV6C $IFC_CFG_FILE && sed -i '/DHCPV6C*/c DHCPV6C=yes' $IFC_CFG_FILE || echo "DHCPV6C=yes" >> $IFC_CFG_FILE
grep IPV6_AUTOCONF $IFC_CFG_FILE && sed -i '/IPV6_AUTOCONF*/c IPV6_AUTOCONF=yes' $IFC_CFG_FILE || echo "IPV6_AUTOCONF=yes" >> $IFC_CFG_FILE
# Restart NetworkManager to apply for IPv6 configs
systemctl restart NetworkManager
# Let NetworkManager apply the DHCPv6 configs
sleep 3
# set kubelet nodeip environment variable
mkdir -p /etc/systemd/system/kubelet.service.d/
Expand Down
14 changes: 10 additions & 4 deletions pkg/userdata/rockylinux/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,16 @@ write_files:
{{ .ContainerRuntimeScript | indent 4 }}
{{ safeDownloadBinariesScript .KubeletVersion | indent 4 }}
DEFAULT_IFC_NAME=$(ip -o route get 1 | grep -oP "dev \K\S+")
echo NETWORKING_IPV6=yes >> /etc/sysconfig/network
echo IPV6INIT=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
echo DHCPV6C=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
ifdown $DEFAULT_IFC_NAME && ifup $DEFAULT_IFC_NAME
IFC_CFG_FILE=/etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
# Enable IPv6 and DHCPv6 on the default interface
grep IPV6INIT $IFC_CFG_FILE && sed -i '/IPV6INIT*/c IPV6INIT=yes' $IFC_CFG_FILE || echo "IPV6INIT=yes" >> $IFC_CFG_FILE
grep DHCPV6C $IFC_CFG_FILE && sed -i '/DHCPV6C*/c DHCPV6C=yes' $IFC_CFG_FILE || echo "DHCPV6C=yes" >> $IFC_CFG_FILE
grep IPV6_AUTOCONF $IFC_CFG_FILE && sed -i '/IPV6_AUTOCONF*/c IPV6_AUTOCONF=yes' $IFC_CFG_FILE || echo "IPV6_AUTOCONF=yes" >> $IFC_CFG_FILE
# Restart NetworkManager to apply for IPv6 configs
systemctl restart NetworkManager
# Let NetworkManager apply the DHCPv6 configs
sleep 3
# set kubelet nodeip environment variable
mkdir -p /etc/systemd/system/kubelet.service.d/
Expand Down
14 changes: 10 additions & 4 deletions pkg/userdata/rockylinux/testdata/kubelet-v1.22-aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,16 @@ write_files:
fi
DEFAULT_IFC_NAME=$(ip -o route get 1 | grep -oP "dev \K\S+")
echo NETWORKING_IPV6=yes >> /etc/sysconfig/network
echo IPV6INIT=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
echo DHCPV6C=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
ifdown $DEFAULT_IFC_NAME && ifup $DEFAULT_IFC_NAME
IFC_CFG_FILE=/etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
# Enable IPv6 and DHCPv6 on the default interface
grep IPV6INIT $IFC_CFG_FILE && sed -i '/IPV6INIT*/c IPV6INIT=yes' $IFC_CFG_FILE || echo "IPV6INIT=yes" >> $IFC_CFG_FILE
grep DHCPV6C $IFC_CFG_FILE && sed -i '/DHCPV6C*/c DHCPV6C=yes' $IFC_CFG_FILE || echo "DHCPV6C=yes" >> $IFC_CFG_FILE
grep IPV6_AUTOCONF $IFC_CFG_FILE && sed -i '/IPV6_AUTOCONF*/c IPV6_AUTOCONF=yes' $IFC_CFG_FILE || echo "IPV6_AUTOCONF=yes" >> $IFC_CFG_FILE
# Restart NetworkManager to apply for IPv6 configs
systemctl restart NetworkManager
# Let NetworkManager apply the DHCPv6 configs
sleep 3
# set kubelet nodeip environment variable
mkdir -p /etc/systemd/system/kubelet.service.d/
Expand Down
14 changes: 10 additions & 4 deletions pkg/userdata/rockylinux/testdata/kubelet-v1.23-aws-external.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,16 @@ write_files:
fi
DEFAULT_IFC_NAME=$(ip -o route get 1 | grep -oP "dev \K\S+")
echo NETWORKING_IPV6=yes >> /etc/sysconfig/network
echo IPV6INIT=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
echo DHCPV6C=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
ifdown $DEFAULT_IFC_NAME && ifup $DEFAULT_IFC_NAME
IFC_CFG_FILE=/etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
# Enable IPv6 and DHCPv6 on the default interface
grep IPV6INIT $IFC_CFG_FILE && sed -i '/IPV6INIT*/c IPV6INIT=yes' $IFC_CFG_FILE || echo "IPV6INIT=yes" >> $IFC_CFG_FILE
grep DHCPV6C $IFC_CFG_FILE && sed -i '/DHCPV6C*/c DHCPV6C=yes' $IFC_CFG_FILE || echo "DHCPV6C=yes" >> $IFC_CFG_FILE
grep IPV6_AUTOCONF $IFC_CFG_FILE && sed -i '/IPV6_AUTOCONF*/c IPV6_AUTOCONF=yes' $IFC_CFG_FILE || echo "IPV6_AUTOCONF=yes" >> $IFC_CFG_FILE
# Restart NetworkManager to apply for IPv6 configs
systemctl restart NetworkManager
# Let NetworkManager apply the DHCPv6 configs
sleep 3
# set kubelet nodeip environment variable
mkdir -p /etc/systemd/system/kubelet.service.d/
Expand Down
14 changes: 10 additions & 4 deletions pkg/userdata/rockylinux/testdata/kubelet-v1.23-aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,16 @@ write_files:
fi
DEFAULT_IFC_NAME=$(ip -o route get 1 | grep -oP "dev \K\S+")
echo NETWORKING_IPV6=yes >> /etc/sysconfig/network
echo IPV6INIT=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
echo DHCPV6C=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
ifdown $DEFAULT_IFC_NAME && ifup $DEFAULT_IFC_NAME
IFC_CFG_FILE=/etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
# Enable IPv6 and DHCPv6 on the default interface
grep IPV6INIT $IFC_CFG_FILE && sed -i '/IPV6INIT*/c IPV6INIT=yes' $IFC_CFG_FILE || echo "IPV6INIT=yes" >> $IFC_CFG_FILE
grep DHCPV6C $IFC_CFG_FILE && sed -i '/DHCPV6C*/c DHCPV6C=yes' $IFC_CFG_FILE || echo "DHCPV6C=yes" >> $IFC_CFG_FILE
grep IPV6_AUTOCONF $IFC_CFG_FILE && sed -i '/IPV6_AUTOCONF*/c IPV6_AUTOCONF=yes' $IFC_CFG_FILE || echo "IPV6_AUTOCONF=yes" >> $IFC_CFG_FILE
# Restart NetworkManager to apply for IPv6 configs
systemctl restart NetworkManager
# Let NetworkManager apply the DHCPv6 configs
sleep 3
# set kubelet nodeip environment variable
mkdir -p /etc/systemd/system/kubelet.service.d/
Expand Down
14 changes: 10 additions & 4 deletions pkg/userdata/rockylinux/testdata/kubelet-v1.23-nutanix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,16 @@ write_files:
fi
DEFAULT_IFC_NAME=$(ip -o route get 1 | grep -oP "dev \K\S+")
echo NETWORKING_IPV6=yes >> /etc/sysconfig/network
echo IPV6INIT=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
echo DHCPV6C=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
ifdown $DEFAULT_IFC_NAME && ifup $DEFAULT_IFC_NAME
IFC_CFG_FILE=/etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
# Enable IPv6 and DHCPv6 on the default interface
grep IPV6INIT $IFC_CFG_FILE && sed -i '/IPV6INIT*/c IPV6INIT=yes' $IFC_CFG_FILE || echo "IPV6INIT=yes" >> $IFC_CFG_FILE
grep DHCPV6C $IFC_CFG_FILE && sed -i '/DHCPV6C*/c DHCPV6C=yes' $IFC_CFG_FILE || echo "DHCPV6C=yes" >> $IFC_CFG_FILE
grep IPV6_AUTOCONF $IFC_CFG_FILE && sed -i '/IPV6_AUTOCONF*/c IPV6_AUTOCONF=yes' $IFC_CFG_FILE || echo "IPV6_AUTOCONF=yes" >> $IFC_CFG_FILE
# Restart NetworkManager to apply for IPv6 configs
systemctl restart NetworkManager
# Let NetworkManager apply the DHCPv6 configs
sleep 3
# set kubelet nodeip environment variable
mkdir -p /etc/systemd/system/kubelet.service.d/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,16 @@ write_files:
fi
DEFAULT_IFC_NAME=$(ip -o route get 1 | grep -oP "dev \K\S+")
echo NETWORKING_IPV6=yes >> /etc/sysconfig/network
echo IPV6INIT=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
echo DHCPV6C=yes >> /etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
ifdown $DEFAULT_IFC_NAME && ifup $DEFAULT_IFC_NAME
IFC_CFG_FILE=/etc/sysconfig/network-scripts/ifcfg-$DEFAULT_IFC_NAME
# Enable IPv6 and DHCPv6 on the default interface
grep IPV6INIT $IFC_CFG_FILE && sed -i '/IPV6INIT*/c IPV6INIT=yes' $IFC_CFG_FILE || echo "IPV6INIT=yes" >> $IFC_CFG_FILE
grep DHCPV6C $IFC_CFG_FILE && sed -i '/DHCPV6C*/c DHCPV6C=yes' $IFC_CFG_FILE || echo "DHCPV6C=yes" >> $IFC_CFG_FILE
grep IPV6_AUTOCONF $IFC_CFG_FILE && sed -i '/IPV6_AUTOCONF*/c IPV6_AUTOCONF=yes' $IFC_CFG_FILE || echo "IPV6_AUTOCONF=yes" >> $IFC_CFG_FILE
# Restart NetworkManager to apply for IPv6 configs
systemctl restart NetworkManager
# Let NetworkManager apply the DHCPv6 configs
sleep 3
# set kubelet nodeip environment variable
mkdir -p /etc/systemd/system/kubelet.service.d/
Expand Down
Loading

0 comments on commit f7b9474

Please sign in to comment.