Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

allow user to change load_balancer_sku #12

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Role Variables
| aad_server_app_secret | | | The secret of an Azure Active Directory server application. |
| aad_tenant_id | | | The ID of an Azure Active Directory tenant. |
| admin_username | | azureuser | User account to create on node VMs for SSH access. |
| agent_pool_type | | AvailabilitySet | Possible values include VirtualMachineScaleSets and AvailabilitySet. |
| service_principal | | Loading from ansible-playbook, environment variable `AZURE_CLIENT_ID` or `~/.azure/credentials` | Service principal used for authentication to Azure APIs. |
| client_secret | | Loading from ansible-playbook, environment variable `AZURE_SECRET` or `~/.azure/credentials` | Secret associated with the service principal. |
| dns_prefix | | The same as `name` | Prefix for hostnames that are created. |
Expand All @@ -29,6 +30,7 @@ Role Variables
| enable_rbac | | True | Enable Kubernetes Role-Based Access Control. |
| http_application_routing | | False | Enable `http_application_routing` addon. Configure ingress with automatic public DNS name creation. |
| kubernetes_version | | First value from `azure_rm_aks_version` module | Version of Kubernetes to use for creating the cluster. |
| load_balancer_sku | | Basic | The load balancer sku for the managed cluster. Standard or Basic |
| location | | eastus | Region of the Kubernetes Service resource, will use `resource_group`'s location if not specified. <br/>*Location is required if resource group not exist*|
| max_pods | | 110| The maximum number of pods deployable to a node. |
| monitoring | | False | Enable `monitoring` addon. Turn on Log Analytics monitoring. |
Expand All @@ -40,6 +42,7 @@ Role Variables
| nodepool_name | | nodepool1 | Node pool name, upto 12 alphanumeric characters. |
| os_type | | Linux | |
| pod_cidr | | | A CIDR notation IP range from which to assign pod IPs when kubenet is used. <br/>*This range must not overlap with any Subnet IP ranges.* |
| resource_tags | | | Dictionary of resource tags. |
| service_cidr | | | A CIDR notation IP range from which to assign service cluster IPs. <br/>*This range must not overlap with any Subnet IP ranges.* |
| storage_profile | | ManagedDisks | |
| ssh_key | | Loading from `~/.ssh/id_rsa.pub` | Public key path or key contents to install on node VMs for SSH access. |
Expand Down Expand Up @@ -80,6 +83,22 @@ Create an AKS with monitoring:
name: akscluster
resource_group: aksroletest
```
Use of Resource Tags

```yml
- hosts: localhost
tasks:
- include_role:
name: azure.aks
vars:
name: akscluster
resource_group: aksroletest
resource_tags:
'service name': 'akscluster'
'service location': "{{ location }}"

```


License
-------
Expand Down
5 changes: 5 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ storage_profile_bak: ManagedDisks
os_type_bak: Linux

network_plugin_bak: kubenet
load_balancer_sku: standard

agent_pool_type: AvailabilitySet

parameter_list:
- http_application_routing
Expand Down Expand Up @@ -53,3 +56,5 @@ parameter_list:
- vnet_subnet_id
- aad_server_app_secret
- client_secret
- load_balancer_sku
- agent_pool_type
1 change: 1 addition & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
network_profile: "{{ network_profile | default(omit) }}"
aad_profile: "{{ aad_profile | default(omit) }}"
addon: "{{ addon | default(omit) }}"
tags: "{{ resource_tags | default(omit) }}"
# check_mode: true
register: aks

Expand Down
1 change: 1 addition & 0 deletions tasks/parameter/agent_pool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
- {'key': 'storage_profiles', 'value': 'storage_profile'}
- {'key': 'vnet_subnet_id', 'value': 'vnet_subnet_id'}
- {'key': 'os_type', 'value': 'os_type'}
- {'key': 'type', 'value': 'agent_pool_type'}
when: vars[item.value] is defined
1 change: 1 addition & 0 deletions tasks/parameter/network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
- {'key': 'service_cidr', 'value': 'service_cidr'}
- {'key': 'dns_service_ip', 'value': 'dns_service_ip'}
- {'key': 'docker_bridge_cidr', 'value': 'docker_bridge_cidr'}
- {'key': 'load_balancer_sku', 'value': 'load_balancer_sku'}
when: ( network_plugin is defined ) and ( vars[item.value] is defined )