Added volume to mariadb in etherpad fixture

Volume constraint is missing in mariadb service
in etherpad example, so added that so that it mariadb container
does not fail in environments where creating container in
/var/lib/mysql is not allowed for non-root process.
This commit is contained in:
Suraj Deshmukh 2016-11-17 13:02:49 +05:30
parent 83c7a824dc
commit b99d5d9bbe
3 changed files with 256 additions and 188 deletions

View File

@ -10,6 +10,8 @@ services:
MYSQL_DATABASE: $DB_NAME MYSQL_DATABASE: $DB_NAME
MYSQL_PASSWORD: $DB_PASS MYSQL_PASSWORD: $DB_PASS
MYSQL_USER: $DB_USER MYSQL_USER: $DB_USER
volumes:
- /var/lib/mysql
etherpad: etherpad:
image: centos/etherpad image: centos/etherpad

View File

@ -4,59 +4,31 @@
"metadata": {}, "metadata": {},
"items": [ "items": [
{ {
"kind": "Deployment", "kind": "Service",
"apiVersion": "extensions/v1beta1", "apiVersion": "v1",
"metadata": { "metadata": {
"name": "mariadb", "name": "etherpad",
"creationTimestamp": null "creationTimestamp": null,
"labels": {
"service": "etherpad"
}
}, },
"spec": { "spec": {
"replicas": 1, "ports": [
"template": { {
"metadata": { "name": "80",
"creationTimestamp": null, "protocol": "TCP",
"labels": { "port": 80,
"service": "mariadb" "targetPort": 9001
}
},
"spec": {
"containers": [
{
"name": "mariadb",
"image": "centos/mariadb",
"ports": [
{
"containerPort": 3306,
"protocol": "TCP"
}
],
"env": [
{
"name": "MYSQL_DATABASE",
"value": "etherpad"
},
{
"name": "MYSQL_PASSWORD",
"value": "etherpad"
},
{
"name": "MYSQL_ROOT_PASSWORD",
"value": "etherpad"
},
{
"name": "MYSQL_USER",
"value": "etherpad"
}
],
"resources": {}
}
],
"restartPolicy": "Always"
} }
}, ],
"strategy": {} "selector": {
"service": "etherpad"
}
}, },
"status": {} "status": {
"loadBalancer": {}
}
}, },
{ {
"kind": "Service", "kind": "Service",
@ -113,10 +85,6 @@
} }
], ],
"env": [ "env": [
{
"name": "DB_USER",
"value": "etherpad"
},
{ {
"name": "DB_DBID", "name": "DB_DBID",
"value": "etherpad" "value": "etherpad"
@ -132,6 +100,10 @@
{ {
"name": "DB_PORT", "name": "DB_PORT",
"value": "3306" "value": "3306"
},
{
"name": "DB_USER",
"value": "etherpad"
} }
], ],
"resources": {} "resources": {}
@ -145,31 +117,92 @@
"status": {} "status": {}
}, },
{ {
"kind": "Service", "kind": "Deployment",
"apiVersion": "v1", "apiVersion": "extensions/v1beta1",
"metadata": { "metadata": {
"name": "etherpad", "name": "mariadb",
"creationTimestamp": null, "creationTimestamp": null
"labels": {
"service": "etherpad"
}
}, },
"spec": { "spec": {
"ports": [ "replicas": 1,
{ "template": {
"name": "80", "metadata": {
"protocol": "TCP", "creationTimestamp": null,
"port": 80, "labels": {
"targetPort": 9001 "service": "mariadb"
}
},
"spec": {
"volumes": [
{
"name": "mariadb-claim0",
"persistentVolumeClaim": {
"claimName": "mariadb-claim0"
}
}
],
"containers": [
{
"name": "mariadb",
"image": "centos/mariadb",
"ports": [
{
"containerPort": 3306,
"protocol": "TCP"
}
],
"env": [
{
"name": "MYSQL_DATABASE",
"value": "etherpad"
},
{
"name": "MYSQL_PASSWORD",
"value": "etherpad"
},
{
"name": "MYSQL_ROOT_PASSWORD",
"value": "etherpad"
},
{
"name": "MYSQL_USER",
"value": "etherpad"
}
],
"resources": {},
"volumeMounts": [
{
"name": "mariadb-claim0",
"mountPath": "/var/lib/mysql"
}
]
}
],
"restartPolicy": "Always"
} }
},
"strategy": {}
},
"status": {}
},
{
"kind": "PersistentVolumeClaim",
"apiVersion": "v1",
"metadata": {
"name": "mariadb-claim0",
"creationTimestamp": null
},
"spec": {
"accessModes": [
"ReadWriteOnce"
], ],
"selector": { "resources": {
"service": "etherpad" "requests": {
"storage": "100Mi"
}
} }
}, },
"status": { "status": {}
"loadBalancer": {}
}
} }
] ]
} }

View File

@ -3,33 +3,6 @@
"apiVersion": "v1", "apiVersion": "v1",
"metadata": {}, "metadata": {},
"items": [ "items": [
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "mariadb",
"creationTimestamp": null,
"labels": {
"service": "mariadb"
}
},
"spec": {
"ports": [
{
"name": "3306",
"protocol": "TCP",
"port": 3306,
"targetPort": 3306
}
],
"selector": {
"service": "mariadb"
}
},
"status": {
"loadBalancer": {}
}
},
{ {
"kind": "Service", "kind": "Service",
"apiVersion": "v1", "apiVersion": "v1",
@ -58,7 +31,7 @@
} }
}, },
{ {
"kind": "DeploymentConfig", "kind": "Service",
"apiVersion": "v1", "apiVersion": "v1",
"metadata": { "metadata": {
"name": "mariadb", "name": "mariadb",
@ -68,100 +41,20 @@
} }
}, },
"spec": { "spec": {
"strategy": { "ports": [
"resources": {}
},
"triggers": [
{ {
"type": "ConfigChange" "name": "3306",
}, "protocol": "TCP",
{ "port": 3306,
"type": "ImageChange", "targetPort": 3306
"imageChangeParams": {
"automatic": true,
"containerNames": [
"mariadb"
],
"from": {
"kind": "ImageStreamTag",
"name": "mariadb:latest"
}
}
} }
], ],
"replicas": 1,
"test": false,
"selector": { "selector": {
"service": "mariadb" "service": "mariadb"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"service": "mariadb"
}
},
"spec": {
"containers": [
{
"name": "mariadb",
"image": " ",
"ports": [
{
"containerPort": 3306,
"protocol": "TCP"
}
],
"env": [
{
"name": "MYSQL_DATABASE",
"value": "etherpad"
},
{
"name": "MYSQL_PASSWORD",
"value": "etherpad"
},
{
"name": "MYSQL_ROOT_PASSWORD",
"value": "etherpad"
},
{
"name": "MYSQL_USER",
"value": "etherpad"
}
],
"resources": {}
}
],
"restartPolicy": "Always"
}
} }
}, },
"status": {}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "mariadb",
"creationTimestamp": null
},
"spec": {
"tags": [
{
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
"name": "centos/mariadb"
},
"generation": null,
"importPolicy": {}
}
]
},
"status": { "status": {
"dockerImageRepository": "" "loadBalancer": {}
} }
}, },
{ {
@ -220,6 +113,10 @@
} }
], ],
"env": [ "env": [
{
"name": "DB_PORT",
"value": "3306"
},
{ {
"name": "DB_USER", "name": "DB_USER",
"value": "etherpad" "value": "etherpad"
@ -235,10 +132,6 @@
{ {
"name": "DB_PASS", "name": "DB_PASS",
"value": "etherpad" "value": "etherpad"
},
{
"name": "DB_PORT",
"value": "3306"
} }
], ],
"resources": {} "resources": {}
@ -274,6 +167,146 @@
"status": { "status": {
"dockerImageRepository": "" "dockerImageRepository": ""
} }
},
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "mariadb",
"creationTimestamp": null,
"labels": {
"service": "mariadb"
}
},
"spec": {
"strategy": {
"resources": {}
},
"triggers": [
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"mariadb"
],
"from": {
"kind": "ImageStreamTag",
"name": "mariadb:latest"
}
}
}
],
"replicas": 1,
"test": false,
"selector": {
"service": "mariadb"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"service": "mariadb"
}
},
"spec": {
"volumes": [
{
"name": "mariadb-claim0",
"persistentVolumeClaim": {
"claimName": "mariadb-claim0"
}
}
],
"containers": [
{
"name": "mariadb",
"image": " ",
"ports": [
{
"containerPort": 3306,
"protocol": "TCP"
}
],
"env": [
{
"name": "MYSQL_ROOT_PASSWORD",
"value": "etherpad"
},
{
"name": "MYSQL_USER",
"value": "etherpad"
},
{
"name": "MYSQL_DATABASE",
"value": "etherpad"
},
{
"name": "MYSQL_PASSWORD",
"value": "etherpad"
}
],
"resources": {},
"volumeMounts": [
{
"name": "mariadb-claim0",
"mountPath": "/var/lib/mysql"
}
]
}
],
"restartPolicy": "Always"
}
}
},
"status": {}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "mariadb",
"creationTimestamp": null
},
"spec": {
"tags": [
{
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
"name": "centos/mariadb"
},
"generation": null,
"importPolicy": {}
}
]
},
"status": {
"dockerImageRepository": ""
}
},
{
"kind": "PersistentVolumeClaim",
"apiVersion": "v1",
"metadata": {
"name": "mariadb-claim0",
"creationTimestamp": null
},
"spec": {
"accessModes": [
"ReadWriteOnce"
],
"resources": {
"requests": {
"storage": "100Mi"
}
}
},
"status": {}
} }
] ]
} }