diff --git a/deploy/asapo_orchestration_docker/scripts/influxdb/create_db_logs.sh.tpl b/deploy/asapo_orchestration_docker/scripts/influxdb/create_db_logs.sh.tpl new file mode 100644 index 0000000000000000000000000000000000000000..52a7b788da2c397338f79b58a9b0b56cddac4952 --- /dev/null +++ b/deploy/asapo_orchestration_docker/scripts/influxdb/create_db_logs.sh.tpl @@ -0,0 +1,3 @@ +set -x + +influx -execute "CREATE DATABASE logs" diff --git a/deploy/asapo_orchestration_docker/scripts/monitoring.nmd.tpl b/deploy/asapo_orchestration_docker/scripts/monitoring.nmd.tpl index e0282a8db0df8e44932a7ab0d56958d2e437e70b..33dd52f41145a042576508fcbd33d4f0b6e1651c 100644 --- a/deploy/asapo_orchestration_docker/scripts/monitoring.nmd.tpl +++ b/deploy/asapo_orchestration_docker/scripts/monitoring.nmd.tpl @@ -30,15 +30,17 @@ job "monitoring" { driver = "docker" user = "${asapo_user}" config { - network_mode = "host" + network_mode = "bridge" security_opt = ["no-new-privileges"] userns_mode = "host" image = "influxdb:${influxdb_version}" - volumes = ["/${service_dir}/influxdb:/var/lib/influxdb"] + volumes = [ + "/${service_dir}/influxdb:/var/lib/influxdb", + "local/influxdb:/docker-entrypoint-initdb.d"] + command = "influxd" } env { - PRE_CREATE_DB="asapo_receivers;asapo_brokers" INFLUXDB_BIND_ADDRESS="127.0.0.1:$${NOMAD_PORT_influxdb_rpc}" INFLUXDB_HTTP_BIND_ADDRESS=":$${NOMAD_PORT_influxdb}" } @@ -70,6 +72,10 @@ job "monitoring" { } } + template { + source = "${scripts_dir}/influxdb/create_db_logs.sh.tpl" + destination = "local/influxdb/create_db_logs.sh" + } } #influxdb