diff --git a/istio-manifests/whitelist-egress-currencyprovider.yaml b/istio-manifests/whitelist-egress-currencyprovider.yaml index 8523fc0..0d3d31b 100644 --- a/istio-manifests/whitelist-egress-currencyprovider.yaml +++ b/istio-manifests/whitelist-egress-currencyprovider.yaml @@ -19,6 +19,7 @@ metadata: spec: hosts: - www.ecb.europa.eu + - amer-demo4-test.apigee.net ports: - number: 80 name: http diff --git a/kubernetes-manifests/currencyservice.yaml b/kubernetes-manifests/currencyservice.yaml index b344b1a..5309bda 100644 --- a/kubernetes-manifests/currencyservice.yaml +++ b/kubernetes-manifests/currencyservice.yaml @@ -25,7 +25,7 @@ spec: terminationGracePeriodSeconds: 5 containers: - name: server - image: gcr.io/microservices-demo-app/currencyservice + image: gcr.io/microservices-demo-app/currencyservice ports: - name: grpc containerPort: 7000 @@ -42,6 +42,9 @@ spec: limits: cpu: 200m memory: 128Mi + env: + - name: DATA_URL + value: "http://amer-demo4-test.apigee.net/currency-service" --- apiVersion: v1 kind: Service diff --git a/src/currencyservice/client.js b/src/currencyservice/client.js index f381dc8..3dbf7c4 100644 --- a/src/currencyservice/client.js +++ b/src/currencyservice/client.js @@ -61,6 +61,6 @@ client.convert(request, (err, response) => { if (err) { logger.error(`Error in convert: ${err}`); } else { - logger.log(`Convert: ${_moneyToString(request.from)} to ${_moneyToString(response)}`); + logger.info(`Convert: ${_moneyToString(request.from)} to ${_moneyToString(response)}`); } }); diff --git a/src/currencyservice/server.js b/src/currencyservice/server.js index 633078c..a101788 100644 --- a/src/currencyservice/server.js +++ b/src/currencyservice/server.js @@ -39,7 +39,7 @@ const MAIN_PROTO_PATH = path.join(__dirname, './proto/demo.proto'); const HEALTH_PROTO_PATH = path.join(__dirname, './proto/grpc/health/v1/health.proto'); const PORT = 7000; -const DATA_URL = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'; +const DATA_URL = process.env.DATA_URL //'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'; const shopProto = _loadProto(MAIN_PROTO_PATH).hipstershop; const healthProto = _loadProto(HEALTH_PROTO_PATH).grpc.health.v1;