diff --git a/pkg/userdata/rhel/provider.go b/pkg/userdata/rhel/provider.go index 46f3b3046..41016bc28 100644 --- a/pkg/userdata/rhel/provider.go +++ b/pkg/userdata/rhel/provider.go @@ -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/ diff --git a/pkg/userdata/rhel/testdata/kubelet-v1.22-aws.yaml b/pkg/userdata/rhel/testdata/kubelet-v1.22-aws.yaml index 11ead7d42..990b382d3 100644 --- a/pkg/userdata/rhel/testdata/kubelet-v1.22-aws.yaml +++ b/pkg/userdata/rhel/testdata/kubelet-v1.22-aws.yaml @@ -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/ diff --git a/pkg/userdata/rhel/testdata/kubelet-v1.22-nutanix.yaml b/pkg/userdata/rhel/testdata/kubelet-v1.22-nutanix.yaml index 733fe615c..a391452dc 100644 --- a/pkg/userdata/rhel/testdata/kubelet-v1.22-nutanix.yaml +++ b/pkg/userdata/rhel/testdata/kubelet-v1.22-nutanix.yaml @@ -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/ diff --git a/pkg/userdata/rhel/testdata/kubelet-v1.23-aws-external.yaml b/pkg/userdata/rhel/testdata/kubelet-v1.23-aws-external.yaml index 286031fa6..89cba1bae 100644 --- a/pkg/userdata/rhel/testdata/kubelet-v1.23-aws-external.yaml +++ b/pkg/userdata/rhel/testdata/kubelet-v1.23-aws-external.yaml @@ -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/ diff --git a/pkg/userdata/rhel/testdata/kubelet-v1.23-aws.yaml b/pkg/userdata/rhel/testdata/kubelet-v1.23-aws.yaml index 8625265ee..d664973d9 100644 --- a/pkg/userdata/rhel/testdata/kubelet-v1.23-aws.yaml +++ b/pkg/userdata/rhel/testdata/kubelet-v1.23-aws.yaml @@ -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/ diff --git a/pkg/userdata/rhel/testdata/kubelet-v1.23-vsphere-mirrors.yaml b/pkg/userdata/rhel/testdata/kubelet-v1.23-vsphere-mirrors.yaml index 930ffddc6..45df41d5b 100644 --- a/pkg/userdata/rhel/testdata/kubelet-v1.23-vsphere-mirrors.yaml +++ b/pkg/userdata/rhel/testdata/kubelet-v1.23-vsphere-mirrors.yaml @@ -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/ diff --git a/pkg/userdata/rhel/testdata/kubelet-v1.23-vsphere-proxy.yaml b/pkg/userdata/rhel/testdata/kubelet-v1.23-vsphere-proxy.yaml index a7edd8cc1..c22c6a5e3 100644 --- a/pkg/userdata/rhel/testdata/kubelet-v1.23-vsphere-proxy.yaml +++ b/pkg/userdata/rhel/testdata/kubelet-v1.23-vsphere-proxy.yaml @@ -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/ diff --git a/pkg/userdata/rhel/testdata/kubelet-v1.23-vsphere.yaml b/pkg/userdata/rhel/testdata/kubelet-v1.23-vsphere.yaml index 05f164b99..588b2f68f 100644 --- a/pkg/userdata/rhel/testdata/kubelet-v1.23-vsphere.yaml +++ b/pkg/userdata/rhel/testdata/kubelet-v1.23-vsphere.yaml @@ -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/ diff --git a/pkg/userdata/rhel/testdata/kubelet-v1.24-aws-external.yaml b/pkg/userdata/rhel/testdata/kubelet-v1.24-aws-external.yaml index 88dfc8387..3c100fa6a 100644 --- a/pkg/userdata/rhel/testdata/kubelet-v1.24-aws-external.yaml +++ b/pkg/userdata/rhel/testdata/kubelet-v1.24-aws-external.yaml @@ -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/ diff --git a/pkg/userdata/rhel/testdata/kubelet-v1.24-aws.yaml b/pkg/userdata/rhel/testdata/kubelet-v1.24-aws.yaml index f1905c82b..49e9b76b1 100644 --- a/pkg/userdata/rhel/testdata/kubelet-v1.24-aws.yaml +++ b/pkg/userdata/rhel/testdata/kubelet-v1.24-aws.yaml @@ -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/ diff --git a/pkg/userdata/rhel/testdata/pod-cidr-azure-rhel.yaml b/pkg/userdata/rhel/testdata/pod-cidr-azure-rhel.yaml index 0e1dcc3ce..5561c339d 100644 --- a/pkg/userdata/rhel/testdata/pod-cidr-azure-rhel.yaml +++ b/pkg/userdata/rhel/testdata/pod-cidr-azure-rhel.yaml @@ -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/ diff --git a/pkg/userdata/rockylinux/provider.go b/pkg/userdata/rockylinux/provider.go index eebe3734e..7efb05332 100644 --- a/pkg/userdata/rockylinux/provider.go +++ b/pkg/userdata/rockylinux/provider.go @@ -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/ diff --git a/pkg/userdata/rockylinux/testdata/kubelet-v1.22-aws.yaml b/pkg/userdata/rockylinux/testdata/kubelet-v1.22-aws.yaml index 67b65185a..45c84c421 100644 --- a/pkg/userdata/rockylinux/testdata/kubelet-v1.22-aws.yaml +++ b/pkg/userdata/rockylinux/testdata/kubelet-v1.22-aws.yaml @@ -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/ diff --git a/pkg/userdata/rockylinux/testdata/kubelet-v1.23-aws-external.yaml b/pkg/userdata/rockylinux/testdata/kubelet-v1.23-aws-external.yaml index 5fef11bd5..0a0256bfc 100644 --- a/pkg/userdata/rockylinux/testdata/kubelet-v1.23-aws-external.yaml +++ b/pkg/userdata/rockylinux/testdata/kubelet-v1.23-aws-external.yaml @@ -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/ diff --git a/pkg/userdata/rockylinux/testdata/kubelet-v1.23-aws.yaml b/pkg/userdata/rockylinux/testdata/kubelet-v1.23-aws.yaml index a61c42f23..082b3f087 100644 --- a/pkg/userdata/rockylinux/testdata/kubelet-v1.23-aws.yaml +++ b/pkg/userdata/rockylinux/testdata/kubelet-v1.23-aws.yaml @@ -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/ diff --git a/pkg/userdata/rockylinux/testdata/kubelet-v1.23-nutanix.yaml b/pkg/userdata/rockylinux/testdata/kubelet-v1.23-nutanix.yaml index 5a926bf22..82ee0fe2e 100644 --- a/pkg/userdata/rockylinux/testdata/kubelet-v1.23-nutanix.yaml +++ b/pkg/userdata/rockylinux/testdata/kubelet-v1.23-nutanix.yaml @@ -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/ diff --git a/pkg/userdata/rockylinux/testdata/kubelet-v1.23-vsphere-mirrors.yaml b/pkg/userdata/rockylinux/testdata/kubelet-v1.23-vsphere-mirrors.yaml index 91c283fa0..53419263f 100644 --- a/pkg/userdata/rockylinux/testdata/kubelet-v1.23-vsphere-mirrors.yaml +++ b/pkg/userdata/rockylinux/testdata/kubelet-v1.23-vsphere-mirrors.yaml @@ -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/ diff --git a/pkg/userdata/rockylinux/testdata/kubelet-v1.23-vsphere-proxy.yaml b/pkg/userdata/rockylinux/testdata/kubelet-v1.23-vsphere-proxy.yaml index 837ba90b6..1b715e6e2 100644 --- a/pkg/userdata/rockylinux/testdata/kubelet-v1.23-vsphere-proxy.yaml +++ b/pkg/userdata/rockylinux/testdata/kubelet-v1.23-vsphere-proxy.yaml @@ -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/ diff --git a/pkg/userdata/rockylinux/testdata/kubelet-v1.23-vsphere.yaml b/pkg/userdata/rockylinux/testdata/kubelet-v1.23-vsphere.yaml index 0216d0958..78ba40086 100644 --- a/pkg/userdata/rockylinux/testdata/kubelet-v1.23-vsphere.yaml +++ b/pkg/userdata/rockylinux/testdata/kubelet-v1.23-vsphere.yaml @@ -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/ diff --git a/pkg/userdata/rockylinux/testdata/kubelet-v1.24-aws.yaml b/pkg/userdata/rockylinux/testdata/kubelet-v1.24-aws.yaml index 16f21929b..3f6a48f7a 100644 --- a/pkg/userdata/rockylinux/testdata/kubelet-v1.24-aws.yaml +++ b/pkg/userdata/rockylinux/testdata/kubelet-v1.24-aws.yaml @@ -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/