azure - 使用 azure-sdk-for-python 将节点部署到 AKS 集群

标签 azure kubernetes azure-aks azure-resource-group azure-sdk-python

到目前为止,我无法找到任何用于在 AKS 群集中创建节点的 Azure 库。我可以使用 azure cli,但我的目标是使用 python。

我可以使用 azure python SDK 创建资源和资源组 - resource_groups.create_or_update('azure-sample-group', resource_group_params)

有人能给我指出正确的文档或一些提示吗?我感谢您的所有帮助。

最佳答案

你可以做到,here's the docs对于您正在寻找的方法。 Here's the SDK code对于同样的东西。型号 Managed Clusters

示例代码类似于:

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)

关于azure - 使用 azure-sdk-for-python 将节点部署到 AKS 集群,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54468025/

相关文章:

kubernetes - 缩减Kubernetes中的视频 session 软件

azure - 如何使用托管标识从 Azure Kubernetes 服务 (AKS) 访问 Azure Key Vault (AKV)

asp.net - azure 持续部署失败

asp.net-mvc-2 - Azure MVC2 应用程序的表单例份验证提供程序?

postgresql - sslcert 和 sslkey 如何在 Kubernetes 中作为环境变量传递?

docker - 在 kubernetes/k8s StatefulSet 中使用 nfs/efs 作为 PersistentVolume 和普通卷有什么区别?

java - 我应该在 Android 中使用 Azure 中的哪个 sdk 库来使用媒体服务?

Azure REST API - 在哪里可以找到资源成本?

kubernetes - 将Grafana指标与不匹配的标签结合

azure-container-service - 限制每个部署或容器的 Log Analytics 日志记录