Skip to content

Commit e4d992a

Browse files
authored
Merge pull request #2154 from aramase/dual-stack
feat: add dual-stack support
2 parents f97fe79 + ebb7ba0 commit e4d992a

File tree

18 files changed

+9635
-10
lines changed

18 files changed

+9635
-10
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ create-management-cluster: $(KUSTOMIZE) $(ENVSUBST) ## Create a management clust
262262
# apply CNI ClusterResourceSets
263263
kubectl create configmap calico-addon --from-file=templates/addons/calico.yaml
264264
kubectl create configmap calico-ipv6-addon --from-file=templates/addons/calico-ipv6.yaml
265+
kubectl create configmap calico-dual-stack-addon --from-file=templates/addons/calico-dual-stack.yaml
265266
kubectl create configmap calico-windows-addon --from-file=templates/addons/windows/calico
266267
kubectl create configmap flannel-windows-addon --from-file=templates/addons/windows/flannel
267268

@@ -455,6 +456,7 @@ generate-addons: fetch-calico-manifests ## Generate metric-server, calico calico
455456
$(KUSTOMIZE) build $(ADDONS_DIR)/metrics-server > $(ADDONS_DIR)/metrics-server/metrics-server.yaml
456457
$(KUSTOMIZE) build $(ADDONS_DIR)/calico > $(ADDONS_DIR)/calico.yaml
457458
$(KUSTOMIZE) build $(ADDONS_DIR)/calico-ipv6 > $(ADDONS_DIR)/calico-ipv6.yaml
459+
$(KUSTOMIZE) build $(ADDONS_DIR)/calico-dual-stack > $(ADDONS_DIR)/calico-dual-stack.yaml
458460

459461
# When updating this, make sure to also update the Windows image version in templates/addons/windows/calico.
460462
CALICO_VERSION := v3.22.1

docs/book/src/topics/dual-stack.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Dual-stack clusters
2+
3+
## Overview
4+
5+
CAPZ enables you to create [dual-stack](https://kubernetes.io/docs/concepts/services-networking/dual-stack/) Kubernetes cluster on Microsoft Azure.
6+
7+
- Dual-stack support is available for Kubernetes version 1.21.0 and later on Azure.
8+
9+
To deploy a cluster using dual-stack, use the [dual-stack flavor template](../../../../templates/cluster-template-dual-stack.yaml).
10+
11+
Things to try out after the cluster created:
12+
13+
- Nodes have 2 internal IPs, one from each IP family.
14+
15+
```bash
16+
kubectl get node <node name> -o go-template --template='{{range .status.addresses}}{{printf "%s: %s \n" .type .address}}{{end}}'
17+
Hostname: capi-dual-stack-md-0-j96nr
18+
InternalIP: 10.1.0.4
19+
InternalIP: 2001:1234:5678:9abd::4
20+
```
21+
22+
- Nodes have 2 `PodCIDRs`, one from each IP family.
23+
24+
```bash
25+
kubectl get node <node name> -o go-template --template='{{range .spec.podCIDRs}}{{printf "%s\n" .}}{{end}}'
26+
10.244.2.0/24
27+
2001:1234:5678:9a42::/64
28+
```
29+
30+
- Pods have 2 `PodIP`, one from each IP family.
31+
32+
```bash
33+
kubectl get pods <pod name> -o go-template --template='{{range .status.podIPs}}{{printf "%s \n" .ip}}{{end}}'
34+
10.244.2.37
35+
2001:1234:5678:9a42::25
36+
```
37+
38+
- Able to reach other pods in cluster using IPv4 and IPv6.
39+
40+
```bash
41+
# inside the nginx-pod
42+
/ # ifconfig eth0
43+
eth0 Link encap:Ethernet HWaddr 8A:B2:32:92:4F:87
44+
inet addr:10.244.2.2 Bcast:0.0.0.0 Mask:255.255.255.255
45+
inet6 addr: 2001:1234:5678:9a42::2/128 Scope:Global
46+
inet6 addr: fe80::88b2:32ff:fe92:4f87/64 Scope:Link
47+
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
48+
RX packets:9 errors:0 dropped:0 overruns:0 frame:0
49+
TX packets:10 errors:0 dropped:1 overruns:0 carrier:0
50+
collisions:0 txqueuelen:0
51+
RX bytes:906 (906.0 B) TX bytes:840 (840.0 B)
52+
53+
/ # ping -c 2 10.244.1.2
54+
PING 10.244.1.2 (10.244.1.2): 56 data bytes
55+
64 bytes from 10.244.1.2: seq=0 ttl=62 time=1.366 ms
56+
64 bytes from 10.244.1.2: seq=1 ttl=62 time=1.396 ms
57+
58+
--- 10.244.1.2 ping statistics ---
59+
2 packets transmitted, 2 packets received, 0% packet loss
60+
round-trip min/avg/max = 1.366/1.381/1.396 ms
61+
/ # ping -c 2 2001:1234:5678:9a41::2
62+
PING 2001:1234:5678:9a41::2 (2001:1234:5678:9a41::2): 56 data bytes
63+
64 bytes from 2001:1234:5678:9a41::2: seq=0 ttl=62 time=1.264 ms
64+
64 bytes from 2001:1234:5678:9a41::2: seq=1 ttl=62 time=1.233 ms
65+
66+
--- 2001:1234:5678:9a41::2 ping statistics ---
67+
2 packets transmitted, 2 packets received, 0% packet loss
68+
round-trip min/avg/max = 1.233/1.248/1.264 ms
69+
```

0 commit comments

Comments
 (0)