-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcs.yaml
56 lines (53 loc) · 1.13 KB
/
cs.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
apiVersion: v1
kind: List
items:
# HTTP Server Pod
- apiVersion: v1
kind: Pod
metadata:
name: http-server
labels:
app: http-server
spec:
containers:
- name: server
image: httpd
ports:
- containerPort: 80
volumeMounts:
- name: http-server-volume
mountPath: /usr/local/apache2/htdocs/
volumes:
- name: http-server-volume
emptyDir: {}
initContainers:
- name: init-server
image: busybox
command: ['sh', '-c', 'echo "hi" > /http-server-volume/emptyfile.txt']
volumeMounts:
- name: http-server-volume
mountPath: /http-server-volume
# HTTP Server Service
- apiVersion: v1
kind: Service
metadata:
name: http-server
spec:
selector:
app: http-server
ports:
- protocol: TCP
port: 80
targetPort: 80
# HTTP Client Pod
- apiVersion: v1
kind: Pod
metadata:
name: http-client
labels:
app: http-client
spec:
containers:
- name: client
image: curlimages/curl
command: ["sh", "-c", "while true; do curl http://http-server/emptyfile.txt -o /dev/null; sleep 5; done"]