diff --git a/docs/admin/install/knative-with-operators.md b/docs/admin/install/knative-with-operators.md index 3a7fd261163..02c24a0dd12 100644 --- a/docs/admin/install/knative-with-operators.md +++ b/docs/admin/install/knative-with-operators.md @@ -311,7 +311,10 @@ knative-serving True Save this for configuring DNS below. + {% include "dns.md" %} +{% include "real-dns-operator.md" %} +{% include "temporary-dns.md" %} ## Installing the Knative Eventing component diff --git a/docs/admin/install/serving/install-serving-with-yaml.md b/docs/admin/install/serving/install-serving-with-yaml.md index f9dbd60094a..d3fce8ef41b 100644 --- a/docs/admin/install/serving/install-serving-with-yaml.md +++ b/docs/admin/install/serving/install-serving-with-yaml.md @@ -178,7 +178,10 @@ Follow the procedure for the networking layer of your choice: kubectl get pods --namespace knative-serving ``` + {% include "dns.md" %} +{% include "real-dns-yaml.md" %} +{% include "temporary-dns.md" %} ## Install optional Serving extensions diff --git a/docs/snippets/dns.md b/docs/snippets/dns.md index 8d5955c9bf5..6a7e78510cd 100644 --- a/docs/snippets/dns.md +++ b/docs/snippets/dns.md @@ -20,75 +20,3 @@ Follow the procedure for the DNS of your choice: is running. In these cases, see the "Real DNS" or "Temporary DNS" tabs. - - -=== "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: - - - If the networking layer produced an External IP address, then configure a - wildcard `A` record for the domain: - - ``` - # Here knative.example.com is the domain suffix for your cluster - *.knative.example.com == A 35.233.41.212 - ``` - - - 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 - *.knative.example.com == CNAME a317a278525d111e89f272a164fd35fb-1510370581.eu-central-1.elb.amazonaws.com - ``` - - Once your DNS provider has been configured, add the following section into your existing Serving CR, and apply it: - - ```yaml - # Replace knative.example.com with your domain suffix - apiVersion: operator.knative.dev/v1alpha1 - kind: KnativeServing - metadata: - name: knative-serving - namespace: knative-serving - spec: - config: - domain: - "knative.example.com": "" - ... - ``` - -=== "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, - 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: - ```bash - kubectl get ksvc - ``` - The output should be similar to: - ```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 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: - - ```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 is: - - ``` - Hello Go Sample v1! - ``` - - Refer to the "Real DNS" method for a permanent solution. diff --git a/docs/snippets/real-dns-operator.md b/docs/snippets/real-dns-operator.md new file mode 100644 index 00000000000..b51a3df26f1 --- /dev/null +++ b/docs/snippets/real-dns-operator.md @@ -0,0 +1,36 @@ +=== "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: + + - If the networking layer produced an External IP address, then configure a + wildcard `A` record for the domain: + + ``` + # Here knative.example.com is the domain suffix for your cluster + *.knative.example.com == A 35.233.41.212 + ``` + + - 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 + *.knative.example.com == CNAME a317a278525d111e89f272a164fd35fb-1510370581.eu-central-1.elb.amazonaws.com + ``` + + - Once your DNS provider has been configured, add the following section into your existing Serving CR, and apply it: + + ```yaml + # Replace knative.example.com with your domain suffix + apiVersion: operator.knative.dev/v1alpha1 + kind: KnativeServing + metadata: + name: knative-serving + namespace: knative-serving + spec: + config: + domain: + "knative.example.com": "" + ... + ``` diff --git a/docs/snippets/real-dns-yaml.md b/docs/snippets/real-dns-yaml.md new file mode 100644 index 00000000000..2a70c7fbdda --- /dev/null +++ b/docs/snippets/real-dns-yaml.md @@ -0,0 +1,30 @@ +=== "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: + + - If the networking layer produced an External IP address, then configure a + wildcard `A` record for the domain: + + ``` + # Here knative.example.com is the domain suffix for your cluster + *.knative.example.com == A 35.233.41.212 + ``` + + - 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 + *.knative.example.com == CNAME a317a278525d111e89f272a164fd35fb-1510370581.eu-central-1.elb.amazonaws.com + ``` + + - Once your DNS provider has been configured, direct Knative to use that domain: + + ```yaml + # Replace knative.example.com with your domain suffix + kubectl patch configmap/config-domain \ + --namespace knative-serving \ + --type merge \ + --patch '{"data":{"knative.example.com":""}}' + ``` diff --git a/docs/snippets/temporary-dns.md b/docs/snippets/temporary-dns.md new file mode 100644 index 00000000000..2472bfba5a2 --- /dev/null +++ b/docs/snippets/temporary-dns.md @@ -0,0 +1,29 @@ +=== "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, + 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: + ```bash + kubectl get ksvc + ``` + The output should be similar to: + ```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 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: + ```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 is: + ``` + Hello Go Sample v1! + ``` + Refer to the "Real DNS" method for a permanent solution.