diff --git a/docs/versioned/.nav.yml b/docs/versioned/.nav.yml index cb4590fcfb..c75c4a2738 100644 --- a/docs/versioned/.nav.yml +++ b/docs/versioned/.nav.yml @@ -252,7 +252,8 @@ nav: - Configuring Knative Eventing CRDs: install/operator/configuring-eventing-cr.md - Installing plugins: - Install Istio for Knative: install/installing-istio.md - # TODO: docs for kourier, contour, gateway-api + # Kourier, Contour, and Gateway API ingress plugins are configured through the Knative Operator. + # See install/operator/knative-with-operators.md and install/operator/configuring-serving-cr.md for details. - Install Kafka for Knative: install/eventing/kafka-install.md - Install RabbitMQ for Knative: install/eventing/rabbitmq-install.md # N.B. this duplicates an "eventing" topic above, cross-referenced here. diff --git a/docs/versioned/install/operator/configuring-serving-cr.md b/docs/versioned/install/operator/configuring-serving-cr.md index 5beb229785..07fcbc20dd 100644 --- a/docs/versioned/install/operator/configuring-serving-cr.md +++ b/docs/versioned/install/operator/configuring-serving-cr.md @@ -552,6 +552,75 @@ spec: service: custom-local-gateway.istio-system.svc.cluster.local ``` +## Configure the Gateway API ingress + +!!! warning + Gateway API support in Knative is currently in **Beta**. The API and configuration may change in future releases. + The Knative team currently tests with Istio, Contour, and Envoy Gateway implementations. For more details, see the + [net-gateway-api repository](https://github.com/knative-extensions/net-gateway-api). + +To use Gateway API as the networking layer, you need to configure the `spec.ingress.gateway-api` and `spec.config.network` fields in the KnativeServing CR. + +### Enable Gateway API + +To enable Gateway API as the ingress, apply the following KnativeServing CR: + +```yaml +apiVersion: operator.knative.dev/v1beta1 +kind: KnativeServing +metadata: + name: knative-serving + namespace: knative-serving +spec: + ingress: + gateway-api: + enabled: true + config: + network: + ingress-class: "gateway-api.ingress.networking.knative.dev" +``` + +### Configure Gateway API gateways + +You can configure external and local gateways for Gateway API by using the `spec.config.gateway` field. For example: + +```yaml +apiVersion: operator.knative.dev/v1beta1 +kind: KnativeServing +metadata: + name: knative-serving + namespace: knative-serving +spec: + ingress: + gateway-api: + enabled: true + config: + network: + ingress-class: "gateway-api.ingress.networking.knative.dev" + gateway: + external-gateways: | + - class: istio + gateway: istio-system/knative-gateway + service: istio-system/istio-ingressgateway + local-gateways: | + - class: istio + gateway: istio-system/knative-local-gateway + service: istio-system/knative-local-gateway +``` + +The key in `spec.config.gateway` is in the format of: + +``` +external-gateways: | + - class: + gateway: / + service: / +local-gateways: | + - class: + gateway: / + service: / +``` + ## Customize kourier-bootstrap for Kourier gateways: By default, Kourier contains envoy bootstrap configuration in the ConfigMap `kourier-bootstrap`. The `spec.ingress.kourier.bootstrap-configmap` field allows you to specify your customized bootstrap ConfigMap. diff --git a/docs/versioned/install/operator/knative-with-operator-cli.md b/docs/versioned/install/operator/knative-with-operator-cli.md index d633cb1652..da41077a34 100644 --- a/docs/versioned/install/operator/knative-with-operator-cli.md +++ b/docs/versioned/install/operator/knative-with-operator-cli.md @@ -123,6 +123,41 @@ you can configure Knative Serving with different ingresses: kn operator enable ingress --contour -n knative-serving ``` +=== "Gateway API" + + !!! warning + Gateway API support in Knative is currently in **Beta**. The API and configuration may change in future releases. + The Knative team currently tests with Istio, Contour, and Envoy Gateway implementations. For more details, see the + [net-gateway-api repository](https://github.com/knative-extensions/net-gateway-api). + + The following steps configure Knative Serving to use Gateway API as the networking layer: + + 1. You must have a Gateway API implementation installed in your cluster (for example, Istio, Contour, + or Envoy Gateway). Refer to your chosen implementation's documentation for installation instructions. + + 1. Install the Gateway API CRDs if they are not already installed on your cluster: + + ```bash + kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/latest/download/standard-install.yaml + ``` + + 1. To configure Knative Serving to use Gateway API, run the command as follows: + + ```bash + kn operator enable ingress --gateway-api -n knative-serving + ``` + + !!! note + By default, the net-gateway-api controller uses Istio's Gateway resources + (`istio-system/knative-gateway` for external traffic and `istio-system/knative-local-gateway` + for cluster-local traffic). If you are using Istio as your Gateway API implementation, + no additional gateway configuration is needed. + + If you are using a different Gateway API implementation such as Contour or Envoy Gateway, + you must configure `spec.config.gateway` in the KnativeServing CR to specify the correct + gateway references. For details, see + [Configure the Gateway API ingress](configuring-serving-cr.md#configure-the-gateway-api-ingress). + ## Install the Knative Eventing component You can install Knative Eventing of any specific version under any specific namespace. By default, the namespace is `knative-eventing`, diff --git a/docs/versioned/install/operator/knative-with-operators.md b/docs/versioned/install/operator/knative-with-operators.md index cfce8a0be1..eedf2a5b08 100644 --- a/docs/versioned/install/operator/knative-with-operators.md +++ b/docs/versioned/install/operator/knative-with-operators.md @@ -263,6 +263,83 @@ Knative Serving with different ingresses: Save this for configuring DNS later. +=== "Gateway API" + + !!! warning + Gateway API support in Knative is currently in **Beta**. The API and configuration may change in future releases. + The Knative team currently tests with Istio, Contour, and Envoy Gateway implementations. For more details, see the + [net-gateway-api repository](https://github.com/knative-extensions/net-gateway-api). + + The following steps configure Knative Serving to use Gateway API as the networking layer: + + 1. You must have a Gateway API implementation installed in your cluster (for example, Istio, Contour, + or Envoy Gateway). Refer to your chosen implementation's documentation for installation instructions. + + 1. Install the Gateway API CRDs if they are not already installed on your cluster: + + ```bash + kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/latest/download/standard-install.yaml + ``` + + 1. Ensure that a `Gateway` resource exists in your cluster for Knative to use. If your Gateway API + implementation does not create one automatically, create it according to your implementation's documentation. + For more information on configuring gateway references, see + [Configure the Gateway API ingress](configuring-serving-cr.md#configure-the-gateway-api-ingress). + + 1. To configure Knative Serving to use Gateway API, add `spec.ingress.gateway-api` + and `spec.config.network` to your Serving CR YAML file as follows: + + ```yaml + apiVersion: operator.knative.dev/v1beta1 + kind: KnativeServing + metadata: + name: knative-serving + namespace: knative-serving + spec: + # ... + ingress: + gateway-api: + enabled: true + config: + network: + ingress-class: "gateway-api.ingress.networking.knative.dev" + ``` + + !!! note + By default, the net-gateway-api controller uses Istio's Gateway resources + (`istio-system/knative-gateway` for external traffic and `istio-system/knative-local-gateway` + for cluster-local traffic). If you are using Istio as your Gateway API implementation, + no additional gateway configuration is needed. + + If you are using a different Gateway API implementation such as Contour or Envoy Gateway, + you must configure `spec.config.gateway` in the KnativeServing CR to specify the correct + gateway references. For details, see + [Configure the Gateway API ingress](configuring-serving-cr.md#configure-the-gateway-api-ingress). + + 1. Apply the YAML file for your Serving CR by running the command: + + ```bash + kubectl apply -f .yaml + ``` + + Where `` is the name of your Serving CR file. + + 1. Verify that the Knative Gateway API components are deployed: + + ```bash + kubectl get deployment -n knative-serving + ``` + + You should see the `net-gateway-api-controller` deployment in the list of deployments. + + 1. Fetch the External IP or CNAME by checking your Gateway status: + + ```bash + kubectl get gateway --all-namespaces + ``` + + The `ADDRESS` column shows the external IP or hostname. Save this for configuring DNS later. + ### Verify the Knative Serving deployment 1. Monitor the Knative deployments: