Skip to content

Commit

Permalink
Add dualstack e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: killianmuldoon <[email protected]>
  • Loading branch information
killianmuldoon committed Apr 13, 2023
1 parent 9ad6d51 commit 3e61c27
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ generate-e2e-templates-main: $(KUSTOMIZE)
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-upgrades-runtimesdk --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-upgrades-runtimesdk.yaml
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-kcp-scale-in --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-kcp-scale-in.yaml
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-ipv6 --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-ipv6.yaml
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-dualstack --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-dualstack.yaml
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-topology-single-node-cluster --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-topology-single-node-cluster.yaml
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-topology --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-topology.yaml
$(KUSTOMIZE) build $(DOCKER_TEMPLATES)/main/cluster-template-ignition --load-restrictor LoadRestrictionsNone > $(DOCKER_TEMPLATES)/main/cluster-template-ignition.yaml
Expand Down
1 change: 1 addition & 0 deletions test/e2e/config/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ providers:
- sourcePath: "../data/infrastructure-docker/main/cluster-template-upgrades-runtimesdk.yaml"
- sourcePath: "../data/infrastructure-docker/main/cluster-template-kcp-scale-in.yaml"
- sourcePath: "../data/infrastructure-docker/main/cluster-template-ipv6.yaml"
- sourcePath: "../data/infrastructure-docker/main/cluster-template-dualstack.yaml"
- sourcePath: "../data/infrastructure-docker/main/cluster-template-topology-single-node-cluster.yaml"
- sourcePath: "../data/infrastructure-docker/main/cluster-template-topology.yaml"
- sourcePath: "../data/infrastructure-docker/main/cluster-template-ignition.yaml"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: '${CLUSTER_NAME}'
spec:
clusterNetwork:
services:
cidrBlocks:
- '${DOCKER_SERVICE_IPV6_CIDRS}'
- '${DOCKER_SERVICE_CIDRS}'
pods:
cidrBlocks:
- '${DOCKER_POD_IPV6_CIDRS}'
- '${DOCKER_POD_CIDRS}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
kind: KubeadmControlPlane
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
metadata:
name: "${CLUSTER_NAME}-control-plane"
spec:
kubeadmConfigSpec:
clusterConfiguration:
apiServer:
# host.docker.internal is required by kubetest when running on MacOS because of the way ports are proxied.
certSANs: [localhost,"127.0.0.1", "0.0.0.0", "::", "::1", host.docker.internal]
initConfiguration:
localAPIEndpoint:
advertiseAddress: '::' # Note: The control plane node should use an ipv6 address as an internalIP. The worker node should use an ipv4 address as an internalIP.
nodeRegistration:
kubeletExtraArgs:
node-ip: "::"
joinConfiguration:
nodeRegistration:
kubeletExtraArgs:
node-ip: "::"
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
bases:
- ../bases/cluster-with-kcp.yaml
- ../bases/md.yaml
- ../bases/crs.yaml

patchesStrategicMerge:
- cluster.yaml
- md.yaml
- kcp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
metadata:
name: "${CLUSTER_NAME}-md-0"
spec:
template:
spec:
initConfiguration:
nodeRegistration:
kubeletExtraArgs:
node-ip: "0.0.0.0" # Note: The control plane node should use an ipv6 address as an internalIP. The worker node should use an ipv4 address as an internalIP.
joinConfiguration:
nodeRegistration:
kubeletExtraArgs:
node-ip: "0.0.0.0"
14 changes: 14 additions & 0 deletions test/e2e/quick_start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,17 @@ var _ = Describe("When following the Cluster API quick-start with Ignition", fun
}
})
})

// NOTE: This test requires a dualstack management cluster (can be configured via IP_FAMILY=dual).
var _ = Describe("When following the Cluster API quick-start with dualstack [PR-Informing]", func() {
QuickStartSpec(ctx, func() QuickStartSpecInput {
return QuickStartSpecInput{
E2EConfig: e2eConfig,
ClusterctlConfigPath: clusterctlConfigPath,
BootstrapClusterProxy: bootstrapClusterProxy,
ArtifactFolder: artifactFolder,
SkipCleanup: skipCleanup,
Flavor: pointer.String("dualstack"),
}
})
})
2 changes: 1 addition & 1 deletion test/infrastructure/container/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ func (d *dockerRuntime) RunContainer(ctx context.Context, runConfig *RunContaine
}
networkConfig := network.NetworkingConfig{}

if runConfig.IPFamily == clusterv1.IPv6IPFamily {
if runConfig.IPFamily == clusterv1.IPv6IPFamily || runConfig.IPFamily == clusterv1.DualStackIPFamily {
hostConfig.Sysctls = map[string]string{
"net.ipv6.conf.all.disable_ipv6": "0",
"net.ipv6.conf.all.forwarding": "1",
Expand Down

0 comments on commit 3e61c27

Please sign in to comment.