Deploying node to AKS cluster using azure-sdk-for-python

1/31/2019

I have so far been unable to find any azure library for creating a node within an AKS cluster. I can use the azure cli, but my goal is to use python.

I can create the resource and resource groups using the azure python SDK - resource_groups.create_or_update('azure-sample-group', resource_group_params)

Can someone point me to the right docs or some tips? I appreciate all your help.

-- ghenzi83
azure
azure-aks
azure-resource-group
azure-sdk-python
kubernetes

1 Answer

1/31/2019

you can do that, here's the docs for the method(s) you are looking for. Here's the SDK code for the same stuff. Model for Managed Clusters

Example code would be something like:

from azure.mgmt.containerservice import ContainerServiceClient # needed to create client
containerservice_client = ContainerServiceClient(get_credentials(), SUBSCRIPTION) # same way like you would for the resource_management_client
parameters = ManagedCluster(
    location=location,
    dns_prefix=dns_prefix,
    kubernetes_version=kubernetes_version,
    tags=stags,
    service_principal_profile=service_principal_profile, # this needs to be a model as well
    agent_pool_profiles=agent_pools, # this needs to be a model as well
    linux_profile=linux_profile, # this needs to be a model as well
    enable_rbac=true
)
containerservice_client.managed_clusters.create_or_update(resource_group, name, parameters)
-- 4c74356b41
Source: StackOverflow