39cb9f206b19fd947f980d7de08406656cdad3ca
[it/test.git] / XTesting / kubespray / docs / azure.md
1 # Azure
2
3 To deploy Kubernetes on [Azure](https://azure.microsoft.com) uncomment the `cloud_provider` option in `group_vars/all/all.yml` and set it to `'azure'`.
4
5 All your instances are required to run in a resource group and a routing table has to be attached to the subnet your instances are in.
6
7 Not all features are supported yet though, for a list of the current status have a look [here](https://github.com/Azure/AKS)
8
9 ## Parameters
10
11 Before creating the instances you must first set the `azure_` variables in the `group_vars/all/all.yml` file.
12
13 All of the values can be retrieved using the Azure CLI tool which can be downloaded here: <https://docs.microsoft.com/en-gb/cli/azure/install-azure-cli>
14 After installation you have to run `az login` to get access to your account.
15
16 ### azure_cloud
17
18 Azure Stack has different API endpoints, depending on the Azure Stack deployment. These need to be provided to the Azure SDK.
19 Possible values are: `AzureChinaCloud`, `AzureGermanCloud`, `AzurePublicCloud` and `AzureUSGovernmentCloud`.
20 The full list of existing settings for the AzureChinaCloud, AzureGermanCloud, AzurePublicCloud and AzureUSGovernmentCloud
21 is available in the source code [here](https://github.com/kubernetes-sigs/cloud-provider-azure/blob/master/docs/cloud-provider-config.md)
22
23 ### azure\_tenant\_id + azure\_subscription\_id
24
25 run `az account show` to retrieve your subscription id and tenant id:
26 `azure_tenant_id` -> Tenant ID field
27 `azure_subscription_id` -> ID field
28
29 ### azure\_location
30
31 The region your instances are located, can be something like `westeurope` or `westcentralus`. A full list of region names can be retrieved via `az account list-locations`
32
33 ### azure\_resource\_group
34
35 The name of the resource group your instances are in, can be retrieved via `az group list`
36
37 ### azure\_vmtype
38
39 The type of the vm. Supported values are `standard` or `vmss`. If vm is type of `Virtual Machines` then value is `standard`. If vm is part of `Virtual Machine Scale Sets` then value is `vmss`
40
41 ### azure\_vnet\_name
42
43 The name of the virtual network your instances are in, can be retrieved via `az network vnet list`
44
45 ### azure\_vnet\_resource\_group
46
47 The name of the resource group that contains the vnet.
48
49 ### azure\_subnet\_name
50
51 The name of the subnet your instances are in, can be retrieved via `az network vnet subnet list --resource-group RESOURCE_GROUP --vnet-name VNET_NAME`
52
53 ### azure\_security\_group\_name
54
55 The name of the network security group your instances are in, can be retrieved via `az network nsg list`
56
57 ### azure\_security\_group\_resource\_group
58
59 The name of the resource group that contains the network security group.  Defaults to `azure_vnet_resource_group`
60
61 ### azure\_route\_table\_name
62
63 The name of the route table used with your instances.
64
65 ### azure\_route\_table\_resource\_group
66
67 The name of the resource group that contains the route table.  Defaults to `azure_vnet_resource_group`
68
69 ### azure\_aad\_client\_id + azure\_aad\_client\_secret
70
71 These will have to be generated first:
72
73 - Create an Azure AD Application with:
74 `az ad app create --display-name kubernetes --identifier-uris http://kubernetes --homepage http://example.com --password CLIENT_SECRET`
75 display name, identifier-uri, homepage and the password can be chosen
76 Note the AppId in the output.
77 - Create Service principal for the application with:
78 `az ad sp create --id AppId`
79 This is the AppId from the last command
80 - Create the role assignment with:
81 `az role assignment create --role "Owner" --assignee http://kubernetes --subscription SUBSCRIPTION_ID`
82
83 azure\_aad\_client\_id must be set to the AppId, azure\_aad\_client\_secret is your chosen secret.
84
85 ### azure\_loadbalancer\_sku
86
87 Sku of Load Balancer and Public IP. Candidate values are: basic and standard.
88
89 ### azure\_exclude\_master\_from\_standard\_lb
90
91 azure\_exclude\_master\_from\_standard\_lb excludes master nodes from `standard` load balancer.
92
93 ### azure\_disable\_outbound\_snat
94
95 azure\_disable\_outbound\_snat disables the outbound SNAT for public load balancer rules. It should only be set when azure\_exclude\_master\_from\_standard\_lb is `standard`.
96
97 ### azure\_primary\_availability\_set\_name
98
99 (Optional) The name of the availability set that should be used as the load balancer backend .If this is set, the Azure
100 cloudprovider will only add nodes from that availability set to the load balancer backend pool. If this is not set, and
101 multiple agent pools (availability sets) are used, then the cloudprovider will try to add all nodes to a single backend
102 pool which is forbidden. In other words, if you use multiple agent pools (availability sets), you MUST set this field.
103
104 ### azure\_use\_instance\_metadata
105
106 Use instance metadata service where possible
107
108 ## Provisioning Azure with Resource Group Templates
109
110 You'll find Resource Group Templates and scripts to provision the required infrastructure to Azure in [*contrib/azurerm*](../contrib/azurerm/README.md)