Skip to content

Commit 9bbb027

Browse files
authored
update example for latest api version (#2072)
1 parent 47e7cb0 commit 9bbb027

File tree

2 files changed

+89
-1
lines changed

2 files changed

+89
-1
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
apiVersion: v1
3+
kind: Namespace
4+
metadata:
5+
name: game-2048
6+
---
7+
apiVersion: apps/v1
8+
kind: Deployment
9+
metadata:
10+
namespace: game-2048
11+
name: deployment-2048
12+
spec:
13+
selector:
14+
matchLabels:
15+
app.kubernetes.io/name: app-2048
16+
replicas: 5
17+
template:
18+
metadata:
19+
labels:
20+
app.kubernetes.io/name: app-2048
21+
spec:
22+
containers:
23+
- image: alexwhen/docker-2048
24+
imagePullPolicy: Always
25+
name: app-2048
26+
ports:
27+
- containerPort: 80
28+
---
29+
apiVersion: v1
30+
kind: Service
31+
metadata:
32+
namespace: game-2048
33+
name: service-2048
34+
spec:
35+
ports:
36+
- port: 80
37+
targetPort: 80
38+
protocol: TCP
39+
type: NodePort
40+
selector:
41+
app.kubernetes.io/name: app-2048
42+
---
43+
apiVersion: networking.k8s.io/v1
44+
kind: Ingress
45+
metadata:
46+
namespace: game-2048
47+
name: ingress-2048
48+
annotations:
49+
kubernetes.io/ingress.class: alb
50+
alb.ingress.kubernetes.io/scheme: internet-facing
51+
alb.ingress.kubernetes.io/target-type: ip
52+
spec:
53+
rules:
54+
- http:
55+
paths:
56+
- path: /
57+
pathType: Prefix
58+
backend:
59+
service:
60+
name: service-2048
61+
port:
62+
number: 80

docs/guide/ingress/spec.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Ingress specification
22
This document covers how ingress resources work in relation to The AWS Load Balancer Controller.
33

4-
An example ingress, from [example](../../examples/2048/2048_full.yaml) is as follows.
4+
An example ingress for Kubernetes Version 1.18 and below, from [example](../../examples/2048/2048_full.yaml) is as follows.
55

66
```yaml
77
apiVersion: extensions/v1beta1
@@ -24,6 +24,32 @@ spec:
2424
servicePort: 80
2525
```
2626
27+
An example ingress for Kubernetes Version 1.19 and above, from [example](../../examples/2048/2048_full_latest.yaml) is as follows.
28+
29+
```yaml
30+
apiVersion: extensions/v1
31+
kind: Ingress
32+
metadata:
33+
name: "2048-ingress"
34+
namespace: "2048-game"
35+
annotations:
36+
kubernetes.io/ingress.class: alb
37+
labels:
38+
app: 2048-nginx-ingress
39+
spec:
40+
rules:
41+
- host: 2048.example.com
42+
http:
43+
paths:
44+
- path: /
45+
pathType: Prefix
46+
backend:
47+
service:
48+
name: service-2048
49+
port:
50+
number: 80
51+
```
52+
2753
The host field specifies the eventual Route 53-managed domain that will route to this service.
2854
2955
The service, service-2048, must be of type NodePort in order for the provisioned ALB to route to it.(see [echoserver-service.yaml](../../examples/echoservice/echoserver-service.yaml))

0 commit comments

Comments
 (0)