-
Notifications
You must be signed in to change notification settings - Fork 130
/
Copy pathflask_deploy.yaml
63 lines (62 loc) · 1.16 KB
/
flask_deploy.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
57
58
59
60
61
62
63
apiVersion: apps/v1
kind: Deployment
metadata:
name: flaskapp
spec:
replicas: 2
selector:
matchLabels:
app: flaskapp
template:
metadata:
labels:
app: flaskapp
spec:
containers:
- name: flaskapp
image: sample_flask:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 5005
volumeMounts:
- name: flasklogs
mountPath: /var/log/flask
env:
- name: DD_AGENT_SERVICE_HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: DD_AGENT_SERVICE_PORT
value: '8126'
volumes:
- hostPath:
path: /var/log/flask
name: flasklogs
---
apiVersion: v1
kind: Service
metadata:
name: flaskapp
spec:
selector:
app: flaskapp
ports:
- name: http
protocol: TCP
port: 5005
---
kind: ConfigMap
apiVersion: v1
metadata:
name: cm-datadog-confd
namespace: default
data:
flasklogs.yaml: |-
init_config:
instances:
logs:
- type: file
path: /var/log/flask/mylog.json
service: flask
source: python
sourcecategory: sourcecode