-
Notifications
You must be signed in to change notification settings - Fork 3
/
deployment.yaml
56 lines (56 loc) · 1.55 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
apiVersion: qddt-client/v1
kind: Deployment
metadata:
name: $CI_ENVIRONMENT_SLUG
namespace: $KUBE_NAMESPACE
annotations:
app.gitlab.com/env: $CI_ENVIRONMENT_SLUG
app.gitlab.com/app: $CI_PROJECT_PATH_SLUG
labels:
app: $CI_ENVIRONMENT_SLUG
pipeline_id: "$CI_PIPELINE_ID"
spec:
replicas: $REPLICAS
selector:
matchLabels:
name: $CI_ENVIRONMENT_SLUG
template:
metadata:
annotations:
app.gitlab.com/env: $CI_ENVIRONMENT_SLUG
app.gitlab.com/app: $CI_PROJECT_PATH_SLUG
labels:
name: $CI_ENVIRONMENT_SLUG
app: $CI_ENVIRONMENT_SLUG
spec:
containers:
- name: app
image: $CI_REGISTRY_IMAGE:$CI_REGISTRY_TAG
ports:
- name: web
containerPort: $HTTP_PORT
livenessProbe:
httpGet:
path: /
port: $HTTP_PORT
initialDelaySeconds: 15
timeoutSeconds: 15
readinessProbe:
httpGet:
path: /
port: $HTTP_PORT
initialDelaySeconds: 5
timeoutSeconds: 15
lifecycle:
preStop: # Give ingress container time to stop sending requests to this container during shutdown.
exec:
command: ['/bin/sleep', '15']
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
name: $CI_ENVIRONMENT_SLUG
topologyKey: topology.kubernetes.io/zone
weight: 10