AKS Cluster

Overview

The AKS Cluster builder is used to create AKS clusters.

  • Container Group (Microsoft.ContainerService/managedClusters)

AKS Builder Keywords

The AKS Builder constructs AKS clusters.

KeywordPurpose
nameSets the name of the AKS cluster.
dns_prefixSets the DNS prefix of the AKS cluster.
enable_rbacEnable Kubernetes Role-Based Access Control.
add_agent_poolsAdds agent pools to the AKS cluster.
add_agent_poolAdds an agent pool to the AKS cluster.
network_profileSets the network profile for the AKS cluster.
linux_profileSets the linux profile for the AKS cluster.
service_principal_client_idSets the client id of the service principal for the AKS cluster.
windows_usernameSets the windows admin username for the AKS cluster.

Agent Pool Builder keywords

The Agent Pool Builder constructs agent pools which are inserted into the AKS cluster.

KeywordPurpose
nameSets the name of the agent pool.
countSets the count of VM’s in the agent pool.
user_modeSets the agent pool to user mode.
disk_sizeSets the disk size for the VM’s in the agent pool.
max_podsSets the maximum number of pods in the agent pool.
os_typeSets the OS type of the VM’s in the agent pool.
subnetSets the name of a virtual network subnet where this AKS cluster should be attached.
vm_sizeSets the size of the VM’s in the agent pool.
vnetSets the name of a virtual network in the same region where this AKS cluster should be attached.

CNI Builder

The CNI builder helps create network profiles on the AKS cluster.

KeywordPurpose
docker_bridgeSets the docker bridge CIDR to a network other than the default 17.17.0.1/16.
dns_serviceSets the DNS service IP - must be within the service CIDR, default is the second address in the service CIDR.
service_cidrSets the service cidr to a network other than the default 10.224.0.0/16.

Example

open Farmer
open Farmer.Builders
open Farmer.ContainerService

let myAks = aks {
    name "k8s-cluster"
    dns_prefix "testaks"
    add_agent_pools [
        agentPool {
            name "linuxPool"
            count 3
        }
    ]
    linux_profile "aksuser" "public-key-here"
    service_principal_client_id "some-spn-client-id"
    network_profile (
        azureCniNetworkProfile {
            service_cidr "10.250.0.0/16"
        }
    )
}