knative / serving

Kubernetes-based, scale-to-zero, request-driven compute
https://knative.dev/docs/serving/
Apache License 2.0
5.54k stars 1.15k forks source link

stock-rest-app sample always responds "stock not found not found for ticker" #1136

Closed will-cromar closed 6 years ago

will-cromar commented 6 years ago

/area test-and-release /kind bug /assign @will-cromar

Expected Behavior

Stock price should be displayed for when getting /stock/{stockId}, when the ticker is valid.

Actual Behavior

The response is always "stock not found for ticker : {stockId}".

Steps to Reproduce the Problem

  1. Follow the instructions for Setup and Exploring in the README with a Knative cluster.
  2. Try GET /stock/{stockId} for some real ticker (eg AAPL).

Additional Info

The root cause is that the app is unable to make connections outside of the cluster. You need to add a ServiceEntry with api.iextrading.com as a host for it to work, otherwise every external API call will fail.

This service entry makes it work:

apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
 name: iextrading
spec:
 hosts:
 - api.iextrading.com
 ports:
 - number: 443
   protocol: HTTPS
evankanderson commented 6 years ago

This looks like a dup of #872

evankanderson commented 6 years ago

/close

evankanderson commented 6 years ago

(It looks like I can't /close without being /assigned -- leaving to @will-cromar to close this)

will-cromar commented 6 years ago

Closing as duplicate.