-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployment.yml
162 lines (157 loc) · 3.69 KB
/
deployment.yml
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: wp-pvc-test-$NAME
namespace: wordpress-test
labels:
app: wordpress-test-$NAME
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: wp-test-$NAME
namespace: wordpress-test
spec:
selector:
matchLabels:
app: wordpress-test-$NAME
replicas: 1
template:
metadata:
labels:
app: wordpress-test-$NAME
spec:
containers:
- name: wp-test-$NAME
image: bitnami/wordpress:latest
env:
- name: MARIADB_HOST
value: "127.0.0.1"
- name: WORDPRESS_DATABASE_USER
value: "jura"
- name: WORDPRESS_DATABASE_PASSWORD
value: "jura"
- name: WORDPRESS_DATABASE_NAME
value: "wordpress_test_db"
- name: WORDPRESS_USER
value: "jura"
- name: WORDPRESS_PASSWORD
value: "jura"
ports:
- containerPort: 8080
volumeMounts:
- name: wordpress-persistent-storage-$NAME
mountPath: /var/www/html
- name: mysql-test-db-$NAME
image: registry.redhat.io/rhel8/mysql-80
env:
- name: MYSQL_DATABASE
value: "wordpress_test_db"
- name: MYSQL_USER
value: "jura"
- name: MYSQL_PASSWORD
value: "jura"
ports:
- containerPort: 3306
volumes:
- name: wordpress-persistent-storage-$NAME
persistentVolumeClaim:
claimName: wp-pvc-test-$NAME
---
apiVersion: v1
kind: Service
metadata:
name: wp-test-$NAME
namespace: wordpress-test
spec:
selector:
app: wordpress-test-$NAME
ports:
- protocol: TCP
port: 80
targetPort: 8080
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: wp-pvc-prodcution-$NAME
namespace: wordpress-production
labels:
app: wordpress-$NAME
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: wp-$NAME
namespace: wordpress-production
spec:
selector:
matchLabels:
app: wordpress-$NAME
replicas: 1
template:
metadata:
labels:
app: wordpress-$NAME
spec:
containers:
- name: wp-$NAME
image: bitnami/wordpress:latest
env:
- name: MARIADB_HOST
value: "127.0.0.1"
- name: WORDPRESS_DATABASE_USER
value: "jura"
- name: WORDPRESS_DATABASE_PASSWORD
value: "jura"
- name: WORDPRESS_DATABASE_NAME
value: "wordpress_db"
- name: WORDPRESS_USERNAME
value: "jura"
- name: WORDPRESS_PASSWORD
value: "jura"
ports:
- containerPort: 8080
volumeMounts:
- name: wordpress-persistent-storage-$NAME
mountPath: /var/www/html
- name: mysql-db-$NAME
image: registry.redhat.io/rhel8/mysql-80
env:
- name: MYSQL_DATABASE
value: "wordpress_db"
- name: MYSQL_USER
value: "jura"
- name: MYSQL_PASSWORD
value: "jura"
ports:
- containerPort: 3306
volumes:
- name: wordpress-persistent-storage-$NAME
persistentVolumeClaim:
claimName: wp-pvc-production-$NAME
---
apiVersion: v1
kind: Service
metadata:
name: wp-$NAME
namespace: wordpress-production
spec:
selector:
app: wordpress-$NAME
ports:
- protocol: TCP
port: 80
targetPort: 8080