From a72ec9bb0fc0ec33fd0635d85f30f89925ddff78 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Thu, 27 Jul 2023 12:25:29 -0400 Subject: [PATCH 1/3] Update defaults.yaml Signed-off-by: 1000TurquoisePogs --- defaults/serverConfig/defaults.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/defaults/serverConfig/defaults.yaml b/defaults/serverConfig/defaults.yaml index f4c659f..2c60a51 100644 --- a/defaults/serverConfig/defaults.yaml +++ b/defaults/serverConfig/defaults.yaml @@ -57,11 +57,10 @@ components: loopbackAddress: "${{ function a(){ if (process.env.ZOWE_LOOPBACK_ADDRESS) { return process.env.ZOWE_LOOPBACK_ADDRESS; } else { return undefined; } }; a() }}" mediationLayer: server: - # if ZWE_DISCOVERY_SERVICES_LIST exists, its more accurate than zowe.externalDomains, as that doesn't handle containers well. - # if exists, its in the format of "https://discovery-0.discovery-service.zowe.svc.cluster.local:7553/eureka/" + # strange but true: to contact discovery in a container, instead reach for the gateway hostname. hostname: '${{ function a() { - if (process.env.ZWE_DISCOVERY_SERVICES_LIST) { - return process.env.ZWE_DISCOVERY_SERVICES_LIST.split(",")[0].split("/")[2].split(":")[0]; + if (process.env.ZWE_RUN_IN_CONTAINER=="true" && process.env.ZWE_GATEWAY_HOST) { + return process.env.ZWE_GATEWAY_HOST; } else { return zowe.externalDomains[0] } }; a() }}' From e78859c422acd83a48f026a7323fa5d5e2b9b1f4 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Thu, 27 Jul 2023 13:02:24 -0400 Subject: [PATCH 2/3] Update defaults.yaml Signed-off-by: 1000TurquoisePogs --- defaults/serverConfig/defaults.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/defaults/serverConfig/defaults.yaml b/defaults/serverConfig/defaults.yaml index 2c60a51..c3d9186 100644 --- a/defaults/serverConfig/defaults.yaml +++ b/defaults/serverConfig/defaults.yaml @@ -73,7 +73,13 @@ components: return zowe.externalDomains[0] } }; a() }}' port: ${{ components.discovery.port }} - gatewayPort: ${{ zowe.externalPort }} + # strange but true: to contact gateway in a container, dont use the external port. + gatewayPort: '${{ function a() { + if (process.env.ZWE_RUN_IN_CONTAINER=="true") { + return components.gateway.port; + } else { + return zowe.externalPort } }; + a() }}' isHttps: true cachingService: enabled: ${{ components['app-server'].node.mediationLayer.enabled && components['caching-service'].enabled }} From 3ad871a6715920167c2ebc2707e9eda5cb5dab64 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Fri, 28 Jul 2023 12:41:57 -0400 Subject: [PATCH 3/3] Fix zss connection in container Signed-off-by: 1000TurquoisePogs --- bin/configure.sh | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/bin/configure.sh b/bin/configure.sh index ec64045..b78fdd7 100755 --- a/bin/configure.sh +++ b/bin/configure.sh @@ -23,30 +23,28 @@ fi cd ${COMPONENT_HOME}/share/zlux-app-server/bin -if [ -n "$ZWE_components_app_server_node_mediationLayer_enabled" -a -z "$ZWE_components_app_server_agent_mediationLayer_enabled" ]; then - if [ "${ZWE_RUN_ON_ZOS}" != "true" ]; then - zss_def_template="zss.apiml_static_reg.yaml.template" - zss_configured=false - if [ -n "${ZWE_components_app_server_agent_https_port}" ]; then - export ZSS_PORT="${ZWE_components_app_server_agent_https_port}" - export ZSS_PROTOCOL=https - zss_configured=true - elif [ -n "${ZWED_components_app_server_agent_http_port}" ]; then - export ZSS_PORT="${ZWE_components_app_server_http_port}" - export ZSS_PROTOCOL=http - zss_configured=true - fi - - if [ "${zss_configured}" = "true" ] && [ -n "${ZWE_STATIC_DEFINITIONS_DIR}" ]; then - zss_registration_yaml=${ZWE_STATIC_DEFINITIONS_DIR}/zss.apiml_static_reg_yaml_template.${ZWE_CLI_PARAMETER_HA_INSTANCE}.yml - zss_def="../${zss_def_template}" - zss_parsed_def=$( ( echo "cat <&1) - echo "${zss_parsed_def}" > "${zss_registration_yaml}" - chmod 770 "${zss_registration_yaml}" - fi +if [ "$ZWE_components_gateway_enabled" == "true" ]; then + if [ "$ZWE_components_zss_enabled" == "true" ]; then + if [ "${ZWE_RUN_ON_ZOS}" != "true" ]; then + zss_def_template="zss.apiml_static_reg.yaml.template" + export ZSS_PORT="${ZWE_components_zss_port}" + if [ "${ZWE_components_zss_tls}" != "false" ]; then + export ZSS_PROTOCOL=https + else + export ZSS_PROTOCOL=http + fi - unset ZSS_PORT - unset ZSS_PROTOCOL + if [ -n "${ZWE_STATIC_DEFINITIONS_DIR}" ]; then + zss_registration_yaml=${ZWE_STATIC_DEFINITIONS_DIR}/zss.apiml_static_reg_yaml_template.${ZWE_CLI_PARAMETER_HA_INSTANCE}.yml + zss_def="../${zss_def_template}" + zss_parsed_def=$( ( echo "cat <&1) + echo "${zss_parsed_def}" > "${zss_registration_yaml}" + chmod 770 "${zss_registration_yaml}" + fi + + unset ZSS_PORT + unset ZSS_PROTOCOL + fi fi fi