0
# Core Models and Types
1
2
Essential data models representing AKS resources including cluster specifications, agent pool configurations, network profiles, and authentication settings. These models define the structure and properties of all Azure Container Service resources.
3
4
## Core Resource Models
5
6
### ManagedCluster
7
8
```python { .api }
9
class ManagedCluster:
10
"""
11
Managed Kubernetes cluster resource.
12
13
Attributes:
14
- location (str): Azure region location
15
- kubernetes_version (str): Kubernetes version (e.g., "1.28.3")
16
- dns_prefix (str): DNS name prefix for the cluster
17
- fqdn (str): Fully qualified domain name of the cluster
18
- agent_pool_profiles (List[ManagedClusterAgentPoolProfile]): Agent pool configurations
19
- linux_profile (ContainerServiceLinuxProfile): Linux VM profile
20
- windows_profile (ManagedClusterWindowsProfile): Windows VM profile
21
- service_principal_profile (ManagedClusterServicePrincipalProfile): Service principal config
22
- addon_profiles (Dict[str, ManagedClusterAddonProfile]): Cluster addons
23
- node_resource_group (str): Resource group for cluster nodes
24
- enable_rbac (bool): Enable Kubernetes RBAC
25
- network_profile (ContainerServiceNetworkProfile): Network configuration
26
- aad_profile (ManagedClusterAADProfile): Azure Active Directory integration
27
- auto_upgrade_profile (ManagedClusterAutoUpgradeProfile): Auto-upgrade settings
28
- identity (ManagedClusterIdentity): Managed identity configuration
29
- provisioning_state (str): Current provisioning state
30
- power_state (PowerState): Cluster power state
31
- api_server_access_profile (ManagedClusterAPIServerAccessProfile): API server access
32
- disk_encryption_set_id (str): Disk encryption set ID
33
- enable_pod_security_policy (bool): Enable pod security policy
34
- private_link_resources (List[PrivateLinkResource]): Private link resources
35
- disable_local_accounts (bool): Disable local accounts
36
- http_proxy_config (ManagedClusterHTTPProxyConfig): HTTP proxy configuration
37
- security_profile (ManagedClusterSecurityProfile): Security settings
38
- storage_profile (ManagedClusterStorageProfile): Storage configuration
39
- ingress_profile (ManagedClusterIngressProfile): Ingress configuration
40
"""
41
```
42
43
### AgentPool
44
45
```python { .api }
46
class AgentPool:
47
"""
48
Agent pool (node pool) resource.
49
50
Attributes:
51
- count (int): Number of nodes
52
- vm_size (str): Virtual machine size (e.g., "Standard_D2s_v3")
53
- os_disk_size_gb (int): OS disk size in GB
54
- os_type (str): Operating system type ("Linux", "Windows")
55
- max_pods (int): Maximum pods per node
56
- type (str): Agent pool type ("VirtualMachineScaleSets", "AvailabilitySet")
57
- mode (str): Agent pool mode ("System", "User")
58
- orchestrator_version (str): Kubernetes version
59
- provisioning_state (str): Provisioning state
60
- power_state (PowerState): Power state
61
- availability_zones (List[str]): Availability zones
62
- enable_auto_scaling (bool): Enable auto-scaling
63
- min_count (int): Minimum node count (auto-scaling)
64
- max_count (int): Maximum node count (auto-scaling)
65
- enable_node_public_ip (bool): Enable public IP on nodes
66
- node_public_ip_prefix_id (str): Public IP prefix ID
67
- scale_down_mode (str): Scale down mode ("Delete", "Deallocate")
68
- spot_max_price (float): Maximum price for spot instances
69
- tags (Dict[str, str]): Resource tags
70
- node_labels (Dict[str, str]): Kubernetes node labels
71
- node_taints (List[str]): Kubernetes node taints
72
- proximity_placement_group_id (str): Proximity placement group ID
73
- upgrade_settings (AgentPoolUpgradeSettings): Upgrade configuration
74
- kubelet_config (KubeletConfig): Kubelet configuration
75
- linux_os_config (LinuxOSConfig): Linux OS configuration
76
- enable_encryption_at_host (bool): Enable encryption at host
77
- enable_ultra_ssd (bool): Enable Ultra SSD
78
- enable_fips (bool): Enable FIPS
79
- gpu_instance_profile (str): GPU instance profile
80
- creation_data (CreationData): Creation data for snapshots
81
- capacity_reservation_group_id (str): Capacity reservation group ID
82
- host_group_id (str): Dedicated host group ID
83
- network_profile (AgentPoolNetworkProfile): Network profile
84
- windows_profile (AgentPoolWindowsProfile): Windows profile
85
"""
86
```
87
88
## Network Models
89
90
### ContainerServiceNetworkProfile
91
92
```python { .api }
93
class ContainerServiceNetworkProfile:
94
"""
95
Network configuration for the cluster.
96
97
Attributes:
98
- network_plugin (str): Network plugin ("azure", "kubenet", "none")
99
- network_policy (str): Network policy ("azure", "calico")
100
- network_mode (str): Network mode ("transparent", "bridge")
101
- pod_cidr (str): Pod CIDR range
102
- service_cidr (str): Service CIDR range
103
- dns_service_ip (str): DNS service IP address
104
- outbound_type (str): Outbound connectivity type ("loadBalancer", "userDefinedRouting")
105
- load_balancer_sku (str): Load balancer SKU ("basic", "standard")
106
- load_balancer_profile (ManagedClusterLoadBalancerProfile): Load balancer configuration
107
- nat_gateway_profile (ManagedClusterNATGatewayProfile): NAT gateway configuration
108
- pod_cidrs (List[str]): Pod CIDR ranges (dual-stack)
109
- service_cidrs (List[str]): Service CIDR ranges (dual-stack)
110
- ip_families (List[str]): IP families ("IPv4", "IPv6")
111
- network_dataplane (str): Network dataplane ("azure", "cilium")
112
- network_plugin_mode (str): Network plugin mode ("overlay")
113
"""
114
```
115
116
### ManagedClusterLoadBalancerProfile
117
118
```python { .api }
119
class ManagedClusterLoadBalancerProfile:
120
"""
121
Load balancer configuration.
122
123
Attributes:
124
- managed_outbound_i_ps (ManagedClusterLoadBalancerProfileManagedOutboundIPs): Managed outbound IPs
125
- outbound_ip_prefixes (ManagedClusterLoadBalancerProfileOutboundIPPrefixes): Outbound IP prefixes
126
- outbound_i_ps (ManagedClusterLoadBalancerProfileOutboundIPs): Outbound IPs
127
- effective_outbound_i_ps (List[ResourceReference]): Effective outbound IPs
128
- allocated_outbound_ports (int): Allocated outbound ports
129
- idle_timeout_in_minutes (int): Idle timeout in minutes
130
- enable_multiple_standard_load_balancers (bool): Enable multiple standard load balancers
131
- backend_pool_type (str): Backend pool type ("nodeIP", "nodeIPConfiguration")
132
"""
133
```
134
135
## Identity and Security Models
136
137
### ManagedClusterIdentity
138
139
```python { .api }
140
class ManagedClusterIdentity:
141
"""
142
Managed cluster identity configuration.
143
144
Attributes:
145
- type (str): Identity type ("SystemAssigned", "UserAssigned", "None")
146
- principal_id (str): Principal ID (read-only)
147
- tenant_id (str): Tenant ID (read-only)
148
- user_assigned_identities (Dict[str, ManagedServiceIdentityUserAssignedIdentitiesValue]): User-assigned identities
149
- delegated_resources (Dict[str, DelegatedResource]): Delegated resources
150
"""
151
```
152
153
### ManagedClusterAADProfile
154
155
```python { .api }
156
class ManagedClusterAADProfile:
157
"""
158
Azure Active Directory integration profile.
159
160
Attributes:
161
- managed (bool): Enable Azure AD integration
162
- enable_azure_rbac (bool): Enable Azure RBAC
163
- admin_group_object_i_ds (List[str]): Admin group object IDs
164
- client_app_id (str): Client application ID
165
- server_app_id (str): Server application ID
166
- server_app_secret (str): Server application secret
167
- tenant_id (str): Tenant ID
168
"""
169
```
170
171
## Configuration Models
172
173
### KubeletConfig
174
175
```python { .api }
176
class KubeletConfig:
177
"""
178
Kubelet configuration for nodes.
179
180
Attributes:
181
- cpu_manager_policy (str): CPU manager policy
182
- cpu_cfs_quota (bool): CPU CFS quota enabled
183
- cpu_cfs_quota_period (str): CPU CFS quota period
184
- image_gc_high_threshold (int): Image GC high threshold
185
- image_gc_low_threshold (int): Image GC low threshold
186
- topology_manager_policy (str): Topology manager policy
187
- allowed_unsafe_sysctls (List[str]): Allowed unsafe sysctls
188
- fail_swap_on (bool): Fail if swap is on
189
- container_log_max_size_mb (int): Container log max size MB
190
- container_log_max_files (int): Container log max files
191
- pod_max_pids (int): Pod max PIDs
192
"""
193
```
194
195
### LinuxOSConfig
196
197
```python { .api }
198
class LinuxOSConfig:
199
"""
200
Linux OS configuration for nodes.
201
202
Attributes:
203
- sysctls (SysctlConfig): Sysctl configuration
204
- transparent_huge_page_enabled (str): Transparent huge page setting
205
- transparent_huge_page_defrag (str): Transparent huge page defrag
206
- swap_file_size_mb (int): Swap file size in MB
207
"""
208
```
209
210
## Maintenance and Upgrade Models
211
212
### MaintenanceConfiguration
213
214
```python { .api }
215
class MaintenanceConfiguration:
216
"""
217
Maintenance configuration for scheduled operations.
218
219
Attributes:
220
- time_in_week (List[TimeInWeek]): Weekly maintenance windows
221
- not_allowed_time (List[TimeSpan]): Blocked time periods
222
- maintenance_window (MaintenanceWindow): Maintenance window configuration
223
"""
224
```
225
226
### AgentPoolUpgradeSettings
227
228
```python { .api }
229
class AgentPoolUpgradeSettings:
230
"""
231
Agent pool upgrade settings.
232
233
Attributes:
234
- max_surge (str): Maximum surge during upgrade
235
- drain_timeout_in_minutes (int): Node drain timeout
236
- node_soak_duration_in_minutes (int): Node soak duration
237
"""
238
```
239
240
## Snapshot Models
241
242
### Snapshot
243
244
```python { .api }
245
class Snapshot:
246
"""
247
Node pool snapshot for backup and restore.
248
249
Attributes:
250
- creation_data (CreationData): Creation data
251
- snapshot_type (str): Snapshot type ("NodePool")
252
- kubernetes_version (str): Kubernetes version
253
- node_image_version (str): Node image version
254
- vm_size (str): VM size
255
- os_type (str): OS type
256
- os_sku (str): OS SKU
257
- enable_fips (bool): FIPS enabled
258
"""
259
```
260
261
## Common Types
262
263
### PowerState
264
265
```python { .api }
266
class PowerState:
267
"""
268
Power state of a resource.
269
270
Attributes:
271
- code (str): Power state code ("Running", "Stopped", "Stopping", "Starting")
272
"""
273
```
274
275
### CreationData
276
277
```python { .api }
278
class CreationData:
279
"""
280
Creation data for snapshots and restores.
281
282
Attributes:
283
- source_resource_id (str): Source resource ID for snapshot creation
284
"""
285
```
286
287
### PrivateEndpointConnectionListResult
288
289
```python { .api }
290
class PrivateEndpointConnectionListResult:
291
"""
292
List of private endpoint connections for a managed cluster.
293
294
Attributes:
295
- value (List[PrivateEndpointConnection]): List of private endpoint connections
296
"""
297
```
298
299
### PrivateLinkResourcesListResult
300
301
```python { .api }
302
class PrivateLinkResourcesListResult:
303
"""
304
List of private link resources for a managed cluster.
305
306
Attributes:
307
- value (List[PrivateLinkResource]): List of private link resources
308
"""
309
```
310
311
### OperationValue
312
313
```python { .api }
314
class OperationValue:
315
"""
316
Operation supported by the Container Service resource provider.
317
318
Attributes:
319
- name (str): Operation name
320
- display (OperationValueDisplay): Operation display information
321
- is_data_action (bool): Whether this is a data plane operation
322
- origin (str): Operation origin
323
"""
324
```
325
326
### TrustedAccessRole
327
328
```python { .api }
329
class TrustedAccessRole:
330
"""
331
Trusted access role that can be granted to external services.
332
333
Attributes:
334
- name (str): Role name
335
- source_resource_type (str): Source resource type for the role
336
- rules (List[TrustedAccessRoleRule]): List of role rules and permissions
337
"""
338
```
339
340
## Azure SDK Common Types
341
342
### LROPoller
343
344
```python { .api }
345
class LROPoller:
346
"""
347
Long-running operation poller for tracking async operations.
348
349
Methods:
350
- result(timeout=None): Wait for operation completion and return result
351
- done(): Check if operation is complete
352
- status(): Get current operation status
353
- wait(timeout=None): Wait for operation completion
354
"""
355
```
356
357
### ItemPaged
358
359
```python { .api }
360
class ItemPaged:
361
"""
362
Paginated result iterator for listing operations.
363
364
Usage:
365
- Iterate directly: for item in paged_result: ...
366
- Get by page: for page in paged_result.by_page(): ...
367
"""
368
```
369
370
### CredentialResults
371
372
```python { .api }
373
class CredentialResults:
374
"""
375
Container for cluster access credentials.
376
377
Attributes:
378
- kubeconfigs (List[CredentialResult]): Kubeconfig credentials
379
"""
380
```
381
382
### CredentialResult
383
384
```python { .api }
385
class CredentialResult:
386
"""
387
Individual credential result.
388
389
Attributes:
390
- name (str): Credential name
391
- value (bytes): Credential value (base64 encoded)
392
"""
393
```
394
395
## Usage Examples
396
397
### Creating a Basic Cluster
398
399
```python
400
from azure.mgmt.containerservice.models import (
401
ManagedCluster,
402
ManagedClusterAgentPoolProfile,
403
ContainerServiceLinuxProfile,
404
ContainerServiceSshConfiguration,
405
ContainerServiceSshPublicKey,
406
ManagedClusterIdentity,
407
ContainerServiceNetworkProfile
408
)
409
410
cluster = ManagedCluster(
411
location="East US",
412
kubernetes_version="1.28.3",
413
dns_prefix="my-cluster",
414
agent_pool_profiles=[
415
ManagedClusterAgentPoolProfile(
416
name="system",
417
count=3,
418
vm_size="Standard_D2s_v3",
419
os_type="Linux",
420
mode="System"
421
)
422
],
423
linux_profile=ContainerServiceLinuxProfile(
424
admin_username="azureuser",
425
ssh=ContainerServiceSshConfiguration(
426
public_keys=[
427
ContainerServiceSshPublicKey(key_data="ssh-rsa AAAA...")
428
]
429
)
430
),
431
identity=ManagedClusterIdentity(type="SystemAssigned"),
432
network_profile=ContainerServiceNetworkProfile(
433
network_plugin="azure",
434
service_cidr="10.0.0.0/16",
435
dns_service_ip="10.0.0.10"
436
)
437
)
438
```