azure - 使用 Ansible Playbook 安装 AKS 时出现错误 Unsupported kubernetes version
问题描述
我创建了一个 Ansible-Playbook 来在 Ubuntu 上安装 AKS。
流动的微软教程
https://docs.microsoft.com/en-us/azure/ansible/ansible-create-configure-aks
yml 文件:
- name: Create Azure Kubernetes Service
hosts: localhost
connection: local
vars:
resource_group: myResourceGroup
location: eastus
aks_name: myAKSCluster
username: azureuser
ssh_key: "your_ssh_key"
client_id: "your_client_id"
client_secret: "your_client_secret"
tasks:
- name: Create resource group
azure_rm_resourcegroup:
name: "{{ resource_group }}"
location: "{{ location }}"
- name: Create a managed Azure Container Services (AKS) cluster
azure_rm_aks:
name: "{{ aks_name }}"
location: "{{ location }}"
resource_group: "{{ resource_group }}"
dns_prefix: "{{ aks_name }}"
linux_profile:
admin_username: "{{ username }}"
ssh_key: "{{ ssh_key }}"
service_principal:
client_id: "{{ client_id }}"
client_secret: "{{ client_secret }}"
agent_pool_profiles:
- name: default
count: 2
vm_size: Standard_D2_v2
tags:
Environment: Production
但它给出了错误:
致命的:[本地主机]:失败!=> {"changed": false, "msg": "不支持的 kubernetes 版本。应为 [u'1.11.9', u'1.11.8', u'1.10.12', u'1.10.13', 之一u'1.12.8', u'1.13.5', u'1.12.7'] 但没有”}
然后我切换到另一个版本为 1.12.8 的 Kubernetes 服务,但它仍然给出了这个错误。我该如何解决?或者如何更改 kubernetes 服务的版本?
解决方案
您需要kubernetes_version
根据模块 wiki指定。这也是错误文本告诉你的
- name: Create a managed Azure Container Services (AKS) cluster
azure_rm_aks:
name: "{{ aks_name }}"
location: "{{ location }}"
resource_group: "{{ resource_group }}"
dns_prefix: "{{ aks_name }}"
kubernetes_version: 1.13.5
xxx
推荐阅读
- javascript - 为什么我收到此错误:未捕获的类型错误:无法读取未定义的属性“serviceId”
- python - Python:requests.session——如何确保我在 Python 2.7.9 中关闭 TCP 连接?
- python - 如何在 html 中显示 Flask 表单数据的摘要?
- ios - 向上/向下滑动应用程序时出现离子问题,但仅在 iOS 中
- java - 有没有办法从异常堆栈跟踪打印中隐藏 jboss 方法?
- java - 如何针对 Azure AD 简单检查用户名和密码是否正确
- apache-spark-sql - 使用 spark scala 读取 hbase 表的方法
- python - 如何从 Python 3 中的现有程序创建带有 argparse 的子解析器?
- html - 如何减少两个输入字段之间的空间
- c# - 在 NET Core Api 中收到的 Angular POST 请求为 Null