Skip to content

Commit f74f1b9

Browse files
authored
Merge pull request #213109 from SteveSaunders1952/v-ssaunders-CaihuaRui
Edits to Caihua/ingress
2 parents e4da7f8 + 938fa6e commit f74f1b9

File tree

3 files changed

+85
-27
lines changed

3 files changed

+85
-27
lines changed
Lines changed: 83 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,133 @@
11
---
2-
title: How to configure ingress for Azure Spring Apps
3-
description: Describes how to configure ingress for Azure Spring Apps.
2+
title: Customize the ingress configuration in Azure Spring Apps
3+
description: Learn how to customize the ingress configuration in Azure Spring Apps.
44
author: KarlErickson
55
ms.author: haital
66
ms.service: spring-apps
77
ms.topic: how-to
8-
ms.date: 05/27/2022
8+
ms.date: 09/29/2022
99
ms.custom: devx-track-java, devx-track-azurecli
1010
---
1111

1212
# Customize the ingress configuration in Azure Spring Apps
1313

1414
**This article applies to:** ✔️ Basic/Standard tier ✔️ Enterprise tier
1515

16-
This article shows you how to set and update the ingress configuration in Azure Spring Apps by using the Azure portal and Azure CLI.
16+
This article shows you how to set and update an application's ingress settings in Azure Spring Apps by using the Azure portal and Azure CLI.
1717

18-
The Azure Spring Apps service uses an underlying ingress controller to handle application traffic management. Currently, the following ingress setting is supported for customization.
18+
The Azure Spring Apps service uses an underlying ingress controller to handle application traffic management. The following ingress settings are supported for customization.
1919

20-
| Name | Ingress setting | Default value | Valid range | Description |
21-
|----------------------|--------------------|---------------|-------------|----------------------------------------------------------------------|
22-
| ingress-read-timeout | proxy-read-timeout | 300 | \[1,1800\] | The timeout in seconds for reading a response from a proxied server. |
20+
| Name | Ingress setting | Default value | Valid range | Description |
21+
|----------------------|------------------------|---------------|-------------------|--------------------------------------------------------------------------|
22+
| `ingress-read-timeout` | `proxy-read-timeout` | 300 | \[1,1800\] | The timeout in seconds for reading a response from a proxied server. |
23+
| `ingress-send-timeout` | `proxy-send-timeout` | 60 | \[1,1800\] | The timeout in seconds for transmitting a request to the proxied server. |
24+
| `session-affinity` | `affinity` | None | Session, None | The type of the affinity that will make the request come to the same pod replica that was responding to the previous request. Set `session-affinity` to Cookie to enable session affinity. In the portal only, you must choose the enable session affinity box. |
25+
| `session-max-age` | `session-cookie-max-age` | 0 | \[0,7 days\] | The time in seconds until the cookie expires, corresponding to the `Max-Age` cookie directive. If you set `session-max-age` to 0, the expiration period is equal to the browser session period. |
26+
| `backend-protocol` | `backend-protocol` | Default | DefaultGRPC | Sets the backend protocol to indicate how NGINX should communicate with the backend service. Default means HTTP/HTTPS/WebSocket. The `backend-protocol` setting only applies to client-to-app traffic. For app-to-app traffic within the same service instance, choose any protocol for app-to-app traffic without modifying the `backend-protocol` setting. The protocol doesn't restrict your choice of protocol for app-to-app traffic within the same service instance. |
2327

2428
## Prerequisites
2529

26-
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
27-
- [The Azure CLI](/cli/azure/install-azure-cli).
28-
- The Azure Spring Apps extension. Use the following command to remove previous versions and install the latest extension. If you previously installed the spring-cloud extension, uninstall it to avoid configuration and version mismatches.
30+
- An Azure subscription. If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
31+
- [Azure CLI](/cli/azure/install-azure-cli) with the Azure Spring Apps extension. Use the following command to remove previous versions and install the latest extension. If you previously installed the spring-cloud extension, uninstall it to avoid configuration and version mismatches.
2932

3033
```azurecli
3134
az extension remove --name spring
3235
az extension add --name spring
3336
az extension remove --name spring-cloud
3437
```
3538

36-
## Set the ingress configuration when creating a service
39+
## Set the ingress configuration
3740

38-
You can set the ingress configuration when creating a service by using the following CLI command.
41+
Use the following Azure CLI command to set the ingress configuration when you create.
3942

4043
```azurecli
41-
az spring create \
44+
az spring app create \
4245
--resource-group <resource-group-name> \
46+
--service <service-name> \
4347
--name <service-name> \
44-
--ingress-read-timeout 300
48+
--ingress-read-timeout 300 \
49+
--ingress-send-timeout 60 \
50+
--session-affinity Cookie \
51+
--session-max-age 1800 \
52+
--backend-protocol Default \
4553
```
4654

