Skip to content

Commit

Permalink
added azure_cloud parameter to Azure's cloud_config (kubernetes-sigs#…
Browse files Browse the repository at this point in the history
  • Loading branch information
widgetpl authored and LuckySB committed Jun 29, 2020
1 parent a7dfb2e commit 41ecddd
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ Before creating the instances you must first set the `azure_` variables in the `
All of the values can be retrieved using the azure cli tool which can be downloaded here: <https://docs.microsoft.com/en-gb/azure/xplat-cli-install>
After installation you have to run `az login` to get access to your account.

### azure_cloud

Azure Stack has different API endpoints, depending on the Azure Stack deployment. These need to be provided to the Azure SDK.
Possible values are: `AzureChinaCloud`, `AzureGermanCloud`, `AzurePublicCloud` and `AzureUSGovernmentCloud`.
The full list of existing settings for the AzureChinaCloud, AzureGermanCloud, AzurePublicCloud and AzureUSGovernmentCloud
is available in the source code [here](https://github.com/kubernetes-sigs/cloud-provider-azure/blob/master/docs/cloud-provider-config.md)

### azure\_tenant\_id + azure\_subscription\_id

run `az account show` to retrieve your subscription id and tenant id:
Expand Down
1 change: 1 addition & 0 deletions inventory/sample/group_vars/all/azure.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## When azure is used, you need to also set the following variables.
## see docs/azure.md for details on how to get these values

# azure_cloud:
# azure_tenant_id:
# azure_subscription_id:
# azure_aad_client_id:
Expand Down
2 changes: 2 additions & 0 deletions roles/kubernetes/node/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,5 @@ azure_exclude_master_from_standard_lb: true
azure_disable_outbound_snat: false
# use instance metadata service where possible
azure_use_instance_metadata: true
# use specific Azure API endpoints
azure_cloud: AzurePublicCloud
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,8 @@
fail:
msg: "azure_vmtype is missing. Supported values are 'standard' or 'vmss'"
when: azure_vmtype is not defined or not azure_vmtype

- name: check azure_cloud value
fail:
msg: "azure_cloud has an invalid value '{{ azure_cloud }}'. Supported values are 'AzureChinaCloud', 'AzureGermanCloud', 'AzurePublicCloud', 'AzureUSGovernmentCloud'."
when: azure_cloud not in ["AzureChinaCloud", "AzureGermanCloud", "AzurePublicCloud", "AzureUSGovernmentCloud"]
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"cloud": "{{ azure_cloud }}"
"tenantId": "{{ azure_tenant_id }}",
"subscriptionId": "{{ azure_subscription_id }}",
"aadClientId": "{{ azure_aad_client_id }}",
Expand Down

0 comments on commit 41ecddd

Please sign in to comment.