Skip to content

Commit fc4c2c6

Browse files
iRaindropevankandersondsimansk
authored
Create Configure Knative Networking page (#6518)
* Create config-network-adapters.md Create file - table test * Added Nav Added Nav and fixed H1 * Update config-network-adapters.md Formatting test * Update config-network-adapters.md More writing * Added snippet file for Kourier Snippet testing * Update config-network-adapters.md snippet testing * Update config-network-adapters.md Snippet name fix * Snippet fix Formatting tests * Update config-network-adapters.md Formatting fix * Update config-network-adapters.md Test * Update config-network-adapters.md Rebuild * Added Contour snippet Formmating * Update config-network-adapters.md Typo fix * Added istio and gateway api snippet files Formatting * Writing and snippet work Updates * Misc fixes Snippet formatting * Link fixes Misc edits * Update netadapter-istio.md Link issue fix * Tab work Added tabs for Network layer setup * Update config-network-adapters.md Minor edit to rebuild * Update config-network-adapters.md tab test * Update config-network-adapters.md More writing and tab test for architecture section * Title and edits Title change and format fix * Update config-network-adapters.md indented mermaid test * Update config-network-adapters.md Mermaid tab test * Update config-network-adapters.md undid test * Update config-network-adapters.md Mermaid fix * Update config-network-adapters.md Tab test * Update config-network-adapters.md More mermaid testing * Update config-network-adapters.md mermaid work * Update config-network-adapters.md Formatting * Update config-network-adapters.md More writing * Update config-network-adapters.md H4s instead of H3s * Update config-network-adapters.md Mermaid tweaks * Update config-network-adapters.md tab test * Writing and structuring Trying out just one tab set * Update config-network-adapters.md Formatting fixes * Update config-network-adapters.md Minor edit to rebuild * Update netadapter-gatewayapi.md Formatting test * Formatting tests * Update config-network-adapters.md Formatting test * Update config-network-adapters.md Format fix * Update config-network-adapters.md test * Update config-network-adapters.md Put back `Verify controller installations` * Update config-network-adapters.md Formatting * Update config-network-adapters.md Minor fix * Update config-network-adapters.md Code format fix * Added Ingress Gateway tab More writing * Update config-network-adapters.md Formatting fix * More writing Consistency edits * Update config-network-adapters.md Format fix * Update config-network-adapters.md Refinement edits * Misc fixes Fixes and refinements * Small edit to rebuild * Update config-network-adapters.md Refinement edits * Update config-network-adapters.md Minor edit to rebuild * Misc updates Copy and refinement edits * Update config-network-adapters.md Added note about IBM Z and IBM Power platforms and Kourier. * Update config-network-adapters.md Fixed link * Update config-network-adapters.md Format fix * Update netadapter-gatewayapi.md Updated Gateway API steps * Update config-network-adapters.md Fixed typos and tweaking * Update config-network-adapters.md Minor edit to rebuild * Update config-network-adapters.md Consistency edits * Update config-network-adapters.md Link fix * Update docs/snippets/dns.md Co-authored-by: Evan Anderson <evan.k.anderson@gmail.com> * Processed reviewer edits * Misc edits Moved page up in Nav, moved 'Detect current state' section down. Also format edits. * Update config-network-adapters.md H3 to H2 - Determine current state * Update docs/versioned/serving/config-network-adapters.md Co-authored-by: Evan Anderson <evan.k.anderson@gmail.com> * Reviewer udpates Removed code snippets - will only be in yaml installation Nav change Diagram work * Update config-network-adapters.md Minor edit to rebuild * Update config-network-adapters.md Test edits to rebuild * Update config-network-adapters.md Build test * Update config-network-adapters.md Build issue with adjacent charts? * Update config-network-adapters.md chart test * Update config-network-adapters.md Test * Update config-network-adapters.md Mermaid chart formatting * Update config-network-adapters.md Chart fix * Update config-network-adapters.md Chart fix * Update config-network-adapters.md Chart formatting * Update docs/snippets/netadapter-kourier.md Co-authored-by: David Simansky <dsimansk@redhat.com> * Update config-network-adapters.md chart work * Update config-network-adapters.md chart work * Chart work and misc fixes * Misc updates Formatting and installation snippets * Update config-network-adapters.md indentation test * Gateway additions and misc various updates * Update config-network-adapters.md Minor edit to rebuild * Update config-network-adapters.md Minor edits to rebuild * Update config-network-adapters.md tab fixes and minor edits * Update config-network-adapters.md Minor edit to rebuild * Update config-network-adapters.md Restructuring refinements * Update config-network-adapters.md Refinements * Update config-network-adapters.md Grammer refinements * Tab test with snippets * Configured snippets Configured snippets to conform with install-serving-with-yaml * Update install-serving-with-yaml.md Provided guidance to refer to the configuration topic * Snippet code formatting * Update install-serving-with-yaml.md minor edits * Update install-serving-with-yaml.md Link fix * Update docs/versioned/serving/config-network-adapters.md Co-authored-by: Evan Anderson <evan.k.anderson@gmail.com> * Update docs/versioned/serving/config-network-adapters.md Co-authored-by: Evan Anderson <evan.k.anderson@gmail.com> * Update docs/versioned/serving/config-network-adapters.md Co-authored-by: Evan Anderson <evan.k.anderson@gmail.com> * Update docs/versioned/serving/config-network-adapters.md Co-authored-by: Evan Anderson <evan.k.anderson@gmail.com> * Update config-network-adapters.md Processed reviewer edits * Update config-network-adapters.md Review edits cont'd. * Update config-network-adapters.md mermaid tweaks * Update config-network-adapters.md Mermaid fixes * Update config-network-adapters.md Mermaid adjustments * Snippet references and fixes Also name change to "Configure Istio's ingress gateway" * Misc edits And tab test with snippet references * Update install-serving-with-yaml.md tabs with snippet references fix * Update install-serving-with-yaml.md tab test again * Snippet and Tab fixes Formatting tasks * Tab fixes * Tab fixes and reviewer edits Misc fixes and edits * tab tweaks * tab and include test * tab include test testing... * tab test * A hopeful test * Tab test with indent filter * Indent test * Test edit to rebuild * Install snippets and DNS snippets Indentation formatting, wordsmithing * Update install-serving-with-yaml.md minor edit to rebuld * file name fix * Format fixes and rerognization Misc edits * formatting fixes * Link improvment minor edit * link format edits Edit to rebuild * Update netadapter-gatewayapi.md Steps rearrangement * Processed reviewer edits * Chart updates And misc edits * Added diagram headings * minor edit to rebuild * Copy edits * minor edit to rebuild * link improvement * Removed erroneous para * link fix * link fix again * Link tweak * typo fix * Link enhanements * Update knative-with-operators.md DNS section fix * Update real-dns-operator.md Added snippet reference of the file where its used. * Update config-network-adapters.md Small edit to rebuild --------- Co-authored-by: Evan Anderson <evan.k.anderson@gmail.com> Co-authored-by: David Simansky <dsimansk@redhat.com>
1 parent 4a7a852 commit fc4c2c6

13 files changed

Lines changed: 585 additions & 177 deletions

docs/snippets/dns.md

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
1-
You can configure DNS to prevent the need to run curl commands with a host header.
1+
<!-- Referenced by:
2+
- install/operator/knative-with-operators.md
3+
- install/yaml-install/serving/install-serving-with-yaml.md
4+
-->
5+
Knative provides a Kubernetes Job called `default-domain` that configures Knative Serving to use [sslip.io](http://sslip.io) as the default DNS suffix.
26

3-
The following tabs expand to show instructions for configuring DNS.
4-
Follow the procedure for the DNS of your choice:
7+
```bash
8+
kubectl apply -f {{artifact(repo="serving",file="serving-default-domain.yaml")}}
9+
```
510

6-
=== "Magic DNS (sslip.io)"
7-
8-
Knative provides a Kubernetes Job called `default-domain` that configures Knative Serving to use [sslip.io](http://sslip.io) as the default DNS suffix.
9-
10-
```bash
11-
kubectl apply -f {{artifact(repo="serving",file="serving-default-domain.yaml")}}
12-
```
13-
14-
!!! warning
15-
This will only work if the cluster `LoadBalancer` Service exposes an
16-
IPv4 address or hostname, so it will not work with IPv6 clusters or local setups
17-
like minikube unless [`minikube tunnel`](https://minikube.sigs.k8s.io/docs/commands/tunnel/)
18-
is running.
19-
20-
In these cases, see the "Real DNS" or "No DNS" tabs.
11+
This configuration works only if the cluster `LoadBalancer` Service exposes an IPv4 address or hostname. It does not work with IPv6 clusters or local setups such as minikube unless the [`minikube tunnel`](https://minikube.sigs.k8s.io/docs/commands/tunnel/) is running.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!-- Referenced by:
2+
- install/yaml-install/serving/install-serving-with-yaml.md
3+
-->
4+
Use the following steps to install and enable Contour and set it as the ingress controller.
5+
6+
1. Install the Knative Contour configuration:
7+
8+
```bash
9+
kubectl apply -f {{ artifact(repo="net-contour",org="knative-extensions",file="contour.yaml")}}
10+
```
11+
12+
1. Install the Knative Contour integration controller:
13+
14+
```bash
15+
kubectl apply -f {{ artifact(repo="net-contour",org="knative-extensions",file="net-contour.yaml")}}
16+
```
17+
18+
1. Configure Knative Serving to use Contour:
19+
20+
```bash
21+
kubectl patch configmap/config-network \
22+
--namespace knative-serving \
23+
--type merge \
24+
--patch '{"data":{"ingress-class":"contour.ingress.networking.knative.dev"}}'
25+
```
26+
27+
1. Get the external IP address (FQDN) to later configure DNS:
28+
29+
```bash
30+
kubectl --namespace contour-external get service envoy
31+
```
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<!-- Referenced by:
2+
- install/yaml-install/serving/install-serving-with-yaml.md
3+
-->
4+
This component is in beta. For the latest information including supported implementations, see the [Knative net-gateway-api](https://github.com/knative-extensions/net-gateway-api).
5+
6+
Use the following steps to install and configure the Knative Gateway API controller. Note that you need to have a [Gateway API implementation](https://gateway-api.sigs.k8s.io/implementations/) installed in your cluster. The Knative team currently tests the Istio, Contour, and Envoy-Gateway implementations of Gateway API.
7+
8+
1. Install the Knative Gateway API:
9+
10+
```bash
11+
kubectl apply -f {{ artifact(repo="net-gateway-api",org="knative-extensions",file="net-gateway-api.yaml") }}
12+
```
13+
14+
<!-- TODO: Alternatively, you can use `contour-gateway.yaml` or `istio-gateway.yaml`. -->
15+
16+
1. Configure Gateway resources for external ("north-south") and local ("east-west") Knative traffic. If you do not need separate routing for local traffic (or [private Knative services](../../../serving/services/private-services.md)), you can use the external Gateway for both.
17+
18+
Knative verifies traffic settings according to the Kubernetes namespace, the name of the Gateways, and an underlying DNS name such as a Kubernetes service DNS name that corresponds to the Gateway.
19+
20+
```bash
21+
cat <<EOF | kubectl apply -f -
22+
apiVersion: v1
23+
kind: ConfigMap
24+
metadata:
25+
name: config-gateway
26+
namespace: knative-serving
27+
data:
28+
external-gateways: |
29+
- name: knative-ingress-gateway # Name of the external Gateway resource
30+
namespace: knative-serving # Namespace where the Gateway is deployed
31+
service: knative-ingress-service.knative-serving.svc.cluster.local # backing Service FQDN
32+
local-gateways: |
33+
- name: knative-local-gateway # Name of the local Gateway resource
34+
namespace: knative-serving # Namespace where the Gateway is deployed
35+
service: knative-local-service.knative-serving.svc.cluster.local # backing Service FQDN
36+
EOF
37+
```
38+
39+
1. Configure Knative Serving to use the Knative Gateway API ingress class:
40+
41+
```bash
42+
kubectl patch configmap/config-network \
43+
--namespace knative-serving \
44+
--type merge \
45+
--patch '{"data":{"ingress-class":"gateway-api.ingress.networking.knative.dev"}}'
46+
```
47+
48+
1. Verify the `config-gateway` ConfigMap:
49+
50+
```bash
51+
kubectl describe configmaps config-gateway -n knative-serving
52+
```
53+
54+
Examine the values for the `externals-gateways` and `local-gateways` keys.
55+
56+
1. Get the external IP address (FQDN) to configure DNS records:
57+
58+
```bash
59+
kubectl get gateway --all-namespaces
60+
```
61+
62+
Look for the external Gateway (`knative-ingress-gateway`) to get status and address for DNS configurations.

docs/snippets/netadapter-istio.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!-- Referenced by:
2+
- install/yaml-install/serving/install-serving-with-yaml.md
3+
-->
4+
Use the following steps to install Istio and set it as the ingress controller.
5+
6+
1. Install a properly configured Istio:
7+
8+
```bash
9+
kubectl apply -l knative.dev/crd-install=true -f {{ artifact(repo="net-istio",org="knative-extensions",file="istio.yaml") }}
10+
kubectl apply -f {{ artifact(repo="net-istio",org="knative-extensions",file="istio.yaml") }}
11+
```
12+
13+
1. Install the Knative Istio controller:
14+
15+
```bash
16+
kubectl apply -f {{ artifact(repo="net-istio",org="knative-extensions", file="net-istio.yaml") }}
17+
```
18+
19+
1. Configure the `config-network` ConfigMap to use Istio:
20+
21+
```bash
22+
kubectl patch configmap/config-network \
23+
--namespace knative-serving \
24+
--type merge \
25+
--patch '{"data":{"ingress-class":"istio.ingress.networking.knative.dev"}}'
26+
```
27+
28+
1. Get the external IP address (FQDN) to later configure DNS:
29+
30+
```bash
31+
kubectl --namespace istio-system get service istio-ingressgateway
32+
```
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!-- Referenced by:
2+
- install/yaml-install/serving/install-serving-with-yaml.md
3+
-->
4+
Use the following steps to install Kourier and set it as the ingress controller.
5+
6+
1. Install the Knative Kourier controller:
7+
8+
```bash
9+
kubectl apply -f {{ artifact(repo="net-kourier",org="knative-extensions", file="kourier.yaml") }}
10+
```
11+
12+
1. Configure Knative Serving to use Kourier by default:
13+
14+
```bash
15+
kubectl patch configmap/config-network \
16+
--namespace knative-serving \
17+
--type merge \
18+
--patch '{"data":{"ingress-class":"kourier.ingress.networking.knative.dev"}}'
19+
```
20+
21+
1. Get the external IP address (FQDN) to later configure DNS:
22+
23+
```bash
24+
kubectl --namespace kourier-system get service kourier
25+
```

docs/snippets/no-dns.md

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,42 @@
22
- install/operator/knative-with-operators.md
33
- install/yaml-install/serving/install-serving-with-yaml.md
44
-->
5-
=== "No DNS"
6-
7-
If you are using `curl` to access [the sample applications](/docs/getting-started/first-service/), 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,
8-
for example, minikube locally or IPv6 clusters.
9-
10-
To access your application using `curl` using this method:
11-
12-
1. Configure Knative to use a domain reachable from outside the cluster:
13-
```bash
14-
kubectl patch configmap/config-domain \
15-
--namespace knative-serving \
16-
--type merge \
17-
--patch '{"data":{"example.com":""}}'
18-
```
19-
20-
1. After starting your application, get the URL of your application:
21-
```bash
22-
kubectl get ksvc
23-
```
24-
The output should be similar to:
25-
```bash
26-
NAME URL LATESTCREATED LATESTREADY READY REASON
27-
helloworld-go http://helloworld-go.default.example.com helloworld-go-vqjlf helloworld-go-vqjlf True
28-
```
29-
30-
1. Instruct `curl` to connect to the External IP or CNAME defined by the
31-
networking layer mentioned in section 3, and use the `-H "Host:"` command-line
32-
option to specify the Knative application's host name.
33-
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 `helloworld-go` application mentioned earlier, use:
34-
```bash
35-
curl -H "Host: helloworld-go.default.example.com" http://192.168.39.228:32198
36-
```
37-
In the case of the provided `helloworld-go` sample application, using the default configuration, the output is:
38-
```
39-
Hello Go Sample v1!
40-
```
41-
Refer to the "Real DNS" method for a permanent solution.
5+
If you are using `curl` to access [the sample applications](/docs/getting-started/first-service/), or your own Knative app, and are unable to use the "Magic DNS (sslip.io)" or "Real DNS" methods, you can evaluate Knative without altering your DNS configuration. You might have this need if minikube locally or IPv6 clusters.
6+
7+
To access your application using `curl` using this method:
8+
9+
1. Configure Knative to use a domain reachable from outside the cluster:
10+
11+
```bash
12+
kubectl patch configmap/config-domain \
13+
--namespace knative-serving \
14+
--type merge \
15+
--patch '{"data":{"example.com":""}}'
16+
```
17+
18+
1. After starting your application, get the URL of your application:
19+
20+
```bash
21+
kubectl get ksvc
22+
```
23+
24+
The output should be similar to:
25+
26+
```bash
27+
NAME URL LATESTCREATED LATESTREADY READY REASON
28+
helloworld-go http://helloworld-go.default.example.com helloworld-go-vqjlf helloworld-go-vqjlf True
29+
```
30+
31+
1. Instruct `curl` to connect to the External IP or CNAME defined by the networking layer mentioned in section 3, 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 `helloworld-go` application mentioned earlier, use:
32+
33+
```bash
34+
curl -H "Host: helloworld-go.default.example.com" http://192.168.39.228:32198
35+
```
36+
37+
In the case of the provided `helloworld-go` sample application, using the default configuration, the output is:
38+
39+
```bash
40+
Hello Go Sample v1!
41+
```
42+
43+
Refer to the "Real DNS" method for a permanent solution.

docs/snippets/real-dns-operator.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
<!-- Referenced by:
2+
- install/operator/knative-with-operators.md
3+
-->
14
=== "Real DNS"
25

36
To configure DNS for Knative, take the External IP

docs/snippets/real-dns-yaml.md

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
1-
=== "Real DNS"
1+
<!-- Referenced by:
2+
- install/yaml-install/serving/install-serving-with-yaml.md
3+
-->
4+
To configure DNS for Knative, take the External IP
5+
or CNAME from setting up networking, and configure it with your DNS provider as
6+
follows:
27

3-
To configure DNS for Knative, take the External IP
4-
or CNAME from setting up networking, and configure it with your DNS provider as
5-
follows:
8+
- If the networking layer produced an External IP address, then configure a wildcard `A` record for the domain. In the following example, `knative.example.com` is the domain suffix for a cluster.
69

7-
- If the networking layer produced an External IP address, then configure a
8-
wildcard `A` record for the domain:
10+
```bash
11+
*.knative.example.com == A 35.233.41.212
12+
```
913

10-
```
11-
# Here knative.example.com is the domain suffix for your cluster
12-
*.knative.example.com == A 35.233.41.212
13-
```
14+
- If the networking layer produced a CNAME, then configure a CNAME record for the domain. In the following example, `knative.example.com` is the domain suffix for a cluster.
1415

15-
- If the networking layer produced a CNAME, then configure a CNAME record for the domain:
16+
```bash
17+
*.knative.example.com == CNAME a317a278525d111e89f272a164fd35fb-1510370581.eu-central-1.elb.amazonaws.com
18+
```
1619

17-
```
18-
# Here knative.example.com is the domain suffix for your cluster
19-
*.knative.example.com == CNAME a317a278525d111e89f272a164fd35fb-1510370581.eu-central-1.elb.amazonaws.com
20-
```
20+
- After your DNS provider has been configured, direct Knative to use that domain:
2121

22-
- Once your DNS provider has been configured, direct Knative to use that domain:
23-
24-
```yaml
25-
# Replace knative.example.com with your domain suffix
26-
kubectl patch configmap/config-domain \
27-
--namespace knative-serving \
28-
--type merge \
29-
--patch '{"data":{"knative.example.com":""}}'
30-
```
22+
```yaml
23+
# Replace knative.example.com with your domain suffix
24+
kubectl patch configmap/config-domain \
25+
--namespace knative-serving \
26+
--type merge \
27+
--patch '{"data":{"knative.example.com":""}}'
28+
```

docs/versioned/.nav.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ nav:
267267
- Configure high-availability components: serving/config-ha.md
268268
- Exclude namespaces from the Knative webhook: serving/webhook-customizations.md
269269
- Networking Options:
270-
- Configure the ingress gateway: serving/setting-up-custom-ingress-gateway.md
270+
- Configure Knative networking: serving/config-network-adapters.md
271+
- Configure Istio's ingress gateway: serving/setting-up-custom-ingress-gateway.md
271272
- Configure domain names: serving/using-a-custom-domain.md
272273
- Istio Authorization: serving/istio-authorization.md
273274
- Extending Queue Proxy image with QPOptions: serving/queue-extensions.md

docs/versioned/install/operator/knative-with-operators.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,22 @@ Knative Serving with different ingresses:
298298
299299
### Configure DNS
300300
<!-- These are snippets from the docs/snippets directory -->
301+
You can configure DNS to avoid specifying the host header in curl commands, or to access the content with a web browser.
302+
303+
The following tabs show instructions for configuring DNS. Follow the procedure for the DNS of your choice.
304+
305+
=== "Magic DNS (sslip.io)"
306+
{% filter indent(width=4) %}
301307
{% include "dns.md" %}
308+
{% endfilter %}
309+
=== "Real DNS"
310+
{% filter indent(width=4) %}
302311
{% include "real-dns-operator.md" %}
312+
{% endfilter %}
313+
=== "No DNS"
314+
{% filter indent(width=4) %}
303315
{% include "no-dns.md" %}
316+
{% endfilter %}
304317
305318
## Install Knative Eventing
306319

0 commit comments

Comments
 (0)