Rework volumes

This commit is contained in:
Daniel Berteaud 2023-10-27 00:16:04 +02:00
parent c4104fd2db
commit 13bdb9898c
2 changed files with 21 additions and 21 deletions

View File

@ -75,18 +75,18 @@ job [[ .unifi.instance | toJSON ]] {
}
}
volume "unifi-mongo" {
type = [[ .unifi.mongo.volume.type | toJSON ]]
source = [[ .unifi.mongo.volume.source | toJSON ]]
volume "mongo" {
type = [[ .unifi.volumes.mongo.type | toJSON ]]
source = [[ .unifi.volumes.mongo.source | toJSON ]]
access_mode = "single-node-writer"
attachment_mode = "file-system"
}
[[- end ]]
volume "unifi-data" {
type = [[ .unifi.controller.volume.type | toJSON ]]
source = [[ .unifi.controller.volume.source | toJSON ]]
volume "data" {
type = [[ .unifi.volumes.data.type | toJSON ]]
source = [[ .unifi.volumes.data.source | toJSON ]]
access_mode = "multi-node-multi-writer"
attachment_mode = "file-system"
}
@ -138,7 +138,7 @@ _EOF
}
volume_mount {
volume = "unifi-data"
volume = "data"
destination = "/data"
}
@ -189,7 +189,7 @@ _EOF
}
volume_mount {
volume = "unifi-data"
volume = "data"
destination = "/data"
}
@ -224,7 +224,7 @@ _EOF
}
volume_mount {
volume = "unifi-mongo"
volume = "mongo"
destination = "/data/db"
}

View File

@ -17,7 +17,7 @@ unifi:
driver: docker
# The image for the controller
image: danielberteaud/unifi:7.5.187-1
image: danielberteaud/unifi:7.5.187-2
# Resource allocation for the controller
resources:
@ -67,11 +67,6 @@ unifi:
#middlewares:
# - ip-trusted@file
# This volume will hold controller data (like cached firmwares)
volume:
type: csi
source: unifi-data
# The inform endpoint is used by the devices to contact the controller
inform:
# Public URL of the inform endpoint
@ -146,18 +141,13 @@ unifi:
cpu: 100
memory: 256
# Persistant volume
volume:
type: csi
source: unifi-mongo
# This componant will be used if a proxy is set.
# It's needed because the UniFi controller do not send outbound web requests
# through the configured proxy to download firmwares
fw_dl:
# The image to use
image: danielberteaud/ubnt-firmware-downloader:20230831-1
image: danielberteaud/ubnt-firmware-downloader:23.10-1
# Resource allocation
resources:
@ -172,3 +162,13 @@ unifi:
UBNT_PLATFORMS: U7HD,US48PRO
# A cron expression to run the update
UBNT_CRON: 48 22 * * *
# Volumes
volumes:
data:
type: csi
source: unifi-data
mongo:
type: csi
source: unifi-mongo