1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,184 @@ |
0 |
+{ |
|
1 |
+ "kind": "Template", |
|
2 |
+ "apiVersion": "v1", |
|
3 |
+ "metadata": { |
|
4 |
+ "name": "mariadb-ephemeral", |
|
5 |
+ "annotations": { |
|
6 |
+ "description": "MariaDB database service, without persistent storage. WARNING: Any data stored will be lost upon pod destruction. Only use this template for testing", |
|
7 |
+ "iconClass": "icon-mariadb", |
|
8 |
+ "tags": "database,mariadb" |
|
9 |
+ } |
|
10 |
+ }, |
|
11 |
+ "objects": [ |
|
12 |
+ { |
|
13 |
+ "kind": "Service", |
|
14 |
+ "apiVersion": "v1", |
|
15 |
+ "metadata": { |
|
16 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
17 |
+ }, |
|
18 |
+ "spec": { |
|
19 |
+ "ports": [ |
|
20 |
+ { |
|
21 |
+ "name": "mariadb", |
|
22 |
+ "port": 3306 |
|
23 |
+ } |
|
24 |
+ ], |
|
25 |
+ "selector": { |
|
26 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
27 |
+ } |
|
28 |
+ } |
|
29 |
+ }, |
|
30 |
+ { |
|
31 |
+ "kind": "DeploymentConfig", |
|
32 |
+ "apiVersion": "v1", |
|
33 |
+ "metadata": { |
|
34 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
35 |
+ }, |
|
36 |
+ "spec": { |
|
37 |
+ "strategy": { |
|
38 |
+ "type": "Recreate" |
|
39 |
+ }, |
|
40 |
+ "triggers": [ |
|
41 |
+ { |
|
42 |
+ "type": "ImageChange", |
|
43 |
+ "imageChangeParams": { |
|
44 |
+ "automatic": true, |
|
45 |
+ "containerNames": [ |
|
46 |
+ "mariadb" |
|
47 |
+ ], |
|
48 |
+ "from": { |
|
49 |
+ "kind": "ImageStreamTag", |
|
50 |
+ "name": "mariadb:10.1", |
|
51 |
+ "namespace": "${NAMESPACE}" |
|
52 |
+ } |
|
53 |
+ } |
|
54 |
+ }, |
|
55 |
+ { |
|
56 |
+ "type": "ConfigChange" |
|
57 |
+ } |
|
58 |
+ ], |
|
59 |
+ "replicas": 1, |
|
60 |
+ "selector": { |
|
61 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
62 |
+ }, |
|
63 |
+ "template": { |
|
64 |
+ "metadata": { |
|
65 |
+ "labels": { |
|
66 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
67 |
+ } |
|
68 |
+ }, |
|
69 |
+ "spec": { |
|
70 |
+ "containers": [ |
|
71 |
+ { |
|
72 |
+ "name": "mariadb", |
|
73 |
+ "image": " ", |
|
74 |
+ "ports": [ |
|
75 |
+ { |
|
76 |
+ "containerPort": 3306 |
|
77 |
+ } |
|
78 |
+ ], |
|
79 |
+ "readinessProbe": { |
|
80 |
+ "timeoutSeconds": 1, |
|
81 |
+ "initialDelaySeconds": 5, |
|
82 |
+ "exec": { |
|
83 |
+ "command": [ "/bin/sh", "-i", "-c", |
|
84 |
+ "MYSQL_PWD=\"$MYSQL_PASSWORD\" mysql -h 127.0.0.1 -u $MYSQL_USER -D $MYSQL_DATABASE -e 'SELECT 1'"] |
|
85 |
+ } |
|
86 |
+ }, |
|
87 |
+ "livenessProbe": { |
|
88 |
+ "timeoutSeconds": 1, |
|
89 |
+ "initialDelaySeconds": 30, |
|
90 |
+ "tcpSocket": { |
|
91 |
+ "port": 3306 |
|
92 |
+ } |
|
93 |
+ }, |
|
94 |
+ "env": [ |
|
95 |
+ { |
|
96 |
+ "name": "MYSQL_USER", |
|
97 |
+ "value": "${MYSQL_USER}" |
|
98 |
+ }, |
|
99 |
+ { |
|
100 |
+ "name": "MYSQL_PASSWORD", |
|
101 |
+ "value": "${MYSQL_PASSWORD}" |
|
102 |
+ }, |
|
103 |
+ { |
|
104 |
+ "name": "MYSQL_DATABASE", |
|
105 |
+ "value": "${MYSQL_DATABASE}" |
|
106 |
+ } |
|
107 |
+ ], |
|
108 |
+ "resources": { |
|
109 |
+ "limits": { |
|
110 |
+ "memory": "${MEMORY_LIMIT}" |
|
111 |
+ } |
|
112 |
+ }, |
|
113 |
+ "volumeMounts": [ |
|
114 |
+ { |
|
115 |
+ "name": "${DATABASE_SERVICE_NAME}-data", |
|
116 |
+ "mountPath": "/var/lib/mysql/data" |
|
117 |
+ } |
|
118 |
+ ], |
|
119 |
+ "imagePullPolicy": "IfNotPresent" |
|
120 |
+ } |
|
121 |
+ ], |
|
122 |
+ "volumes": [ |
|
123 |
+ { |
|
124 |
+ "name": "${DATABASE_SERVICE_NAME}-data", |
|
125 |
+ "emptyDir": { |
|
126 |
+ "medium": "" |
|
127 |
+ } |
|
128 |
+ } |
|
129 |
+ ] |
|
130 |
+ } |
|
131 |
+ } |
|
132 |
+ } |
|
133 |
+ } |
|
134 |
+ ], |
|
135 |
+ "parameters": [ |
|
136 |
+ { |
|
137 |
+ "name": "MEMORY_LIMIT", |
|
138 |
+ "displayName": "Memory Limit", |
|
139 |
+ "description": "Maximum amount of memory the container can use.", |
|
140 |
+ "value": "512Mi", |
|
141 |
+ "required": true |
|
142 |
+ }, |
|
143 |
+ { |
|
144 |
+ "name": "NAMESPACE", |
|
145 |
+ "displayName": "Namespace", |
|
146 |
+ "description": "The OpenShift Namespace where the ImageStream resides.", |
|
147 |
+ "value": "openshift" |
|
148 |
+ }, |
|
149 |
+ { |
|
150 |
+ "name": "DATABASE_SERVICE_NAME", |
|
151 |
+ "displayName": "Database Service Name", |
|
152 |
+ "description": "The name of the OpenShift Service exposed for the database.", |
|
153 |
+ "value": "mariadb", |
|
154 |
+ "required": true |
|
155 |
+ }, |
|
156 |
+ { |
|
157 |
+ "name": "MYSQL_USER", |
|
158 |
+ "displayName": "MySQL User", |
|
159 |
+ "description": "Username for MariaDB user that will be used for accessing the database.", |
|
160 |
+ "generate": "expression", |
|
161 |
+ "from": "user[A-Z0-9]{3}", |
|
162 |
+ "required": true |
|
163 |
+ }, |
|
164 |
+ { |
|
165 |
+ "name": "MYSQL_PASSWORD", |
|
166 |
+ "displayName": "MySQL Password", |
|
167 |
+ "description": "Password for the MariaDB user.", |
|
168 |
+ "generate": "expression", |
|
169 |
+ "from": "[a-zA-Z0-9]{16}", |
|
170 |
+ "required": true |
|
171 |
+ }, |
|
172 |
+ { |
|
173 |
+ "name": "MYSQL_DATABASE", |
|
174 |
+ "displayName": "MySQL Database Name", |
|
175 |
+ "description": "Name of the MariaDB database accessed.", |
|
176 |
+ "value": "sampledb", |
|
177 |
+ "required": true |
|
178 |
+ } |
|
179 |
+ ], |
|
180 |
+ "labels": { |
|
181 |
+ "template": "mariadb-persistent-template" |
|
182 |
+ } |
|
183 |
+} |
0 | 184 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,208 @@ |
0 |
+{ |
|
1 |
+ "kind": "Template", |
|
2 |
+ "apiVersion": "v1", |
|
3 |
+ "metadata": { |
|
4 |
+ "name": "mariadb-persistent", |
|
5 |
+ "annotations": { |
|
6 |
+ "description": "MariaDB database service, with persistent storage. Scaling to more than one replica is not supported. You must have persistent volumes available in your cluster to use this template.", |
|
7 |
+ "iconClass": "icon-mariadb", |
|
8 |
+ "tags": "database,mariadb" |
|
9 |
+ } |
|
10 |
+ }, |
|
11 |
+ "objects": [ |
|
12 |
+ { |
|
13 |
+ "kind": "Service", |
|
14 |
+ "apiVersion": "v1", |
|
15 |
+ "metadata": { |
|
16 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
17 |
+ }, |
|
18 |
+ "spec": { |
|
19 |
+ "ports": [ |
|
20 |
+ { |
|
21 |
+ "name": "mariadb", |
|
22 |
+ "port": 3306 |
|
23 |
+ } |
|
24 |
+ ], |
|
25 |
+ "selector": { |
|
26 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
27 |
+ } |
|
28 |
+ } |
|
29 |
+ }, |
|
30 |
+ { |
|
31 |
+ "kind": "PersistentVolumeClaim", |
|
32 |
+ "apiVersion": "v1", |
|
33 |
+ "metadata": { |
|
34 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
35 |
+ }, |
|
36 |
+ "spec": { |
|
37 |
+ "accessModes": [ |
|
38 |
+ "ReadWriteOnce" |
|
39 |
+ ], |
|
40 |
+ "resources": { |
|
41 |
+ "requests": { |
|
42 |
+ "storage": "${VOLUME_CAPACITY}" |
|
43 |
+ } |
|
44 |
+ } |
|
45 |
+ } |
|
46 |
+ }, |
|
47 |
+ { |
|
48 |
+ "kind": "DeploymentConfig", |
|
49 |
+ "apiVersion": "v1", |
|
50 |
+ "metadata": { |
|
51 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
52 |
+ }, |
|
53 |
+ "spec": { |
|
54 |
+ "strategy": { |
|
55 |
+ "type": "Recreate" |
|
56 |
+ }, |
|
57 |
+ "triggers": [ |
|
58 |
+ { |
|
59 |
+ "type": "ImageChange", |
|
60 |
+ "imageChangeParams": { |
|
61 |
+ "automatic": true, |
|
62 |
+ "containerNames": [ |
|
63 |
+ "mariadb" |
|
64 |
+ ], |
|
65 |
+ "from": { |
|
66 |
+ "kind": "ImageStreamTag", |
|
67 |
+ "name": "mariadb:10.1", |
|
68 |
+ "namespace": "${NAMESPACE}" |
|
69 |
+ } |
|
70 |
+ } |
|
71 |
+ }, |
|
72 |
+ { |
|
73 |
+ "type": "ConfigChange" |
|
74 |
+ } |
|
75 |
+ ], |
|
76 |
+ "replicas": 1, |
|
77 |
+ "selector": { |
|
78 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
79 |
+ }, |
|
80 |
+ "template": { |
|
81 |
+ "metadata": { |
|
82 |
+ "labels": { |
|
83 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
84 |
+ } |
|
85 |
+ }, |
|
86 |
+ "spec": { |
|
87 |
+ "containers": [ |
|
88 |
+ { |
|
89 |
+ "name": "mariadb", |
|
90 |
+ "image": " ", |
|
91 |
+ "ports": [ |
|
92 |
+ { |
|
93 |
+ "containerPort": 3306 |
|
94 |
+ } |
|
95 |
+ ], |
|
96 |
+ "readinessProbe": { |
|
97 |
+ "timeoutSeconds": 1, |
|
98 |
+ "initialDelaySeconds": 5, |
|
99 |
+ "exec": { |
|
100 |
+ "command": [ "/bin/sh", "-i", "-c", |
|
101 |
+ "MYSQL_PWD=\"$MYSQL_PASSWORD\" mysql -h 127.0.0.1 -u $MYSQL_USER -D $MYSQL_DATABASE -e 'SELECT 1'"] |
|
102 |
+ } |
|
103 |
+ }, |
|
104 |
+ "livenessProbe": { |
|
105 |
+ "timeoutSeconds": 1, |
|
106 |
+ "initialDelaySeconds": 30, |
|
107 |
+ "tcpSocket": { |
|
108 |
+ "port": 3306 |
|
109 |
+ } |
|
110 |
+ }, |
|
111 |
+ "env": [ |
|
112 |
+ { |
|
113 |
+ "name": "MYSQL_USER", |
|
114 |
+ "value": "${MYSQL_USER}" |
|
115 |
+ }, |
|
116 |
+ { |
|
117 |
+ "name": "MYSQL_PASSWORD", |
|
118 |
+ "value": "${MYSQL_PASSWORD}" |
|
119 |
+ }, |
|
120 |
+ { |
|
121 |
+ "name": "MYSQL_DATABASE", |
|
122 |
+ "value": "${MYSQL_DATABASE}" |
|
123 |
+ } |
|
124 |
+ ], |
|
125 |
+ "resources": { |
|
126 |
+ "limits": { |
|
127 |
+ "memory": "${MEMORY_LIMIT}" |
|
128 |
+ } |
|
129 |
+ }, |
|
130 |
+ "volumeMounts": [ |
|
131 |
+ { |
|
132 |
+ "name": "${DATABASE_SERVICE_NAME}-data", |
|
133 |
+ "mountPath": "/var/lib/mysql/data" |
|
134 |
+ } |
|
135 |
+ ], |
|
136 |
+ "imagePullPolicy": "IfNotPresent" |
|
137 |
+ } |
|
138 |
+ ], |
|
139 |
+ "volumes": [ |
|
140 |
+ { |
|
141 |
+ "name": "${DATABASE_SERVICE_NAME}-data", |
|
142 |
+ "persistentVolumeClaim": { |
|
143 |
+ "claimName": "${DATABASE_SERVICE_NAME}" |
|
144 |
+ } |
|
145 |
+ } |
|
146 |
+ ] |
|
147 |
+ } |
|
148 |
+ } |
|
149 |
+ } |
|
150 |
+ } |
|
151 |
+ ], |
|
152 |
+ "parameters": [ |
|
153 |
+ { |
|
154 |
+ "name": "MEMORY_LIMIT", |
|
155 |
+ "displayName": "Memory Limit", |
|
156 |
+ "description": "Maximum amount of memory the container can use.", |
|
157 |
+ "value": "512Mi", |
|
158 |
+ "required": true |
|
159 |
+ }, |
|
160 |
+ { |
|
161 |
+ "name": "NAMESPACE", |
|
162 |
+ "displayName": "Namespace", |
|
163 |
+ "description": "The OpenShift Namespace where the ImageStream resides.", |
|
164 |
+ "value": "openshift" |
|
165 |
+ }, |
|
166 |
+ { |
|
167 |
+ "name": "DATABASE_SERVICE_NAME", |
|
168 |
+ "displayName": "Database Service Name", |
|
169 |
+ "description": "The name of the OpenShift Service exposed for the database.", |
|
170 |
+ "value": "mariadb", |
|
171 |
+ "required": true |
|
172 |
+ }, |
|
173 |
+ { |
|
174 |
+ "name": "MYSQL_USER", |
|
175 |
+ "displayName": "MySQL User", |
|
176 |
+ "description": "Username for MariaDB user that will be used for accessing the database.", |
|
177 |
+ "generate": "expression", |
|
178 |
+ "from": "user[A-Z0-9]{3}", |
|
179 |
+ "required": true |
|
180 |
+ }, |
|
181 |
+ { |
|
182 |
+ "name": "MYSQL_PASSWORD", |
|
183 |
+ "displayName": "MySQL Password", |
|
184 |
+ "description": "Password for the MariaDB user.", |
|
185 |
+ "generate": "expression", |
|
186 |
+ "from": "[a-zA-Z0-9]{16}", |
|
187 |
+ "required": true |
|
188 |
+ }, |
|
189 |
+ { |
|
190 |
+ "name": "MYSQL_DATABASE", |
|
191 |
+ "displayName": "MySQL Database Name", |
|
192 |
+ "description": "Name of the MariaDB database accessed.", |
|
193 |
+ "value": "sampledb", |
|
194 |
+ "required": true |
|
195 |
+ }, |
|
196 |
+ { |
|
197 |
+ "name": "VOLUME_CAPACITY", |
|
198 |
+ "displayName": "Volume Capacity", |
|
199 |
+ "description": "Volume space available for data, e.g. 512Mi, 2Gi.", |
|
200 |
+ "value": "1Gi", |
|
201 |
+ "required": true |
|
202 |
+ } |
|
203 |
+ ], |
|
204 |
+ "labels": { |
|
205 |
+ "template": "mariadb-persistent-template" |
|
206 |
+ } |
|
207 |
+} |
... | ... |
@@ -3,7 +3,6 @@ |
3 | 3 |
"apiVersion": "v1", |
4 | 4 |
"metadata": { |
5 | 5 |
"name": "mysql-ephemeral", |
6 |
- "creationTimestamp": null, |
|
7 | 6 |
"annotations": { |
8 | 7 |
"description": "MySQL database service, without persistent storage. WARNING: Any data stored will be lost upon pod destruction. Only use this template for testing", |
9 | 8 |
"iconClass": "icon-mysql-database", |
... | ... |
@@ -60,7 +59,7 @@ |
60 | 60 |
], |
61 | 61 |
"from": { |
62 | 62 |
"kind": "ImageStreamTag", |
63 |
- "name": "mysql:latest", |
|
63 |
+ "name": "mysql:5.6", |
|
64 | 64 |
"namespace": "${NAMESPACE}" |
65 | 65 |
}, |
66 | 66 |
"lastTriggeredImage": "" |
... | ... |
@@ -122,10 +121,10 @@ |
122 | 122 |
} |
123 | 123 |
], |
124 | 124 |
"resources": { |
125 |
- "limits": { |
|
126 |
- "memory": "${MEMORY_LIMIT}" |
|
127 |
- } |
|
128 |
- }, |
|
125 |
+ "limits": { |
|
126 |
+ "memory": "${MEMORY_LIMIT}" |
|
127 |
+ } |
|
128 |
+ }, |
|
129 | 129 |
"volumeMounts": [ |
130 | 130 |
{ |
131 | 131 |
"name": "${DATABASE_SERVICE_NAME}-data", |
... | ... |
@@ -60,7 +60,7 @@ |
60 | 60 |
], |
61 | 61 |
"from": { |
62 | 62 |
"kind": "ImageStreamTag", |
63 |
- "name": "postgresql:latest", |
|
63 |
+ "name": "postgresql:9.4", |
|
64 | 64 |
"namespace": "${NAMESPACE}" |
65 | 65 |
}, |
66 | 66 |
"lastTriggeredImage": "" |
... | ... |
@@ -121,10 +121,10 @@ |
121 | 121 |
} |
122 | 122 |
], |
123 | 123 |
"resources": { |
124 |
- "limits": { |
|
125 |
- "memory": "${MEMORY_LIMIT}" |
|
126 |
- } |
|
127 |
- }, |
|
124 |
+ "limits": { |
|
125 |
+ "memory": "${MEMORY_LIMIT}" |
|
126 |
+ } |
|
127 |
+ }, |
|
128 | 128 |
"volumeMounts": [ |
129 | 129 |
{ |
130 | 130 |
"name": "${DATABASE_SERVICE_NAME}-data", |
... | ... |
@@ -100,9 +100,11 @@ func TestExampleObjectSchemas(t *testing.T) { |
100 | 100 |
"mysql-persistent-template": &templateapi.Template{}, |
101 | 101 |
"postgresql-persistent-template": &templateapi.Template{}, |
102 | 102 |
"mongodb-persistent-template": &templateapi.Template{}, |
103 |
+ "mariadb-persistent-template": &templateapi.Template{}, |
|
103 | 104 |
"mysql-ephemeral-template": &templateapi.Template{}, |
104 | 105 |
"postgresql-ephemeral-template": &templateapi.Template{}, |
105 | 106 |
"mongodb-ephemeral-template": &templateapi.Template{}, |
107 |
+ "mariadb-ephemeral-template": &templateapi.Template{}, |
|
106 | 108 |
}, |
107 | 109 |
"../test/extended/testdata/ldap": { |
108 | 110 |
"ldapserver-buildconfig": &buildapi.BuildConfig{}, |
... | ... |
@@ -2,6 +2,8 @@ |
2 | 2 |
// sources: |
3 | 3 |
// examples/image-streams/image-streams-centos7.json |
4 | 4 |
// examples/image-streams/image-streams-rhel7.json |
5 |
+// examples/db-templates/mariadb-ephemeral-template.json |
|
6 |
+// examples/db-templates/mariadb-persistent-template.json |
|
5 | 7 |
// examples/db-templates/mongodb-ephemeral-template.json |
6 | 8 |
// examples/db-templates/mongodb-persistent-template.json |
7 | 9 |
// examples/db-templates/mysql-ephemeral-template.json |
... | ... |
@@ -1308,6 +1310,432 @@ func examplesImageStreamsImageStreamsRhel7Json() (*asset, error) { |
1308 | 1308 |
return a, nil |
1309 | 1309 |
} |
1310 | 1310 |
|
1311 |
+var _examplesDbTemplatesMariadbEphemeralTemplateJson = []byte(`{ |
|
1312 |
+ "kind": "Template", |
|
1313 |
+ "apiVersion": "v1", |
|
1314 |
+ "metadata": { |
|
1315 |
+ "name": "mariadb-ephemeral", |
|
1316 |
+ "annotations": { |
|
1317 |
+ "description": "MariaDB database service, without persistent storage. WARNING: Any data stored will be lost upon pod destruction. Only use this template for testing", |
|
1318 |
+ "iconClass": "icon-mariadb", |
|
1319 |
+ "tags": "database,mariadb" |
|
1320 |
+ } |
|
1321 |
+ }, |
|
1322 |
+ "objects": [ |
|
1323 |
+ { |
|
1324 |
+ "kind": "Service", |
|
1325 |
+ "apiVersion": "v1", |
|
1326 |
+ "metadata": { |
|
1327 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
1328 |
+ }, |
|
1329 |
+ "spec": { |
|
1330 |
+ "ports": [ |
|
1331 |
+ { |
|
1332 |
+ "name": "mariadb", |
|
1333 |
+ "port": 3306 |
|
1334 |
+ } |
|
1335 |
+ ], |
|
1336 |
+ "selector": { |
|
1337 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
1338 |
+ } |
|
1339 |
+ } |
|
1340 |
+ }, |
|
1341 |
+ { |
|
1342 |
+ "kind": "DeploymentConfig", |
|
1343 |
+ "apiVersion": "v1", |
|
1344 |
+ "metadata": { |
|
1345 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
1346 |
+ }, |
|
1347 |
+ "spec": { |
|
1348 |
+ "strategy": { |
|
1349 |
+ "type": "Recreate" |
|
1350 |
+ }, |
|
1351 |
+ "triggers": [ |
|
1352 |
+ { |
|
1353 |
+ "type": "ImageChange", |
|
1354 |
+ "imageChangeParams": { |
|
1355 |
+ "automatic": true, |
|
1356 |
+ "containerNames": [ |
|
1357 |
+ "mariadb" |
|
1358 |
+ ], |
|
1359 |
+ "from": { |
|
1360 |
+ "kind": "ImageStreamTag", |
|
1361 |
+ "name": "mariadb:10.1", |
|
1362 |
+ "namespace": "${NAMESPACE}" |
|
1363 |
+ } |
|
1364 |
+ } |
|
1365 |
+ }, |
|
1366 |
+ { |
|
1367 |
+ "type": "ConfigChange" |
|
1368 |
+ } |
|
1369 |
+ ], |
|
1370 |
+ "replicas": 1, |
|
1371 |
+ "selector": { |
|
1372 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
1373 |
+ }, |
|
1374 |
+ "template": { |
|
1375 |
+ "metadata": { |
|
1376 |
+ "labels": { |
|
1377 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
1378 |
+ } |
|
1379 |
+ }, |
|
1380 |
+ "spec": { |
|
1381 |
+ "containers": [ |
|
1382 |
+ { |
|
1383 |
+ "name": "mariadb", |
|
1384 |
+ "image": " ", |
|
1385 |
+ "ports": [ |
|
1386 |
+ { |
|
1387 |
+ "containerPort": 3306 |
|
1388 |
+ } |
|
1389 |
+ ], |
|
1390 |
+ "readinessProbe": { |
|
1391 |
+ "timeoutSeconds": 1, |
|
1392 |
+ "initialDelaySeconds": 5, |
|
1393 |
+ "exec": { |
|
1394 |
+ "command": [ "/bin/sh", "-i", "-c", |
|
1395 |
+ "MYSQL_PWD=\"$MYSQL_PASSWORD\" mysql -h 127.0.0.1 -u $MYSQL_USER -D $MYSQL_DATABASE -e 'SELECT 1'"] |
|
1396 |
+ } |
|
1397 |
+ }, |
|
1398 |
+ "livenessProbe": { |
|
1399 |
+ "timeoutSeconds": 1, |
|
1400 |
+ "initialDelaySeconds": 30, |
|
1401 |
+ "tcpSocket": { |
|
1402 |
+ "port": 3306 |
|
1403 |
+ } |
|
1404 |
+ }, |
|
1405 |
+ "env": [ |
|
1406 |
+ { |
|
1407 |
+ "name": "MYSQL_USER", |
|
1408 |
+ "value": "${MYSQL_USER}" |
|
1409 |
+ }, |
|
1410 |
+ { |
|
1411 |
+ "name": "MYSQL_PASSWORD", |
|
1412 |
+ "value": "${MYSQL_PASSWORD}" |
|
1413 |
+ }, |
|
1414 |
+ { |
|
1415 |
+ "name": "MYSQL_DATABASE", |
|
1416 |
+ "value": "${MYSQL_DATABASE}" |
|
1417 |
+ } |
|
1418 |
+ ], |
|
1419 |
+ "resources": { |
|
1420 |
+ "limits": { |
|
1421 |
+ "memory": "${MEMORY_LIMIT}" |
|
1422 |
+ } |
|
1423 |
+ }, |
|
1424 |
+ "volumeMounts": [ |
|
1425 |
+ { |
|
1426 |
+ "name": "${DATABASE_SERVICE_NAME}-data", |
|
1427 |
+ "mountPath": "/var/lib/mysql/data" |
|
1428 |
+ } |
|
1429 |
+ ], |
|
1430 |
+ "imagePullPolicy": "IfNotPresent" |
|
1431 |
+ } |
|
1432 |
+ ], |
|
1433 |
+ "volumes": [ |
|
1434 |
+ { |
|
1435 |
+ "name": "${DATABASE_SERVICE_NAME}-data", |
|
1436 |
+ "emptyDir": { |
|
1437 |
+ "medium": "" |
|
1438 |
+ } |
|
1439 |
+ } |
|
1440 |
+ ] |
|
1441 |
+ } |
|
1442 |
+ } |
|
1443 |
+ } |
|
1444 |
+ } |
|
1445 |
+ ], |
|
1446 |
+ "parameters": [ |
|
1447 |
+ { |
|
1448 |
+ "name": "MEMORY_LIMIT", |
|
1449 |
+ "displayName": "Memory Limit", |
|
1450 |
+ "description": "Maximum amount of memory the container can use.", |
|
1451 |
+ "value": "512Mi", |
|
1452 |
+ "required": true |
|
1453 |
+ }, |
|
1454 |
+ { |
|
1455 |
+ "name": "NAMESPACE", |
|
1456 |
+ "displayName": "Namespace", |
|
1457 |
+ "description": "The OpenShift Namespace where the ImageStream resides.", |
|
1458 |
+ "value": "openshift" |
|
1459 |
+ }, |
|
1460 |
+ { |
|
1461 |
+ "name": "DATABASE_SERVICE_NAME", |
|
1462 |
+ "displayName": "Database Service Name", |
|
1463 |
+ "description": "The name of the OpenShift Service exposed for the database.", |
|
1464 |
+ "value": "mariadb", |
|
1465 |
+ "required": true |
|
1466 |
+ }, |
|
1467 |
+ { |
|
1468 |
+ "name": "MYSQL_USER", |
|
1469 |
+ "displayName": "MySQL User", |
|
1470 |
+ "description": "Username for MariaDB user that will be used for accessing the database.", |
|
1471 |
+ "generate": "expression", |
|
1472 |
+ "from": "user[A-Z0-9]{3}", |
|
1473 |
+ "required": true |
|
1474 |
+ }, |
|
1475 |
+ { |
|
1476 |
+ "name": "MYSQL_PASSWORD", |
|
1477 |
+ "displayName": "MySQL Password", |
|
1478 |
+ "description": "Password for the MariaDB user.", |
|
1479 |
+ "generate": "expression", |
|
1480 |
+ "from": "[a-zA-Z0-9]{16}", |
|
1481 |
+ "required": true |
|
1482 |
+ }, |
|
1483 |
+ { |
|
1484 |
+ "name": "MYSQL_DATABASE", |
|
1485 |
+ "displayName": "MySQL Database Name", |
|
1486 |
+ "description": "Name of the MariaDB database accessed.", |
|
1487 |
+ "value": "sampledb", |
|
1488 |
+ "required": true |
|
1489 |
+ } |
|
1490 |
+ ], |
|
1491 |
+ "labels": { |
|
1492 |
+ "template": "mariadb-persistent-template" |
|
1493 |
+ } |
|
1494 |
+} |
|
1495 |
+`) |
|
1496 |
+ |
|
1497 |
+func examplesDbTemplatesMariadbEphemeralTemplateJsonBytes() ([]byte, error) { |
|
1498 |
+ return _examplesDbTemplatesMariadbEphemeralTemplateJson, nil |
|
1499 |
+} |
|
1500 |
+ |
|
1501 |
+func examplesDbTemplatesMariadbEphemeralTemplateJson() (*asset, error) { |
|
1502 |
+ bytes, err := examplesDbTemplatesMariadbEphemeralTemplateJsonBytes() |
|
1503 |
+ if err != nil { |
|
1504 |
+ return nil, err |
|
1505 |
+ } |
|
1506 |
+ |
|
1507 |
+ info := bindataFileInfo{name: "examples/db-templates/mariadb-ephemeral-template.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} |
|
1508 |
+ a := &asset{bytes: bytes, info: info} |
|
1509 |
+ return a, nil |
|
1510 |
+} |
|
1511 |
+ |
|
1512 |
+var _examplesDbTemplatesMariadbPersistentTemplateJson = []byte(`{ |
|
1513 |
+ "kind": "Template", |
|
1514 |
+ "apiVersion": "v1", |
|
1515 |
+ "metadata": { |
|
1516 |
+ "name": "mariadb-persistent", |
|
1517 |
+ "annotations": { |
|
1518 |
+ "description": "MariaDB database service, with persistent storage. Scaling to more than one replica is not supported. You must have persistent volumes available in your cluster to use this template.", |
|
1519 |
+ "iconClass": "icon-mariadb", |
|
1520 |
+ "tags": "database,mariadb" |
|
1521 |
+ } |
|
1522 |
+ }, |
|
1523 |
+ "objects": [ |
|
1524 |
+ { |
|
1525 |
+ "kind": "Service", |
|
1526 |
+ "apiVersion": "v1", |
|
1527 |
+ "metadata": { |
|
1528 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
1529 |
+ }, |
|
1530 |
+ "spec": { |
|
1531 |
+ "ports": [ |
|
1532 |
+ { |
|
1533 |
+ "name": "mariadb", |
|
1534 |
+ "port": 3306 |
|
1535 |
+ } |
|
1536 |
+ ], |
|
1537 |
+ "selector": { |
|
1538 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
1539 |
+ } |
|
1540 |
+ } |
|
1541 |
+ }, |
|
1542 |
+ { |
|
1543 |
+ "kind": "PersistentVolumeClaim", |
|
1544 |
+ "apiVersion": "v1", |
|
1545 |
+ "metadata": { |
|
1546 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
1547 |
+ }, |
|
1548 |
+ "spec": { |
|
1549 |
+ "accessModes": [ |
|
1550 |
+ "ReadWriteOnce" |
|
1551 |
+ ], |
|
1552 |
+ "resources": { |
|
1553 |
+ "requests": { |
|
1554 |
+ "storage": "${VOLUME_CAPACITY}" |
|
1555 |
+ } |
|
1556 |
+ } |
|
1557 |
+ } |
|
1558 |
+ }, |
|
1559 |
+ { |
|
1560 |
+ "kind": "DeploymentConfig", |
|
1561 |
+ "apiVersion": "v1", |
|
1562 |
+ "metadata": { |
|
1563 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
1564 |
+ }, |
|
1565 |
+ "spec": { |
|
1566 |
+ "strategy": { |
|
1567 |
+ "type": "Recreate" |
|
1568 |
+ }, |
|
1569 |
+ "triggers": [ |
|
1570 |
+ { |
|
1571 |
+ "type": "ImageChange", |
|
1572 |
+ "imageChangeParams": { |
|
1573 |
+ "automatic": true, |
|
1574 |
+ "containerNames": [ |
|
1575 |
+ "mariadb" |
|
1576 |
+ ], |
|
1577 |
+ "from": { |
|
1578 |
+ "kind": "ImageStreamTag", |
|
1579 |
+ "name": "mariadb:10.1", |
|
1580 |
+ "namespace": "${NAMESPACE}" |
|
1581 |
+ } |
|
1582 |
+ } |
|
1583 |
+ }, |
|
1584 |
+ { |
|
1585 |
+ "type": "ConfigChange" |
|
1586 |
+ } |
|
1587 |
+ ], |
|
1588 |
+ "replicas": 1, |
|
1589 |
+ "selector": { |
|
1590 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
1591 |
+ }, |
|
1592 |
+ "template": { |
|
1593 |
+ "metadata": { |
|
1594 |
+ "labels": { |
|
1595 |
+ "name": "${DATABASE_SERVICE_NAME}" |
|
1596 |
+ } |
|
1597 |
+ }, |
|
1598 |
+ "spec": { |
|
1599 |
+ "containers": [ |
|
1600 |
+ { |
|
1601 |
+ "name": "mariadb", |
|
1602 |
+ "image": " ", |
|
1603 |
+ "ports": [ |
|
1604 |
+ { |
|
1605 |
+ "containerPort": 3306 |
|
1606 |
+ } |
|
1607 |
+ ], |
|
1608 |
+ "readinessProbe": { |
|
1609 |
+ "timeoutSeconds": 1, |
|
1610 |
+ "initialDelaySeconds": 5, |
|
1611 |
+ "exec": { |
|
1612 |
+ "command": [ "/bin/sh", "-i", "-c", |
|
1613 |
+ "MYSQL_PWD=\"$MYSQL_PASSWORD\" mysql -h 127.0.0.1 -u $MYSQL_USER -D $MYSQL_DATABASE -e 'SELECT 1'"] |
|
1614 |
+ } |
|
1615 |
+ }, |
|
1616 |
+ "livenessProbe": { |
|
1617 |
+ "timeoutSeconds": 1, |
|
1618 |
+ "initialDelaySeconds": 30, |
|
1619 |
+ "tcpSocket": { |
|
1620 |
+ "port": 3306 |
|
1621 |
+ } |
|
1622 |
+ }, |
|
1623 |
+ "env": [ |
|
1624 |
+ { |
|
1625 |
+ "name": "MYSQL_USER", |
|
1626 |
+ "value": "${MYSQL_USER}" |
|
1627 |
+ }, |
|
1628 |
+ { |
|
1629 |
+ "name": "MYSQL_PASSWORD", |
|
1630 |
+ "value": "${MYSQL_PASSWORD}" |
|
1631 |
+ }, |
|
1632 |
+ { |
|
1633 |
+ "name": "MYSQL_DATABASE", |
|
1634 |
+ "value": "${MYSQL_DATABASE}" |
|
1635 |
+ } |
|
1636 |
+ ], |
|
1637 |
+ "resources": { |
|
1638 |
+ "limits": { |
|
1639 |
+ "memory": "${MEMORY_LIMIT}" |
|
1640 |
+ } |
|
1641 |
+ }, |
|
1642 |
+ "volumeMounts": [ |
|
1643 |
+ { |
|
1644 |
+ "name": "${DATABASE_SERVICE_NAME}-data", |
|
1645 |
+ "mountPath": "/var/lib/mysql/data" |
|
1646 |
+ } |
|
1647 |
+ ], |
|
1648 |
+ "imagePullPolicy": "IfNotPresent" |
|
1649 |
+ } |
|
1650 |
+ ], |
|
1651 |
+ "volumes": [ |
|
1652 |
+ { |
|
1653 |
+ "name": "${DATABASE_SERVICE_NAME}-data", |
|
1654 |
+ "persistentVolumeClaim": { |
|
1655 |
+ "claimName": "${DATABASE_SERVICE_NAME}" |
|
1656 |
+ } |
|
1657 |
+ } |
|
1658 |
+ ] |
|
1659 |
+ } |
|
1660 |
+ } |
|
1661 |
+ } |
|
1662 |
+ } |
|
1663 |
+ ], |
|
1664 |
+ "parameters": [ |
|
1665 |
+ { |
|
1666 |
+ "name": "MEMORY_LIMIT", |
|
1667 |
+ "displayName": "Memory Limit", |
|
1668 |
+ "description": "Maximum amount of memory the container can use.", |
|
1669 |
+ "value": "512Mi", |
|
1670 |
+ "required": true |
|
1671 |
+ }, |
|
1672 |
+ { |
|
1673 |
+ "name": "NAMESPACE", |
|
1674 |
+ "displayName": "Namespace", |
|
1675 |
+ "description": "The OpenShift Namespace where the ImageStream resides.", |
|
1676 |
+ "value": "openshift" |
|
1677 |
+ }, |
|
1678 |
+ { |
|
1679 |
+ "name": "DATABASE_SERVICE_NAME", |
|
1680 |
+ "displayName": "Database Service Name", |
|
1681 |
+ "description": "The name of the OpenShift Service exposed for the database.", |
|
1682 |
+ "value": "mariadb", |
|
1683 |
+ "required": true |
|
1684 |
+ }, |
|
1685 |
+ { |
|
1686 |
+ "name": "MYSQL_USER", |
|
1687 |
+ "displayName": "MySQL User", |
|
1688 |
+ "description": "Username for MariaDB user that will be used for accessing the database.", |
|
1689 |
+ "generate": "expression", |
|
1690 |
+ "from": "user[A-Z0-9]{3}", |
|
1691 |
+ "required": true |
|
1692 |
+ }, |
|
1693 |
+ { |
|
1694 |
+ "name": "MYSQL_PASSWORD", |
|
1695 |
+ "displayName": "MySQL Password", |
|
1696 |
+ "description": "Password for the MariaDB user.", |
|
1697 |
+ "generate": "expression", |
|
1698 |
+ "from": "[a-zA-Z0-9]{16}", |
|
1699 |
+ "required": true |
|
1700 |
+ }, |
|
1701 |
+ { |
|
1702 |
+ "name": "MYSQL_DATABASE", |
|
1703 |
+ "displayName": "MySQL Database Name", |
|
1704 |
+ "description": "Name of the MariaDB database accessed.", |
|
1705 |
+ "value": "sampledb", |
|
1706 |
+ "required": true |
|
1707 |
+ }, |
|
1708 |
+ { |
|
1709 |
+ "name": "VOLUME_CAPACITY", |
|
1710 |
+ "displayName": "Volume Capacity", |
|
1711 |
+ "description": "Volume space available for data, e.g. 512Mi, 2Gi.", |
|
1712 |
+ "value": "1Gi", |
|
1713 |
+ "required": true |
|
1714 |
+ } |
|
1715 |
+ ], |
|
1716 |
+ "labels": { |
|
1717 |
+ "template": "mariadb-persistent-template" |
|
1718 |
+ } |
|
1719 |
+} |
|
1720 |
+`) |
|
1721 |
+ |
|
1722 |
+func examplesDbTemplatesMariadbPersistentTemplateJsonBytes() ([]byte, error) { |
|
1723 |
+ return _examplesDbTemplatesMariadbPersistentTemplateJson, nil |
|
1724 |
+} |
|
1725 |
+ |
|
1726 |
+func examplesDbTemplatesMariadbPersistentTemplateJson() (*asset, error) { |
|
1727 |
+ bytes, err := examplesDbTemplatesMariadbPersistentTemplateJsonBytes() |
|
1728 |
+ if err != nil { |
|
1729 |
+ return nil, err |
|
1730 |
+ } |
|
1731 |
+ |
|
1732 |
+ info := bindataFileInfo{name: "examples/db-templates/mariadb-persistent-template.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} |
|
1733 |
+ a := &asset{bytes: bytes, info: info} |
|
1734 |
+ return a, nil |
|
1735 |
+} |
|
1736 |
+ |
|
1311 | 1737 |
var _examplesDbTemplatesMongodbEphemeralTemplateJson = []byte(`{ |
1312 | 1738 |
"kind": "Template", |
1313 | 1739 |
"apiVersion": "v1", |
... | ... |
@@ -1370,7 +1798,7 @@ var _examplesDbTemplatesMongodbEphemeralTemplateJson = []byte(`{ |
1370 | 1370 |
], |
1371 | 1371 |
"from": { |
1372 | 1372 |
"kind": "ImageStreamTag", |
1373 |
- "name": "mongodb:latest", |
|
1373 |
+ "name": "mongodb:3.2", |
|
1374 | 1374 |
"namespace": "${NAMESPACE}" |
1375 | 1375 |
}, |
1376 | 1376 |
"lastTriggeredImage": "" |
... | ... |
@@ -1622,7 +2050,7 @@ var _examplesDbTemplatesMongodbPersistentTemplateJson = []byte(`{ |
1622 | 1622 |
], |
1623 | 1623 |
"from": { |
1624 | 1624 |
"kind": "ImageStreamTag", |
1625 |
- "name": "mongodb:latest", |
|
1625 |
+ "name": "mongodb:3.2", |
|
1626 | 1626 |
"namespace": "${NAMESPACE}" |
1627 | 1627 |
}, |
1628 | 1628 |
"lastTriggeredImage": "" |
... | ... |
@@ -1807,7 +2235,6 @@ var _examplesDbTemplatesMysqlEphemeralTemplateJson = []byte(`{ |
1807 | 1807 |
"apiVersion": "v1", |
1808 | 1808 |
"metadata": { |
1809 | 1809 |
"name": "mysql-ephemeral", |
1810 |
- "creationTimestamp": null, |
|
1811 | 1810 |
"annotations": { |
1812 | 1811 |
"description": "MySQL database service, without persistent storage. WARNING: Any data stored will be lost upon pod destruction. Only use this template for testing", |
1813 | 1812 |
"iconClass": "icon-mysql-database", |
... | ... |
@@ -1864,7 +2291,7 @@ var _examplesDbTemplatesMysqlEphemeralTemplateJson = []byte(`{ |
1864 | 1864 |
], |
1865 | 1865 |
"from": { |
1866 | 1866 |
"kind": "ImageStreamTag", |
1867 |
- "name": "mysql:latest", |
|
1867 |
+ "name": "mysql:5.6", |
|
1868 | 1868 |
"namespace": "${NAMESPACE}" |
1869 | 1869 |
}, |
1870 | 1870 |
"lastTriggeredImage": "" |
... | ... |
@@ -1926,10 +2353,10 @@ var _examplesDbTemplatesMysqlEphemeralTemplateJson = []byte(`{ |
1926 | 1926 |
} |
1927 | 1927 |
], |
1928 | 1928 |
"resources": { |
1929 |
- "limits": { |
|
1930 |
- "memory": "${MEMORY_LIMIT}" |
|
1931 |
- } |
|
1932 |
- }, |
|
1929 |
+ "limits": { |
|
1930 |
+ "memory": "${MEMORY_LIMIT}" |
|
1931 |
+ } |
|
1932 |
+ }, |
|
1933 | 1933 |
"volumeMounts": [ |
1934 | 1934 |
{ |
1935 | 1935 |
"name": "${DATABASE_SERVICE_NAME}-data", |
... | ... |
@@ -2093,7 +2520,7 @@ var _examplesDbTemplatesMysqlPersistentTemplateJson = []byte(`{ |
2093 | 2093 |
], |
2094 | 2094 |
"from": { |
2095 | 2095 |
"kind": "ImageStreamTag", |
2096 |
- "name": "mysql:latest", |
|
2096 |
+ "name": "mysql:5.6", |
|
2097 | 2097 |
"namespace": "${NAMESPACE}" |
2098 | 2098 |
} |
2099 | 2099 |
} |
... | ... |
@@ -2313,7 +2740,7 @@ var _examplesDbTemplatesPostgresqlEphemeralTemplateJson = []byte(`{ |
2313 | 2313 |
], |
2314 | 2314 |
"from": { |
2315 | 2315 |
"kind": "ImageStreamTag", |
2316 |
- "name": "postgresql:latest", |
|
2316 |
+ "name": "postgresql:9.4", |
|
2317 | 2317 |
"namespace": "${NAMESPACE}" |
2318 | 2318 |
}, |
2319 | 2319 |
"lastTriggeredImage": "" |
... | ... |
@@ -2374,10 +2801,10 @@ var _examplesDbTemplatesPostgresqlEphemeralTemplateJson = []byte(`{ |
2374 | 2374 |
} |
2375 | 2375 |
], |
2376 | 2376 |
"resources": { |
2377 |
- "limits": { |
|
2378 |
- "memory": "${MEMORY_LIMIT}" |
|
2379 |
- } |
|
2380 |
- }, |
|
2377 |
+ "limits": { |
|
2378 |
+ "memory": "${MEMORY_LIMIT}" |
|
2379 |
+ } |
|
2380 |
+ }, |
|
2381 | 2381 |
"volumeMounts": [ |
2382 | 2382 |
{ |
2383 | 2383 |
"name": "${DATABASE_SERVICE_NAME}-data", |
... | ... |
@@ -2553,7 +2980,7 @@ var _examplesDbTemplatesPostgresqlPersistentTemplateJson = []byte(`{ |
2553 | 2553 |
], |
2554 | 2554 |
"from": { |
2555 | 2555 |
"kind": "ImageStreamTag", |
2556 |
- "name": "postgresql:latest", |
|
2556 |
+ "name": "postgresql:9.4", |
|
2557 | 2557 |
"namespace": "${NAMESPACE}" |
2558 | 2558 |
}, |
2559 | 2559 |
"lastTriggeredImage": "" |
... | ... |
@@ -6073,6 +6500,8 @@ func AssetNames() []string { |
6073 | 6073 |
var _bindata = map[string]func() (*asset, error){ |
6074 | 6074 |
"examples/image-streams/image-streams-centos7.json": examplesImageStreamsImageStreamsCentos7Json, |
6075 | 6075 |
"examples/image-streams/image-streams-rhel7.json": examplesImageStreamsImageStreamsRhel7Json, |
6076 |
+ "examples/db-templates/mariadb-ephemeral-template.json": examplesDbTemplatesMariadbEphemeralTemplateJson, |
|
6077 |
+ "examples/db-templates/mariadb-persistent-template.json": examplesDbTemplatesMariadbPersistentTemplateJson, |
|
6076 | 6078 |
"examples/db-templates/mongodb-ephemeral-template.json": examplesDbTemplatesMongodbEphemeralTemplateJson, |
6077 | 6079 |
"examples/db-templates/mongodb-persistent-template.json": examplesDbTemplatesMongodbPersistentTemplateJson, |
6078 | 6080 |
"examples/db-templates/mysql-ephemeral-template.json": examplesDbTemplatesMysqlEphemeralTemplateJson, |
... | ... |
@@ -6130,6 +6559,10 @@ type bintree struct { |
6130 | 6130 |
var _bintree = &bintree{nil, map[string]*bintree{ |
6131 | 6131 |
"examples": &bintree{nil, map[string]*bintree{ |
6132 | 6132 |
"db-templates": &bintree{nil, map[string]*bintree{ |
6133 |
+ "mariadb-ephemeral-template.json": &bintree{examplesDbTemplatesMariadbEphemeralTemplateJson, map[string]*bintree{ |
|
6134 |
+ }}, |
|
6135 |
+ "mariadb-persistent-template.json": &bintree{examplesDbTemplatesMariadbPersistentTemplateJson, map[string]*bintree{ |
|
6136 |
+ }}, |
|
6133 | 6137 |
"mongodb-ephemeral-template.json": &bintree{examplesDbTemplatesMongodbEphemeralTemplateJson, map[string]*bintree{ |
6134 | 6138 |
}}, |
6135 | 6139 |
"mongodb-persistent-template.json": &bintree{examplesDbTemplatesMongodbPersistentTemplateJson, map[string]*bintree{ |
... | ... |
@@ -87,6 +87,7 @@ var ( |
87 | 87 |
} |
88 | 88 |
templateLocations = map[string]string{ |
89 | 89 |
"mongodb": "examples/db-templates/mongodb-ephemeral-template.json", |
90 |
+ "mariadb": "examples/db-templates/mariadb-ephemeral-template.json", |
|
90 | 91 |
"mysql": "examples/db-templates/mysql-ephemeral-template.json", |
91 | 92 |
"postgresql": "examples/db-templates/postgresql-ephemeral-template.json", |
92 | 93 |
"cakephp quickstart": "examples/quickstarts/cakephp-mysql.json", |
93 | 94 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,41 @@ |
0 |
+package images |
|
1 |
+ |
|
2 |
+import ( |
|
3 |
+ "fmt" |
|
4 |
+ |
|
5 |
+ g "github.com/onsi/ginkgo" |
|
6 |
+ o "github.com/onsi/gomega" |
|
7 |
+ |
|
8 |
+ exutil "github.com/openshift/origin/test/extended/util" |
|
9 |
+) |
|
10 |
+ |
|
11 |
+var _ = g.Describe("[images][mariadb][Slow] openshift mariadb image", func() { |
|
12 |
+ defer g.GinkgoRecover() |
|
13 |
+ var ( |
|
14 |
+ templatePath = exutil.FixturePath("..", "..", "examples", "db-templates", "mariadb-ephemeral-template.json") |
|
15 |
+ oc = exutil.NewCLI("mariadb-create", exutil.KubeConfigPath()) |
|
16 |
+ ) |
|
17 |
+ g.Describe("Creating from a template", func() { |
|
18 |
+ g.It(fmt.Sprintf("should process and create the %q template", templatePath), func() { |
|
19 |
+ oc.SetOutputDir(exutil.TestContext.OutputDir) |
|
20 |
+ |
|
21 |
+ g.By(fmt.Sprintf("calling oc process -f %q", templatePath)) |
|
22 |
+ configFile, err := oc.Run("process").Args("-f", templatePath).OutputToFile("config.json") |
|
23 |
+ o.Expect(err).NotTo(o.HaveOccurred()) |
|
24 |
+ |
|
25 |
+ g.By(fmt.Sprintf("calling oc create -f %q", configFile)) |
|
26 |
+ err = oc.Run("create").Args("-f", configFile).Execute() |
|
27 |
+ o.Expect(err).NotTo(o.HaveOccurred()) |
|
28 |
+ |
|
29 |
+ // oc.KubeFramework().WaitForAnEndpoint currently will wait forever; for now, prefacing with our WaitForADeploymentToComplete, |
|
30 |
+ // which does have a timeout, since in most cases a failure in the service coming up stems from a failed deployment |
|
31 |
+ err = exutil.WaitForADeploymentToComplete(oc.KubeREST().ReplicationControllers(oc.Namespace()), "mariadb", oc) |
|
32 |
+ o.Expect(err).NotTo(o.HaveOccurred()) |
|
33 |
+ |
|
34 |
+ g.By("expecting the mariadb service get endpoints") |
|
35 |
+ err = oc.KubeFramework().WaitForAnEndpoint("mariadb") |
|
36 |
+ o.Expect(err).NotTo(o.HaveOccurred()) |
|
37 |
+ }) |
|
38 |
+ }) |
|
39 |
+ |
|
40 |
+}) |