From fdd9a5fd0452b11c3f9bf5389ffe070aa490906c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Borja=20Paz=20Rodr=C3=ADguez?= Date: Wed, 21 Jun 2023 18:02:47 +0200 Subject: [PATCH] feat(service): add datadog-agent --- services/cf-companion/.env.template | 3 +++ services/cf-companion/docker-compose.yml | 4 ++++ services/datadog-agent/.env.template | 9 +++++++++ services/datadog-agent/Makefile | 15 +++++++++++++++ services/datadog-agent/docker-compose.yml | 23 +++++++++++++++++++++++ services/traefik/.env.template | 1 + services/traefik/docker-compose.yml | 2 ++ 7 files changed, 57 insertions(+) create mode 100644 services/datadog-agent/.env.template create mode 100644 services/datadog-agent/Makefile create mode 100644 services/datadog-agent/docker-compose.yml diff --git a/services/cf-companion/.env.template b/services/cf-companion/.env.template index 6ff6fff..0316581 100644 --- a/services/cf-companion/.env.template +++ b/services/cf-companion/.env.template @@ -5,6 +5,9 @@ DOMAIN1_ZONE_ID= DOMAIN2= DOMAIN2_TARGET_DOMAIN= DOMAIN2_ZONE_ID= +DOMAIN3= +DOMAIN3_TARGET_DOMAIN= +DOMAIN3_ZONE_ID= ## Configuration ## CF_API_EMAIL= diff --git a/services/cf-companion/docker-compose.yml b/services/cf-companion/docker-compose.yml index c087e40..cfbfa23 100644 --- a/services/cf-companion/docker-compose.yml +++ b/services/cf-companion/docker-compose.yml @@ -19,6 +19,10 @@ services: - DOMAIN2_TARGET_DOMAIN=${DOMAIN2_TARGET_DOMAIN} - DOMAIN2_ZONE_ID=${DOMAIN2_ZONE_ID} - DOMAIN2_PROXIED=true + - DOMAIN3=${DOMAIN3} + - DOMAIN3_TARGET_DOMAIN=${DOMAIN3_TARGET_DOMAIN} + - DOMAIN3_ZONE_ID=${DOMAIN3_ZONE_ID} + - DOMAIN3_PROXIED=true - TZ=${TZ} volumes: - /var/run/docker.sock:/var/run/docker.sock:ro diff --git a/services/datadog-agent/.env.template b/services/datadog-agent/.env.template new file mode 100644 index 0000000..ec18c07 --- /dev/null +++ b/services/datadog-agent/.env.template @@ -0,0 +1,9 @@ +## Volume settings ## +VOLUME_DIR= + +## App configuration ## +DD_API_KEY= +DD_SITE= + +## Timezone configuration ## +TZ= diff --git a/services/datadog-agent/Makefile b/services/datadog-agent/Makefile new file mode 100644 index 0000000..abed085 --- /dev/null +++ b/services/datadog-agent/Makefile @@ -0,0 +1,15 @@ +ROOT_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +SERVICE := datadog-agent +include $(ROOT_DIR)/../../core/common.mk +include .env + +.ONESHELL: + +.PHONY: install +install: ## Start all containers in background + @$(DOCKER_COMPOSE) up -d + +.PHONY: uninstall +uninstall: ## Stop all containers and remove all data + @$(DOCKER_COMPOSE) down -v + @sudo rm -rf $(VOLUME_DIR) diff --git a/services/datadog-agent/docker-compose.yml b/services/datadog-agent/docker-compose.yml new file mode 100644 index 0000000..dbdda51 --- /dev/null +++ b/services/datadog-agent/docker-compose.yml @@ -0,0 +1,23 @@ +version: "3.7" + +services: + ### Datadog Agent: The Datadog Agent collects metrics and events from your systems and apps. ### + datadog-agent: + image: gcr.io/datadoghq/agent:7 + container_name: datadog-agent + restart: always + environment: + - DD_API_KEY=${DD_API_KEY} + - DD_SITE=${DD_SITE} + - TZ=${TZ} + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + - /proc/:/host/proc/:ro + - /sys/fs/cgroup/:/host/sys/fs/cgroup:ro + +networks: + default: + name: datadog-agent-network + traefik-network: + name: traefik-network + external: true diff --git a/services/traefik/.env.template b/services/traefik/.env.template index 80d3530..f982a63 100644 --- a/services/traefik/.env.template +++ b/services/traefik/.env.template @@ -10,6 +10,7 @@ TRAEFIK_HUB_TOKEN= ## Domain settings ## DOMAIN1= DOMAIN2= +DOMAIN3= DASHBOARD_DOMAIN= ## Certificate settings ## diff --git a/services/traefik/docker-compose.yml b/services/traefik/docker-compose.yml index b64b5b1..e8b4373 100644 --- a/services/traefik/docker-compose.yml +++ b/services/traefik/docker-compose.yml @@ -136,6 +136,8 @@ services: - traefik.http.routers.wildcard-certs.tls.domains[0].sans=${DOMAIN1} - traefik.http.routers.wildcard-certs.tls.domains[1].main=*.${DOMAIN2} - traefik.http.routers.wildcard-certs.tls.domains[1].sans=${DOMAIN2} + - traefik.http.routers.wildcard-certs.tls.domains[2].main=*.${DOMAIN3} + - traefik.http.routers.wildcard-certs.tls.domains[2].sans=${DOMAIN3} ## Traefik dashboard configuration ## # Set HTTP domain and HTTP -> HTTPS redirection #