Skip to content

Commit

Permalink
Update multiple instances setup (zowe#898)
Browse files Browse the repository at this point in the history
* update config to 2020 version

Signed-off-by: jandadav <[email protected]>

* certificates and config update

Signed-off-by: jandadav <[email protected]>

* Properly override allPeersUrls

Signed-off-by: Jakub Balhar <[email protected]>

* Working multi instance setup

Signed-off-by: Jakub Balhar <[email protected]>

* Make sure the services are accessible via Gateway and discovered

Signed-off-by: Jakub Balhar <[email protected]>

* revert run to master

Signed-off-by: jandadav <[email protected]>

Co-authored-by: jandadav <[email protected]>
Co-authored-by: Jakub Balhar <[email protected]>
  • Loading branch information
3 people authored Oct 21, 2020
1 parent 21f04a5 commit 85d9b0d
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 59 deletions.
12 changes: 7 additions & 5 deletions config/local-multi/api-catalog-service.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
environment:
discoveryLocations: https://localhost2:10021/eureka/,https://localhost3:10031/eureka/
discoveryLocations: https://localhost2:10021/eureka/,https://localhost:10011/eureka/
dsIpAddress: 0.0.0.0
eurekaPassword: password
eurekaUserId: eureka
Expand All @@ -8,7 +8,7 @@ environment:
ipAddress: 127.0.0.1
port: 10014
preferIpAddress: false
truststore: keystore/localhost/localhost.truststore.p12
truststore: keystore/localhost/localhost-multi.truststore.p12
truststorePassword: password
truststoreType: PKCS12

Expand All @@ -22,12 +22,14 @@ eureka:

server:
ssl:
enabled: false
keyAlias: localhost
keyAlias: localhost-multi
keyPassword: password
keyStore: keystore/localhost/localhost.keystore.p12
keyStore: keystore/localhost/localhost-multi.keystore.p12
keyStorePassword: password
keyStoreType: PKCS12
truststore: keystore/localhost/localhost-multi.truststore.p12
truststorePassword: password
truststoreType: PKCS12
apiml:
service-registry:
cacheRefreshInitialDelayInMillis: 10000
Expand Down
8 changes: 4 additions & 4 deletions config/local-multi/discoverable-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apiml:
hostname: localhost
ipAddress: 127.0.0.1
port: 10012
discoveryServiceUrls: https://localhost2:10021/eureka/,https://localhost3:10031/eureka/
discoveryServiceUrls: https://localhost2:10021/eureka/,https://localhost:10011/eureka/

spring:
output:
Expand All @@ -14,11 +14,11 @@ spring:

server:
ssl:
keyAlias: localhost
keyAlias: localhost-multi
keyPassword: password
keyStore: keystore/selfsigned/localhost.keystore.p12
keyStore: keystore/localhost/localhost-multi.keystore.p12
keyStorePassword: password
keyStoreType: PKCS12
trustStore: keystore/selfsigned/localhost.truststore.p12
trustStore: keystore/localhost/localhost-multi.truststore.p12
trustStorePassword: password
trustStoreType: PKCS12
27 changes: 15 additions & 12 deletions config/local-multi/discovery-service-1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ spring.profiles.include: diag

apiml:
service:
hostname: localhost2
ipAddress: 127.0.0.2
port: 10021
hostname: localhost
ipAddress: 0.0.0.0
port: 10011
discovery:
staticApiDefinitionsDirectories: config/local/api-defs
allPeersUrls: http://localhost2:10021/eureka/,http://localhost3:10031/eureka/
allPeersUrls: https://localhost2:10021/eureka
security:
ssl:
verifySslCertificatesOfServices: true
banner: console

spring:
output:
Expand All @@ -17,18 +21,17 @@ spring:
---
spring.profiles: https

apiml:
discovery:
allPeersUrls: https://localhost2:10021/eureka/,https://localhost3:10031/eureka/

server:
address: 0.0.0.0
ssl:
keyAlias: localhost
keyAlias: localhost-multi
keyPassword: password
keyStoreType: PKCS12
keyStore: keystore/localhost/localhost.keystore.p12
keyStore: keystore/localhost/localhost-multi.keystore.p12
keyStorePassword: password
trustStoreType: PKCS12
trustStore: keystore/localhost/localhost.truststore.p12
trustStore: keystore/localhost/localhost-multi.truststore.p12
trustStorePassword: password

apiml:
discovery:
allPeersUrls: https://localhost2:10021/eureka
27 changes: 15 additions & 12 deletions config/local-multi/discovery-service-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ spring.profiles.include: diag

apiml:
service:
hostname: localhost3
ipAddress: 127.0.0.3
port: 10031
hostname: localhost2
ipAddress: 0.0.0.0
port: 10021
discovery:
staticApiDefinitionsDirectories: config/local/api-defs
allPeersUrls: https://localhost2:10021/eureka/,https://localhost3:10031/eureka/
allPeersUrls: https://localhost:10011/eureka
security:
ssl:
verifySslCertificatesOfServices: true
banner: console

spring:
output:
Expand All @@ -17,18 +21,17 @@ spring:
---
spring.profiles: https

apiml:
discovery:
allPeersUrls: https://localhost2:10021/eureka/,https://localhost3:10031/eureka/

server:
address: 0.0.0.0
ssl:
keyAlias: localhost
keyAlias: localhost-multi
keyPassword: password
keyStoreType: PKCS12
keyStore: keystore/localhost/localhost.keystore.p12
keyStore: keystore/localhost/localhost-multi.keystore.p12
keyStorePassword: password
trustStoreType: PKCS12
trustStore: keystore/localhost/localhost.truststore.p12
trustStore: keystore/localhost/localhost-multi.truststore.p12
trustStorePassword: password

apiml:
discovery:
allPeersUrls: https://localhost:10011/eureka
26 changes: 21 additions & 5 deletions config/local-multi/gateway-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,38 @@ spring.profiles.include: diag
apiml:
service:
hostname: localhost
ipAddress: 127.0.0.1
ipAddress: 0.0.0.0
port: 10010
discoveryServiceUrls: https://localhost2:10021/eureka/,https://localhost3:10031/eureka/
discoveryServiceUrls: https://localhost2:10021/eureka/
security:
auth:
provider: dummy
zosmfServiceId: zosmf # Replace me with the correct z/OSMF service id
passTicket:
timeout: 360 # [s] - default timeout to expire (z/OS has 10 mins as default)
ssl:
verifySslCertificatesOfServices: true
zosmf:
useJwtToken: true # if true and z/OSMF returns JWT token use it, otherwise create Zowe JWT token with LTPA token from z/OSMF, default is true
x509:
enabled: true
banner: console

spring:
output:
ansi:
enabled: always
cache:
ehcache:
config: classpath:ehcache.xml

server:
ssl:
keyAlias: localhost
keyAlias: localhost-multi
keyPassword: password
keyStore: keystore/localhost/localhost.keystore.p12
keyStore: keystore/localhost/localhost-multi.keystore.p12
keyStorePassword: password
keyStoreType: PKCS12
trustStore: keystore/localhost/localhost.truststore.p12
trustStore: keystore/localhost/localhost-multi.truststore.p12
trustStorePassword: password
trustStoreType: PKCS12
36 changes: 18 additions & 18 deletions keystore/local_ca/localca.cer
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
-----BEGIN CERTIFICATE-----
MIID+zCCAuOgAwIBAgIEdkRICDANBgkqhkiG9w0BAQsFADCBnjELMAkGA1UEBhMC
-----BEGIN CERTIFICATE-----
MIID+zCCAuOgAwIBAgIES2Kd2TANBgkqhkiG9w0BAQsFADCBnjELMAkGA1UEBhMC
Q1oxDzANBgNVBAgTBlByYWd1ZTEPMA0GA1UEBxMGUHJhZ3VlMRQwEgYDVQQKEwta
b3dlIFNhbXBsZTEcMBoGA1UECxMTQVBJIE1lZGlhdGlvbiBMYXllcjE5MDcGA1UE
AxMwWm93ZSBEZXZlbG9wbWVudCBJbnN0YW5jZXMgQ2VydGlmaWNhdGUgQXV0aG9y
aXR5MB4XDTE5MDExMTEyMTIwNVoXDTI5MDEwODEyMTIwNVowgZ4xCzAJBgNVBAYT
aXR5MB4XDTIwMTAyMDA3MzkyOVoXDTMwMTAxODA3MzkyOVowgZ4xCzAJBgNVBAYT
AkNaMQ8wDQYDVQQIEwZQcmFndWUxDzANBgNVBAcTBlByYWd1ZTEUMBIGA1UEChML
Wm93ZSBTYW1wbGUxHDAaBgNVBAsTE0FQSSBNZWRpYXRpb24gTGF5ZXIxOTA3BgNV
BAMTMFpvd2UgRGV2ZWxvcG1lbnQgSW5zdGFuY2VzIENlcnRpZmljYXRlIEF1dGhv
cml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALyotswfS+sLTmwO
08ocbkNWPccRVWGWaP/LvfLe1USmhUOMO7E38ztTy8AJYBxrFTPr2lL3rXybRHCn
Lscz0XNvkNll6Yef71ghaLbpe0V12Jygw4J9BAbYdVIsrP+brR3pijGVO/ECvJwD
815ODsGU3Staw9HFlHO7dWss/TM2uz3Y6oVLObuhEWvAXiU3fW3PpFebRUlhLe5g
yprGSZDFQAJpi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FCRpLjbYx589Li1EfWKwGmQxiLA2MA0GCSqGSIb3DQEBCwUAA4IBAQCt
0YxLl4u7RZkntKSBjDiQXoFL6xkzvvoEAGtNztCVW78NHgA86MkuWmQ+eBSBxHda
NzjtLHHSwFfzHaaXoc/kNS2iTyHbntKheJ6YHi6mCA71nA5m+AUS3yV+iO5qFusc
jeYXXuwbP06i2v5J/yYtEyEARl2Wo9mOCOTOAl7e+V9qhYgRh1EbWO0pYTeRpya+
MCHI+xEPSmUaguEtxvGTdtmhDuKuS1Ndo5j72ceevy0uP5el3scsJnB1puGhQCh1
waG/jp8kndRbB3V3YjIqbA9MxxpMzpiOC5S0uQQ3t2sqV6p4q7Dj5o4GgfDu+RK3
EDOis6zm74HV4CIcw9Ka
-----END CERTIFICATE-----
Binary file modified keystore/local_ca/localca.keystore.p12
Binary file not shown.
Binary file added keystore/localhost/localhost-multi.keystore.p12
Binary file not shown.
Binary file added keystore/localhost/localhost-multi.truststore.p12
Binary file not shown.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"discoverable-client-debug": "java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=5012,suspend=n -jar discoverable-client/build/libs/discoverable-client.jar --spring.config.additional-location=file:./config/local/discoverable-client.yml",
"onboarding-enabler-spring-v1-sample-app": "java -jar onboarding-enabler-spring-v1-sample-app/build/libs/enabler-springboot-1.5.9.RELEASE-sample.jar --spring.config.location=classpath:/,file:./config/local/onboarding-enabler-spring-v1-sample-app.yml",
"api-layer-multi": "concurrently --names \"GS1,DS1,DS2,AC1,DC1\" -c cyan,yellow,yellow,white,blue npm:gateway-service-1 npm:discovery-service-1 npm:discovery-service-2 npm:api-catalog-service-1 npm:discoverable-client-1",
"gateway-service-1": "java -jar gateway-service/build/libs/gateway-service.jar --spring.config.additional-location=file:./config/local-multi/gateway-service.yml",
"discovery-service-1": "java -jar discovery-service/build/libs/discovery-service.jar --spring.profiles.active=https --spring.config.additional-location=file:./config/local-multi/discovery-service-1.yml",
"gateway-service-1": "java -Djavax.net.debug=all -jar gateway-service/build/libs/gateway-service.jar --spring.config.additional-location=file:./config/local-multi/gateway-service.yml",
"discovery-service-1": "java -jar discovery-service/build/libs/discovery-service.jar --spring.profiles.include=debug --spring.profiles.active=https --spring.config.additional-location=file:./config/local-multi/discovery-service-1.yml",
"discovery-service-2": "java -jar discovery-service/build/libs/discovery-service.jar --spring.profiles.include=debug --spring.profiles.active=https --spring.config.additional-location=file:./config/local-multi/discovery-service-2.yml",
"discovery-service-1-debug": "java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=5010,suspend=n -jar discovery-service/build/libs/discovery-service.jar --spring.profiles.active=https --spring.config.additional-location=file:./config/local-multi/discovery-service-1.yml",
"discovery-service-2": "java -jar discovery-service/build/libs/discovery-service.jar --spring.profiles.active=https --spring.config.additional-location=file:./config/local-multi/discovery-service-2.yml",
"api-catalog-service-1": "java -jar api-catalog-services/build/libs/api-catalog-services.jar --spring.config.additional-location=file:./config/local-multi/api-catalog-service.yml",
"discoverable-client-1": "java -jar discoverable-client/build/libs/discoverable-client.jar --spring.config.additional-location=file:./config/local-multi/discoverable-client.yml",
"mock-zosmf": "java -jar mock-zosmf/build/libs/mock-zosmf.jar",
Expand Down

0 comments on commit 85d9b0d

Please sign in to comment.