mirror of https://github.com/knative/docs.git
Update samples to not use Ingress. (#60)
* Update samples to not use Ingress. This is follow-up of https://github.com/knative/serving/pull/1228. We moved to Istio v1alpha3 / Gateway which requires a different way to get the external IP address to send traffic to our samples. * Also update the command to find service domain.
This commit is contained in:
parent
c57f006f4c
commit
b97fa65aec
|
@ -29,14 +29,14 @@ kubectl apply -f sample/autoscale/sample.yaml
|
|||
|
||||
```
|
||||
|
||||
Export your Ingress IP as SERVICE_IP.
|
||||
Export your ingress IP as SERVICE_IP.
|
||||
|
||||
```shell
|
||||
# Put the Ingress Host name into an environment variable.
|
||||
# Put the ingress Host name into an environment variable.
|
||||
export SERVICE_HOST=`kubectl get route autoscale-route -o jsonpath="{.status.domain}"`
|
||||
|
||||
# Put the Ingress IP into an environment variable.
|
||||
export SERVICE_IP=`kubectl get ingress autoscale-route-ingress -o jsonpath="{.status.loadBalancer.ingress[*]['ip']}"`
|
||||
# Put the ingress IP into an environment variable.
|
||||
export SERVICE_IP=`kubectl get svc knative-ingressgateway -n istio-system -o jsonpath="{.status.loadBalancer.ingress[*].ip}"`
|
||||
```
|
||||
|
||||
Request the largest prime less than 40,000,000 from the autoscale app. Note that it consumes about 1 cpu/sec.
|
||||
|
|
|
@ -55,21 +55,21 @@ Once the `BuildComplete` status becomes `True` the resources will start getting
|
|||
|
||||
To access this service via `curl`, we first need to determine its ingress address:
|
||||
```shell
|
||||
$ watch kubectl get ing
|
||||
NAME HOSTS ADDRESS PORTS AGE
|
||||
buildpack-sample-app-ingress buildpack-app.example.com 80 3m
|
||||
$ watch kubectl get svc knative-ingressgateway -n istio-system
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
knative-ingressgateway LoadBalancer 10.23.247.74 35.203.155.229 80:32380/TCP,443:32390/TCP,32400:32400/TCP 2d
|
||||
```
|
||||
|
||||
Once the `ADDRESS` gets assigned to the cluster, you can run:
|
||||
|
||||
```shell
|
||||
# Put the Ingress Host name into an environment variable.
|
||||
# Put the Host name into an environment variable.
|
||||
export SERVICE_HOST=`kubectl get route buildpack-sample-app -o jsonpath="{.status.domain}"`
|
||||
|
||||
# Put the Ingress IP into an environment variable.
|
||||
$ export SERVICE_IP=`kubectl get ingress buildpack-sample-app-ingress -o jsonpath="{.status.loadBalancer.ingress[*]['ip']}"`
|
||||
# Put the ingress IP into an environment variable.
|
||||
export SERVICE_IP=`kubectl get svc knative-ingressgateway -n istio-system -o jsonpath="{.status.loadBalancer.ingress[*].ip}"`
|
||||
|
||||
# Curl the Ingress IP "as-if" DNS were properly configured.
|
||||
# Curl the ingress IP "as-if" DNS were properly configured.
|
||||
$ curl --header "Host: $SERVICE_HOST" http://${SERVICE_IP}/
|
||||
[response]
|
||||
```
|
||||
|
|
|
@ -54,21 +54,22 @@ Once the `BuildComplete` status becomes `True` the resources will start getting
|
|||
|
||||
To access this service via `curl`, we first need to determine its ingress address:
|
||||
```shell
|
||||
$ watch kubectl get ing
|
||||
NAME HOSTS ADDRESS PORTS AGE
|
||||
buildpack-function-ingress buildpack-function.default.example.com 0.0.0.0 80 3m
|
||||
watch kubectl get svc knative-ingressgateway -n istio-system
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
knative-ingressgateway LoadBalancer 10.23.247.74 35.203.155.229 80:32380/TCP,443:32390/TCP,32400:32400/TCP 2d
|
||||
```
|
||||
|
||||
Once the `ADDRESS` gets assigned to the cluster, you can run:
|
||||
Once the `EXTERNAL-IP` gets assigned to the cluster, you can run:
|
||||
|
||||
```shell
|
||||
# Put the Ingress Host name into an environment variable.
|
||||
# Put the Host name into an environment variable.
|
||||
$ export SERVICE_HOST=`kubectl get route buildpack-function -o jsonpath="{.status.domain}"`
|
||||
|
||||
# Put the Ingress IP into an environment variable.
|
||||
$ export SERVICE_IP=`kubectl get ingress buildpack-function-ingress -o jsonpath="{.status.loadBalancer.ingress[*]['ip']}"`
|
||||
# Put the ingress IP into an environment variable.
|
||||
$ export SERVICE_IP=`kubectl get svc knative-ingressgateway -n istio-system -o jsonpath="{.status.loadBalancer.ingress[*].ip}"`
|
||||
|
||||
# Curl the Ingress IP "as-if" DNS were properly configured.
|
||||
|
||||
# Curl the ingress IP "as-if" DNS were properly configured.
|
||||
$ curl http://${SERVICE_IP}/ -H "Host: $SERVICE_HOST" -H "Content-Type: application/json" -d "33"
|
||||
[response]
|
||||
```
|
||||
|
|
|
@ -47,14 +47,14 @@ kubectl get revisions -o yaml
|
|||
```
|
||||
|
||||
To make this service accessible to github, we first need to determine its ingress address
|
||||
(might have to wait a little while until 'ADDRESS' gets assigned):
|
||||
(might have to wait a little while until `EXTERNAL-IP` gets assigned):
|
||||
```shell
|
||||
$ watch kubectl get ingress
|
||||
NAME HOSTS ADDRESS PORTS AGE
|
||||
git-webhook-ingress demostuff.aikas.org 35.202.30.59 80 14s
|
||||
watch kubectl get svc knative-ingressgateway -n istio-system
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
knative-ingressgateway LoadBalancer 10.23.247.74 35.203.155.229 80:32380/TCP,443:32390/TCP,32400:32400/TCP 2d
|
||||
```
|
||||
|
||||
Once the `ADDRESS` gets assigned to the cluster, you need to assign a DNS name for that IP address.
|
||||
Once the `EXTERNAL-IP` gets assigned to the cluster, you need to assign a DNS name for that IP address.
|
||||
[Using GCP DNS](https://support.google.com/domains/answer/3290350)
|
||||
|
||||
So, you'd need to create an A record for demostuff.aikas.org pointing to 35.202.30.59.
|
||||
|
|
|
@ -37,11 +37,11 @@ kubectl apply -f sample/grpc-ping/sample.yaml
|
|||
1. Fetch the created ingress hostname and IP.
|
||||
|
||||
```
|
||||
# Put the Ingress Host name into an environment variable.
|
||||
# Put the Host name into an environment variable.
|
||||
export SERVICE_HOST=`kubectl get route grpc-ping -o jsonpath="{.status.domain}"`
|
||||
|
||||
# Put the Ingress IP into an environment variable.
|
||||
export SERVICE_IP=`kubectl get ingress grpc-ping-ela-ingress -o jsonpath="{.status.loadBalancer.ingress[*]['ip']}"`
|
||||
# Put the ingress IP into an environment variable.
|
||||
export SERVICE_IP=`kubectl get svc knative-ingressgateway -n istio-system -o jsonpath="{.status.loadBalancer.ingress[*].ip}"`
|
||||
```
|
||||
|
||||
1. Use the client to send message streams to the gRPC server
|
||||
|
|
|
@ -115,15 +115,24 @@ folder) you're ready to build and deploy the sample app.
|
|||
* Network programming to create a route, ingress, service, and load balance for your app.
|
||||
* Automatically scale your pods up and down (including to zero active pods).
|
||||
|
||||
1. To find the URL and IP address for your service, use `kubectl get ing` to
|
||||
list the ingress points in the cluster. It may take a few seconds for the
|
||||
ingress point to be created.
|
||||
1. To find the IP address for your service, use
|
||||
`kubectl get svc knative-ingressgateway -n istio-system` to get the ingress IP for your
|
||||
cluster. If your cluster is new, it may take sometime for the service to get asssigned
|
||||
an external IP address.
|
||||
|
||||
```shell
|
||||
kubectl get ing
|
||||
kubectl get svc knative-ingressgateway -n istio-system
|
||||
|
||||
NAME HOSTS ADDRESS PORTS AGE
|
||||
helloworld-csharp-ingress helloworld-csharp.default.example.com 35.232.134.1 80 1m
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
knative-ingressgateway LoadBalancer 10.23.247.74 35.203.155.229 80:32380/TCP,443:32390/TCP,32400:32400/TCP 2d
|
||||
|
||||
```
|
||||
|
||||
1. To find the URL for your service, use
|
||||
```
|
||||
kubectl get services.serving.knative.dev helloworld-csharp -o=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain
|
||||
NAME DOMAIN
|
||||
helloworld-csharp helloworld-csharp.default.example.com
|
||||
```
|
||||
|
||||
1. Now you can make a request to your app to see the result. Replace
|
||||
|
|
|
@ -126,15 +126,24 @@ folder) you're ready to build and deploy the sample app.
|
|||
* Network programming to create a route, ingress, service, and load balance for your app.
|
||||
* Automatically scale your pods up and down (including to zero active pods).
|
||||
|
||||
1. To find the URL and IP address for your service, use `kubectl get ing` to
|
||||
list the ingress points in the cluster. It may take a few seconds for the
|
||||
ingress point to be created.
|
||||
1. To find the IP address for your service, use
|
||||
`kubectl get svc knative-ingressgateway -n istio-system` to get the ingress IP for your
|
||||
cluster. If your cluster is new, it may take sometime for the service to get asssigned
|
||||
an external IP address.
|
||||
|
||||
```shell
|
||||
kubectl get ing
|
||||
kubectl get svc knative-ingressgateway -n istio-system
|
||||
|
||||
NAME HOSTS ADDRESS PORTS AGE
|
||||
helloworld-go-ingress helloworld-go.default.example.com,*.helloworld-go.default.example.com 35.232.134.1 80 1m
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
knative-ingressgateway LoadBalancer 10.23.247.74 35.203.155.229 80:32380/TCP,443:32390/TCP,32400:32400/TCP 2d
|
||||
|
||||
```
|
||||
|
||||
1. To find the URL for your service, use
|
||||
```
|
||||
kubectl get services.serving.knative.dev helloworld-go -o=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain
|
||||
NAME DOMAIN
|
||||
helloworld-go helloworld-go.default.example.com
|
||||
```
|
||||
|
||||
1. Now you can make a request to your app to see the results. Replace
|
||||
|
|
|
@ -139,15 +139,24 @@ folder) you're ready to build and deploy the sample app.
|
|||
* Network programming to create a route, ingress, service, and load balance for your app.
|
||||
* Automatically scale your pods up and down (including to zero active pods).
|
||||
|
||||
1. To find the URL and IP address for your service, use `kubectl get ing` to
|
||||
list the ingress points in the cluster. It may take a few seconds for the
|
||||
ingress point to be created.
|
||||
1. To find the IP address for your service, use
|
||||
`kubectl get svc knative-ingressgateway -n istio-system` to get the ingress IP for your
|
||||
cluster. If your cluster is new, it may take sometime for the service to get asssigned
|
||||
an external IP address.
|
||||
|
||||
```shell
|
||||
kubectl get ing
|
||||
kubectl get svc knative-ingressgateway -n istio-system
|
||||
|
||||
NAME HOSTS ADDRESS PORTS AGE
|
||||
helloworld-java-ingress helloworld-java.default.example.com 35.232.134.1 80 1m
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
knative-ingressgateway LoadBalancer 10.23.247.74 35.203.155.229 80:32380/TCP,443:32390/TCP,32400:32400/TCP 2d
|
||||
|
||||
```
|
||||
|
||||
1. To find the URL for your service, use
|
||||
```
|
||||
kubectl get services.serving.knative.dev helloworld-java -o=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain
|
||||
NAME DOMAIN
|
||||
helloworld-java helloworld-java.default.example.com
|
||||
```
|
||||
|
||||
1. Now you can make a request to your app to see the result. Replace
|
||||
|
|
|
@ -157,15 +157,24 @@ folder) you're ready to build and deploy the sample app.
|
|||
* Network programming to create a route, ingress, service, and load balance for your app.
|
||||
* Automatically scale your pods up and down (including to zero active pods).
|
||||
|
||||
1. To find the URL and IP address for your service, use `kubectl get ing` to
|
||||
list the ingress points in the cluster. It may take a few seconds for the
|
||||
ingress point to be created.
|
||||
1. To find the IP address for your service, use
|
||||
`kubectl get svc knative-ingressgateway -n istio-system` to get the ingress IP for your
|
||||
cluster. If your cluster is new, it may take sometime for the service to get asssigned
|
||||
an external IP address.
|
||||
|
||||
```shell
|
||||
kubectl get ing
|
||||
kubectl get svc knative-ingressgateway -n istio-system
|
||||
|
||||
NAME HOSTS ADDRESS PORTS AGE
|
||||
helloworld-nodejs-ingress helloworld-nodejs.default.example.com 35.232.134.1 80 1m
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
knative-ingressgateway LoadBalancer 10.23.247.74 35.203.155.229 80:32380/TCP,443:32390/TCP,32400:32400/TCP 2d
|
||||
|
||||
```
|
||||
|
||||
1. To find the URL for your service, use
|
||||
```
|
||||
kubectl get services.serving.knative.dev helloworld-nodejs -o=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain
|
||||
NAME DOMAIN
|
||||
helloworld-nodejs helloworld-nodejs.default.example.com
|
||||
```
|
||||
|
||||
1. Now you can make a request to your app to see the result. Replace
|
||||
|
@ -182,4 +191,4 @@ To remove the sample app from your cluster, delete the service record:
|
|||
|
||||
```shell
|
||||
kubectl delete -f service.yaml
|
||||
```
|
||||
```
|
||||
|
|
|
@ -69,7 +69,7 @@ following instructions recreate the source files from this folder.
|
|||
|
||||
## Building and deploying the sample
|
||||
|
||||
Once you have recreated the sample code files (or used the files in the sample folder)
|
||||
Once you have recreated the sample code files (or used the files in the sample folder)
|
||||
you're ready to build and deploy the sample app.
|
||||
|
||||
1. Use Docker to build the sample code into a container. To build and push with
|
||||
|
@ -98,13 +98,24 @@ you're ready to build and deploy the sample app.
|
|||
* Network programming to create a route, ingress, service, and load balance for your app.
|
||||
* Automatically scale your pods up and down (including to zero active pods).
|
||||
|
||||
1. To find the URL and IP address for your service, use kubectl to list the ingress points in the cluster:
|
||||
1. To find the IP address for your service, use
|
||||
`kubectl get svc knative-ingressgateway -n istio-system` to get the ingress IP for your
|
||||
cluster. If your cluster is new, it may take sometime for the service to get asssigned
|
||||
an external IP address.
|
||||
|
||||
```shell
|
||||
kubectl get ing
|
||||
kubectl get svc knative-ingressgateway -n istio-system
|
||||
|
||||
NAME HOSTS ADDRESS PORTS AGE
|
||||
helloworld-php-ingress helloworld-php.default.example.com,*.helloworld-php.default.example.com 35.232.134.1 80 1m
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
knative-ingressgateway LoadBalancer 10.23.247.74 35.203.155.229 80:32380/TCP,443:32390/TCP,32400:32400/TCP 2d
|
||||
|
||||
```
|
||||
|
||||
1. To find the URL for your service, use
|
||||
```
|
||||
kubectl get services.serving.knative.dev helloworld-php -o=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain
|
||||
NAME DOMAIN
|
||||
helloworld-php helloworld-php.default.example.com
|
||||
```
|
||||
|
||||
1. Now you can make a request to your app to see the result. Replace
|
||||
|
|
|
@ -15,7 +15,7 @@ TARGET is not specified, it will use "NOT SPECIFIED" as the TARGET.
|
|||
## Steps to recreate the sample code
|
||||
|
||||
While you can clone all of the code from this directory, hello world apps are
|
||||
generally more useful if you build them step-by-step.
|
||||
generally more useful if you build them step-by-step.
|
||||
The following instructions recreate the source files from this folder.
|
||||
|
||||
1. Create a new directory and cd into it:
|
||||
|
@ -110,16 +110,27 @@ folder) you're ready to build and deploy the sample app.
|
|||
* Network programming to create a route, ingress, service, and load balance for your app.
|
||||
* Automatically scale your pods up and down (including to zero active pods).
|
||||
|
||||
1. To find the URL and IP address for your service, use kubectl to list the ingress points in the cluster:
|
||||
1. To find the IP address for your service, use
|
||||
`kubectl get svc knative-ingressgateway -n istio-system` to get the ingress IP for your
|
||||
cluster. If your cluster is new, it may take sometime for the service to get asssigned
|
||||
an external IP address.
|
||||
|
||||
```shell
|
||||
kubectl get ing
|
||||
kubectl get svc knative-ingressgateway -n istio-system
|
||||
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
knative-ingressgateway LoadBalancer 10.23.247.74 35.203.155.229 80:32380/TCP,443:32390/TCP,32400:32400/TCP 2d
|
||||
|
||||
NAME HOSTS ADDRESS PORTS AGE
|
||||
helloworld-python-ingress helloworld-python.default.example.com,*.helloworld-python.default.example.com 35.232.134.1 80 1m
|
||||
```
|
||||
|
||||
1. Now you can make a request to your app to see the result. Replace `{IP_ADDRESS}`
|
||||
1. To find the URL for your service, use
|
||||
```
|
||||
kubectl get services.serving.knative.dev helloworld-python -o=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain
|
||||
NAME DOMAIN
|
||||
helloworld-python helloworld-python.default.example.com
|
||||
```
|
||||
|
||||
1. Now you can make a request to your app to see the result. Replace `{IP_ADDRESS}`
|
||||
with the address you see returned in the previous step.
|
||||
|
||||
```shell
|
||||
|
|
|
@ -14,8 +14,8 @@ TARGET is not specified, it will use "NOT SPECIFIED" as the TARGET.
|
|||
|
||||
## Steps to recreate the sample code
|
||||
|
||||
While you can clone all of the code from this directory, hello world apps are
|
||||
generally more useful if you build them step-by-step.
|
||||
While you can clone all of the code from this directory, hello world apps are
|
||||
generally more useful if you build them step-by-step.
|
||||
The following instructions recreate the source files from this folder.
|
||||
|
||||
1. Create a new directory and cd into it:
|
||||
|
@ -38,7 +38,7 @@ The following instructions recreate the source files from this folder.
|
|||
end
|
||||
```
|
||||
|
||||
1. Create a file named `Dockerfile` and copy the code block below into it.
|
||||
1. Create a file named `Dockerfile` and copy the code block below into it.
|
||||
See [official Ruby docker image](https://hub.docker.com/_/ruby/) for more details.
|
||||
|
||||
```docker
|
||||
|
@ -66,7 +66,7 @@ The following instructions recreate the source files from this folder.
|
|||
gem 'sinatra'
|
||||
```
|
||||
|
||||
1. Run bundle. If you don't have bundler installed, copy the
|
||||
1. Run bundle. If you don't have bundler installed, copy the
|
||||
[Gemfile.lock](./Gemfile.lock) to your working directory.
|
||||
|
||||
```shell
|
||||
|
@ -96,7 +96,7 @@ The following instructions recreate the source files from this folder.
|
|||
|
||||
## Build and deploy this sample
|
||||
|
||||
Once you have recreated the sample code files (or used the files in the sample folder)
|
||||
Once you have recreated the sample code files (or used the files in the sample folder)
|
||||
you're ready to build and deploy the sample app.
|
||||
|
||||
1. Use Docker to build the sample code into a container. To build and push with
|
||||
|
@ -125,16 +125,27 @@ you're ready to build and deploy the sample app.
|
|||
* Network programming to create a route, ingress, service, and load balance for your app.
|
||||
* Automatically scale your pods up and down (including to zero active pods).
|
||||
|
||||
1. To find the URL and IP address for your service, use kubectl to list the ingress points in the cluster:
|
||||
1. To find the IP address for your service, use
|
||||
`kubectl get svc knative-ingressgateway -n istio-system` to get the ingress IP for your
|
||||
cluster. If your cluster is new, it may take sometime for the service to get asssigned
|
||||
an external IP address.
|
||||
|
||||
```shell
|
||||
kubectl get ing
|
||||
kubectl get svc knative-ingressgateway -n istio-system
|
||||
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
knative-ingressgateway LoadBalancer 10.23.247.74 35.203.155.229 80:32380/TCP,443:32390/TCP,32400:32400/TCP 2d
|
||||
|
||||
NAME HOSTS ADDRESS PORTS AGE
|
||||
helloworld-ruby-ingress helloworld-ruby.default.example.com,*.helloworld-ruby.default.example.com 35.232.134.1 80 1m
|
||||
```
|
||||
|
||||
1. Now you can make a request to your app to see the result. Replace `{IP_ADDRESS}`
|
||||
1. To find the URL for your service, use
|
||||
```
|
||||
kubectl get services.serving.knative.dev helloworld-ruby -o=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain
|
||||
NAME DOMAIN
|
||||
helloworld-ruby helloworld-ruby.default.example.com
|
||||
```
|
||||
|
||||
1. Now you can make a request to your app to see the result. Replace `{IP_ADDRESS}`
|
||||
with the address you see returned in the previous step.
|
||||
|
||||
```shell
|
||||
|
|
|
@ -32,7 +32,7 @@ following instructions recreate the source files from this folder.
|
|||
```
|
||||
|
||||
1. Create a `src` folder, then create a new file named `main.rs` in that folder
|
||||
and paste the following code. This code creates a basic web server which
|
||||
and paste the following code. This code creates a basic web server which
|
||||
listens on port 8080:
|
||||
|
||||
```rust
|
||||
|
@ -141,15 +141,24 @@ folder) you're ready to build and deploy the sample app.
|
|||
* Network programming to create a route, ingress, service, and load balance for your app.
|
||||
* Automatically scale your pods up and down (including to zero active pods).
|
||||
|
||||
1. To find the URL and IP address for your service, use `kubectl get ing` to
|
||||
list the ingress points in the cluster. It may take a few seconds for the
|
||||
ingress point to be created.
|
||||
1. To find the IP address for your service, use
|
||||
`kubectl get svc knative-ingressgateway -n istio-system` to get the ingress IP for your
|
||||
cluster. If your cluster is new, it may take sometime for the service to get asssigned
|
||||
an external IP address.
|
||||
|
||||
```shell
|
||||
kubectl get ing
|
||||
kubectl get svc knative-ingressgateway -n istio-system
|
||||
|
||||
NAME HOSTS ADDRESS PORTS AGE
|
||||
helloworld-rust-ingress helloworld-rust.default.example.com 35.232.134.1 80 1m
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
knative-ingressgateway LoadBalancer 10.23.247.74 35.203.155.229 80:32380/TCP,443:32390/TCP,32400:32400/TCP 2d
|
||||
|
||||
```
|
||||
|
||||
1. To find the URL for your service, use
|
||||
```
|
||||
kubectl get services.serving.knative.dev helloworld-rust -o=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain
|
||||
NAME DOMAIN
|
||||
helloworld-rust helloworld-rust.default.example.com
|
||||
```
|
||||
|
||||
1. Now you can make a request to your app to see the result. Replace
|
||||
|
|
|
@ -157,19 +157,18 @@ As with the other demos, you can confirm that things work by capturing the IP
|
|||
of the ingress endpoint:
|
||||
|
||||
```
|
||||
# Put the Ingress Host name into an environment variable.
|
||||
# Put the Host name into an environment variable.
|
||||
export SERVICE_HOST=`kubectl get route private-repos \
|
||||
-o jsonpath="{.status.domain}"`
|
||||
|
||||
export SERVICE_IP=`kubectl get ing private-repos-ingress \
|
||||
-o jsonpath="{.status.loadBalancer.ingress[*]['ip']}"`
|
||||
export SERVICE_IP=`kubectl get svc knative-ingressgateway -n istio-system -o jsonpath="{.status.loadBalancer.ingress[*].ip}"`
|
||||
```
|
||||
|
||||
If your cluster is running outside a cloud provider (for example on Minikube),
|
||||
your ingress will never get an address. In that case, use the istio `hostIP` and `nodePort` as the service IP:
|
||||
your services will never get an external IP address. In that case, use the istio `hostIP` and `nodePort` as the service IP:
|
||||
|
||||
```shell
|
||||
export SERVICE_IP=$(kubectl get po -l istio=ingress -n istio-system -o 'jsonpath={.items[0].status.hostIP}'):$(kubectl get svc istio-ingress -n istio-system -o 'jsonpath={.spec.ports[?(@.port==80)].nodePort}')
|
||||
export SERVICE_IP=$(kubectl get po -l knative=ingressgateway -n istio-system -o 'jsonpath={.items[0].status.hostIP}'):$(kubectl get svc knative-ingressgateway -n istio-system -o 'jsonpath={.spec.ports[?(@.port==80)].nodePort}')
|
||||
```
|
||||
|
||||
Now curl the service IP as if DNS were properly configured:
|
||||
|
|
|
@ -44,26 +44,26 @@ Once the `BuildComplete` status becomes `True` the resources will start getting
|
|||
|
||||
To access this service via `curl`, we first need to determine its ingress address:
|
||||
```shell
|
||||
$ watch kubectl get ing
|
||||
NAME HOSTS ADDRESS PORTS AGE
|
||||
steren-sample-app-ingress steren-sample-app.default.example.net 80 3m
|
||||
$ watch kubectl get svc knative-ingressgateway -n istio-system
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
knative-ingressgateway LoadBalancer 10.23.247.74 35.203.155.229 80:32380/TCP,443:32390/TCP,32400:32400/TCP 2d
|
||||
```
|
||||
|
||||
Once the `ADDRESS` gets assigned to the cluster, you can run:
|
||||
Once the `EXTERNAL-IP` gets assigned to the cluster, you can run:
|
||||
|
||||
```shell
|
||||
# Put the Ingress Host name into an environment variable.
|
||||
# Put the Host name into an environment variable.
|
||||
export SERVICE_HOST=`kubectl get route steren-sample-app -o jsonpath="{.status.domain}"`
|
||||
|
||||
# Put the Ingress IP into an environment variable.
|
||||
export SERVICE_IP=`kubectl get ingress steren-sample-app-ingress -o jsonpath="{.status.loadBalancer.ingress[*]['ip']}"`
|
||||
# Put the ingress IP into an environment variable.
|
||||
export SERVICE_IP=`kubectl get svc knative-ingressgateway -n istio-system -o jsonpath="{.status.loadBalancer.ingress[*].ip}"`
|
||||
```
|
||||
|
||||
If your cluster is running outside a cloud provider (for example on Minikube),
|
||||
your ingress will never get an address. In that case, use the istio `hostIP` and `nodePort` as the service IP:
|
||||
your services will never get an external IP address. In that case, use the istio `hostIP` and `nodePort` as the service IP:
|
||||
|
||||
```shell
|
||||
export SERVICE_IP=$(kubectl get po -l istio=ingress -n istio-system -o 'jsonpath={.items[0].status.hostIP}'):$(kubectl get svc istio-ingress -n istio-system -o 'jsonpath={.spec.ports[?(@.port==80)].nodePort}')
|
||||
export SERVICE_IP=$(kubectl get po -l knative=ingressgateway -n istio-system -o 'jsonpath={.items[0].status.hostIP}'):$(kubectl get svc knative-ingressgateway -n istio-system -o 'jsonpath={.spec.ports[?(@.port==80)].nodePort}')
|
||||
```
|
||||
|
||||
Now curl the service IP as if DNS were properly configured:
|
||||
|
|
|
@ -43,26 +43,26 @@ Once the `BuildComplete` status becomes `True` the resources will start getting
|
|||
|
||||
To access this service via `curl`, we first need to determine its ingress address:
|
||||
```shell
|
||||
$ watch kubectl get ing
|
||||
NAME HOSTS ADDRESS PORTS AGE
|
||||
steren-sample-fn-ingress steren-sample-fn.default.example.net 80 3m
|
||||
$ watch kubectl get svc knative-ingressgateway -n istio-system
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
knative-ingressgateway LoadBalancer 10.23.247.74 35.203.155.229 80:32380/TCP,443:32390/TCP,32400:32400/TCP 2d
|
||||
```
|
||||
|
||||
Once the `ADDRESS` gets assigned to the cluster, you can run:
|
||||
|
||||
```shell
|
||||
# Put the Ingress Host name into an environment variable.
|
||||
# Put the Host name into an environment variable.
|
||||
export SERVICE_HOST=`kubectl get route steren-sample-fn -o jsonpath="{.status.domain}"`
|
||||
|
||||
# Put the Ingress IP into an environment variable.
|
||||
export SERVICE_IP=`kubectl get ingress steren-sample-fn-ingress -o jsonpath="{.status.loadBalancer.ingress[*]['ip']}"`
|
||||
# Put the ingress IP into an environment variable.
|
||||
export SERVICE_IP=`kubectl get svc knative-ingressgateway -n istio-system -o jsonpath="{.status.loadBalancer.ingress[*].ip}"`
|
||||
```
|
||||
|
||||
If your cluster is running outside a cloud provider (for example on Minikube),
|
||||
your ingress will never get an address. In that case, use the istio `hostIP` and `nodePort` as the service IP:
|
||||
your services will never get an external IP address. In that case, use the istio `hostIP` and `nodePort` as the service IP:
|
||||
|
||||
```shell
|
||||
export SERVICE_IP=$(kubectl get po -l istio=ingress -n istio-system -o 'jsonpath={.items[0].status.hostIP}'):$(kubectl get svc istio-ingress -n istio-system -o 'jsonpath={.spec.ports[?(@.port==80)].nodePort}')
|
||||
export SERVICE_IP=$(kubectl get po -l knative=ingressgateway -n istio-system -o 'jsonpath={.items[0].status.hostIP}'):$(kubectl get svc knative-ingressgateway -n istio-system -o 'jsonpath={.spec.ports[?(@.port==80)].nodePort}')
|
||||
```
|
||||
|
||||
Now curl the service IP as if DNS were properly configured:
|
||||
|
|
|
@ -52,31 +52,31 @@ kubectl get revisions -o yaml
|
|||
|
||||
To access this service via `curl`, we first need to determine its ingress address:
|
||||
```shell
|
||||
watch kubectl get ingress
|
||||
watch get svc knative-ingressgateway -n istio-system
|
||||
```
|
||||
|
||||
When the ingress is ready, you'll see an IP address in the ADDRESS field:
|
||||
When the service is ready, you'll see an IP address in the EXTERNAL-IP field:
|
||||
|
||||
```
|
||||
NAME HOSTS ADDRESS PORTS AGE
|
||||
stock-route-example-ingress stock-route-example.default.example.com 35.185.44.102 80 1m
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
knative-ingressgateway LoadBalancer 10.23.247.74 35.203.155.229 80:32380/TCP,443:32390/TCP,32400:32400/TCP 2d
|
||||
```
|
||||
|
||||
Once the `ADDRESS` gets assigned to the cluster, you can run:
|
||||
|
||||
```shell
|
||||
# Put the Ingress Host name into an environment variable.
|
||||
# Put the host name into an environment variable.
|
||||
export SERVICE_HOST=`kubectl get route stock-route-example -o jsonpath="{.status.domain}"`
|
||||
|
||||
# Put the Ingress IP into an environment variable.
|
||||
export SERVICE_IP=`kubectl get ingress stock-route-example-ingress -o jsonpath="{.status.loadBalancer.ingress[*]['ip']}"`
|
||||
# Put the ingress IP into an environment variable.
|
||||
export SERVICE_IP=`kubectl get svc knative-ingressgateway -n istio-system -o jsonpath="{.status.loadBalancer.ingress[*].ip}"`
|
||||
```
|
||||
|
||||
If your cluster is running outside a cloud provider (for example on Minikube),
|
||||
your ingress will never get an address. In that case, use the istio `hostIP` and `nodePort` as the service IP:
|
||||
your services will never get an external IP address. In that case, use the istio `hostIP` and `nodePort` as the service IP:
|
||||
|
||||
```shell
|
||||
export SERVICE_IP=$(kubectl get po -l istio=ingress -n istio-system -o 'jsonpath={.items[0].status.hostIP}'):$(kubectl get svc istio-ingress -n istio-system -o 'jsonpath={.spec.ports[?(@.port==80)].nodePort}')
|
||||
export SERVICE_IP=$(kubectl get po -l knative=ingressgateway -n istio-system -o 'jsonpath={.items[0].status.hostIP}'):$(kubectl get svc knative-ingressgateway -n istio-system -o 'jsonpath={.spec.ports[?(@.port==80)].nodePort}')
|
||||
```
|
||||
|
||||
Now curl the service IP as if DNS were properly configured:
|
||||
|
|
|
@ -52,21 +52,21 @@ kubectl get revisions -o yaml
|
|||
|
||||
To access this service via `curl`, we first need to determine its ingress address:
|
||||
```shell
|
||||
watch kubectl get ingress
|
||||
NAME HOSTS ADDRESS PORTS AGE
|
||||
telemetrysample-route-ingress telemetrysample.myhost.net 80 14s
|
||||
watch kubectl get svc knative-ingressgateway -n istio-system
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
knative-ingressgateway LoadBalancer 10.23.247.74 35.203.155.229 80:32380/TCP,443:32390/TCP,32400:32400/TCP 2d
|
||||
```
|
||||
|
||||
Once the `ADDRESS` gets assigned to the cluster, you can run:
|
||||
Once the `EXTERNAL-IP` gets assigned to the cluster, you can run:
|
||||
|
||||
```shell
|
||||
# Put the Ingress Host name into an environment variable.
|
||||
# Put the Host name into an environment variable.
|
||||
export SERVICE_HOST=`kubectl get route telemetrysample-route -o jsonpath="{.status.domain}"`
|
||||
|
||||
# Put the Ingress IP into an environment variable.
|
||||
export SERVICE_IP=`kubectl get ingress telemetrysample-route-ingress -o jsonpath="{.status.loadBalancer.ingress[*]['ip']}"`
|
||||
# Put the ingress IP into an environment variable.
|
||||
export SERVICE_IP=`kubectl get svc knative-ingressgateway -n istio-system -o jsonpath="{.status.loadBalancer.ingress[*].ip}"`
|
||||
|
||||
# Curl the Ingress IP "as-if" DNS were properly configured.
|
||||
# Curl the ingress IP "as-if" DNS were properly configured.
|
||||
curl --header "Host:$SERVICE_HOST" http://${SERVICE_IP}
|
||||
Hello World!
|
||||
```
|
||||
|
|
|
@ -117,7 +117,9 @@ Once `BuildComplete` has a `status: "True"`, the revision will get deployed as i
|
|||
To confirm that the app deployed, you can check for the Knative Serving service using `kubectl`. First, is there an ingress service:
|
||||
|
||||
```
|
||||
kubectl get ing
|
||||
kubectl get svc knative-ingressgateway -n istio-system
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
knative-ingressgateway LoadBalancer 10.23.247.74 35.203.155.229 80:32380/TCP,443:32390/TCP,32400:32400/TCP 2d
|
||||
```
|
||||
|
||||
Sometimes the newly deployed app may take few seconds to initialize. You can check its status like this
|
||||
|
@ -129,18 +131,18 @@ kubectl -n default get pods
|
|||
The Knative Serving ingress service will automatically be assigned an IP so let's capture that IP so we can use it in subsequent `curl` commands
|
||||
|
||||
```
|
||||
# Put the Ingress Host name into an environment variable.
|
||||
# Put the Host name into an environment variable.
|
||||
export SERVICE_HOST=`kubectl get route thumb -o jsonpath="{.status.domain}"`
|
||||
|
||||
export SERVICE_IP=`kubectl get ing thumb-ingress \
|
||||
-o jsonpath="{.status.loadBalancer.ingress[*]['ip']}"`
|
||||
# Put the ingress IP into an environment variable.
|
||||
export SERVICE_IP=`kubectl get svc knative-ingressgateway -n istio-system -o jsonpath="{.status.loadBalancer.ingress[*].ip}"`
|
||||
```
|
||||
|
||||
If your cluster is running outside a cloud provider (for example on Minikube),
|
||||
your ingress will never get an address. In that case, use the istio `hostIP` and `nodePort` as the service IP:
|
||||
your services will never get an external IP address. In that case, use the istio `hostIP` and `nodePort` as the service IP:
|
||||
|
||||
```shell
|
||||
export SERVICE_IP=$(kubectl get po -l istio=ingress -n istio-system -o 'jsonpath={.items[0].status.hostIP}'):$(kubectl get svc istio-ingress -n istio-system -o 'jsonpath={.spec.ports[?(@.port==80)].nodePort}')
|
||||
export SERVICE_IP=$(kubectl get po -l knative=ingressgateway -n istio-system -o 'jsonpath={.items[0].status.hostIP}'):$(kubectl get svc knative-ingressgateway -n istio-system -o 'jsonpath={.spec.ports[?(@.port==80)].nodePort}')
|
||||
```
|
||||
|
||||
> To make the JSON service responses more readable consider installing [jq](https://stedolan.github.io/jq/), makes JSON pretty
|
||||
|
|
Loading…
Reference in New Issue