Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 771
ghenzi83 Avatar asked Jun 20 '26 05:06

ghenzi83


1 Answers

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)
like image 72
4c74356b41 Avatar answered Jun 22 '26 12:06

4c74356b41