47-
This command will create a service with ingress read timeout set to 300 seconds.
55+
This command creates an app with the following settings:
4856

49-
## Update the ingress configuration for an existing service
57+
- Ingress read timeout: 300 seconds
58+
- Ingress send timeout: 60 seconds
59+
- Session affinity: Cookie
60+
- Session cookie max age: 1800 seconds
61+
- Backend protocol: Default
62+
63+
## Update the ingress settings for an existing app
5064

5165
### [Azure portal](#tab/azure-portal)
5266

53-
To update the ingress configuration for an existing service, use the following steps:
67+
Use the following steps to update the ingress settings for an application hosted by an existing service instance.
5468

5569
1. Sign in to the portal using an account associated with the Azure subscription that contains the Azure Spring Apps instance.
56-
2. Navigate to the **Networking** pane, then select the **Ingress configuration** tab.
57-
3. Update the ingress configuration, and then select **Save**.
70+
1. Navigate to the **Apps** pane, and then select the app you want to configure.
71+
1. Navigate to the **Configuration** pane, and then select the **Ingress settings** tab.
72+
1. Update the ingress settings, and then select **Save**.
5873

59-
:::image type="content" source="media/how-to-configure-ingress/config-ingress-read-timeout.png" lightbox="media/how-to-configure-ingress/config-ingress-read-timeout.png" alt-text="Screenshot of Azure portal example for config ingress read timeout.":::
74+
:::image type="content" source="media/how-to-configure-ingress/ingress-settings.jpg" lightbox="media/how-to-configure-ingress/ingress-settings.jpg" alt-text="Screenshot of Azure portal Configuration page showing the Ingress settings tab.":::
6075

6176
### [Azure CLI](#tab/azure-cli)
6277

63-
To update the ingress configuration for an existing service, use the following command:
78+
Use the following command to update the ingress settings for an existing app.
6479

6580
```azurecli
66-
az spring update \
81+
az spring app update \
6782
--resource-group <resource-group-name> \
83+
--service <service-name> \
6884
--name <service-name> \
69-
--ingress-read-timeout 600
85+
--ingress-read-timeout 600 \
86+
--ingress-send-timeout 600 \
87+
--session-affinity None \
88+
--session-max-age 0 \
89+
--backend-protocol GRPC \
7090
```
7191

72-
This command will update the ingress read timeout to 600 seconds.
92+
This command updates the app with the following settings:
93+
94+
- Ingress read timeout: 600 seconds
95+
- Ingress send timeout: 600 seconds
96+
- Session affinity: None
97+
- Session cookie max age: 0
98+
- Backend protocol: GRPC
99+
100+
---
101+
102+
## FAQ
103+
104+
- How do you enable gRPC?
105+
106+
Set the backend protocol to *GRPC*.
107+
108+
- How do you enable WebSocket?
109+
110+
WebSocket is enabled by default if you set the backend protocol to *Default*. The WebSocket connection limit is 20000. When you reach that limit, the connection will fail.
111+
112+
You can also use RSocket based on WebSocket.
113+
114+
- What is the difference between ingress config and ingress settings?
115+
116+
Ingress config can still be used in the Azure CLI and SDK, and that setting will apply to all apps within the service instance. Once an app has been configured by ingress settings, the Ingress config won't affect it. We don't recommend that new scripts use ingress config since we plan to stop supporting it in the future.
117+
118+
- When ingress settings are used together with App Gateway/APIM, what happens when you set the timeout in both Azure Spring Apps ingress and the App Gateway/APIM?
119+
120+
The shorter timeout is used.
121+
122+
- Do you need extra config in App Gateway/APIM if you need to have end-to-end support for gRPC or WebSocket?
123+
124+
You don't need extra config as long as the App Gateway supports gRPC.
125+
126+
- Is configurable port supported?
127+
128+
Configurable port isn't currently supported (80/443).
73129

74130
## Next steps
75131

76-
- [Learn more about ingress controller](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers)
77-
- [Learn more about NGINX ingress controller](https://kubernetes.github.io/ingress-nginx)
132+
- [Ingress controllers](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers)
133+
- [NGINX ingress controller](https://kubernetes.github.io/ingress-nginx)
148 KB
Loading

articles/spring-apps/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ items:
226226
href: how-to-access-app-from-internet-virtual-network.md
227227
- name: Configure Palo Alto
228228
href: how-to-configure-palo-alto.md
229+
- name: Customize the ingress configuration in Azure Spring Apps
230+
href: how-to-configure-ingress.md
229231
- name: Customer responsibilities running Azure Spring Apps in VNET
230232
href: vnet-customer-responsibilities.md
231233
- name: Troubleshooting Azure Spring Apps in virtual networks

0 commit comments

Comments
 (0)