Skip to content

Commit

Permalink
Merge pull request #1172 from mafteiu/aks-availability-zones
Browse files Browse the repository at this point in the history
add aks node pool availability zones
  • Loading branch information
ninjarobot authored Dec 26, 2024
2 parents 5dae58b + d8d38ca commit a05e963
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/content/api-overview/resources/aks-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
2 changes: 2 additions & 0 deletions src/Farmer/Arm/ContainerService.fs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ type ManagedCluster = {
OsDiskSize: int<Gb>
OsType: OS
VmSize: VMSize
AvailabilityZones: string list
VirtualNetworkName: ResourceName option
SubnetName: ResourceName option
PodSubnetName: ResourceName option
Expand Down Expand Up @@ -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()
Expand Down
9 changes: 9 additions & 0 deletions src/Farmer/Builders/Builders.ContainerService.fs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type AgentPoolConfig = {
OsDiskSize: int<Gb>
OsType: OS
VmSize: VMSize
AvailabilityZones: string list
VirtualNetworkName: ResourceName option
SubnetName: ResourceName option
PodSubnetName: ResourceName option
Expand All @@ -42,6 +43,7 @@ type AgentPoolConfig = {
SubnetName = None
PodSubnetName = None
VmSize = Standard_DS2_v2
AvailabilityZones = []
AutoscaleSetting = None
ScaleDownMode = None
MinCount = None
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -282,6 +285,12 @@ type AgentPoolBuilder() =
[<CustomOperation "os_type">]
member _.OsType(state: AgentPoolConfig, os) = { state with OsType = os }

[<CustomOperation "add_availability_zones">]
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.
[<CustomOperation "subnet">]
member _.SubnetName(state: AgentPoolConfig, subnetName) = {
Expand Down
1 change: 1 addition & 0 deletions src/Tests/test-data/aks-with-acr.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"properties": {
"agentPoolProfiles": [
{
"availabilityZones": [],
"count": 3,
"mode": "System",
"name": "nodepool1",
Expand Down

0 comments on commit a05e963

Please sign in to comment.