mirror of https://github.com/knative/docs.git
parent
2a8804db21
commit
95d291af57
|
@ -141,47 +141,6 @@ Follow the procedure for the networking layer of your choice:
|
|||
!!! tip
|
||||
Save this to use in the [Configure DNS](#configure-dns) section below.
|
||||
|
||||
|
||||
=== "Gloo"
|
||||
|
||||
!!! tip
|
||||
For a detailed guide on Gloo integration, see
|
||||
[Installing Gloo for Knative](https://docs.solo.io/gloo/latest/installation/knative/)
|
||||
in the Gloo documentation.
|
||||
|
||||
The following commands install Gloo and enable its Knative integration.
|
||||
|
||||
1. Ensure `glooctl` is installed by running the command:
|
||||
|
||||
```bash
|
||||
glooctl version
|
||||
```
|
||||
|
||||
v1.3.x or later is recommended.
|
||||
If it is not installed, you can install the latest version by running the command:
|
||||
```bash
|
||||
curl -sL https://run.solo.io/gloo/install | sh
|
||||
export PATH=$HOME/.gloo/bin:$PATH
|
||||
```
|
||||
|
||||
or by following the
|
||||
[Gloo CLI install instructions](https://docs.solo.io/gloo/latest/installation/knative/#install-command-line-tool-cli) in the Gloo documentation.
|
||||
|
||||
1. Install Gloo and the Knative integration by running the command:
|
||||
```bash
|
||||
glooctl install knative --install-knative=false
|
||||
```
|
||||
|
||||
1. Fetch the External IP address or CNAME by running the command:
|
||||
|
||||
```bash
|
||||
glooctl proxy url --name knative-external-proxy
|
||||
```
|
||||
|
||||
!!! tip
|
||||
Save this to use in the [Configure DNS](#configure-dns) section below.
|
||||
|
||||
|
||||
=== "Istio"
|
||||
|
||||
The following commands install Istio and enable its Knative integration.
|
||||
|
@ -219,106 +178,7 @@ Follow the procedure for the networking layer of your choice:
|
|||
kubectl get pods --namespace knative-serving
|
||||
```
|
||||
|
||||
|
||||
## Configure DNS
|
||||
|
||||
You can configure DNS to prevent the need to run curl commands with a host header.
|
||||
|
||||
The tabs below expand to show instructions for configuring DNS.
|
||||
Follow the procedure for the DNS of your choice:
|
||||
|
||||
<!-- This indentation is important for things to render properly. -->
|
||||
|
||||
=== "Magic DNS (xip.io)"
|
||||
|
||||
If the cluster LoadBalancer service doesn't expose an IPv4 address or hostname, such as with
|
||||
IPv6 clusters or local setups such as minikube, Magic DNS won't work.
|
||||
Follow the Real DNS or Temporary DNS steps instead.
|
||||
|
||||
* If the cluster LoadBalancer service exposes an IPv4 address or hostname, use a simple
|
||||
Kubernetes Job called `serving-default-domain` that configures Knative Serving to use
|
||||
[xip.io](http://xip.io) as the default DNS suffix by running the command:
|
||||
|
||||
```bash
|
||||
kubectl apply -f {{ artifact(repo="serving",file="serving-default-domain.yaml")}}
|
||||
```
|
||||
|
||||
|
||||
=== "Real DNS"
|
||||
|
||||
To configure DNS for Knative, take the External IP address
|
||||
or CNAME from setting up networking, and configure it with your DNS provider as
|
||||
follows:
|
||||
|
||||
1. If the networking layer produced an External IP address, then configure a
|
||||
wildcard `A` record for the domain by running the command:
|
||||
|
||||
```bash
|
||||
*.<domain-suffix> == A 35.233.41.212
|
||||
```
|
||||
Where `<domain-suffix>` is the domain suffix for your cluster
|
||||
|
||||
1. If the networking layer produced a CNAME, then configure a CNAME record for the domain by running the command:
|
||||
|
||||
```bash
|
||||
*.<domain-suffix> == CNAME a317a278525d111e89f272a164fd35fb-1510370581.eu-central-1.elb.amazonaws.com
|
||||
```
|
||||
Where `<domain-suffix>` is the domain suffix for your cluster
|
||||
|
||||
1. After your DNS provider is configured, direct Knative to use that domain by running the command:
|
||||
|
||||
```bash
|
||||
kubectl patch configmap/config-domain \
|
||||
--namespace knative-serving \
|
||||
--type merge \
|
||||
--patch '{"data":{"<domain-suffix>":""}}'
|
||||
```
|
||||
Where `<domain-suffix>` is the domain suffix for your cluster
|
||||
|
||||
=== "Temporary DNS"
|
||||
|
||||
If you are using curl to access the sample applications or your own Knative app, and are
|
||||
unable to use the Magic DNS (xip.io) or Real DNS methods, you can use a temporary approach.
|
||||
|
||||
See the Real DNS method for a permanent solution.
|
||||
|
||||
Temporary DNS is useful for evaluating Knative without altering the DNS configuration, as in the
|
||||
Real DNS method, or cannot use the Magic DNS method due to using, for example, minikube locally
|
||||
or IPv6 clusters.
|
||||
|
||||
To access your application using curl using this method:
|
||||
|
||||
1. After starting your application, get the URL of your application by running the command:
|
||||
|
||||
```bash
|
||||
kubectl get ksvc
|
||||
```
|
||||
|
||||
!!! success "Verify the output"
|
||||
|
||||
```bash
|
||||
NAME URL LATESTCREATED LATESTREADY READY REASON
|
||||
helloworld-go http://helloworld-go.default.example.com helloworld-go-vqjlf helloworld-go-vqjlf True
|
||||
```
|
||||
|
||||
1. Instruct curl to connect to the External IP address or CNAME defined by the
|
||||
networking layer in section 3 above, and use the `-H "Host:"` command-line
|
||||
option to specify the Knative application's hostname.
|
||||
|
||||
For example, if the networking layer defines your External IP address and port to be
|
||||
`http://192.168.39.228:32198` and you wish to access the above `helloworld-go` application,
|
||||
run the command:
|
||||
|
||||
```bash
|
||||
curl -H "Host: helloworld-go.default.example.com" http://192.168.39.228:32198
|
||||
```
|
||||
|
||||
!!! success "Verify the output"
|
||||
In the case of the provided `helloworld-go` sample application, when using the default configuration the output is:
|
||||
|
||||
```
|
||||
Hello Go Sample v1!
|
||||
```
|
||||
{% include "dns.md" %}
|
||||
|
||||
## Install optional Serving extensions
|
||||
|
||||
|
|
|
@ -7,11 +7,10 @@ Follow the procedure for the DNS of your choice:
|
|||
|
||||
=== "Magic DNS (sslip.io)"
|
||||
|
||||
Knative provides a Kubernetes Job called default-domain that configures Knative Serving to
|
||||
use <a href="http://sslip.io">sslip.io</a> as the default DNS suffix.
|
||||
Knative provides a Kubernetes Job called `default-domain` that configures Knative Serving to use <a href="http://sslip.io">sslip.io</a> as the default DNS suffix.
|
||||
|
||||
```bash
|
||||
kubectl apply --filename {{artifact(repo="serving",file="serving-default-domain.yaml")}}
|
||||
kubectl apply -f {{artifact(repo="serving",file="serving-default-domain.yaml")}}
|
||||
```
|
||||
|
||||
!!! warning
|
||||
|
@ -24,6 +23,7 @@ Follow the procedure for the DNS of your choice:
|
|||
|
||||
|
||||
=== "Real DNS"
|
||||
|
||||
To configure DNS for Knative, take the External IP
|
||||
or CNAME from setting up networking, and configure it with your DNS provider as
|
||||
follows:
|
||||
|
@ -36,8 +36,7 @@ Follow the procedure for the DNS of your choice:
|
|||
*.knative.example.com == A 35.233.41.212
|
||||
```
|
||||
|
||||
- If the networking layer produced a CNAME, then configure a CNAME record for
|
||||
the domain:
|
||||
- If the networking layer produced a CNAME, then configure a CNAME record for the domain:
|
||||
|
||||
```
|
||||
# Here knative.example.com is the domain suffix for your cluster
|
||||
|
@ -46,7 +45,7 @@ Follow the procedure for the DNS of your choice:
|
|||
|
||||
Once your DNS provider has been configured, add the following section into your existing Serving CR, and apply it:
|
||||
|
||||
```bash
|
||||
```yaml
|
||||
# Replace knative.example.com with your domain suffix
|
||||
apiVersion: operator.knative.dev/v1alpha1
|
||||
kind: KnativeServing
|
||||
|
@ -62,11 +61,7 @@ Follow the procedure for the DNS of your choice:
|
|||
|
||||
=== "Temporary DNS"
|
||||
|
||||
If you are using `curl` to access the sample
|
||||
applications, or your own Knative app, and are unable to use the "Magic DNS
|
||||
(sslip.io)" or "Real DNS" methods, there is a temporary approach. This is useful
|
||||
for those who wish to evaluate Knative without altering their DNS configuration,
|
||||
as per the "Real DNS" method, or cannot use the "Magic DNS" method due to using,
|
||||
If you are using `curl` to access the sample applications, or your own Knative app, and are unable to use the "Magic DNS (sslip.io)" or "Real DNS" methods, there is a temporary approach. This is useful for those who wish to evaluate Knative without altering their DNS configuration, as per the "Real DNS" method, or cannot use the "Magic DNS" method due to using,
|
||||
for example, minikube locally or IPv6 clusters.
|
||||
|
||||
To access your application using `curl` using this method:
|
||||
|
@ -83,15 +78,15 @@ Follow the procedure for the DNS of your choice:
|
|||
|
||||
1. Instruct `curl` to connect to the External IP or CNAME defined by the
|
||||
networking layer in section 3 above, and use the `-H "Host:"` command-line
|
||||
option to specify the Knative application's host name. For example, if the
|
||||
networking layer defines your External IP and port to be
|
||||
`http://192.168.39.228:32198` and you wish to access the above
|
||||
`helloworld-go` application, use:
|
||||
option to specify the Knative application's host name.
|
||||
|
||||
For example, if the networking layer defines your External IP and port to be `http://192.168.39.228:32198` and you wish to access the above `helloworld-go` application, use:
|
||||
|
||||
```bash
|
||||
curl -H "Host: helloworld-go.default.example.com" http://192.168.39.228:32198
|
||||
```
|
||||
In the case of the provided `helloworld-go` sample application, using the default
|
||||
configuration, the output should be:
|
||||
In the case of the provided `helloworld-go` sample application, using the default configuration, the output is:
|
||||
|
||||
```
|
||||
Hello Go Sample v1!
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue