Error Unsupported kubernetes version when using Ansible Playbook to install AKS

6/16/2019

I created an Ansible-Playbook to install AKS on Ubuntu .

Flowing microsoft tutorial

https://docs.microsoft.com/en-us/azure/ansible/ansible-create-configure-aks

Yml file:

- 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

But it given error:

fatal: [localhost]: FAILED! => {"changed": false, "msg": "Unsupported kubernetes version. Expected one of [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'] but got None"}

Then i switched to another Kubernetes Service which its version is 1.12.8 But it still given this error. How can i fix it? Or how can i change the version of kubernetes service ?

-- Cường Đoàn
ansible
azure
azure-aks
azure-kubernetes
kubernetes

1 Answer

6/16/2019

you need to specify kubernetes_version according to the module wiki. this is also what the error text is telling you

  - 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
-- 4c74356b41
Source: StackOverflow