-
Notifications
You must be signed in to change notification settings - Fork 0
/
api-text.yaml
52 lines (52 loc) · 1.21 KB
/
api-text.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
apiVersion: v1
kind: Service
metadata:
name: kubernetes-api-text
labels:
app: kubernetes-tp
spec:
ports:
- port: 3002
targetPort: 3000
selector:
app: kubernetes-tp
partie: kubernetes-api-text
type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: kubernetes-api-text
labels:
app: kubernetes-tp
spec:
template:
spec:
containers:
- name: kubernetes-api-text
image: pfourny/kubernetes-tp-api-text:latest
ports:
- containerPort: 3000
readinessProbe:
failureThreshold: 5 # Reessayer 5 fois
httpGet:
path: /ping
port: 3000
scheme: HTTP
initialDelaySeconds: 30 # Attendre 30s avant de tester
periodSeconds: 10 # Attendre 10s entre chaque essai
timeoutSeconds: 5 # Attendre 5s la reponse
env:
- name: DATABASE_URL
value: "apitext:1234@tcp(database:3306)/apitext"
metadata:
labels:
app: kubernetes-tp
partie: kubernetes-api-text
selector:
matchLabels:
app: kubernetes-tp
partie: kubernetes-api-text
strategy:
type: Recreate
replicas: 1