/
pod-two-stream-sidecars.yaml
50 lines (50 loc) · 1.21 KB
/
pod-two-stream-sidecars.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
apiVersion: apps/v1
kind: Deployment
metadata:
name: comment-web
labels:
app: comment-web
spec:
replicas: 2
selector:
matchLabels:
service: comments
tier: web
template:
metadata:
labels:
service: comments
tier: web
spec:
containers:
- name: webserver
image: busybox:1.36
args:
- /bin/sh
- -c
- >
i=0;
while true;
do
echo "OUT $(hostname) $(date)" >> /var/log/stdout.log;
echo "ERROR $(hostname) $(date)" >> /var/log/stderr.log;
sleep 5;
done
volumeMounts:
- name: log
mountPath: /var/log
- name: stdout-sidecar
image: busybox:1.36
args: [/bin/sh, -c, 'tail -n+1 -F /var/log/stdout.log']
volumeMounts:
- name: log
mountPath: /var/log
- name: stderr-sidecar
image: busybox:1.36
args: [/bin/sh, -c, 'tail -n+1 -F /var/log/stderr.log']
volumeMounts:
- name: log
mountPath: /var/log
volumes:
- name: log
emptyDir: {}