update sslproxy deployment to include health check and Jenkinsfile that builds docker image

fixed metrics.xai-corp.net host file
This commit is contained in:
2018-10-29 21:56:55 -04:00
parent 039ac6d6e5
commit 5c94127056
4 changed files with 26 additions and 8 deletions

View File

@@ -1,20 +1,22 @@
node('docker') {
def dockerfile = 'Dockerfile'
def app_name = 'sslproxy'
def app_port = '80'
def workdir = 'dockerfiles/services/sslproxy'
stage('prepare') {
git credentialsId: 'f1f58215-c789-44a2-9b72-50e4425cb061', url: 'ssh://git@git.xai-corp.net:10022/xai-corp.net/provisioning.git'
//checkout scm
sh 'ls'
}
stage('build') {
dir(workdir) {
//docker.build -f docker-compose.yml
sh """
docker-compose -f docker-compose.yml build
"""
docker.Image.push dkregistry.xai-corp.net:5000/sslproxy:2.1
docker.withRegistry('http://dkregistry.xai-corp.net:5000') {
def customImage = docker.build("dkregistry.xai-corp.net:5000/sslproxy:2.1", "-f ${dockerfile} .")
customImage.push()
}
sh "docker-compose -f docker-compose-prod.yml pull"
}
}

View File

@@ -5,3 +5,5 @@ export DOCKER_HOST=dkmanager:2376
docker login -u richard -p $DKREGISTRY_PASS $DKREGISTRY
docker stack deploy --with-registry-auth --prune -c docker-compose-prod.yml sslproxy
docker service update sslproxy

View File

@@ -19,6 +19,13 @@ services:
- "443:443"
- "80:80" # required for letsencrypt
healthcheck:
test: ["CMD", "wget", "--spider", "--header", "'Host: git.xai-corp.net'", "https://localhost/"]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 3m
logging:
driver: fluentd
options:

View File

@@ -2,9 +2,9 @@ proxy_cache_path /data/nginx/cache/metrics levels=1:2 keys_zone=metrics:10m max_
inactive=60m use_temp_path=off;
upstream metrics_upstream {
server tasks.metrics_graphana:3001;
server metrics.xai-corp.net:3001;
#server tasks.metrics_graphana:3001;
server metrics.xai-corp.net:3001 backup;
server dkhost.xai-corp.net:3001 backup;
}
@@ -21,8 +21,15 @@ server {
add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
location / {
proxy_set_header Connection $http_connection;
proxy_set_header Connection $http_connection;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://metrics_upstream;
proxy_connect_timeout 3s;
}
}