https://pulumi.com logo
#azure
Title
# azure
s

steep-beard-51313

05/11/2021, 1:03 PM
Hello everybody, I am a bit stuck with automating an AKS deployment through pulumi. My specific pain is that I would like to use the "azure cni" network plugin, but I can't figure out the right options for KubernetesClusterNetworkProfile to make it use an existing subnet within an existing vnet. I would also be fine with creating a new vnet and / or subnet, but then I would need to control the addressing, such that I can peer it with another vnet afterwards. Its a piece of cake in azure portal, but I can't figure it out in Pulumi:
r

rich-farmer-40546

05/12/2021, 3:26 PM
In the agentpool profiles, you can configure in which subnet the pool (vmss) will be deployed in, here’s a sample piece:
Copy code
...
agentPoolProfiles: [
      {
        count: 1,
        maxPods: 110,
        mode: 'System',
        name: 'agentpool',
        osDiskSizeGB,
        osType: 'Linux',
        type: 'VirtualMachineScaleSets',
        vmSize: 'Standard_D2s_v4',
        vnetSubnetID,
      },
...
Specifically
vnetSubnetID
In my example I already have a variable called the same so I didn’t need to expand it, but you would want it to be the subnet ID, like:
vnetSubnetID: /subscriptions/123123/resourceGroups/rgname/etc/etc
s

steep-beard-51313

05/13/2021, 7:35 AM
Ohh I see, so when I use cni I add the network config to the agent pool and not the ClusterNetworkProfile. Gotme. I was tempted to try that but then I figured that would be too far from intuitive. Thanks man!
🙏 1
3 Views