Format markdown (#1379)

Produced via: `prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github)`
This commit is contained in:
mattmoor-sockpuppet 2019-05-29 07:28:34 -07:00 committed by Knative Prow Robot
parent dee2bd0751
commit ff9cac1293
1 changed files with 115 additions and 117 deletions

View File

@ -1,8 +1,7 @@
This "stock ticker" sample demonstrates how to create and run a simple RESTful service This "stock ticker" sample demonstrates how to create and run a simple RESTful
on Knative Serving. The exposed endpoint outputs the stock price for a given service on Knative Serving. The exposed endpoint outputs the stock price for a
"[stock symbol](https://www.marketwatch.com/tools/quotes/lookup.asp)", like given "[stock symbol](https://www.marketwatch.com/tools/quotes/lookup.asp)",
`AAPL`,`AMZN`, `GOOG`, `MSFT`, etc. like `AAPL`,`AMZN`, `GOOG`, `MSFT`, etc.
## Prerequisites ## Prerequisites
@ -155,12 +154,12 @@ You can inspect the created resources with the following `kubectl` commands:
## Access the Service ## Access the Service
To access this service and run the stock ticker, you first obtain the ingress address To access this service and run the stock ticker, you first obtain the ingress
and service hostname, and then you run `curl` commands to send request with your stock address and service hostname, and then you run `curl` commands to send request
symbol. with your stock symbol.
**Note**: This sample assumes that you are using Knative's default Ingress Gateway. **Note**: This sample assumes that you are using Knative's default Ingress
If you customized your gateway, you need to adjust the enviornment Gateway. If you customized your gateway, you need to adjust the enviornment
variables in the following steps. variables in the following steps.
1. Find the IP address of the ingress gateway: 1. Find the IP address of the ingress gateway:
@ -176,10 +175,10 @@ variables in the following steps.
echo $INGRESS_IP echo $INGRESS_IP
``` ```
- **Minikube**: If your cluster is running outside a cloud provider (for example on - **Minikube**: If your cluster is running outside a cloud provider (for
Minikube), your services will never get an external IP address, and example on Minikube), your services will never get an external IP address,
`INGRESS_IP` won't contain a value. In that case, use the Istio `hostIP` and and `INGRESS_IP` won't contain a value. In that case, use the Istio
`nodePort` as the ingress IP: `hostIP` and `nodePort` as the ingress IP:
```shell ```shell
export INGRESS_IP=$(kubectl get po --selector $INGRESSGATEWAY_LABEL=ingressgateway --namespace istio-system \ export INGRESS_IP=$(kubectl get po --selector $INGRESSGATEWAY_LABEL=ingressgateway --namespace istio-system \
@ -202,8 +201,8 @@ variables in the following steps.
The `curl` command below makes a request to the Ingress Gateway IP. The The `curl` command below makes a request to the Ingress Gateway IP. The
Ingress Gateway uses the host header to route the request to the Service. Ingress Gateway uses the host header to route the request to the Service.
This example passes the host header to skip DNS configuration. If your This example passes the host header to skip DNS configuration. If your
cluster has DNS configured, you can simply curl the DNS name instead of the cluster has DNS configured, you can simply curl the DNS name instead of
ingress gateway IP. the ingress gateway IP.
```shell ```shell
curl --header "Host:$SERVICE_HOSTNAME" http://${INGRESS_IP} curl --header "Host:$SERVICE_HOSTNAME" http://${INGRESS_IP}
@ -228,7 +227,6 @@ variables in the following steps.
where `<SYMBOL>` is your "stock symbol". where `<SYMBOL>` is your "stock symbol".
Response body: `stock price for ticker <SYMBOL> is <PRICE>` Response body: `stock price for ticker <SYMBOL> is <PRICE>`
**Example** **Example**