-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment.yaml
105 lines (103 loc) · 2.22 KB
/
deployment.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
apiVersion: apps/v1
kind: Deployment
metadata:
name: $PROJECT_NAME
namespace: $PROJECT_NAMESPACE
labels:
app: $PROJECT_NAME
developer: DinGo4DEV
annotations:
git: $GIT_URL
spec:
replicas: 1
selector:
matchLabels:
app: $PROJECT_NAME
template:
creationTimestamp: null
metadata:
labels:
app: $PROJECT_NAME
developer: DinGo4DEV
annotations:
git: $GIT_URL
spec:
containers:
- name: $PROJECT_NAME
image: $IMAGE_REPO_HOST/$IMAGE_REPO/$PROJECT_NAME:$IMAGE_TAG
imagePullPolicy: "Always"
env:
- name: CONFIG_DIRECTORY
value: /var/config
resources:
limits:
memory: "250Mi"
cpu: "300m"
ports:
- containerPort: 8080
- name: $PROJECT_NAME-worker
image: $IMAGE_REPO_HOST/$IMAGE_REPO/$PROJECT_NAME:$IMAGE_TAG
imagePullPolicy: "Always"
env:
- name: CONFIG_DIRECTORY
value: /var/config
ports:
- containerPort: 8003
command:
- celery
args:
- '--app'
- app.worker.celery
- worker
- '--concurrency'
- '5'
- '--loglevel'
- info
imagePullSecrets:
- name: regcred
dnsPolicy: ClusterFirst
---
apiVersion: v1
kind: Service
metadata:
name: $PROJECT_NAME
namespace: $PROJECT_NAMESPACE
labels:
app: $PROJECT_NAME
developer: DinGo4DEV
annotations:
git: $GIT_URL
prometheus.io/scrape: 'true'
spec:
type: ClusterIP
selector:
app: $PROJECT_NAME
ports:
- name: web
protocol: TCP
port: 80
targetPort: 8080
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
annotations:
labels:
app.kubernetes.io/component: metrics
app.kubernetes.io/instance: "$PROJECT_NAME-metrics"
app.kubernetes.io/name: "$PROJECT_NAME-metrics"
release: prometheus
name: "$PROJECT_NAME-metrics"
namespace: $PROJECT_NAMESPACE
spec:
endpoints:
- interval: 10s
path: /metrics
port: web
scrapeTimeout: 10s
namespaceSelector:
matchNames:
- $PROJECT_NAMESPACE
selector:
matchLabels:
app: $PROJECT_NAME