Problem: Kubernetes template broken for threescale/apicast deployment (#2206)

This commit is contained in:
Ahmed Muawia Khan 2018-04-26 11:37:41 +02:00 committed by GitHub
parent e90b5fa5f2
commit 119420785d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 4 deletions

View File

@ -57,11 +57,12 @@ data:
# available/listening for requests.
mongodb-backend-port: "27017"
# TODO: Change `openresty` to `apicast`
# openresty-backend-port is the port number on which OpenResty is listening
# for requests. This is used by the NGINX instance to forward the requests to
# the right port, and by OpenResty instance to bind to the correct port to
# receive requests from NGINX instance.
openresty-backend-port: "80"
openresty-backend-port: "8080"
# BigchainDB configuration parameters
# Refer https://docs.bigchaindb.com/projects/server/en/latest/server-reference/configuration.html

View File

@ -228,6 +228,7 @@ function generate_config_map(){
tm_chain_id="${8}"
tm_instance_name="${9}"
dns_resolver_k8s="${10}"
auth_mode="${11}"
cat > config-map.yaml << EOF
apiVersion: v1
@ -282,11 +283,12 @@ data:
# available/listening for requests.
mongodb-backend-port: "27017"
# TODO: Change `openresty` to `apicast`
# openresty-backend-port is the port number on which OpenResty is listening
# for requests. This is used by the NGINX instance to forward the requests to
# the right port, and by OpenResty instance to bind to the correct port to
# receive requests from NGINX instance.
openresty-backend-port: "80"
openresty-backend-port: "8080"
# BigchainDB configuration parameters
# Refer https://docs.bigchaindb.com/projects/server/en/latest/server-reference/configuration.html
@ -318,7 +320,7 @@ data:
storage-engine-cache-size: ""
# POST API authorization mode [threescale | secret-token]
authorization-mode: "secret-token"
authorization-mode: "${auth_mode}"
---
apiVersion: v1

View File

@ -15,6 +15,7 @@ INDEX='0'
CONFIGURE_CA='true'
CONFIGURE_MEMBER='true'
CONFIGURE_CLIENT='true'
SECRET_TOKEN=${SECRET_TOKEN:="secret-token"}
function show_help(){
cat > /dev/stdout << END
@ -52,6 +53,17 @@ if [[ -z "${CERT_DIR}" ]] ; then
exit 1
fi
if [[ -z "${AUTH_MODE}" ]]; then
echo "Missing required argument AUTH_MODE"
exit 1
fi
if [[ "${AUTH_MODE}" != "secret-token" && \
"${AUTH_MODE}" != "threescale" ]]; then
echo "Invalid AUTH_MODE configuration, only accepted values are: [secret-token, threescale]"
exit 1
fi
# Create BASE_DIR
BASE_DIR="$(pwd)/${CERT_DIR}"
mkdir -p "${BASE_DIR}"
@ -87,4 +99,5 @@ convert_b64 $BASE_K8S_DIR $BASE_CA_DIR/$BASE_EASY_RSA_PATH $BASE_CLIENT_CERT_DIR
get_users $BASE_USERS_DIR $BASE_CA_DIR/$BASE_EASY_RSA_PATH
generate_secretes_no_threescale $BASE_K8S_DIR $SECRET_TOKEN $HTTPS_CERT_KEY_FILE_NAME $HTTPS_CERT_CHAIN_FILE_NAME $MDB_ADMIN_PASSWORD
generate_config_map $BASE_USERS_DIR $MDB_ADMIN_USER $NODE_FQDN $TM_SEEDS $TM_VALIDATORS $TM_VALIDATOR_POWERS $TM_GENESIS_TIME $TM_CHAIN_ID $TM_INSTANCE_NAME $NODE_DNS_SERVER
generate_config_map $BASE_USERS_DIR $MDB_ADMIN_USER $NODE_FQDN $TM_SEEDS $TM_VALIDATORS $TM_VALIDATOR_POWERS $TM_GENESIS_TIME \
$TM_CHAIN_ID $TM_INSTANCE_NAME $NODE_DNS_SERVER $AUTH_MODE

View File

@ -1,8 +1,12 @@
# DNS name of the bigchaindb node
NODE_FQDN="test-node.bigchaindb.com"
# Authorization mode: [secret-token, threescale]
AUTH_MODE="secret-token"
# Secret token used for authorization of
# POST requests to the bigchaindb node
# Only required when AUTH_MODE=secret-token
SECRET_TOKEN="test-secret"
# Absolute path for the SSL certificate key