Skip to content

Commit

Permalink
Merge pull request #76 from ns1/release/3.1.3-monitor
Browse files Browse the repository at this point in the history
Release/3.1.3 monitor
  • Loading branch information
saxmfone1 authored Oct 6, 2020
2 parents 718f4b4 + 7e54ab0 commit c5e238e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ services:
--server_id ${SERVER_ID:-myserver}
--core_host ${CORE_HOSTS:-core}
--monitoring_region lga
--digest_service_def_id 3
--service_def_id 3
--inst_id 1
--use_privileged_ping true
networks:
Expand Down
5 changes: 3 additions & 2 deletions docker-compose/edge-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ services:
command: >-
--pop_id ${POP_ID:-mypop}
--server_id ${SERVER_ID:-myserver}
--core_host ${CORE_HOSTS}
--core_host ${CORE_HOSTS:-core}
--monitoring_region lga
--digest_service_def_id 3
--service_def_id 3
--inst_id 1
--use_privileged_ping true
networks:
Expand All @@ -151,3 +151,4 @@ volumes:
ns1dns:
ns1dist:
ns1dhcp:
ns1monitor:
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,26 @@ provider "docker" {
}
}

data "docker_registry_image" "monitoring_edge" {
data "docker_registry_image" "monitor" {
count = var.docker_registry_address != null ? 1 : 0
name = local.docker_image_name
}

resource "docker_image" "monitoring_edge" {
resource "docker_image" "monitor" {
count = var.docker_registry_address != null ? 1 : 0
name = data.docker_registry_image.monitoring_edge[count.index].name
pull_triggers = [data.docker_registry_image.monitoring_edge[count.index].sha256_digest]
name = data.docker_registry_image.monitor[count.index].name
pull_triggers = [data.docker_registry_image.monitor[count.index].sha256_digest]
keep_locally = true
}

resource "docker_volume" "monitoring_edge" {
name = "ns1monitoring_edge"
resource "docker_volume" "monitor" {
name = "ns1monitor"
}

resource "docker_container" "monitoring_edge" {
name = "monitoring_edge"
resource "docker_container" "monitor" {
name = "monitor"
# If using registry, use sha of found image, otherwise use name that should be found on docker host
image = var.docker_registry_address != null ? docker_image.monitoring_edge[0].latest : local.docker_image_name
image = var.docker_registry_address != null ? docker_image.monitor[0].latest : local.docker_image_name

env = [
# "CONFIG_PORT=3305",
Expand All @@ -61,7 +61,7 @@ resource "docker_container" "monitoring_edge" {
}

volumes {
volume_name = docker_volume.monitoring_edge.name
volume_name = docker_volume.monitor.name
container_path = "/ns1/data"
}

Expand All @@ -75,8 +75,8 @@ resource "docker_container" "monitoring_edge" {
join(",", var.core_hosts),
"--monitoring_region",
var.monitoring_region,
"--digest_service_def_id",
var.digest_service_def_id,
"--service_def_id",
var.service_def_id,
"--log_level",
var.log_level,
"--metrics_addr_base",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ variable "docker_image_username" {
}

variable "docker_image_repository" {
default = "privatedns_monitoring_edge"
default = "privatedns_monitor"
description = "The repository name used in the Docker image name. This should not need to be changed."
}

Expand Down Expand Up @@ -37,7 +37,7 @@ variable "docker_network" {
}

variable "container_name" {
default = "monitoring_edge"
default = "monitor"
description = "The name of the Docker container."
}

Expand All @@ -63,7 +63,7 @@ variable "core_hosts" {
}

variable "hostname" {
default = "monitoring_edge"
default = "monitor"
description = "Hostname to give the running container"
}

Expand All @@ -77,7 +77,7 @@ variable "monitoring_region" {
description = "Monitoring region code of the service definition"
}

variable "digest_service_def_id" {
variable "service_def_id" {
default = "3"
description = "ID of the monitoring service definition for reading the monitoring jobs digest"
}
Expand Down

0 comments on commit c5e238e

Please sign in to comment.