-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path03-deployment-noconfigmap-liveness.yaml
39 lines (38 loc) · 1.59 KB
/
03-deployment-noconfigmap-liveness.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
apiVersion: apps/v1
kind: Deployment
metadata:
name: goserver-deployment
labels:
app: goserver-deployment
spec:
replicas: 2
selector:
matchLabels:
app: goserver #
template:
metadata:
name: goserver
labels:
app: goserver
spec:
containers:
- name: goserver
image: fabiolnh/hello-go:v5.5
#startupProbe: # The first check before readnessProbe and livenessProbe. Only after this one that these other two will start to count. (IT IS RECOMMENDED TO USE. It says since when the liveNess and readNess can start to check)
#readinessProbe: # If gets error, tt takes away the traffic of the container and send to other. OBS: With this one, the access to container gets available only when the health is 200 (same config of the livenessProbe)
livenessProbe: # It recreates the container
#command # execute a command inside de container
#tcp: # try stabilish a connection TCP with the container
httpGet: # Do a request Http (the most used)
path: /health
port: 80 # Container Port
periodSeconds: 5
failureThreshold: 1 # if gets error 1 time, restart container.
timeoutSeconds: 5 # time to get the response from the container
successThreshold: 1 # How many times it has to test to confirm that the app is online
initialDelaySeconds: 3 # Wait for seconds to try the first request
ports:
- containerPort: 80
env:
- name: NAME
value: "Fabio"