mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Added update config before starting nginx
Signed-off-by: Shahbaz Nazir <shahbaz@bigchaindb.com>
This commit is contained in:
parent
d577b209e7
commit
9fa4be5503
@ -1,8 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Secret
|
|
||||||
metadata:
|
|
||||||
name: apicast-secret
|
|
||||||
namespace: default
|
|
||||||
type: Opaque
|
|
||||||
data:
|
|
||||||
portal-endpoint: "aHR0cHM6Ly9jNzQzOTRhM2M1NzQ5OWE5ZWIxNGI4YzYzZWZjNmVkNUBiaWdjaGFpbmRiLWFkbWluLjNzY2FsZS5uZXQ"
|
|
||||||
@ -13,24 +13,38 @@ spec:
|
|||||||
containers:
|
containers:
|
||||||
- name: nginx-openresty
|
- name: nginx-openresty
|
||||||
image: bigchaindb/nginx_3scale:unstable
|
image: bigchaindb/nginx_3scale:unstable
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: Always
|
||||||
env:
|
env:
|
||||||
- name: RESOLVER
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: vars
|
|
||||||
key: cluster-dns-server-ip
|
|
||||||
- name: THREESCALE_PORTAL_ENDPOINT
|
- name: THREESCALE_PORTAL_ENDPOINT
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: apicast-secret
|
name: apicast-secret
|
||||||
key: portal-endpoint
|
key: portal-endpoint
|
||||||
|
- name: RESOLVER
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
name: vars
|
||||||
|
key: cluster-dns-server-ip
|
||||||
- name: APICAST_LOG_LEVEL
|
- name: APICAST_LOG_LEVEL
|
||||||
value: "debug"
|
valueFrom:
|
||||||
- name: APICAST_CONFIGURATION_LOADER
|
configMapKeyRef:
|
||||||
value: "boot"
|
name: apicast-config
|
||||||
|
key: api-log-level
|
||||||
- name: APICAST_MANAGEMENT_API
|
- name: APICAST_MANAGEMENT_API
|
||||||
value: "debug"
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
name: apicast-config
|
||||||
|
key: mgmt-api-mode
|
||||||
|
- name: BIGCHAINDB_BACKEND_HOST
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
name: vars
|
||||||
|
key: bdb-instance-name
|
||||||
|
- name: BIGCHAINDB_API_PORT
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
name: vars
|
||||||
|
key: bigchaindb-api-port
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
|||||||
@ -16,7 +16,7 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- port: 8080
|
- port: 8080
|
||||||
targetPort: 8080
|
targetPort: 8080
|
||||||
name: apicast-proxy
|
name: apicast-svc
|
||||||
- port: 8090
|
- port: 8090
|
||||||
targetPort: 8090
|
targetPort: 8090
|
||||||
name: apicast-mgmt
|
name: apicast-mgmt
|
||||||
|
|||||||
@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
docker build -t bigchaindb/nginx_3scale:unstable .
|
docker build -t bigchaindb/nginx_3scale:unstable .
|
||||||
|
|
||||||
#docker push bigchaindb/nginx_3scale:unstable
|
docker push bigchaindb/nginx_3scale:unstable
|
||||||
|
|||||||
@ -5,34 +5,33 @@ BASE_DIR=$(pwd)
|
|||||||
APICAST_RELEASE="3.1.0"
|
APICAST_RELEASE="3.1.0"
|
||||||
BASE_GIT_URL="https://github.com/3scale/apicast/archive"
|
BASE_GIT_URL="https://github.com/3scale/apicast/archive"
|
||||||
|
|
||||||
|
|
||||||
# Sanity Check
|
|
||||||
if [[ -z "${THREESCALE_PORTAL_ENDPOINT:?THREESCALE_PORTAL_ENDPOINT not specified. Exiting!}" || \
|
|
||||||
-z "${BDB_SERVICE_ENDPOINT:?bigchaindb backend service endpoint not specified. Exiting!}" ]]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Download and Install Apicast
|
|
||||||
wget "${BASE_GIT_URL}/v${APICAST_RELEASE}.tar.gz"
|
|
||||||
tar -xvzf "v${APICAST_RELEASE}.tar.gz"
|
|
||||||
|
|
||||||
luarocks make apicast-${APICAST_RELEASE}/apicast/*.rockspec --tree /usr/local/openresty/luajit
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Set Default config
|
# Set Default config
|
||||||
export APICAST_CONFIGURATION_LOADER="boot" # Overriding apicast default lazy config loader
|
export APICAST_CONFIGURATION_LOADER="boot" # Overriding apicast default lazy config loader
|
||||||
export APICAST_MANAGEMENT_API="debug" # Overriding apicast default fo 'status' mode to be
|
export APICAST_MANAGEMENT_API="debug" # Overriding apicast default fo 'status' mode to be
|
||||||
# able to update service endpoint from https://test.bigchaindb.com
|
# able to update bigchaindb backen service endpoint
|
||||||
# to local service endpoint
|
|
||||||
|
# Sanity Check
|
||||||
|
if [[ -z "${THREESCALE_PORTAL_ENDPOINT:?THREESCALE_PORTAL_ENDPOINT not specified. Exiting!}" || \
|
||||||
|
-z "${BIGCHAINDB_BACKEND_HOST:?BIGCHAINDB_BACKEND_HOST not specified. Exiting!}" || \
|
||||||
|
-z "${BIGCHAINDB_API_PORT:?BIGCHAINDB_API_PORT not specified. Exiting!}" ]]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
export THREESCALE_PORTAL_ENDPOINT=`printenv THREESCALE_PORTAL_ENDPOINT`
|
||||||
|
|
||||||
# Print Current Configs
|
# Print Current Configs
|
||||||
echo "Apicast Release: ${APICAST_RELEASE}"
|
echo "Apicast Release: ${APICAST_RELEASE}"
|
||||||
echo "Apicast Download URL: ${BASE_GIT_URL}"
|
echo "Apicast Download URL: ${BASE_GIT_URL}"
|
||||||
echo "APICAST_CONFIGURATION_LOADER: ${APICAST_CONFIGURATION_LOADER}"
|
echo "APICAST_CONFIGURATION_LOADER: ${APICAST_CONFIGURATION_LOADER}"
|
||||||
echo "BDB_SERVICE_ENDPOINT: ${BDB_SERVICE_ENDPOINT}"
|
echo "BIGCHAINDB_BACKEND_HOST: ${BIGCHAINDB_BACKEND_HOST}"
|
||||||
|
echo "BIGCHAINDB_API_PORT: ${BIGCHAINDB_API_PORT}"
|
||||||
|
|
||||||
|
# Download and Install Apicast
|
||||||
|
wget "${BASE_GIT_URL}/v${APICAST_RELEASE}.tar.gz"
|
||||||
|
tar -xvzf "v${APICAST_RELEASE}.tar.gz"
|
||||||
|
|
||||||
|
eval luarocks make apicast-${APICAST_RELEASE}/apicast/*.rockspec --tree /usr/local/openresty/luajit
|
||||||
|
|
||||||
# Start nginx
|
# Start nginx
|
||||||
echo "INFO: starting nginx..."
|
echo "INFO: starting nginx..."
|
||||||
exec apicast-${APICAST_RELEASE}/apicast/bin/apicast -b -e production -v -v -v
|
exec apicast-${APICAST_RELEASE}/apicast/bin/apicast -b -e production -v -v -v
|
||||||
Loading…
x
Reference in New Issue
Block a user