-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathdeployment-app.yaml
85 lines (83 loc) · 2.09 KB
/
deployment-app.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
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: backend
name: backend
spec:
minReadySeconds: 5
replicas: 3
revisionHistoryLimit: 1
selector:
matchLabels:
app: backend
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 50%
type: RollingUpdate
template:
metadata:
labels:
app: backend
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- backend
topologyKey: kubernetes.io/hostname
weight: 100
initContainers:
- args:
- /bin/bash
- -c
- (php artisan migrate || true) && (php artisan config:cache || true) && (php
artisan route:cache || true) && (cp -rp /var/www/html /codebase)
envFrom:
- configMapRef:
name: backend-config
image: changeme
imagePullPolicy: Always
name: artisan
volumeMounts:
- mountPath: /codebase
name: codebase
containers:
- name: app
envFrom:
- configMapRef:
name: backend-config
image: changeme
imagePullPolicy: Always
livenessProbe:
initialDelaySeconds: 10
periodSeconds: 15
tcpSocket:
port: 80
timeoutSeconds: 30
ports:
- containerPort: 80
readinessProbe:
initialDelaySeconds: 10
periodSeconds: 10
tcpSocket:
port: 80
resources:
limits:
cpu: 200m
memory: 400M
requests:
cpu: 100m
memory: 200M
volumeMounts:
- mountPath: /var/www
name: codebase
volumes:
- emptyDir: {}
name: codebase