You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/aks/ingress-tls.md
+182-8Lines changed: 182 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,21 +26,34 @@ You can also:
26
26
27
27
## Before you begin
28
28
29
-
This article assumes that you have an existing AKS cluster. If you need an AKS cluster, see the AKS quickstart [using the Azure CLI][aks-quickstart-cli] or [using the Azure portal][aks-quickstart-portal].
29
+
This article assumes that you have an existing AKS cluster. If you need an AKS cluster, see the AKS quickstart [using the Azure CLI][aks-quickstart-cli], [using Azure PowerShell][aks-quickstart-powershell] or [using the Azure portal][aks-quickstart-portal].
30
30
31
31
This article also assumes you have [a custom domain][custom-domain] with a [DNS Zone][dns-zone] in the same resource group as your AKS cluster.
32
32
33
33
This article uses [Helm 3][helm] to install the NGINX ingress controller on a [supported version of Kubernetes][aks-supported versions]. Make sure that you are using the latest release of Helm and have access to the `ingress-nginx` and `jetstack` Helm repositories. The steps outlined in this article may not be compatible with previous versions of the Helm chart, NGINX ingress controller, or Kubernetes.
34
34
35
35
For more information on configuring and using Helm, see [Install applications with Helm in Azure Kubernetes Service (AKS)][use-helm]. For upgrade instructions, see the [Helm install docs][helm-install].
36
36
37
-
This article also requires that you are running the Azure CLI version 2.0.64 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI][azure-cli-install].
37
+
### [Azure CLI](#tab/azure-cli)
38
38
39
39
In addition, this article assumes you have an existing AKS cluster with an integrated ACR. For more details on creating an AKS cluster with an integrated ACR, see [Authenticate with Azure Container Registry from Azure Kubernetes Service][aks-integrated-acr].
40
40
41
+
This article also requires that you are running the Azure CLI version 2.0.64 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI][azure-cli-install].
42
+
43
+
### [Azure PowerShell](#tab/azure-powershell)
44
+
45
+
In addition, this article assumes you have an existing AKS cluster with an integrated ACR. For more details on creating an AKS cluster with an integrated ACR, see [Authenticate with Azure Container Registry from Azure Kubernetes Service][aks-integrated-acr-ps].
46
+
47
+
This article also requires that you're running Azure PowerShell version 5.9.0 or later. Run `Get-InstalledModule -Name Az` to find the version. If you need to install or upgrade, see [Install Azure PowerShell][azure-powershell-install].
48
+
49
+
---
41
50
## Import the images used by the Helm chart into your ACR
42
51
43
-
This article uses the [NGINX ingress controller Helm chart][ingress-nginx-helm-chart], which relies on three container images. Use `az acr import` to import those images into your ACR.
52
+
This article uses the [NGINX ingress controller Helm chart][ingress-nginx-helm-chart], which relies on three container images.
53
+
54
+
### [Azure CLI](#tab/azure-cli)
55
+
56
+
Use `az acr import` to import those images into your ACR.
> In addition to importing container images into your ACR, you can also import Helm charts into your ACR. For more information, see [Push and pull Helm charts to an Azure container registry][acr-helm].
70
114
@@ -80,6 +124,8 @@ The ingress controller also needs to be scheduled on a Linux node. Windows Serve
80
124
> [!TIP]
81
125
> If you would like to enable [client source IP preservation][client-source-ip] for requests to containers in your cluster, add `--set controller.service.externalTrafficPolicy=Local` to the Helm install command. The client source IP is stored in the request header under *X-Forwarded-For*. When using an ingress controller with client source IP preservation enabled, TLS pass-through will not work.
During the installation, an Azure public IP address is created for the ingress controller. This public IP address is static for the life-span of the ingress controller. If you delete the ingress controller, the public IP address assignment is lost. If you then create an additional ingress controller, a new public IP address is assigned. If you wish to retain the use of the public IP address, you can instead [create an ingress controller with a static public IP address][aks-ingress-static-tls].
112
196
113
197
To get the public IP address, use the `kubectl get service` command. It takes a few minutes for the IP address to be assigned to the service.
@@ -123,16 +207,35 @@ No ingress rules have been created yet. If you browse to the public IP address,
123
207
124
208
## Add an A record to your DNS zone
125
209
210
+
### [Azure CLI](#tab/azure-cli)
211
+
126
212
Add an *A* record to your DNS zone with the external IP address of the NGINX service using [az network dns record-set a add-record][az-network-dns-record-set-a-add-record].
127
213
128
-
```console
214
+
```azurecli
129
215
az network dns record-set a add-record \
130
216
--resource-group myResourceGroup \
131
217
--zone-name MY_CUSTOM_DOMAIN \
132
218
--record-set-name "*" \
133
219
--ipv4-address MY_EXTERNAL_IP
134
220
```
135
221
222
+
### [Azure PowerShell](#tab/azure-powershell)
223
+
224
+
Add an *A* record to your DNS zone with the external IP address of the NGINX service using [New-AzDnsRecordSet][new-az-dns-recordset-create-a-record].
-ResourceGroupName <Name of Resource Group for the DNS Zone> `
232
+
-ZoneName <Custom Domain Name> `
233
+
-TTL 3600
234
+
-DnsRecords $Records
235
+
```
236
+
237
+
---
238
+
136
239
### Configure an FQDN for the ingress controller
137
240
Optionally, you can configure an FQDN for the ingress controller IP address instead of a custom domain. Your FQDN will be of the form `<CUSTOM LABEL>.<AZURE REGION NAME>.cloudapp.azure.com`.
138
241
@@ -141,6 +244,8 @@ There are two methods for this configuration described below.
141
244
#### Method 1: Set the DNS label using the Azure CLI
#### Method 2: Set the DNS label using helm chart settings
162
286
You can pass an annotation setting to your helm chart configuration by using the `--set controller.service.annotations."service\.beta\.kubernetes\.io/azure-dns-label-name"` parameter. This can be set either when the ingress controller is first deployed, or it can be configured later.
163
287
The following example shows how to update this setting after the controller has been deployed.
The NGINX ingress controller supports TLS termination. There are several ways to retrieve and configure certificates for HTTPS. This article demonstrates using [cert-manager][cert-manager], which provides automatic [Lets Encrypt][lets-encrypt] certificate generation and management functionality.
178
318
179
319
To install the cert-manager controller:
180
320
181
-
```console
321
+
### [Azure CLI](#tab/azure-cli)
322
+
323
+
```bash
182
324
# Label the ingress-basic namespace to disable resource validation
0 commit comments