mirror of https://github.com/k3s-io/k3s
commit
8016ae2b69
|
@ -16,6 +16,7 @@ def provision(vm, roles, role_num, node_num)
|
||||||
vm.hostname = "#{roles[0]}-#{role_num}"
|
vm.hostname = "#{roles[0]}-#{role_num}"
|
||||||
node_ip4 = "#{NETWORK4_PREFIX}.#{100+node_num}"
|
node_ip4 = "#{NETWORK4_PREFIX}.#{100+node_num}"
|
||||||
node_ip6 = "#{NETWORK6_PREFIX}::#{10+node_num}"
|
node_ip6 = "#{NETWORK6_PREFIX}::#{10+node_num}"
|
||||||
|
node_ip6_gw = "#{NETWORK6_PREFIX}::1"
|
||||||
# Only works with libvirt, which allows IPv4 + IPv6 on a single network/interface
|
# Only works with libvirt, which allows IPv4 + IPv6 on a single network/interface
|
||||||
vm.network "private_network",
|
vm.network "private_network",
|
||||||
:ip => node_ip4,
|
:ip => node_ip4,
|
||||||
|
@ -32,7 +33,7 @@ def provision(vm, roles, role_num, node_num)
|
||||||
|
|
||||||
defaultOSConfigure(vm)
|
defaultOSConfigure(vm)
|
||||||
|
|
||||||
vm.provision "IPv6 Setup", type: "shell", path: scripts_location +"/ipv6.sh", args: [node_ip4, node_ip6, vm.box.to_s]
|
vm.provision "IPv6 Setup", type: "shell", path: scripts_location +"/ipv6.sh", args: [node_ip4, node_ip6, node_ip6_gw, vm.box.to_s]
|
||||||
install_type = getInstallType(vm, RELEASE_VERSION, GITHUB_BRANCH)
|
install_type = getInstallType(vm, RELEASE_VERSION, GITHUB_BRANCH)
|
||||||
|
|
||||||
vm.provision "Ping Check", type: "shell", inline: "ping -c 2 k3s.io"
|
vm.provision "Ping Check", type: "shell", inline: "ping -c 2 k3s.io"
|
||||||
|
|
|
@ -117,7 +117,7 @@ var _ = Describe("Verify DualStack Configuration", Ordered, func() {
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
for _, node := range nodeIPs {
|
for _, node := range nodeIPs {
|
||||||
Expect(node.ipv4).Should(ContainSubstring("10.10.10"))
|
Expect(node.ipv4).Should(ContainSubstring("10.10.10"))
|
||||||
Expect(node.ipv6).Should(ContainSubstring("a11:decf:c0ff"))
|
Expect(node.ipv6).Should(ContainSubstring("fd11:decf:c0ff"))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
It("Verifies that each pod has IPv4 and IPv6", func() {
|
It("Verifies that each pod has IPv4 and IPv6", func() {
|
||||||
|
@ -125,7 +125,7 @@ var _ = Describe("Verify DualStack Configuration", Ordered, func() {
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
for _, pod := range podIPs {
|
for _, pod := range podIPs {
|
||||||
Expect(pod.ipv4).Should(Or(ContainSubstring("10.10.10"), ContainSubstring("10.42.")), pod.name)
|
Expect(pod.ipv4).Should(Or(ContainSubstring("10.10.10"), ContainSubstring("10.42.")), pod.name)
|
||||||
Expect(pod.ipv6).Should(Or(ContainSubstring("a11:decf:c0ff"), ContainSubstring("2001:cafe:42")), pod.name)
|
Expect(pod.ipv6).Should(Or(ContainSubstring("fd11:decf:c0ff"), ContainSubstring("2001:cafe:42")), pod.name)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
ip4_addr=$1
|
ip4_addr=$1
|
||||||
ip6_addr=$2
|
ip6_addr=$2
|
||||||
os=$3
|
ip6_addr_gw=$3
|
||||||
|
os=$4
|
||||||
|
|
||||||
sysctl -w net.ipv6.conf.all.disable_ipv6=0
|
sysctl -w net.ipv6.conf.all.disable_ipv6=0
|
||||||
sysctl -w net.ipv6.conf.eth1.accept_dad=0
|
sysctl -w net.ipv6.conf.eth1.accept_dad=0
|
||||||
|
@ -19,4 +20,5 @@ elif [ -z "${os##*alpine*}" ]; then
|
||||||
else
|
else
|
||||||
ip -6 addr add "$ip6_addr"/64 dev eth1
|
ip -6 addr add "$ip6_addr"/64 dev eth1
|
||||||
fi
|
fi
|
||||||
ip addr show dev eth1
|
ip addr show dev eth1
|
||||||
|
ip -6 r add default via "$ip6_addr_gw"
|
||||||
|
|
Loading…
Reference in New Issue