Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create AKS Agent Nodepool with custom configuration file #1445

Closed
aaron-armada opened this issue Feb 14, 2024 · 3 comments · Fixed by #1477
Closed

How to create AKS Agent Nodepool with custom configuration file #1445

aaron-armada opened this issue Feb 14, 2024 · 3 comments · Fixed by #1477
Labels
has_pr PR fixes have been made medium_priority Medium priority question Further information is requested

Comments

@aaron-armada
Copy link

SUMMARY

Azure documentation describes how to add a node pool with custom configuration files: https://learn.microsoft.com/en-us/azure/aks/custom-node-configuration?tabs=linux-node-pools#add-a-node-pool-using-custom-configuration-files

I do not see how to do this in either the documentation or source for the azure.azcollection.azure_rm_aksagentpool module.

ISSUE TYPE
  • Documentation Report
COMPONENT NAME

azure_rm_aksagentpool

ANSIBLE VERSION
ansible [core 2.16.3]
  config file = None
  configured module search path = ['/Users/foo/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/homebrew/lib/python3.11/site-packages/ansible
  ansible collection location = /Users/foo/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/homebrew/bin/ansible
  python version = 3.11.7 (main, Dec  4 2023, 18:10:11) [Clang 15.0.0 (clang-1500.1.0.2.5)] (/opt/homebrew/opt/python@3.11/bin/python3.11)
  jinja version = 3.1.3
  libyaml = True
@Fred-sun
Copy link
Collaborator

@aaron-armada Do you want to add a node agent pool as follows?

 - name: Create a kubernet service with minimal parameters
  azure_rm_aks:
    name: "min{{ rpfx }}"
    location: eastus
    resource_group: "{{ resource_group }}"
    kubernetes_version: "{{ versions.azure_aks_versions[0] }}"
    dns_prefix: "aks{{ rpfx }}"
    enable_rbac: true
    aad_profile:
      managed: true
    agent_pool_profiles:
      - name: default
        count: 1
        vm_size: Standard_B2s
        mode: System
    api_server_access_profile:
      authorized_ip_ranges:
        - "192.0.2.0"
        - "198.51.100.0"
        - "203.0.113.0"
      enable_private_cluster: false
    network_profile:
      load_balancer_sku: standard
      outbound_type: loadBalancer
  register: output

- name: Add node agent pool
  azure_rm_aksagentpool:
    resource_group: "{{ resource_group }}"
    cluster_name: "min{{ rpfx }}"
    name: default03
    count: 1
    vm_size: Standard_B2s
    type_properties_type: VirtualMachineScaleSets
    mode: System
    node_labels: {"release":"stable"}
    max_pods: 42
    enable_auto_scaling: true
    min_count: 1
    max_count: 10
    orchestrator_version: "{{ agentpool_version.azure_orchestrator_version[0] }}"
    availability_zones:
      - 1
      - 2
  register: output

@Fred-sun Fred-sun added question Further information is requested medium_priority Medium priority work in In trying to solve, or in working with contributors labels Feb 29, 2024
@aaron-armada
Copy link
Author

@aaron-armada Do you want to add a node agent pool as follows?

 - name: Create a kubernet service with minimal parameters
  azure_rm_aks:
    name: "min{{ rpfx }}"
    location: eastus
    resource_group: "{{ resource_group }}"
    kubernetes_version: "{{ versions.azure_aks_versions[0] }}"
    dns_prefix: "aks{{ rpfx }}"
    enable_rbac: true
    aad_profile:
      managed: true
    agent_pool_profiles:
      - name: default
        count: 1
        vm_size: Standard_B2s
        mode: System
    api_server_access_profile:
      authorized_ip_ranges:
        - "192.0.2.0"
        - "198.51.100.0"
        - "203.0.113.0"
      enable_private_cluster: false
    network_profile:
      load_balancer_sku: standard
      outbound_type: loadBalancer
  register: output

- name: Add node agent pool
  azure_rm_aksagentpool:
    resource_group: "{{ resource_group }}"
    cluster_name: "min{{ rpfx }}"
    name: default03
    count: 1
    vm_size: Standard_B2s
    type_properties_type: VirtualMachineScaleSets
    mode: System
    node_labels: {"release":"stable"}
    max_pods: 42
    enable_auto_scaling: true
    min_count: 1
    max_count: 10
    orchestrator_version: "{{ agentpool_version.azure_orchestrator_version[0] }}"
    availability_zones:
      - 1
      - 2
  register: output

No I would like to be able to do something like this:

- name: Add node agent pool
  azure_rm_aksagentpool:
    resource_group: "{{ resource_group }}"
    cluster_name: "min{{ rpfx }}"
    name: default03
    count: 1
    vm_size: Standard_B2s
    type_properties_type: VirtualMachineScaleSets
    mode: System
    node_labels: {"release":"stable"}
    max_pods: 42
    enable_auto_scaling: true
    min_count: 1
    max_count: 10
    orchestrator_version: "{{ agentpool_version.azure_orchestrator_version[0] }}"
    availability_zones:
      - 1
      - 2
    os_config:
      - {"transparentHugePageEnabled": "madvise"}
      - {"transparentHugePageDefrag": "defer+madvise"}
      - {"swapFileSizeMB": 1500}
  register: output

@Fred-sun
Copy link
Collaborator

Fred-sun commented Mar 5, 2024

Added in #1477

@Fred-sun Fred-sun added has_pr PR fixes have been made and removed work in In trying to solve, or in working with contributors labels Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has_pr PR fixes have been made medium_priority Medium priority question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants