Fix for configmaps

This commit is contained in:
amit.kumar 2019-06-20 15:56:31 +05:30
parent 8a4caee0ef
commit 70364e8963
5 changed files with 40 additions and 51 deletions

View file

@ -29,6 +29,21 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: PUBLIC_URL
valueFrom:
configMapKeyRef:
name: {{ .Values.publicService.name }}
key: url
- name: SANDBOX_URL
valueFrom:
configMapKeyRef:
name: {{ .Values.sandboxService.name }}
key: url
- name: TRUSTED_URL
valueFrom:
configMapKeyRef:
name: {{ .Values.service.name }}
key: url
- name: MYSQL_HOSTNAME
valueFrom:
secretKeyRef:

View file

@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.publicService.name }}
annotations:
configmap.fabric8.io/update-on-change: {{ template "fullname" . }}
expose.config.fabric8.io/url-key: url

View file

@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.sandboxService.name }}
annotations:
configmap.fabric8.io/update-on-change: {{ template "fullname" . }}
expose.config.fabric8.io/url-key: url

View file

@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.service.name }}
annotations:
configmap.fabric8.io/update-on-change: {{ template "fullname" . }}
expose.config.fabric8.io/url-key: url

View file

@ -1,61 +1,14 @@
#!/bin/bash
set -e
function printHelp {
cat <<EOF
Optional parameters:
--trustedUrlBase XXX - sets the trusted url of the instance (default: http://localhost:3000)
--sandboxUrlBase XXX - sets the sandbox url of the instance (default: http://localhost:3003)
--publicUrlBase XXX - sets the public url of the instance (default: http://localhost:3004)
--withProxy - use if Mailtrain is behind an http reverse proxy
EOF
exit 1
}
urlBaseTrusted=http://localhost:3000
urlBaseSandbox=http://localhost:3003
urlBasePublic=http://localhost:3004
wwwProxy=false
while [ $# -gt 0 ]; do
case "$1" in
--help)
printHelp
;;
--trustedUrlBase)
urlBaseTrusted="$2"
shift 2
;;
--sandboxUrlBase)
urlBaseSandbox="$2"
shift 2
;;
--publicUrlBase)
urlBasePublic="$2"
shift 2
;;
--withProxy)
wwwProxy=true
shift 1
;;
*)
echo "Error: unrecognized option $1."
printHelp
esac
done
cat > server/config/production.yaml <<EOT
www:
host: 0.0.0.0
proxy: $wwwProxy
proxy: true
secret: "`pwgen -1`"
trustedUrlBase: $urlBaseTrusted
sandboxUrlBase: $urlBaseSandbox
publicUrlBase: $urlBasePublic
trustedUrlBase: $TRUSTED_URL
sandboxUrlBase: $SANDBOX_URL
publicUrlBase: $PUBLIC_URL
mysql:
host: $MYSQL_HOSTNAME