-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnginx.yaml
52 lines (52 loc) · 1.19 KB
/
nginx.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
apiVersion: v1
kind: Service
metadata:
name: openemis-nginx
namespace: moe
labels:
app: openemis-nginx
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: "nlb"
spec:
externalTrafficPolicy: Local
ports:
- name: http
port: 80
protocol: TCP
targetPort: 80
selector:
app: openemis-nginx
type: LoadBalancer
---
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: openemis-nginx
namespace: moe
spec:
strategy:
type: Recreate
selector:
matchLabels:
app: openemis-nginx
replicas: 3 # tells deployment to run 1 pods matching the template
template: # create pods using pod definition in this template
metadata:
labels:
app: openemis-nginx
spec:
containers:
- name: openemis-nginx
image: phpdockerio/nginx:latest
imagePullPolicy: Always
ports:
- containerPort: 80
volumeMounts:
- name: mysql-storage
mountPath: ./nginx:/var/www/myapp
- name: mysql-storage
mountPath: ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
volumes:
- name: mysql-storage
persistentVolumeClaim:
claimName: mysql-moe-claimn