How to increase default compute instance for azure kubernetes compute clusters while creating it using python SDK??

Aryan Rastogi 60 Reputation points
2025-05-29T10:58:53.5833333+00:00

First I created my cluster using below code:

attach_config = KubernetesCompute(
                            name=kubernetes_attached_compute,
                            resource_id=f"/subscriptions/{config_dict['subscription_id']}/resourceGroups/{resource_group}/providers/Microsoft.ContainerService/managedClusters/{kubernetes_name}",
                            properties={
                                "ssl": {
                                    "enabled": True
                                }
							}
				)

got default instance of

User's image

Then i created using the below code:

attach_config = KubernetesCompute(
                            name=kubernetes_attached_compute,
                            resource_id=f"/subscriptions/{config_dict['subscription_id']}/resourceGroups/{resource_group}/providers/Microsoft.ContainerService/managedClusters/{kubernetes_name}",
                            properties={
                                "ssl": {
                                    "enabled": True
                                },
                                "clusterPurpose": cluster_purpose,
                                "defaultInstanceType": "custominstancetype",
                                "instanceTypes": {
                                    "custominstancetype": {
                                        "resources": {
                                            "limits": {
                                                "cpu": "4",
                                                "memory": "6Gi"
                                            },
                                            "requests": {
                                                "cpu": "0.5",
                                                "memory": "1Gi"
                                            }
                                        }
                                    }
                                }
                            }
                        )

But this creates 2 instances User's image

I only need one with limit 4 cores and 6Gi

How to do that??

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,432 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.