Skip to content

Commit a78005e

Browse files
committed
Revsied article to align with deprecation of extensions/v1beta1
1 parent 1a8bfc2 commit a78005e

File tree

1 file changed

+49
-25
lines changed

1 file changed

+49
-25
lines changed

articles/application-gateway/ingress-controller-annotations.md

Lines changed: 49 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ services: application-gateway
55
author: greg-lindsay
66
ms.service: application-gateway
77
ms.topic: article
8-
ms.date: 3/18/2022
8+
ms.date: 10/26/2022
99
ms.author: greglin
1010
---
1111

12-
# Annotations for Application Gateway Ingress Controller
12+
# Annotations for Application Gateway Ingress Controller
1313

1414
## Introductions
1515

@@ -44,7 +44,7 @@ appgw.ingress.kubernetes.io/backend-path-prefix: <path prefix>
4444
### Example
4545
4646
```yaml
47-
apiVersion: extensions/v1beta1
47+
apiVersion: apiVersion: networking.k8s.io/v1
4848
kind: Ingress
4949
metadata:
5050
name: go-server-ingress-bkprefix
@@ -57,13 +57,17 @@ spec:
5757
- http:
5858
paths:
5959
- path: /hello/
60+
pathType: Exact
6061
backend:
61-
serviceName: go-server-service
62-
servicePort: 80
62+
service:
63+
name: go-server-service
64+
port:
65+
number: 80
6366
```
67+
6468
In the example above, we have defined an ingress resource named `go-server-ingress-bkprefix` with an annotation `appgw.ingress.kubernetes.io/backend-path-prefix: "/test/"` . The annotation tells application gateway to create an HTTP setting, which will have a path prefix override for the path `/hello` to `/test/`.
6569

66-
> [!NOTE]
70+
> [!NOTE]
6771
> In the above example we have only one rule defined. However, the annotations are applicable to the entire ingress resource, so if a user had defined multiple rules, the backend path prefix would be set up for each of the paths specified. Thus, if a user wants different rules with different path prefixes (even for the same service) they would need to define different ingress resources.
6872

6973
## TLS Redirect
@@ -83,7 +87,7 @@ appgw.ingress.kubernetes.io/ssl-redirect: "true"
8387
### Example
8488

8589
```yaml
86-
apiVersion: extensions/v1beta1
90+
apiVersion: apiVersion: networking.k8s.io/v1
8791
kind: Ingress
8892
metadata:
8993
name: go-server-ingress-redirect
@@ -101,8 +105,10 @@ spec:
101105
http:
102106
paths:
103107
- backend:
104-
serviceName: websocket-repeater
105-
servicePort: 80
108+
service:
109+
name: websocket-repeater
110+
port:
111+
number: 80
106112
```
107113

108114
## Connection Draining
@@ -120,7 +126,7 @@ appgw.ingress.kubernetes.io/connection-draining-timeout: "60"
120126
### Example
121127

122128
```yaml
123-
apiVersion: extensions/v1beta1
129+
apiVersion: apiVersion: networking.k8s.io/v1
124130
kind: Ingress
125131
metadata:
126132
name: go-server-ingress-drain
@@ -134,9 +140,12 @@ spec:
134140
- http:
135141
paths:
136142
- path: /hello/
143+
pathType: Exact
137144
backend:
138-
serviceName: go-server-service
139-
servicePort: 80
145+
service:
146+
name: go-server-service
147+
port:
148+
number: 80
140149
```
141150

142151
## Cookie Based Affinity
@@ -152,7 +161,7 @@ appgw.ingress.kubernetes.io/cookie-based-affinity: "true"
152161
### Example
153162

154163
```yaml
155-
apiVersion: extensions/v1beta1
164+
apiVersion: apiVersion: networking.k8s.io/v1
156165
kind: Ingress
157166
metadata:
158167
name: go-server-ingress-affinity
@@ -165,9 +174,12 @@ spec:
165174
- http:
166175
paths:
167176
- path: /hello/
177+
pathType: Exact
168178
backend:
169-
serviceName: go-server-service
170-
servicePort: 80
179+
service:
180+
name: go-server-service
181+
port:
182+
number: 80
171183
```
172184

173185
## Request Timeout
@@ -183,7 +195,7 @@ appgw.ingress.kubernetes.io/request-timeout: "20"
183195
### Example
184196

185197
```yaml
186-
apiVersion: extensions/v1beta1
198+
apiVersion: apiVersion: networking.k8s.io/v1
187199
kind: Ingress
188200
metadata:
189201
name: go-server-ingress-timeout
@@ -196,9 +208,12 @@ spec:
196208
- http:
197209
paths:
198210
- path: /hello/
211+
pathType: Exact
199212
backend:
200-
serviceName: go-server-service
201-
servicePort: 80
213+
service:
214+
name: go-server-service
215+
port:
216+
number: 80
202217
```
203218

204219
## Use Private IP
@@ -209,15 +224,16 @@ This annotation allows us to specify whether to expose this endpoint on Private
209224
> * Application Gateway doesn't support multiple IPs on the same port (example: 80/443). Ingress with annotation `appgw.ingress.kubernetes.io/use-private-ip: "false"` and another with `appgw.ingress.kubernetes.io/use-private-ip: "true"` on `HTTP` will cause AGIC to fail in updating the Application Gateway.
210225
> * For Application Gateway that doesn't have a private IP, Ingresses with `appgw.ingress.kubernetes.io/use-private-ip: "true"` will be ignored. This will reflected in the controller logs and ingress events for those ingresses with `NoPrivateIP` warning.
211226

212-
213227
### Usage
228+
214229
```yaml
215230
appgw.ingress.kubernetes.io/use-private-ip: "true"
216231
```
217232

218233
### Example
234+
219235
```yaml
220-
apiVersion: extensions/v1beta1
236+
apiVersion: apiVersion: networking.k8s.io/v1
221237
kind: Ingress
222238
metadata:
223239
name: go-server-ingress-timeout
@@ -230,9 +246,12 @@ spec:
230246
- http:
231247
paths:
232248
- path: /hello/
249+
pathType: Exact
233250
backend:
234-
serviceName: go-server-service
235-
servicePort: 80
251+
service:
252+
name: go-server-service
253+
port:
254+
number: 80
236255
```
237256

238257
## Backend Protocol
@@ -244,13 +263,15 @@ This annotation allows us to specify the protocol that Application Gateway shoul
244263
> * Make sure to not use port 80 with HTTPS and port 443 with HTTP on the Pods.
245264

246265
### Usage
266+
247267
```yaml
248268
appgw.ingress.kubernetes.io/backend-protocol: "https"
249269
```
250270

251271
### Example
272+
252273
```yaml
253-
apiVersion: extensions/v1beta1
274+
apiVersion: apiVersion: networking.k8s.io/v1
254275
kind: Ingress
255276
metadata:
256277
name: go-server-ingress-timeout
@@ -263,9 +284,12 @@ spec:
263284
- http:
264285
paths:
265286
- path: /hello/
287+
pathType: Exact
266288
backend:
267-
serviceName: go-server-service
268-
servicePort: 443
289+
service:
290+
name: go-server-service
291+
port:
292+
number: 443
269293
```
270294

271295
## Rewrite Rule Set

0 commit comments

Comments
 (0)