Commit f83ddd9a authored by Gerry Gunzenhauser's avatar Gerry Gunzenhauser

make port / ssl configurable

parent 105b5c0f
Pipeline #2221 passed with stage
in 15 seconds
......@@ -11,6 +11,14 @@ export DEPLOY_ROOT_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
source "$DEPLOY_ROOT_DIR/src/common.bash"
if [ "${INGRESS_ENABLE_SSL:-true}" = "true" ]; then
export INGRESS_SSL_ANNOTATION='kubernetes.io/tls-acme: "true"'
else
export INGRESS_SSL_ANNOTATION=''
fi
export CONTAINER_HTTP_PORT="${CONTAINER_HTTP_PORT:-$CONTAINER_HTTP_PORT}"
if [[ -z "$CI_ENVIRONMENT_URL" ]]; then
echo "Reading CI_ENVIRONMENT_URL from .gitlab-ci.yml..."
CI_ENVIRONMENT_URL="$(ruby -ryaml -e 'puts YAML.load_file(".gitlab-ci.yml")[ENV["CI_BUILD_NAME"]]["environment"]["url"]')"
......@@ -61,17 +69,17 @@ spec:
value: "$CI_BUILD_ID"
ports:
- name: web
containerPort: 5000
containerPort: $CONTAINER_HTTP_PORT
livenessProbe:
httpGet:
path: /
port: 5000
port: $CONTAINER_HTTP_PORT
initialDelaySeconds: 15
timeoutSeconds: 15
readinessProbe:
httpGet:
path: /
port: 5000
port: $CONTAINER_HTTP_PORT
initialDelaySeconds: 5
timeoutSeconds: 3
---
......@@ -87,7 +95,7 @@ metadata:
spec:
ports:
- name: web
port: 5000
port: $CONTAINER_HTTP_PORT
targetPort: web
selector:
name: $CI_ENVIRONMENT_SLUG
......@@ -102,8 +110,8 @@ metadata:
pipeline_id: "$CI_PIPELINE_ID"
build_id: "$CI_BUILD_ID"
annotations:
kubernetes.io/tls-acme: "true"
kubernetes.io/ingress.class: "nginx"
$INGRESS_SSL_ANNOTATION
spec:
tls:
- hosts:
......@@ -116,7 +124,7 @@ spec:
- path: /
backend:
serviceName: $CI_ENVIRONMENT_SLUG
servicePort: 5000
servicePort: $CONTAINER_HTTP_PORT
EOF
echo "Waiting for deployment..."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment