diff --git a/config/default.hjson b/config/default.hjson index 7ee3c52ccaab888cb00675bfdee7c855bc065df8..93920953f4c9865c8590152d861a2b15f796fc56 100644 --- a/config/default.hjson +++ b/config/default.hjson @@ -64,9 +64,11 @@ k8component: { prefix: "/beaker" autoRestart: true healthPath: "/" + healthScheme: "HTTP" healthDelay: 2 healthPeriod: 10 livePath: "/" + liveScheme: "HTTP" liveDelay: 2 livePeriod: 30 checksumSkipReStr: "^(?:path[0-9]*|escapedPath[0-9]*)$" diff --git a/deploy.sh b/deploy.sh index 8fc2bc58436ef33df688a16547b3451e68cf4dfa..021e5e6f4ac176fda361d0902687704035cc78d0 100755 --- a/deploy.sh +++ b/deploy.sh @@ -18,16 +18,14 @@ do --tls) tls=--tls ;; - --docker-only) + --update-docker) buildDocker=1 - updateDeploy="" ;; --always-pull) alwaysPull=1 ;; - --docker-skip) - buildDocker="" - updateDeploy=1 + --no-deploy-scripts) + updateDeploy="" ;; --no-push) noPush=1 @@ -53,7 +51,7 @@ do chownRoot=$1 ;; *) - echo "usage: $0 [--debug] [--tls] [--nomad-root <pathToNomadRoot>] [--chown-root <pathForPrometheusVolumes>] [--env <NODE_ENV_VALUE>] [--docker-only] [--docker-skip] [--target-hostname hostname] [--secret-web-certs <secretName>] [--always-pull] [--no-push]" + echo "usage: $0 [--debug] [--tls] [--nomad-root <pathToNomadRoot>] [--chown-root <pathForPrometheusVolumes>] [--env <NODE_ENV_VALUE>] [--update-docker] [--no-deploy-scripts] [--target-hostname hostname] [--secret-web-certs <secretName>] [--always-pull] [--no-push]" echo echo "Env variables: NODE_ENV, target_hostname, nomadRoot" echo "Examples:" @@ -67,7 +65,10 @@ do done chownRoot=${chownRoot:-$nomadRoot/servers/$target_hostname} -version=$(git describe --tags --always --dirty) +if [ -n "$buildDocker" ] ; then + git describe --tags --always --dirty > version_to_deploy +fi +version=$(cat version_to_deploy) name="analytics-toolkit.nomad-coe.eu:5509/nomadlab/nomad-container-manager:$version" if [ -n "$buildDocker" ] ; then if [ -n "$alwaysPull" ] ; then @@ -86,7 +87,7 @@ fi echo "# Initial setup" echo "To make kubectl work, for example for the test kubernetes" -echo " export KUBECONFIG=/nomad/nomadlab/kubernetes/dev/config" +echo " export KUBECONFIG=/etc/kubernetes/admin.conf" echo "# Helm install" if [ -n updateDeploy ]; then @@ -281,7 +282,7 @@ spec: containers: - name: notebooks-mongo image: mongo:3.4 - imagePullPolicy: IfNotPresent + imagePullPolicy: $pullPolicy ports: - containerPort: 27017 env: @@ -530,6 +531,10 @@ HERE fi if [ -n "$updateDeploy" ]; then + scheme=HTTP + if [ "$target_hostname" == "labdev-nomad" -o "$target_hostname" == "labtest-nomad" ] ; then + scheme=HTTPS + fi targetF=container-manager-deploy-$imageType.yaml cat > $targetF <<HERE apiVersion: apps/v1beta2 @@ -655,10 +660,6 @@ EOF name: web-certs EOF fi - scheme=HTTP - if [ "$target_hostname" == "labdev-nomad" -o "$target_hostname" == "labtest-nomad" ] ; then - scheme=HTTPS - fi cat >> $targetF <<EOF - mountPath: "/usr/src/app/kube-certs" name: kube-certs diff --git a/templates/kube/defaultTemplate.yaml b/templates/kube/defaultTemplate.yaml index e04bfd425f28d4ddd9035e8b127c4a8998a3f3b4..bc2901d6180ce6965540498e752ad9630340bfc5 100644 --- a/templates/kube/defaultTemplate.yaml +++ b/templates/kube/defaultTemplate.yaml @@ -41,12 +41,14 @@ spec: httpGet: path: "{{e healthPath}}" port: {{n port}} + scheme: "{{e healthScheme}}" initialDelaySeconds: {{n healthDelay}} periodSeconds: {{n healthPeriod}} livenessProbe: httpGet: path: "{{e livePath}}" port: {{n port}} + scheme: "{{e liveScheme}}" initialDelaySeconds: {{n liveDelay}} periodSeconds: {{n livePeriod}} volumes: diff --git a/templates/kube/jupyterTemplate.yaml b/templates/kube/jupyterTemplate.yaml index 8ae8880aa65a8a7f25fc7cd90d61563de3286414..f48222998ff9f16c72810cc69992eacf58c1ff69 100644 --- a/templates/kube/jupyterTemplate.yaml +++ b/templates/kube/jupyterTemplate.yaml @@ -43,12 +43,14 @@ spec: httpGet: path: "{{e healthPath}}" port: {{n port}} + scheme: "{{e healthScheme}}" initialDelaySeconds: {{n healthDelay}} periodSeconds: {{n healthPeriod}} livenessProbe: httpGet: path: "{{e livePath}}" port: {{n port}} + scheme: "{{e liveScheme}}" initialDelaySeconds: {{n liveDelay}} periodSeconds: {{n livePeriod}} volumes: