-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample-ingress-stack.yaml
More file actions
109 lines (109 loc) · 1.86 KB
/
sample-ingress-stack.yaml
File metadata and controls
109 lines (109 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
---
apiVersion: v1
kind: Service
metadata:
labels:
app: frontend-1
name: frontend-1
spec:
ports:
- port: 8080
protocol: TCP
targetPort: 8080
selector:
app: frontend-1
---
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: frontend-1
name: frontend-1
spec:
replicas: 1
selector:
matchLabels:
app: frontend-1
strategy: {}
template:
metadata:
labels:
app: frontend-1
spec:
containers:
- image: gcr.io/google-samples/hello-app:1.0
name: frontend-1
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
labels:
app: frontend-2
name: frontend-2
spec:
ports:
- port: 8080
protocol: TCP
targetPort: 8080
selector:
app: frontend-2
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: frontend-2
name: frontend-2
spec:
replicas: 1
selector:
matchLabels:
app: frontend-2
strategy: {}
template:
metadata:
labels:
app: frontend-2
spec:
containers:
- image: gcr.io/google-samples/hello-app:2.0
name: frontend-2
ports:
- containerPort: 8080
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
name: frontend-ingress
spec:
rules:
- host: hello-world.info
http:
paths:
- backend:
serviceName: frontend-1
servicePort: 8080
path: /v1
- backend:
serviceName: frontend-2
servicePort: 8080
path: /v2
- host: api-v1.hello-world.info
http:
paths:
- backend:
serviceName: frontend-1
servicePort: 8080
path: /
- host: api-v2.hello-world.info
http:
paths:
- backend:
serviceName: frontend-2
servicePort: 8080
path: /