Skip to content

Commit b6af8e5

Browse files
committed
feat(health-probes): add files
1 parent a74def8 commit b6af8e5

File tree

4 files changed

+110
-0
lines changed

4 files changed

+110
-0
lines changed

health-probes/color-api-pod.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: color-api-pod
5+
labels:
6+
name: color-api-pod
7+
spec:
8+
containers:
9+
- name: color-api-pod
10+
image: lmacademy/color-api:1.2.1
11+
ports:
12+
- containerPort: 80
13+
resources:
14+
limits:
15+
cpu: '500m'
16+
memory: '512Mi'
17+
env:
18+
- name: DELAY_STARTUP
19+
value: 'false'
20+
- name: FAIL_LIVENESS
21+
value: 'false'
22+
startupProbe:
23+
httpGet:
24+
path: /up
25+
port: 80
26+
failureThreshold: 2
27+
periodSeconds: 3
28+
livenessProbe:
29+
httpGet:
30+
path: /health
31+
port: 80
32+
failureThreshold: 3
33+
periodSeconds: 10
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: color-api
5+
labels:
6+
app: color-api
7+
spec:
8+
replicas: 6
9+
selector:
10+
matchLabels:
11+
app: color-api
12+
template:
13+
metadata:
14+
labels:
15+
app: color-api
16+
spec:
17+
containers:
18+
- name: color-api
19+
image: lmacademy/color-api:1.2.1
20+
ports:
21+
- containerPort: 80
22+
resources:
23+
limits:
24+
cpu: '500m'
25+
memory: '512Mi'
26+
env:
27+
- name: DELAY_STARTUP
28+
value: 'false'
29+
- name: FAIL_LIVENESS
30+
value: 'false'
31+
- name: FAIL_READINESS
32+
value: 'true'
33+
startupProbe:
34+
httpGet:
35+
path: /up
36+
port: 80
37+
failureThreshold: 2
38+
periodSeconds: 3
39+
livenessProbe:
40+
httpGet:
41+
path: /health
42+
port: 80
43+
failureThreshold: 3
44+
periodSeconds: 10
45+
readinessProbe:
46+
httpGet:
47+
path: /ready
48+
port: 80
49+
failureThreshold: 2
50+
periodSeconds: 5
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: color-api-svc
5+
spec:
6+
selector:
7+
app: color-api
8+
ports:
9+
- port: 80
10+
targetPort: 80
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: traffic-generator
5+
labels:
6+
app: traffic-generator
7+
spec:
8+
containers:
9+
- name: traffic-generator
10+
image: lmacademy/traffic-generator:1.0.0
11+
args:
12+
- 'color-api-svc/api'
13+
- '0.5'
14+
resources:
15+
limits:
16+
cpu: '500m'
17+
memory: '512Mi'

0 commit comments

Comments
 (0)