diff --git a/kubernetes-manifests/currencyservice.yaml b/kubernetes-manifests/currencyservice.yaml index 2d6d76a..908c4f4 100644 --- a/kubernetes-manifests/currencyservice.yaml +++ b/kubernetes-manifests/currencyservice.yaml @@ -32,6 +32,9 @@ spec: ports: - name: grpc containerPort: 7000 + env: + - name: PORT + value: "7000" readinessProbe: exec: command: ["/bin/grpc_health_probe", "-addr=:7000"] diff --git a/src/currencyservice/server.js b/src/currencyservice/server.js index 0b231b0..d3e9ad1 100644 --- a/src/currencyservice/server.js +++ b/src/currencyservice/server.js @@ -36,7 +36,7 @@ const protoLoader = require('@grpc/proto-loader'); 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 PORT = process.env.PORT; const shopProto = _loadProto(MAIN_PROTO_PATH).hipstershop; const healthProto = _loadProto(HEALTH_PROTO_PATH).grpc.health.v1;