Skip to content

Commit

Permalink
feat: add dual-stack support
Browse files Browse the repository at this point in the history
Signed-off-by: Anish Ramasekar <[email protected]>

feat: add dual-stack flavor in templates

Signed-off-by: Anish Ramasekar <[email protected]>

test: add prow-dual-stack flavor

Signed-off-by: Anish Ramasekar <[email protected]>

chore: use calico-ipv6 as base for dual-stack and rm azure-mtu.yaml

Signed-off-by: Anish Ramasekar <[email protected]>

docs: add dual-stack validation steps

Signed-off-by: Anish Ramasekar <[email protected]>

test: add test for dual-stack clusters

Signed-off-by: Anish Ramasekar <[email protected]>

chore: remove calico-node, tolerations yaml and add min k8s version

Signed-off-by: Anish Ramasekar <[email protected]>

test: make dual-stack test optional

Signed-off-by: Anish Ramasekar <[email protected]>
  • Loading branch information
aramase committed Mar 16, 2022
1 parent 29976f8 commit deb3704
Show file tree
Hide file tree
Showing 18 changed files with 9,627 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ create-management-cluster: $(KUSTOMIZE) $(ENVSUBST) ## Create a management clust
# apply CNI ClusterResourceSets
kubectl create configmap calico-addon --from-file=templates/addons/calico.yaml
kubectl create configmap calico-ipv6-addon --from-file=templates/addons/calico-ipv6.yaml
kubectl create configmap calico-dual-stack-addon --from-file=templates/addons/calico-dual-stack.yaml
kubectl create configmap calico-windows-addon --from-file=templates/addons/windows/calico
kubectl create configmap flannel-windows-addon --from-file=templates/addons/windows/flannel

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

# When updating this, make sure to also update the Windows image version in templates/addons/windows/calico.
CALICO_VERSION := v3.22.1
Expand Down
69 changes: 69 additions & 0 deletions docs/book/src/topics/dual-stack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Dual-stack clusters

## Overview

CAPZ enables you to create [dual-stack](https://kubernetes.io/docs/concepts/services-networking/dual-stack/) Kubernetes cluster on Microsoft Azure.

- Dual-stack support is available for Kubernetes version 1.21.0 and later on Azure.

To deploy a cluster using dual-stack, use the [dual-stack flavor template](../../../../templates/cluster-template-dual-stack.yaml).

Things to try out after the cluster created:

- Nodes have 2 internal IPs, one from each IP family.

```bash
kubectl get node <node name> -o go-template --template='{{range .status.addresses}}{{printf "%s: %s \n" .type .address}}{{end}}'
Hostname: capi-dual-stack-md-0-j96nr
InternalIP: 10.1.0.4
InternalIP: 2001:1234:5678:9abd::4
```

- Nodes have 2 `PodCIDRs`, one from each IP family.

```bash
kubectl get node <node name> -o go-template --template='{{range .spec.podCIDRs}}{{printf "%s\n" .}}{{end}}'
10.244.2.0/24
2001:1234:5678:9a42::/64
```

- Pods have 2 `PodIP`, one from each IP family.

```bash
kubectl get pods <pod name> -o go-template --template='{{range .status.podIPs}}{{printf "%s \n" .ip}}{{end}}'
10.244.2.37
2001:1234:5678:9a42::25
```

- Able to reach other pods in cluster using IPv4 and IPv6.

```bash
# inside the nginx-pod
/ # ifconfig eth0
eth0 Link encap:Ethernet HWaddr 8A:B2:32:92:4F:87
inet addr:10.244.2.2 Bcast:0.0.0.0 Mask:255.255.255.255
inet6 addr: 2001:1234:5678:9a42::2/128 Scope:Global
inet6 addr: fe80::88b2:32ff:fe92:4f87/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:9 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:1 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:906 (906.0 B) TX bytes:840 (840.0 B)

/ # ping -c 2 10.244.1.2
PING 10.244.1.2 (10.244.1.2): 56 data bytes
64 bytes from 10.244.1.2: seq=0 ttl=62 time=1.366 ms
64 bytes from 10.244.1.2: seq=1 ttl=62 time=1.396 ms

--- 10.244.1.2 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 1.366/1.381/1.396 ms
/ # ping -c 2 2001:1234:5678:9a41::2
PING 2001:1234:5678:9a41::2 (2001:1234:5678:9a41::2): 56 data bytes
64 bytes from 2001:1234:5678:9a41::2: seq=0 ttl=62 time=1.264 ms
64 bytes from 2001:1234:5678:9a41::2: seq=1 ttl=62 time=1.233 ms

--- 2001:1234:5678:9a41::2 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 1.233/1.248/1.264 ms
```
Loading

0 comments on commit deb3704

Please sign in to comment.