Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

feat: allow creation of dualstack Windows clusters #4176

Merged
merged 7 commits into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions examples/dualstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,8 @@ nginx-ipv6 LoadBalancer fd00::6283 2603:1030:805:3::3 80:31140/TCP

- Dual stack clusters are supported only with kubenet and azurecni.
- Dual stack cluster with azurecni are only supported with `bridge` network mode.
- Dual stack clusters are supported only with Linux.
- Dual stack clusters with Windows is not supported at this time because it requires
- Kubernetes version 1.19+ and
- [backport to 2004 to support dualstack containers](https://github.com/Azure/aks-engine/issues/3568).
- Dual stack clusters are supported on Windows from version 2004 (kernel version 10.0.19041.610) and Kubernetes version 1.19
vavenk-ms marked this conversation as resolved.
Show resolved Hide resolved
- https://kubernetes.io/docs/setup/production-environment/windows/intro-windows-in-kubernetes/#ipv4-ipv6-dual-stack
- Dual stack clusters are supported with
- ipvs kube-proxy mode (Kubernetes version 1.16+)
- iptables kube-proxy mode (Kubernetes version 1.18+).
Expand Down
60 changes: 60 additions & 0 deletions examples/dualstack/kubernetes-windows.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"apiVersion": "vlabs",
"properties": {
"featureFlags": {
"enableIPv6DualStack": true
},
"orchestratorProfile": {
"orchestratorRelease": "1.19",
"kubernetesConfig": {
"apiServerConfig": {
"--feature-gates": "IPv6DualStack=true"
},
"kubeletConfig": {
"--feature-gates": "IPv6DualStack=true"
},
"controllerManagerConfig": {
"--feature-gates": "IPv6DualStack=true"
},
"kubeProxyMode": "ipvs",
"networkPlugin": "azure",
"networkMode": "bridge",
"networkPolicy": "",
"useManagedIdentity": false
}
},
"masterProfile": {
"count": 1,
"dnsPrefix": "",
"vmSize": "Standard_D2_v3"
},
"agentPoolProfiles": [
{
"name": "windowspool2",
"count": 1,
"vmSize": "Standard_D2_v3",
"availabilityProfile": "VirtualMachineScaleSets",
"osType": "Windows",
"osDiskSizeGB": 128
}
],
"windowsProfile": {
"windowsPublisher": "MicrosoftWindowsServer",
"windowsOffer": "WindowsServer",
"windowsSku": "Datacenter-Core-2004-with-Containers-smalldisk",
"imageVersion": "latest",
"adminUsername": "azureuser",
"adminPassword": "replacepassword1234$"
},
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": ""
}
]
}
}
}
}
4 changes: 2 additions & 2 deletions pkg/api/vlabs/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,8 @@ func (a *Properties) validateAgentPoolProfiles(isUpdate bool) error {

// validate os type is linux if dual stack feature is enabled
if a.FeatureFlags.IsIPv6DualStackEnabled() || a.FeatureFlags.IsIPv6OnlyEnabled() {
if agentPoolProfile.OSType == Windows {
return errors.Errorf("Dual stack and single stack IPv6 feature is supported only with Linux, but agent pool '%s' is of os type %s", agentPoolProfile.Name, agentPoolProfile.OSType)
if agentPoolProfile.OSType == Windows && !common.IsKubernetesVersionGe(a.OrchestratorProfile.OrchestratorVersion, "1.19.0") {
vavenk-ms marked this conversation as resolved.
Show resolved Hide resolved
return errors.Errorf("Dual stack and single stack IPv6 feature is supported on Windows only from Kubernetes version 1.19, but OrchestratorProfile.OrchestratorVersion is '%s'", a.OrchestratorProfile.OrchestratorVersion)
}
if agentPoolProfile.Distro == Flatcar {
return errors.Errorf("Dual stack and single stack IPv6 feature is currently supported only with Ubuntu, but agent pool '%s' is of distro type %s", agentPoolProfile.Name, agentPoolProfile.Distro)
Expand Down
5 changes: 3 additions & 2 deletions pkg/api/vlabs/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4139,7 +4139,7 @@ func TestValidateProperties_OrchestratorSpecificProperties(t *testing.T) {
}
})

t.Run("Should not support os type other than linux for single stack ipv6 and dual stack feature", func(t *testing.T) {
t.Run("Should not support os type other than linux along with kubernetes version less than 1.19 for single stack ipv6 and dual stack feature", func(t *testing.T) {
vavenk-ms marked this conversation as resolved.
Show resolved Hide resolved
t.Parallel()
cs := getK8sDefaultContainerService(true)
for _, featureFlags := range []FeatureFlags{{EnableIPv6DualStack: true}, {EnableIPv6Only: true}} {
Expand All @@ -4149,7 +4149,8 @@ func TestValidateProperties_OrchestratorSpecificProperties(t *testing.T) {
masterProfile.Distro = Ubuntu
agentPoolProfiles := cs.Properties.AgentPoolProfiles
agentPoolProfiles[0].OSType = Windows
expectedMsg := fmt.Sprintf("Dual stack and single stack IPv6 feature is supported only with Linux, but agent pool '%s' is of os type %s", agentPoolProfiles[0].Name, agentPoolProfiles[0].OSType)
cs.Properties.OrchestratorProfile.OrchestratorVersion = "1.17"
vavenk-ms marked this conversation as resolved.
Show resolved Hide resolved
expectedMsg := fmt.Sprintf("Dual stack and single stack IPv6 feature is supported on Windows only from Kubernetes version 1.19, but OrchestratorProfile.OrchestratorVersion is '%s'", cs.Properties.OrchestratorProfile.OrchestratorVersion)
if err := cs.Properties.validateAgentPoolProfiles(false); err.Error() != expectedMsg {
t.Errorf("expected error with message : %s, but got %s", expectedMsg, err.Error())
}
Expand Down