-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrouting.yaml
57 lines (57 loc) · 1.07 KB
/
routing.yaml
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
---
# regular service
apiVersion: v1
kind: Service
metadata:
name: echo-hostname
spec:
selector:
app: echo-hostname
ports:
- port: 8080
targetPort: 8080
---
# master service
apiVersion: v1
kind: Service
metadata:
name: echo-hostname-master
annotations:
qoqo.dev/service-mode: active-standby
spec:
selector:
app: echo-hostname
ports:
- name: foo
port: 8080
targetPort: 8080
---
# dummy http servers that echo their own hostname in a response header
apiVersion: apps/v1
kind: Deployment
metadata:
name: echo-hostname
spec:
replicas: 2
selector:
matchLabels:
app: echo-hostname
template:
metadata:
labels:
app: echo-hostname
spec:
containers:
- image: alpine
name: echo-hostname
command:
- sh
- -c
- |
trap 'jobs -p | xargs kill -TERM' TERM
apk add -U socat
socat -s tcp-listen:8080,fork system:"echo 'HTTP/1.1 200 OK'; echo 'Hostname: $HOSTNAME'; echo" &
wait
readinessProbe:
tcpSocket:
port: 8080