forked from plainfast/infrastructure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwordpress.yaml
109 lines (108 loc) · 2.39 KB
/
wordpress.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
106
107
108
109
apiVersion: v1
data:
redis.ini: |
# enable php redis extension
extension=redis.so
kind: ConfigMap
metadata:
name: wordpress-redis-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: wordpress
spec:
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 1
replicas: 3
selector:
matchLabels:
app: wordpress
template:
metadata:
labels:
app: wordpress
spec:
restartPolicy: Always
containers:
- name: wordpress
image: yobasystems/alpine-php-wordpress:latest
imagePullPolicy: IfNotPresent
envFrom:
- secretRef:
name: wordpress-secrets
volumeMounts:
- mountPath: "/usr/html"
name: wordpress-storage
ports:
- containerPort: 80
protocol: TCP
volumes:
- name: wordpress-storage
nfs:
# this is replaced on build by pre/wordpress.yaml
server: ""
path: "/"
- name: redis-config
configMap:
name: wordpress-redis-config
---
kind: Service
apiVersion: v1
metadata:
name: wordpress-service
spec:
selector:
app: wordpress
ports:
# Three types of ports for a service
# nodePort - a static port assigned on each the node
# port - port exposed internally in the cluster
# targetPort - the container port to send requests to
- port: 80
targetPort: 80
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-wordpress
spec:
rules:
- host: $(DOMAIN_LOCAL)
http:
paths:
- path: /
backend:
serviceName: wordpress-service
servicePort: 80
- host: $(DOMAIN_1)
http:
paths:
- path: /
backend:
serviceName: wordpress-service
servicePort: 80
- host: $(DOMAIN_2)
http:
paths:
- path: /
backend:
serviceName: wordpress-service
servicePort: 80
- host: $(DOMAIN_2_WWW)
http:
paths:
- path: /
backend:
serviceName: wordpress-service
servicePort: 80
- host: $(DOMAIN_3)
http:
paths:
- path: /
backend:
serviceName: wordpress-service
servicePort: 80