Skip to content

Commit

Permalink
docker: Move pod and node agent to dev compose, add env variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
Woojciech committed Oct 14, 2024
1 parent 66b32d1 commit 0fa13dd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 84 deletions.
22 changes: 19 additions & 3 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,16 @@ services:
dockerfile: Dockerfile
restart: always
command:
- "--runningLocally"
- "true"
- "--clusterFriendlyName"
- "local-docker"
- "--scrape"
- "pods"
- "--scrapeIntervalSeconds"
- "30"
- "--logScrapeIntervalSeconds"
- ${POD_AGENT_LOG_SCRAPE_INTERVAL_SECONDS}
- "--metadataScrapeIntervalSeconds"
- ${POD_AGENT_METADATA_SCRAPE_INTERVAL_SECONDS}
- "--remoteWriteBrokerUrl"
- ${KAFKA_BROKER_URL}
- "--remoteWriteBrokerUsername"
Expand All @@ -58,6 +64,8 @@ services:
- ${KAFKA_CLIENT_PASSWORD}
- "--remoteWriteBatchSize"
- ${KAFKA_CLIENT_BATCH_SIZE}
- "--podRemoteWriteMetadataUrl"
- ${POD_AGENT_METADATA_REMOTE_WRITE_URL}
develop:
watch:
- action: rebuild
Expand All @@ -76,14 +84,20 @@ services:
dockerfile: Dockerfile
restart: always
command:
- "--runningLocally"
- "true"
- "--scrape"
- "nodes"
- "--logScrapeIntervalSeconds"
- ${NODE_AGENT_LOG_SCRAPE_INTERVAL_SECONDS}
- "--metadataScrapeIntervalSeconds"
- ${NODE_AGENT_METADATA_SCRAPE_INTERVAL_SECONDS}
- "--redisUrl"
- "redis:6379"
- "--redisPassword"
- ${REDIS_PASSWORD}
- "--file"
- "/var/log/file"
- ${NODE_AGENT_WATCHED_FILE}
- "--remoteWriteBrokerUrl"
- ${KAFKA_BROKER_URL}
- "--remoteWriteBrokerUsername"
Expand All @@ -92,6 +106,8 @@ services:
- ${KAFKA_CLIENT_PASSWORD}
- "--remoteWriteBatchSize"
- ${KAFKA_CLIENT_BATCH_SIZE}
- "--nodeRemoteWriteMetadataUrl"
- ${NODE_AGENT_METADATA_REMOTE_WRITE_URL}
environment:
NODE_NAME: "mock-node-name"
develop:
Expand Down
81 changes: 0 additions & 81 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,87 +134,6 @@ services:
VIRTUAL_PORT: 8081
depends_on:
- mongodb
pod-agent:
user: "0" # Elevated permission needed for bind mount
container_name: magpie-monitor-pod-agent
build:
context: ./agent/app
dockerfile: Dockerfile
restart: always
depends_on:
- kafka
command:
- "--runningLocally"
- "true"
- "--clusterFriendlyName"
- "local-docker"
- "--scrape"
- "pods"
- "--logScrapeIntervalSeconds"
- ${POD_AGENT_LOG_SCRAPE_INTERVAL_SECONDS}
- "--metadataScrapeIntervalSeconds"
- ${POD_AGENT_METADATA_SCRAPE_INTERVAL_SECONDS}
- "--remoteWriteBrokerUrl"
- ${KAFKA_BROKER_URL}
- "--remoteWriteBrokerUsername"
- ${KAFKA_CLIENT_USERNAME}
- "--remoteWriteBrokerPassword"
- ${KAFKA_CLIENT_PASSWORD}
- "--remoteWriteBatchSize"
- ${KAFKA_CLIENT_BATCH_SIZE}
- "--podRemoteWriteMetadataUrl"
- ${POD_AGENT_METADATA_REMOTE_WRITE_URL}
develop:
watch:
- action: rebuild
path: ./agent/app
target: /src
volumes:
- ${POD_AGENT_HOST_KUBECONFIG_PATH}:/root/.kube
node-agent:
user: "0" # Elevated permission needed for bind mount
container_name: magpie-monitor-node-agent
depends_on:
- kafka
- redis
build:
context: ./agent/app
dockerfile: Dockerfile
restart: always
command:
- "--runningLocally"
- "true"
- "--scrape"
- "nodes"
- "--logScrapeIntervalSeconds"
- ${NODE_AGENT_LOG_SCRAPE_INTERVAL_SECONDS}
- "--metadataScrapeIntervalSeconds"
- ${NODE_AGENT_METADATA_SCRAPE_INTERVAL_SECONDS}
- "--redisUrl"
- "redis:6379"
- "--redisPassword"
- ${REDIS_PASSWORD}
- "--file"
- ${NODE_AGENT_WATCHED_FILE}
- "--remoteWriteBrokerUrl"
- ${KAFKA_BROKER_URL}
- "--remoteWriteBrokerUsername"
- ${KAFKA_CLIENT_USERNAME}
- "--remoteWriteBrokerPassword"
- ${KAFKA_CLIENT_PASSWORD}
- "--remoteWriteBatchSize"
- ${KAFKA_CLIENT_BATCH_SIZE}
- "--nodeRemoteWriteMetadataUrl"
- ${NODE_AGENT_METADATA_REMOTE_WRITE_URL}
environment:
NODE_NAME: "mock-node-name"
develop:
watch:
- action: rebuild
path: ./agent/app
target: /src
volumes:
- ${NODE_AGENT_HOST_WATCHED_FILE_PATH}:/var/log/file
# Please ignore warning about vm.overcommit_memory, it requires host changes that aren't justified in a dev environment.
management-service:
container_name: magpie-monitor-management-service
Expand Down

0 comments on commit 0fa13dd

Please sign in to comment.