-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmulti-container-pod.yaml
More file actions
45 lines (42 loc) · 1.01 KB
/
multi-container-pod.yaml
File metadata and controls
45 lines (42 loc) · 1.01 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
apiVersion: v1
kind: Pod
metadata:
name: multi-container-pod
labels:
app: multi-container-demo
spec:
containers:
- name: container-web
image: nginx:1.21
volumeMounts:
- name: shared-data
mountPath: /usr/share/nginx/html
- name: container-logger
image: busybox:1.36
command: ["/bin/sh", "-c"]
args:
- while true; do
log_msg="Log do sistema atualizado em $(date)";
echo "$log_msg" >> /data/log.txt;
echo "$log_msg";
sleep 10;
done
volumeMounts:
- name: shared-data
mountPath: /data
- name: container-monitor
image: busybox:1.36
command: ["/bin/sh", "-c"]
args:
- while true; do
monitor_msg="Verificando estado dos containers em $(date)";
echo "$monitor_msg" >> /data/monitor.txt;
echo "$monitor_msg";
sleep 30;
done
volumeMounts:
- name: shared-data
mountPath: /data
volumes:
- name: shared-data
emptyDir: {}