add dockerfile building for prometheus to jenkinsfile

This commit is contained in:
2018-11-03 20:29:51 -04:00
parent 2e6cb21d22
commit 790f838a91
3 changed files with 28 additions and 20 deletions

View File

@@ -13,10 +13,10 @@ node('docker') {
stage('build') {
dir(workdir) {
docker.withRegistry('http://dkregistry.xai-corp.net:5000') {
def customImage = docker.build("dkregistry.xai-corp.net:5000/${app_name}:latest", "-f Dockerfile .")
def customImage = docker.build("dkregistry.xai-corp.net:5000/xaicorp/${app_name}:latest", "-f Dockerfile .")
customImage.push()
}
sh "docker-compose -f ${build_file} pull"
sh "docker-compose -f ${deployment_file} pull"
}
}
@@ -24,7 +24,11 @@ node('docker') {
dir(workdir) {
sh """
docker stack deploy -c ${deployment_file} ${service_name}
docker service update -q ${service_name}_${app_name}
docker service update -q ${service_name}_prometheus
docker service update -q ${service_name}_statsd_exporter
docker service update -q ${service_name}_fluentd_exporter
docker service update -q ${service_name}_node_exporter
docker service update -q ${service_name}_graphana
"""
}
}

View File

@@ -20,13 +20,12 @@ services:
- 9090:9090
volumes:
- prometheus-storage:/prometheus
# logging:
# driver: fluentd
# options:
# fluentd-address: "logs.xai-corp.net:24224"
# fluentd-async-connect: 'true'
# tag: metrics
healthcheck:
test: ["CMD", "wget", "--spider", "http://localhost:9090/metrics"]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 3m
deploy:
mode: replicated
replicas: 1
@@ -66,6 +65,12 @@ services:
resources:
limits:
memory: 512M
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/metrics"]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 3m
postgres_exporter:
image: wrouesnel/postgres_exporter
@@ -75,7 +80,7 @@ services:
DATA_SOURCE_NAME: "postgresql://xaicorp_admin:snqioxni1sw@tasks.postgres:5432/?sslmode=disable"
deploy:
mode: replicated
replicas: 0
replicas: 1
restart_policy:
condition: any
delay: "1s"

View File

@@ -19,13 +19,13 @@ scrape_configs:
static_configs:
- targets: ['prometheus:9090']
- job_name: glusterfs
metrics_path: /metrics
scrape_interval: 120s
scrape_timeout: 14s
static_configs:
- targets:
- 'cubox-i.xai-corp.net:9189'
#- job_name: glusterfs
# metrics_path: /metrics
# scrape_interval: 120s
# scrape_timeout: 14s
# static_configs:
# - targets:
# - 'cubox-i.xai-corp.net:9189'
# - 'home.xai-corp.net:9189'
- job_name: fluentd
@@ -73,7 +73,6 @@ scrape_configs:
metrics_path: '/metrics'
scrape_interval: 60s
scrape_timeout: 9s
scheme: https
static_configs:
- targets:
- 'metrics.xai-corp.net'
- 'metrics_graphana:3000'