diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index f4b785e11..701830331 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,6 +1,9 @@ Release Notes ============= +## 1.9.8 +* AKS Cluster: support for node pool availability zones + ## 1.9.7 * AKS Cluster: support for Sku and Tier. Support for pod subnet in agent pool config. Support for node pool autoscaling * CosmosDB: Add support for Gremlin Graphs diff --git a/docs/content/api-overview/resources/aks-cluster.md b/docs/content/api-overview/resources/aks-cluster.md index 3f7d7a7c4..6f6ef4e62 100644 --- a/docs/content/api-overview/resources/aks-cluster.md +++ b/docs/content/api-overview/resources/aks-cluster.md @@ -57,6 +57,7 @@ The Agent Pool builder (`agentPool`) constructs agent pools in the AKS cluster. | pod_subnet | Sets the name of a virtual network subnet where this AKS cluster should be attached. | | subnet | Sets the name of a virtual network subnet where this AKS cluster should be attached. | | vm_size | Sets the size of the VM's in the agent pool. | +| add_availability_zones | Sets the Azure availability zones for the VM's in the agent pool. | | vnet | Sets the name of a virtual network in the same region where this AKS cluster should be attached. | | enable_autoscale | Enables node pool autoscale | | autoscale_scale_down_mode | Optional. Use with enable_autoscaling. Options are Delete and Deallocate | diff --git a/src/Farmer/Arm/ContainerService.fs b/src/Farmer/Arm/ContainerService.fs index 1a283cb7a..498a1ea4d 100644 --- a/src/Farmer/Arm/ContainerService.fs +++ b/src/Farmer/Arm/ContainerService.fs @@ -183,6 +183,7 @@ type ManagedCluster = { OsDiskSize: int OsType: OS VmSize: VMSize + AvailabilityZones: string list VirtualNetworkName: ResourceName option SubnetName: ResourceName option PodSubnetName: ResourceName option @@ -295,6 +296,7 @@ type ManagedCluster = { osDiskSizeGB = agent.OsDiskSize osType = string agent.OsType vmSize = agent.VmSize.ArmValue + availabilityZones = agent.AvailabilityZones vnetSubnetID = match agent.VirtualNetworkName, agent.SubnetName with | Some vnet, Some subnet -> subnets.resourceId(vnet, subnet).Eval() diff --git a/src/Farmer/Builders/Builders.ContainerService.fs b/src/Farmer/Builders/Builders.ContainerService.fs index dd60b6a7d..ad56cf3e6 100644 --- a/src/Farmer/Builders/Builders.ContainerService.fs +++ b/src/Farmer/Builders/Builders.ContainerService.fs @@ -19,6 +19,7 @@ type AgentPoolConfig = { OsDiskSize: int OsType: OS VmSize: VMSize + AvailabilityZones: string list VirtualNetworkName: ResourceName option SubnetName: ResourceName option PodSubnetName: ResourceName option @@ -42,6 +43,7 @@ type AgentPoolConfig = { SubnetName = None PodSubnetName = None VmSize = Standard_DS2_v2 + AvailabilityZones = [] AutoscaleSetting = None ScaleDownMode = None MinCount = None @@ -185,6 +187,7 @@ type AksConfig = { SubnetName = agentPool.SubnetName PodSubnetName = agentPool.PodSubnetName VmSize = agentPool.VmSize + AvailabilityZones = agentPool.AvailabilityZones VirtualNetworkName = agentPool.VirtualNetworkName AutoscaleSetting = agentPool.AutoscaleSetting ScaleDownMode = agentPool.ScaleDownMode @@ -282,6 +285,12 @@ type AgentPoolBuilder() = [] member _.OsType(state: AgentPoolConfig, os) = { state with OsType = os } + [] + member _.AddAvailabilityZone(state: AgentPoolConfig, availabilityZones: string list) = { + state with + AvailabilityZones = state.AvailabilityZones @ availabilityZones + } + /// Sets the name of a virtual network subnet where this AKS cluster should be attached. [] member _.SubnetName(state: AgentPoolConfig, subnetName) = { diff --git a/src/Tests/test-data/aks-with-acr.json b/src/Tests/test-data/aks-with-acr.json index 95cce80b9..9726627d6 100644 --- a/src/Tests/test-data/aks-with-acr.json +++ b/src/Tests/test-data/aks-with-acr.json @@ -53,6 +53,7 @@ "properties": { "agentPoolProfiles": [ { + "availabilityZones": [], "count": 3, "mode": "System", "name": "nodepool1",