-
Notifications
You must be signed in to change notification settings - Fork 0
/
dep.yaml
72 lines (69 loc) · 1.69 KB
/
dep.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
kind: Deployment
apiVersion: apps/v1
metadata:
name: php-fpm-nginx
namespace: test
spec:
selector:
matchLabels:
app: php-fpm-nginx
replicas: 3
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
template:
metadata:
labels:
app: php-fpm-nginx
spec:
imagePullSecrets:
- name: default-secret
containers:
- name: php-fpm
image: CONTAINER_IMAGE
imagePullPolicy: Always
ports:
- containerPort: 9000
volumeMounts:
- mountPath: /var/www/html
name: nginx-www
lifecycle:
postStart:
exec:
command:
- "/bin/sh"
- "-c"
- >
cp -r /app/. /var/www/html;
chmod -R 755 /var/www/html;
preStop:
exec:
command:
- sh
- '-c'
- sleep 5 && kill -SIGQUIT 1
- name: nginx
image: nginx
ports:
- containerPort: 80
volumeMounts:
- mountPath: /var/www/html
name: nginx-www
- mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
name: nginx-config
lifecycle:
preStop:
exec:
command:
- sh
- '-c'
- sleep 5 && /usr/sbin/nginx -s quit
volumes:
- name: nginx-www
emptyDir: {}
- name: nginx-config
configMap:
name: nginx-config