-
Notifications
You must be signed in to change notification settings - Fork 2
/
service2.yml
74 lines (74 loc) · 1.41 KB
/
service2.yml
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
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: service2
name: service2
spec:
replicas: 1
selector:
matchLabels:
app: service2
template:
metadata:
labels:
app: service2
spec:
containers:
- image: iamnoah4real/saywhat
name: say-what
env:
- name: RESPONSE_MESSAGE
value: "hello from service 2"
livenessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 30
periodSeconds: 60
timeoutSeconds: 30
failureThreshold: 2
ports:
- containerPort: 3000
protocol: TCP
---
apiVersion: v1
kind: Service
metadata:
name: service2
spec:
selector:
app: service2
ports:
- protocol: TCP
port: 80
targetPort: 3000
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: service1-ingress
annotations:
kubernetes.io/ingress.class: traefik
traefik.ingress.kubernetes.io/router.middlewares: default-service2-stripprefix@kubernetescrd
spec:
rules:
- http:
paths:
- path: /service2
pathType: Exact
backend:
service:
name: service2
port:
number: 80
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: service2-stripprefix
spec:
stripPrefix:
prefixes:
- /service2