Skip to content

Commit

Permalink
add midburn profiles drupal app + DB (#6)
Browse files Browse the repository at this point in the history
* add profiles external chart containing the drupal app and DB
* add bi external chart - using metabase (currently disabled, needs some more work)
* upgrade traefik configuration to use route53 dns API for more robust certificate issuing and renewals
  • Loading branch information
OriHoch authored Jan 18, 2018
1 parent ab465c0 commit df2d43b
Show file tree
Hide file tree
Showing 22 changed files with 1,109 additions and 89 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ env:
matrix:
- DEPLOY_ENVIRONMENT=staging DEPLOY_BRANCH=master
- DEPLOY_ENVIRONMENT=production DEPLOY_TAGS=true
# - DEPLOY_ENVIRONMENT=ori DEPLOY_BRANCH=midburn-profiles-aka-drupal-infra
services:
- docker
script:
Expand All @@ -25,6 +26,8 @@ script:
! ./helm_upgrade.sh && echo 'failed helm upgrade' && RES=1;
! ./helm_upgrade_external_chart.sh spark && echo 'failed spark upgrade' && RES=1;
! ./helm_upgrade_external_chart.sh volunteers && echo 'failed volunteers upgrade' && RES=1;
! ./helm_upgrade_external_chart.sh bi && echo 'failed bi upgrade' && RES=1;
! ./helm_upgrade_external_chart.sh profiles && echo 'failed profiles upgrade' && RES=1;
exit "'$'"RES
" "orihoch/sk8s-ops" "${OPS_REPO_SLUG}" "${OPS_REPO_BRANCH}"; then
true
Expand Down
1 change: 1 addition & 0 deletions charts-external/bi/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name: bi
1 change: 1 addition & 0 deletions charts-external/bi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Midburn Business Intelligence
106 changes: 106 additions & 0 deletions charts-external/bi/templates/metabase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{{ if .Values.enabled }}
apiVersion: v1
kind: Service
metadata:
name: metabase
spec:
selector:
app: metabase
ports:
- port: 3000
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: metabase
spec:
replicas: 1
strategy: {type: Recreate, rollingUpdate: null}
template:
metadata:
labels:
app: metabase
spec:
terminationGracePeriodSeconds: 0
containers:
# this is a small postgreSQL DB used internally by metabase
- name: postgres
image: postgres
command:
- bash
- "-c"
- |
docker-entrypoint.sh postgres &
export PGPASS=$POSTGRES_PASSWORD
while ! echo "select 1" | psql -h 127.0.0.1 -p 5432 -U postgres; do echo "waiting for db.."; sleep 5; done
RES=0
ERRORS=""
! echo "CREATE DATABASE ${MB_DB_DBNAME}" | psql -h 127.0.0.1 -p 5432 -U postgres \
&& ERRORS+="; failed to create db ${MB_DB_DBNAME}" && RES=1
if [ "${RES}" == "0" ]; then
echo "Great Success!"
touch /state/db_ready
while true; do sleep 86400; done
else
echo "Failed"
echo "${ERRORS}"
echo "Waiting 1 day before existing with error - to allow debugging"
sleep 86400
exit 1
fi
env:
- {name: POSTGRES_PASSWORD, value: "123456"}
- {name: MB_DB_DBNAME, value: metabase}
ports:
- containerPort: 5432
resources:
requests:
cpu: "10m"
memory: "50Mi"
limits:
cpu: "100m"
memory: "100Mi"
volumeMounts:
- name: state
mountPath: /state
- name: metabase
image: metabase/metabase
env:
- {name: "MB_DB_TYPE", value: "postgres"}
- {name: "MB_DB_DBNAME", value: metabase}
- {name: "MB_DB_PORT", value: "5432"}
- {name: "MB_DB_USER", value: postgres}
- {name: "MB_DB_PASS", value: "123456"}
- {name: "MB_DB_HOST", value: "localhost"}
command:
- bash
- "-c"
- |
while ! [ -e /state/db_ready ]; do echo "waiting for db.."; sleep 5; done
touch /state/starting_metabase
/app/run_metabase.sh
readinessProbe:
exec:
command:
- bash
- "-c"
- |
[ -e /state/starting_metabase ] && wget -q localhost:3000 -O /dev/null
initialDelaySeconds: 5
periodSeconds: 5
ports:
- containerPort: 3000
resources:
requests:
cpu: 0.3
memory: "600Mi"
limits:
cpu: 0.6
memory: "1400Mi"
volumeMounts:
- name: state
mountPath: /state
volumes:
- name: state
emptyDir: {}
{{ end }}
1 change: 1 addition & 0 deletions charts-external/profiles/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name: profiles
3 changes: 3 additions & 0 deletions charts-external/profiles/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Midburn Profiles

Contains Midburn profiles system (AKA Drupal) related infrastructure
Loading

0 comments on commit df2d43b

Please sign in to comment.