Support group service by shared volumes (#1439)

Signed-off-by: Hang Yan <hang.yan@hotmail.com>
This commit is contained in:
Hang Yan
2021-10-03 23:07:41 +08:00
committed by GitHub
parent 5d7ed192a4
commit 72ea6a3c24
10 changed files with 357 additions and 109 deletions
+28
View File
@@ -0,0 +1,28 @@
version: "3.5"
services:
librenms:
image: librenms/librenms:latest
container_name: librenms
hostname: librenms
ports:
- target: 8000
published: 8000
protocol: tcp
volumes:
- "./librenms:/data"
environment:
- "TZ=${TZ}"
restart: always
dispatcher:
image: librenms/dispatcher:latest
container_name: dispatcher
hostname: dispatcher
depends_on:
- librenms
volumes:
- "./librenms:/data"
environment:
- "TZ=${TZ}"
restart: always
+137
View File
@@ -0,0 +1,137 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "librenms",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "librenms-dispatcher"
}
},
"spec": {
"ports": [
{
"name": "8000",
"port": 8000,
"targetPort": 8000
}
],
"selector": {
"io.kompose.service": "librenms-dispatcher"
}
},
"status": {
"loadBalancer": {}
}
},
{
"kind": "Deployment",
"apiVersion": "apps/v1",
"metadata": {
"name": "librenms-dispatcher",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "librenms-dispatcher"
}
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"io.kompose.service": "librenms-dispatcher"
}
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "librenms-dispatcher"
}
},
"spec": {
"volumes": [
{
"name": "librenms-dispatcher-claim0",
"persistentVolumeClaim": {
"claimName": "librenms-dispatcher-claim0"
}
}
],
"containers": [
{
"name": "librenms",
"image": "librenms/librenms:latest",
"ports": [
{
"containerPort": 8000
}
],
"env": [
{
"name": "TZ"
}
],
"resources": {},
"volumeMounts": [
{
"name": "librenms-dispatcher-claim0",
"mountPath": "/data"
}
]
},
{
"name": "dispatcher",
"image": "librenms/dispatcher:latest",
"env": [
{
"name": "TZ"
}
],
"resources": {},
"volumeMounts": [
{
"name": "librenms-dispatcher-claim0",
"mountPath": "/data"
}
]
}
],
"restartPolicy": "Always",
"hostname": "dispatcher"
}
},
"strategy": {
"type": "Recreate"
}
},
"status": {}
},
{
"kind": "PersistentVolumeClaim",
"apiVersion": "v1",
"metadata": {
"name": "librenms-dispatcher-claim0",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "librenms-dispatcher-claim0"
}
},
"spec": {
"accessModes": [
"ReadWriteOnce"
],
"resources": {
"requests": {
"storage": "100Mi"
}
}
},
"status": {}
}
]
}