diff --git a/config/redirects.yml b/config/redirects.yml
index 1a15338fbf6..8b7991b0183 100644
--- a/config/redirects.yml
+++ b/config/redirects.yml
@@ -20,7 +20,7 @@ plugins:
versioned/eventing/broker/rabbitmq-broker/README.md: versioned/eventing/brokers/broker-types/rabbitmq-broker/README.md
versioned/eventing/broker/README.md: versioned/eventing/brokers/README.md
versioned/concepts/resources/revisions.md: versioned/serving/revisions/README.md
- versioned/serving/revision-gc.md: versioned/serving/revisions/revision-developer-config-options.md
+ versioned/serving/revision-gc.md: versioned/serving/revisions/README.md#disabling-garbage-collection-for-a-revision
versioned/serving/configuration/revision-gc.md: versioned/serving/revisions/revision-admin-config-options.md
versioned/reference/concepts/duck-typing.md: versioned/eventing/concepts/duck-typing.md
versioned/reference/client/README.md: versioned/client/README.md
@@ -181,7 +181,7 @@ plugins:
versioned/operator/configuring-serving-cr/index.md: versioned/install/operator/configuring-serving-cr.md
versioned/reference/resources/index.md: versioned/client/README.md
versioned/serving/autoscaling/autoscaling-concepts.md: versioned/serving/autoscaling/autoscaler-types.md
- versioned/serving/autoscaling/target-burst-capacity/index.md: versioned/serving/load-balancing/target-burst-capacity.md
+ versioned/serving/autoscaling/target-burst-capacity/index.md: versioned/serving/load-balancing/README.md#setting-the-target-burst-capacity
versioned/serving/configuring-autoscaling/index.md: versioned/serving/autoscaling/README.md
versioned/serving/creating-domain-mappings.md: versioned/serving/services/custom-domains.md
versioned/serving/debugging-application-issues.md: versioned/serving/troubleshooting/debugging-application-issues.md
@@ -240,3 +240,11 @@ plugins:
versioned/getting-started/clean-up.md: versioned/getting-started/next-steps.md#clean-up
versioned/bookstore/disclaimer/README.md: versioned/bookstore/disclaimer/disclaimer.md
versioned/bookstore/extra-challenge/README.md: versioned/bookstore/extra-challenge/extra-challenges.md
+ versioned/functions/install-func.md: versioned/functions/running-functions.md
+ versioned/functions/creating-functions.md: versioned/functions/running-functions.md
+ versioned/functions/invoking-functions.md: versioned/functions/running-functions.md
+ versioned/functions/kafka-functions.md: versioned/functions/subscribing-functions.md
+ versioned/serving/load-balancing/target-burst-capacity.md: versioned/serving/load-balancing/README.md
+ versioned/serving/load-balancing/activator-capacity.md: versioned/serving/load-balancing/README.md
+ versioned/serving/revisions/revision-developer-config-options.md: versioned/serving/revisions/README.md
+ versioned/serving/app-security/secure-pod-defaults.md: versioned/serving/configuration/secure-pod-defaults.md
diff --git a/docs/snippets/route-status-updates.md b/docs/snippets/route-status-updates.md
index 7a55b7e8858..f073a32fc39 100644
--- a/docs/snippets/route-status-updates.md
+++ b/docs/snippets/route-status-updates.md
@@ -18,14 +18,14 @@ spec:
revisionName: config-00005 # Pinned to a specific Revision.
```
-Initially 1% of the traffic is rolled out to the Revisions:
+Initially 1% of the traffic is rolled out to the new Revision in `status.traffic`:
```yaml
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
...
-spec:
+status:
...
traffic:
- percent: 54
@@ -43,7 +43,7 @@ apiVersion: serving.knative.dev/v1
kind: Service
metadata:
...
-spec:
+status:
...
traffic:
- percent: 36
@@ -61,7 +61,7 @@ apiVersion: serving.knative.dev/v1
kind: Service
metadata:
...
-spec:
+status:
...
traffic:
- percent: 55
diff --git a/docs/versioned/.nav.yml b/docs/versioned/.nav.yml
index c04631218ba..a7f437604ad 100644
--- a/docs/versioned/.nav.yml
+++ b/docs/versioned/.nav.yml
@@ -28,67 +28,53 @@ nav:
###############################################################################
- Functions:
- Overview: functions/README.md
- - Install: functions/install-func.md
- - Create: functions/creating-functions.md
- - Build: functions/building-functions.md
- - Run locally: functions/running-functions.md
- - Deploy: functions/deploying-functions.md
- - Invoke: functions/invoking-functions.md
- - Subscribe to events: functions/subscribing-functions.md
- - Kafka: functions/kafka-functions.md
- - Language packs: functions/language-packs.md
+ - Develop locally: functions/running-functions.md
+ - Build an image: functions/building-functions.md
+ - Deploy a function: functions/deploying-functions.md
+ - Connect events: functions/subscribing-functions.md
+ - Templates and runtimes: functions/language-packs.md
###############################################################################
# Serving
###############################################################################
- Serving:
- - Knative Serving:
- - Overview: serving/README.md
- - Architecture: serving/architecture.md
- - Request Flow: serving/request-flow.md
- - Converting a Kubernetes Deployment to a Knative Service: serving/convert-deployment-to-knative-service.md
+ - Overview: serving/README.md
+ - Architecture: serving/architecture.md
+ - Request flow: serving/request-flow.md
+ - Deploy and configure:
+ - Services overview: serving/services/README.md
+ - Create a Service: serving/services/creating-services.md
+ - Convert a Deployment: serving/convert-deployment-to-knative-service.md
+ - Private registries: serving/deploying-from-private-registry.md
+ - Resource requests and limits: serving/services/configure-requests-limits-services.md
+ - Health probes: serving/services/configure-probing.md
+ - Volumes: serving/services/storage.md
+ - Dry run: serving/dryrun.md
+ - Networking:
+ - Private Services: serving/services/private-services.md
+ - Ingress class: serving/services/ingress-class.md
+ - Certificate class: serving/services/certificate-class.md
+ - Custom domains: serving/services/custom-domains.md
+ - Custom TLS certificates: serving/services/custom-tls-certificate-domain-mapping.md
+ - HTTP protocols: serving/services/http-protocol.md
+ - Revisions and traffic:
+ - Revisions: serving/revisions/README.md
+ - Traffic splitting and tags: serving/traffic-management.md
+ - Gradual rollouts: serving/rolling-out-latest-revision.md
- Autoscaling:
- - About autoscaling: serving/autoscaling/README.md
- - Supported autoscaler types: serving/autoscaling/autoscaler-types.md
- - Configuring metrics: serving/autoscaling/autoscaling-metrics.md
- - Configuring targets: serving/autoscaling/autoscaling-targets.md
- - Configuring scale to zero: serving/autoscaling/scale-to-zero.md
- - Configuring concurrency: serving/autoscaling/concurrency.md
- - Configuring the requests per second (RPS) target: serving/autoscaling/rps-target.md
- - Configuring scale bounds: serving/autoscaling/scale-bounds.md
- - Additional autoscaling configuration for Knative Pod Autoscaler: serving/autoscaling/kpa-specific.md
- - Autoscale Sample App - Go: serving/autoscaling/autoscale-go/README.md
- # Serving - developer docs
- - Developer Tasks:
- - Services:
- - Knative Services: serving/services/README.md
- - Creating a Service: serving/services/creating-services.md
- - Configuring private Services: serving/services/private-services.md
- - Configuring ingress class: serving/services/ingress-class.md
- - Configuring certificate class: serving/services/certificate-class.md
- - Configuring custom domains: serving/services/custom-domains.md
- - Using a custom TLS certificate for DomainMapping: serving/services/custom-tls-certificate-domain-mapping.md
- # TODO: Add security section to docs?
- - Configure resource requests and limits: serving/services/configure-requests-limits-services.md
- - Configuring probes: serving/services/configure-probing.md
- - Configuring HTTP: serving/services/http-protocol.md
- - Performing Dry Run: serving/dryrun.md
- - Volume Support: serving/services/storage.md
- - Revisions:
- - About Revisions: serving/revisions/README.md
- - Garbage Collection: serving/revisions/revision-developer-config-options.md
- - Traffic management: serving/traffic-management.md
- - Configuring gradual rollout of traffic to Revisions: serving/rolling-out-latest-revision.md
- - Tag resolution: serving/tag-resolution.md
- - Deploying from private registries: serving/deploying-from-private-registry.md
- - Load balancing:
- - About load balancing: serving/load-balancing/README.md
- - Configuring target burst capacity: serving/load-balancing/target-burst-capacity.md
- - Configuring Activator capacity: serving/load-balancing/activator-capacity.md
- - Secure Pod Defaults: serving/app-security/secure-pod-defaults.md
- # Serving - observability
+ - Overview: serving/autoscaling/README.md
+ - Autoscaler types: serving/autoscaling/autoscaler-types.md
+ - Metrics: serving/autoscaling/autoscaling-metrics.md
+ - Targets: serving/autoscaling/autoscaling-targets.md
+ - Concurrency: serving/autoscaling/concurrency.md
+ - Requests per second (RPS): serving/autoscaling/rps-target.md
+ - Scale bounds: serving/autoscaling/scale-bounds.md
+ - Scale to zero: serving/autoscaling/scale-to-zero.md
+ - KPA settings: serving/autoscaling/kpa-specific.md
+ - Request buffering: serving/load-balancing/README.md
+ - Autoscale sample app: serving/autoscaling/autoscale-go/README.md
- Observability:
- Collecting metrics: serving/observability/metrics/collecting-metrics.md
- - Metrics Reference: serving/observability/metrics/serving-metrics.md
+ - Metrics reference: serving/observability/metrics/serving-metrics.md
- Troubleshooting: serving/troubleshooting/debugging-application-issues.md
- Serving API: serving/reference/serving-api.md
- Code samples: samples/serving.md
@@ -249,6 +235,7 @@ nav:
- Config Revision Garbage Collection: serving/revisions/revision-admin-config-options.md
- Configure the Defaults ConfigMap: serving/configuration/config-defaults.md
- Secure Pod Defaults: serving/configuration/secure-pod-defaults.md
+ - Registry trust and tag resolution: serving/tag-resolution.md
- Serving encryption configuration:
- Overview: serving/encryption/encryption-overview.md
- Configure cert-manager integration: serving/encryption/configure-certmanager-integration.md
diff --git a/docs/versioned/client/README.md b/docs/versioned/client/README.md
index c05df275eea..28700ce25f9 100755
--- a/docs/versioned/client/README.md
+++ b/docs/versioned/client/README.md
@@ -37,7 +37,7 @@ The `func` CLI enables you to create, build, and deploy Knative Functions withou
### Additional resources
-- See [Installing Knative Functions](../functions/install-func.md).
+- See [Develop locally — Prepare](../functions/running-functions.md#prepare).
- See the [`func` documentation]({{ funcdocs() }}){target=_blank} in Github.
## Connecting CLI tools to your cluster
diff --git a/docs/versioned/functions/README.md b/docs/versioned/functions/README.md
index 70f9fc91d63..7bdb8d08fa5 100644
--- a/docs/versioned/functions/README.md
+++ b/docs/versioned/functions/README.md
@@ -3,26 +3,31 @@ audience: developer
components:
- functions
function: explanation
+hide_prev: true
+hide_next: true
---
-# Knative Functions overview
+# Knative Functions
--8<-- "about-functions.md"
-## Function templates
+## Start here
---8<-- "functions-templates-intro.md"
+New to Knative Functions? Follow [Try Functions](../getting-started/about-knative-functions.md)
+to create, edit, and test a Go function locally — no Kubernetes cluster or
+registry account required.
-## Language packs
+## Choose a task
-Functions can be written in any language supported by the available [language packs](https://github.com/knative/func/blob/main/docs/language-packs/language-pack-contract.md){target=_blank}.
-
+- **[Develop locally](running-functions.md):** install `func`, create a project,
+ run it locally, and send HTTP or CloudEvents test requests.
+- **[Build an image](building-functions.md):** build a container image locally
+ without running or deploying it.
+- **[Deploy a function](deploying-functions.md):** deploy from your machine or
+ build and deploy remotely on a cluster with Tekton.
+- **[Connect events](subscribing-functions.md):** subscribe a function to a
+ Knative Broker with Triggers, or consume Apache Kafka topics via sidecar.
+- **[Templates and runtimes](language-packs.md):** choose a language and
+ HTTP/CloudEvents template, or use custom language-pack repositories.
-## Getting started with functions
-
-Follow [Get started with Functions](../getting-started/about-knative-functions.md)
-to create, change, and test a Go function locally. This is the same Functions
-track linked from Get Started. Cluster deployment is optional and links to the
-shared learning-cluster setup.
-
-For an existing project, use the how-to guides in this section.
+For the full CLI reference, see the [`func` documentation]({{ funcdocs() }}){target=_blank}.
diff --git a/docs/versioned/functions/building-functions.md b/docs/versioned/functions/building-functions.md
index 7bca01c18f9..ad1269179e1 100644
--- a/docs/versioned/functions/building-functions.md
+++ b/docs/versioned/functions/building-functions.md
@@ -3,136 +3,81 @@ audience: developer
components:
- functions
function: how-to
+hide_prev: true
+hide_next: true
---
-# Building functions
+# Build an image
-Build a container image from an existing function project. The local procedure
-builds only: it does not run, publish, or deploy the function. The optional
-on-cluster workflow below builds **and deploys**, so choose it only when you want
-that result.
+`func build` turns a function project into a container image. It does not push
+anything to a registry by default (add `--push` to push the image), and it never
+deploys. For standard deployments, skip this separate build step:
+[`func deploy`](deploying-functions.md) builds, pushes, and deploys in one command.
-## Local builds
+## Requirements
-### Prerequisites
+- An initialized function project containing `func.yaml` and source code.
+ [Create a project](running-functions.md#create-a-project) if needed.
+- A running Docker-compatible container engine, such as
+ [Docker](https://docs.docker.com/get-started/get-docker/) or
+ [Podman](https://github.com/knative/func/blob/main/docs/building-functions/podman.md){target=_blank},
+ for containerized builders (`pack` or `s2i`).
+- Run commands from inside the function project directory (or use `--path`).
-- You have an initialized function project containing `func.yaml` and its source.
- [Create a project](creating-functions.md) if needed.
-- Docker is running for the container-based buildpacks builder used here.
-- Run these commands from that project directory, not its parent directory.
+
-### Procedure
+## Build
-Set an explicit local image name so the build does not need a registry prompt:
+Pass your registry: the registry host and your account namespace, for example
+`ghcr.io/alice` or `docker.io/alice`:
=== "func"
```bash
- func build --builder pack \
- --image localhost/my-function:latest
+ func build --registry
```
=== "kn func"
```bash
- kn func build --builder pack \
- --image localhost/my-function:latest
+ kn func build --registry
```
-`my-function` is an example image name; substitute yours consistently if desired.
-`localhost` here is a local tag, not a registry server you must create. Wait for
-building to complete, then check the image in Docker:
+`func` names the image `/:latest` and saves the registry
+in `func.yaml`, so later builds and deploys need no registry flag. You can also
+set the registry with `FUNC_REGISTRY`. The image stays in your container engine's
+local image store until you push it. If you previously set `--image`, see
+[Set the image name yourself](#set-the-image-name-yourself) to return to registry-based naming.
-```bash
-docker image ls localhost/my-function:latest
-```
-
-A row with the tag `latest` and an image ID identifies the built image. This does
-not mean it was pushed or started. For publishing, see the
-[deployment guide](deploying-functions.md#procedure), which explains registry
-prefixes and full image destinations. [Try Functions](../getting-started/about-knative-functions.md#run-and-test)
-shows how to run and test an image as a separate step. For other builders, image
-naming options, and flags, see the [func build reference](https://github.com/knative/func/blob/main/docs/reference/func_build.md).
-
-## On-cluster Builds
-
-This alternative uses a remote pipeline and deploys the resulting function.
-It avoids a local container build, but requires a configured cluster and registry
-credentials. The source can come from Git **or** direct upload; Git is not required
-for the direct-upload branch.
-
-### Prerequisites
-
-- Your kubeconfig selects a cluster with Knative Serving installed.
-- Tekton Pipelines and the function build pipeline are configured according to the
- [on-cluster build setup guide](https://github.com/knative/func/blob/main/docs/building-functions/on_cluster_build.md).
-- The pipeline can push to your chosen registry, and the cluster can pull the image.
- Complete the registry/credential setup in that guide rather than assuming local
- Docker login alone configures every remote pipeline.
-- You have an initialized local function project and are in its directory.
-
-### Procedure
-
-Choose the source branch below. Replace `REGISTRY-USER` with your Docker Hub
-account namespace in the image name. For Git, separately replace `GIT-OWNER` and
-`GIT-REPO` with the repository owner and name; the Git owner need not match your
-registry account. The explicit image destination avoids carrying over a local-only
-tag from an earlier build.
-
-#### Git-backed source
-
-The function project must be committed in a Git repository the pipeline can read.
-For a private repository, your platform administrator must provision pipeline
-access before you use this branch; the linked function-build setup guide does
-not provide a private-Git authentication recipe. The [Tekton authentication guide](https://tekton.dev/docs/pipelines/auth/)
-is background for that platform setup. If you cannot arrange repository access,
-use direct upload instead.
-
-These commands assume the project is at the repository root. For a subdirectory,
-set `build.source.dir` in your project's `func.yaml` to its relative path, following
-the configuration example in the [on-cluster build guide](https://github.com/knative/func/blob/main/docs/building-functions/on_cluster_build.md).
-For example, `dir: functions/my-function` selects that directory within the Git repository.
-
-=== "func"
+## Verify the image
- ```bash
- func deploy --remote \
- --image docker.io/REGISTRY-USER/my-function:latest \
- --git-url https://github.com/GIT-OWNER/GIT-REPO
- ```
-
-=== "kn func"
+Confirm the image exists (with Podman, use `podman image ls`):
- ```bash
- kn func deploy --remote \
- --image docker.io/REGISTRY-USER/my-function:latest \
- --git-url https://github.com/GIT-OWNER/GIT-REPO
- ```
+```bash
+docker image ls /
+```
-#### Direct-upload source
+A row with tag `latest` and an image ID confirms the build succeeded.
-Use this branch to upload the current local project. No Git repository is required.
-Passing an empty Git URL explicitly clears a previously configured Git source.
-If you previously set `build.source.dir` for a Git subdirectory, remove that `dir`
-entry from `build.source` too so the upload uses the current local project root:
+
-=== "func"
+## Other builders
- ```bash
- func deploy --remote \
- --image docker.io/REGISTRY-USER/my-function:latest \
- --git-url=""
- ```
+`func build` supports `--builder pack` (Cloud Native Buildpacks, the default),
+`--builder s2i` (Source-to-Image), and `--builder host`, which builds with your
+local toolchain and needs no container engine. The `host` builder currently
+supports Go and Python functions. It writes the image to `.func/build/oci`
+in the project, not to the container engine, so `docker image ls` does not list it.
-=== "kn func"
+For remote on-cluster builds with Tekton, see
+[Deploy a function — Build and deploy remotely](deploying-functions.md#build-and-deploy-remotely).
+For all flags and builder options, see the
+[`func build` reference](https://github.com/knative/func/blob/main/docs/reference/func_build.md){target=_blank}.
- ```bash
- kn func deploy --remote \
- --image docker.io/REGISTRY-USER/my-function:latest \
- --git-url=""
- ```
+## Set the image name yourself
-Wait for the pipeline and deployment to finish. Verify the **deployed** function
-using `func invoke --target remote` (or `kn func invoke --target remote`) and
-check your function's expected response. A finished image build alone does not
-prove deployment or invocation succeeded.
+To choose the full image name instead of `/:latest`,
+pass `--image`, for example `--image ghcr.io/alice/my-image:v1`. `func` saves it
+in the `image:` line in `func.yaml`, where it takes precedence over `--registry`
+and `FUNC_REGISTRY` on later builds and deploys. To return to registry-based
+naming, delete the `image:` line from `func.yaml`.
diff --git a/docs/versioned/functions/creating-functions.md b/docs/versioned/functions/creating-functions.md
deleted file mode 100644
index c34be4b9261..00000000000
--- a/docs/versioned/functions/creating-functions.md
+++ /dev/null
@@ -1,10 +0,0 @@
----
-audience: developer
-components:
- - functions
-function: how-to
----
-
-# Creating functions
-
---8<-- "create-a-function.md"
diff --git a/docs/versioned/functions/deploying-functions.md b/docs/versioned/functions/deploying-functions.md
index 62b578d60db..4e42bd8758f 100644
--- a/docs/versioned/functions/deploying-functions.md
+++ b/docs/versioned/functions/deploying-functions.md
@@ -3,36 +3,143 @@ audience: developer
components:
- functions
function: how-to
+hide_prev: true
+hide_next: true
---
-# Deploying functions
+# Deploy a function
---8<-- "deploy-func-intro.md"
+Build, push, and deploy a function project to Kubernetes as a Knative Service
+(or as a raw Kubernetes Deployment). For a guided first deployment, see
+[Try Functions — Deploy to Knative](../getting-started/about-knative-functions.md#deploy-to-knative-optional).
-## Prerequisites
+## Requirements
-- You have a Kubernetes cluster with Knative Serving installed, and your kubeconfig
- selects the intended cluster and namespace. For a disposable environment,
- [set up a learning cluster](../getting-started/quickstart-install.md) and check
- its context before returning here. Local Functions development alone does not
- create a cluster.
+- An initialized function project containing `func.yaml`
+ ([create a project](running-functions.md#create-a-project) if needed).
+- A Kubernetes cluster with Knative Serving installed, with your `kubectl`
+ context selecting the target cluster and namespace.
+- Push access to a container registry that your cluster can pull from (use a
+ public repository or configure image pull secrets for private registries).
+- For local builds: a running [Docker](https://docs.docker.com/get-started/get-docker/)
+ engine. For remote builds: Tekton Pipelines configured on the cluster.
-- You have a Docker daemon running on your local machine for the container builder.
- Quickstart uses an existing container engine; it does not install one.
+## Deploy from your machine
-- You have access to a container registry and are able to push images to this registry. Note that some image registries set newly pushed images to private by default. If you are deploying a function for the first time, you may need to ensure that your images are set to public.
+Run `func deploy` from inside the project directory and pass your registry: the
+registry host and your account namespace, for example `ghcr.io/alice` or
+`docker.io/alice`. There is no need to run `func build` first. If you previously
+passed `--image` (an exact image name), `func.yaml` keeps that name in an `image:`
+line, which takes precedence over `--registry` until you delete the line.
-## Procedure
+=== "func"
-For a first deployment, follow the [worked deployment tutorial](../getting-started/about-knative-functions.md#deploy-to-knative-optional),
-which covers cluster setup, registry login, and the full image name. This is also
-the next step if you are coming from the local Functions track.
+ ```bash
+ func deploy --registry
+ ```
-In the commands below, `` means the registry **and your account namespace**.
-For example, `docker.io/alice` means Alice's Docker Hub namespace, and
-`ghcr.io/alice` means her GitHub Container Registry namespace. Substitute your own
-account; do not type the angle brackets. The CLI uses that prefix with the
-function's project name to construct the image name. The worked tutorial instead
-uses `--image` to set the complete destination explicitly.
+=== "kn func"
---8<-- "proc-deploying-function.md"
+ ```bash
+ kn func deploy --registry
+ ```
+
+`func` builds the image, pushes it to `/:latest`, and
+creates or updates a Knative Service with the project name.
+
+- **Namespace:** By default, `func deploy` uses the previously deployed
+ namespace recorded in the project, or your current `kubectl` namespace on
+ first deploy. Pass `-n ` to target a specific namespace.
+- **Private registries:** Set `FUNC_USERNAME` and `FUNC_PASSWORD` environment
+ variables for registry push credentials (avoid passing `--password` on the
+ command line), and ensure the target cluster namespace has pull credentials.
+- **Raw Kubernetes deployer:** Add `--deployer raw` to deploy as a standard
+ Kubernetes Deployment and Service instead of a Knative Service.
+
+## Build and deploy remotely
+
+Use `--remote` to run the build and deployment on the cluster with Tekton
+Pipelines instead of a local Docker engine. Configure Tekton and pipeline RBAC
+first using the
+[on-cluster build guide](https://github.com/knative/func/blob/main/docs/building-functions/on_cluster_build.md){target=_blank}.
+
+The following commands use the source flags introduced in `func` v1.24.0.
+Before v1.24.0, `--source`, `--revision`, and `--source-dir` were named
+`--git-url`, `--git-branch`, and `--git-dir`, respectively.
+
+Choose one source method (replace `REGISTRY-USER` with your registry account
+namespace):
+
+=== "Git-backed source"
+
+ Commit your project to a Git repository the cluster pipeline can read. For
+ private repositories, have your platform administrator provision pipeline
+ Git access first (see the
+ [Tekton authentication guide](https://tekton.dev/docs/pipelines/auth/){target=_blank}).
+ If the project is in a subdirectory, add `--source-dir `.
+ To select a branch, tag, or commit, add `--revision `.
+
+ ```bash
+ func deploy --remote \
+ --registry docker.io/REGISTRY-USER \
+ --source https://github.com/GIT-OWNER/GIT-REPO
+ ```
+
+ With an explicit `--source`, `func` deploys the function by reference from
+ the repository and does not write to the local `func.yaml`. Do not combine
+ `--source` with `--image`; use `--registry` instead. Re-run the same command
+ with `--source` for subsequent Git-backed deployments.
+
+=== "Direct upload (no Git)"
+
+ Upload the current local project directory directly. Passing `--source=""`
+ and `--source-dir=""` clears any previously configured Git repository and
+ subdirectory:
+
+ ```bash
+ func deploy --remote \
+ --registry docker.io/REGISTRY-USER \
+ --source="" --source-dir=""
+ ```
+
+(`kn func deploy` accepts the same flags.)
+
+## Verify
+
+Invoke the deployed function with an explicit `--target remote` so you do not
+accidentally hit a locally running instance:
+
+=== "func"
+
+ ```bash
+ func invoke --target remote
+ ```
+
+=== "kn func"
+
+ ```bash
+ kn func invoke --target remote
+ ```
+
+Confirm the response body matches your function's expected output. You can also
+check status on the cluster:
+
+- **Knative deployer (default):** `kn service describe -n `
+- **Raw deployer (`--deployer raw`):** `kubectl get deployment/ service/ -n `
+
+## Update and remove
+
+- **Update:**
+ - Local builds and direct-upload remote builds: edit your code and re-run
+ `func deploy` (or `func deploy --remote --source="" --source-dir=""`).
+ - Git-backed remote builds: commit and push your changes to the Git
+ repository first, then re-run the same `func deploy --remote --source ...`
+ command, including any `--revision` and `--source-dir` flags.
+ - With the default Knative deployer, each deploy rolls out a new Revision;
+ with `--deployer raw`, it updates the Kubernetes Deployment.
+- **Remove:** Run `func delete` from inside the project directory (works for
+ both Knative and raw deployers). You can also delete directly with
+ `kn service delete -n ` (Knative deployer) or
+ `kubectl delete deployment/ service/ -n ` (raw
+ deployer). Deleting the workload does not delete the pushed image from your
+ container registry.
diff --git a/docs/versioned/functions/install-func.md b/docs/versioned/functions/install-func.md
deleted file mode 100644
index ad5aca03307..00000000000
--- a/docs/versioned/functions/install-func.md
+++ /dev/null
@@ -1,18 +0,0 @@
----
-audience: developer
-components:
- - functions
-function: how-to
----
-
-# Installing Knative Functions
-
---8<-- "install-functions-intro.md"
-
-## Installing the `func` CLI
-
---8<-- "install-func-CLI.md"
-
-## Installing the `kn func` CLI plugin
-
---8<-- "install-kn-func-plugin.md"
diff --git a/docs/versioned/functions/invoking-functions.md b/docs/versioned/functions/invoking-functions.md
deleted file mode 100644
index da8d92b9300..00000000000
--- a/docs/versioned/functions/invoking-functions.md
+++ /dev/null
@@ -1,17 +0,0 @@
----
-audience: developer
-components:
- - functions
-function: how-to
----
-
-# Invoking functions
-
-You can use the `func invoke` command to send a test request to invoke a
-function either locally or on your Knative cluster.
-
-This command can be used to test that a function is working and able to receive HTTP requests and CloudEvents correctly.
-
-If your function is running locally, `func invoke` sends a test request to the local instance.
-
-You can use the `func invoke` command to send test data to your function with the `--data` flag, as well as other options to simulate different types of requests. See the [func invoke](https://github.com/knative/func/blob/main/docs/reference/func_invoke.md){target=_blank} documentation for more information.
diff --git a/docs/versioned/functions/kafka-functions.md b/docs/versioned/functions/kafka-functions.md
deleted file mode 100644
index 66cbcbef7be..00000000000
--- a/docs/versioned/functions/kafka-functions.md
+++ /dev/null
@@ -1,15 +0,0 @@
----
-audience: developer
-components:
- - functions
-function: explanation
----
-
-# Kafka functions
-
-A function can consume messages from an Apache Kafka topic. When a function declares a `run.kafka` configuration, `func` deploys a language-agnostic runtime sidecar alongside it. The sidecar consumes the topic and delivers each record to the function as a CloudEvent over HTTP, so the function stays a plain CloudEvents handler in any language, with no Kafka client code of its own.
-
-The full guide lives in the `func` repository, covering concepts, a getting-started walkthrough, delivery and retries, deployment and scaling, idempotency, local development, and troubleshooting:
-
-- [Kafka functions guide](https://github.com/knative/func/blob/main/docs/kafka-functions/README.md){target=_blank}
-- [run.kafka configuration reference](https://github.com/knative/func/blob/main/docs/reference/func_yaml.md#runkafka){target=_blank}
diff --git a/docs/versioned/functions/language-packs.md b/docs/versioned/functions/language-packs.md
index 0322039ed87..431011aee5f 100644
--- a/docs/versioned/functions/language-packs.md
+++ b/docs/versioned/functions/language-packs.md
@@ -3,19 +3,84 @@ audience: developer
components:
- functions
function: how-to
+hide_prev: true
+hide_next: true
---
-# Language packs
+# Templates and runtimes
-Language packs can be used to extend Knative Functions to support additional runtimes, function signatures, operating systems, and installed tooling for functions. Language Packs are distributed through Git repositories or as a directory on a disc.
+Knative Functions includes built-in language runtimes and templates, and lets
+you pull custom templates from Git repositories via language packs.
-For more information see the [language pack](https://github.com/knative/func/blob/main/docs/language-packs/language-pack-contract.md){target=_blank} documentation.
+## Choose a runtime
-## Using external Git repositories
+Pass `-l ` to `func create`. Built-in runtimes:
-When creating a new function, a Git repository can be specified as the source
-for the template files.
+| Runtime | `-l` value |
+| --- | --- |
+| Go | `go` |
+| Node.js | `node` |
+| TypeScript | `typescript` |
+| Python | `python` |
+| Quarkus (Java) | `quarkus` |
+| Spring Boot (Java) | `springboot` |
+| Rust | `rust` |
-## Installing language packs locally
+## Choose HTTP or CloudEvents
-Language packs can be installed locally by using the [`func repository`](https://github.com/knative/func/blob/main/docs/reference/func_repository.md){target=_blank} command.
+Pass `-t ` to `func create` (default `http`):
+
+- **`http`** — handles standard HTTP requests and responses.
+- **`cloudevents`** — receives and optionally returns CloudEvents; use this
+ when connecting a function to Knative Eventing or Kafka.
+
+```bash
+func create -l python -t cloudevents my-event-fn
+```
+
+## Use an external repository
+
+To scaffold a function from a remote Git template repository without installing
+it locally, pass `--repository`:
+
+```bash
+func create -l go \
+ --template \
+ --repository \
+ my-function
+```
+
+Verify the generated `my-function/` directory contains `func.yaml` and the
+expected template files.
+
+## Installed repositories { #manage-installed-repositories }
+
+Install a trusted template repository locally with `func repository` so you can
+reuse its templates by name:
+
+1. Add the repository and verify it appears in the list:
+
+ ```bash
+ func repository add my-pack
+ func repository list
+ ```
+
+ The output lists `default` alongside `my-pack`.
+
+1. Create a function using `/`:
+
+ ```bash
+ func create -l go -t my-pack/ my-function
+ ```
+
+1. Rename or remove installed repositories when needed:
+
+ ```bash
+ func repository rename my-pack renamed-pack
+ func repository remove renamed-pack
+ ```
+
+For all repository flags, see the
+[`func repository` reference](https://github.com/knative/func/blob/main/docs/reference/func_repository.md){target=_blank}.
+To author your own language pack, see the
+[language pack contract](https://github.com/knative/func/blob/main/docs/language-packs/language-pack-contract.md){target=_blank}.
diff --git a/docs/versioned/functions/running-functions.md b/docs/versioned/functions/running-functions.md
index db19a8ab722..8fda229d023 100644
--- a/docs/versioned/functions/running-functions.md
+++ b/docs/versioned/functions/running-functions.md
@@ -3,16 +3,165 @@ audience: developer
components:
- functions
function: how-to
+hide_prev: true
+hide_next: true
---
-# Running functions
+# Develop locally
---8<-- "run-func-intro.md"
+Install the `func` CLI, scaffold a function project, run it on your machine,
+and test it with HTTP or CloudEvents requests — no Kubernetes cluster or
+container registry required.
-## Prerequisites
+
-- You have a Docker daemon on your local machine. This is already provided if you have used the Quickstart installation.
+## Prepare
-## Procedure
+- A running [Docker](https://docs.docker.com/get-started/get-docker/) engine
+ for containerized builds (`pack` or `s2i`). For `--builder host`, Docker is
+ optional, but the target language toolchain (Go or Python) must be installed
+ on your host.
+- Install the `func` CLI (or `kn func` plugin):
---8<-- "proc-running-function.md"
+=== "Homebrew"
+
+ ```bash
+ brew install knative-extensions/kn-plugins/func
+ ```
+
+ If `kn` is also installed via Homebrew, `kn func` is available automatically.
+
+=== "Release binary"
+
+ Download the binary for your OS and architecture from the
+ [`func` release page](https://github.com/knative/func/releases){target=_blank},
+ make it executable, and place it on your `PATH` as `func` (or as `kn-func`
+ to use it as a `kn` plugin).
+
+=== "Build from source"
+
+ Requires Go and `make`:
+
+ ```bash
+ git clone https://github.com/knative/func.git func
+ cd func
+ make
+ ```
+
+ Place the resulting `func` binary on your `PATH`.
+
+Verify the installation using the command matching how you installed it:
+
+```bash
+func version
+# or, if installed as a kn plugin:
+kn func version
+```
+
+
+
+## Create a project
+
+Create a new function directory using `-l` (language) and `-t` (template:
+`http` or `cloudevents`, default `http`). See
+[Templates and runtimes](language-packs.md) for the full list of supported
+languages.
+
+=== "func"
+
+ ```bash
+ func create -l go -t http my-function
+ cd my-function
+ ```
+
+=== "kn func"
+
+ ```bash
+ kn func create -l go -t http my-function
+ cd my-function
+ ```
+
+`func create` writes a new `my-function/` directory containing `func.yaml`,
+handler source, and starter tests. Pass `-t cloudevents` if your function will
+consume CloudEvents. For all flags, see the
+[`func create` reference](https://github.com/knative/func/blob/main/docs/reference/func_create.md){target=_blank}.
+
+## Run locally
+
+Inside the project directory, build and run the function locally. Pass an
+explicit `localhost/...` image name so the build stays local without needing a
+container registry:
+
+=== "func"
+
+ ```bash
+ func run --builder pack \
+ --image localhost/my-function:latest
+ ```
+
+=== "kn func"
+
+ ```bash
+ kn func run --builder pack \
+ --image localhost/my-function:latest
+ ```
+
+`--image` saves this local image name in `func.yaml`. Before deploying with
+`--registry`, delete the `image:` line so the saved local name does not override
+your registry. See [Deploy a function](deploying-functions.md).
+
+Wait until the function prints its local address, for example:
+
+```text
+Function running on 127.0.0.1:8080
+```
+
+Useful flags:
+
+- `--builder host` — run Go or Python directly on your host without Docker.
+- `--build=true` — force a rebuild even if no source changes were detected.
+- `--build=false` — reuse an already-built image without rebuilding (fails if
+ no image has been built yet).
+- `--address 127.0.0.1:8081` — bind to a different local port.
+
+Keep this terminal open while testing.
+
+
+
+## Send test requests
+
+In a **second terminal** inside the same project directory, use `func invoke`
+with `--target local` so you are guaranteed to hit the local instance:
+
+=== "HTTP request"
+
+ ```bash
+ func invoke --target local \
+ --content-type application/json \
+ --data '{"message":"Hello local!"}'
+ ```
+
+=== "CloudEvent"
+
+ ```bash
+ func invoke --target local \
+ --format cloudevent \
+ --type dev.knative.example \
+ --source /local-test \
+ --data '{"message":"Hello event!"}'
+ ```
+
+(`kn func invoke` accepts the same flags.) Confirm the response body matches
+your handler's output. You can also target a deployed instance with
+`--target remote` or an arbitrary endpoint with `--target https://...`. See the
+[`func invoke` reference](https://github.com/knative/func/blob/main/docs/reference/func_invoke.md){target=_blank}
+for all options.
+
+## Iterate and stop
+
+1. Press ++ctrl+c++ in the `func run` terminal to stop the local function.
+2. Edit your handler code and save.
+3. Re-run `func run` and verify the updated output with `func invoke --target local`.
+
+When you are ready to package or ship the function, continue to
+[Build an image](building-functions.md) or [Deploy a function](deploying-functions.md).
diff --git a/docs/versioned/functions/subscribing-functions.md b/docs/versioned/functions/subscribing-functions.md
index 41d48749330..00499b06f65 100644
--- a/docs/versioned/functions/subscribing-functions.md
+++ b/docs/versioned/functions/subscribing-functions.md
@@ -2,43 +2,114 @@
audience: developer
components:
- functions
+ - eventing
function: how-to
+hide_prev: true
+hide_next: true
---
-# Subscribe functions to CloudEvents
+# Connect events
-### Prerequisites
+Deliver events to a function either through a Knative Eventing **Broker** and
+**Trigger**, or directly from an **Apache Kafka** topic using a runtime sidecar.
-- Knative Eventing installed on the cluster
+## Broker subscription { #configure-a-broker-subscription }
-### Procedure
+**Requirements (Broker path):**
---8<-- "proc-subscribe-function.md"
+- An initialized function project using the `cloudevents` template
+ (`func create -l -t cloudevents `), with a handler that logs
+ or otherwise makes received events observable.
+- A Kubernetes cluster with Knative Serving and Knative Eventing installed, and
+ a ready Broker in your target namespace (for example `default`, or
+ `example-broker` if reusing a Quickstart cluster).
+- Registry push and cluster pull access as described in
+ [Deploy a function](deploying-functions.md#requirements).
-### Deployment with Triggers
+`func subscribe` records event subscription filters in `func.yaml` — it does
+not modify the cluster until you deploy.
-When invoking `func deploy` the CLI will create Knative Triggers for the function.
+Pass `--source` with your Broker's name (if omitted, `func` defaults to a
+Broker named `default`) and one or more `--filter` key/value pairs (all filters
+must match):
=== "func"
- Deploy the function with Triggers by running the command inside the project directory:
-
```bash
- func deploy
+ func subscribe \
+ --source example-broker \
+ --filter type=dev.knative.example
```
=== "kn func"
- Deploy the function with Triggers by running the command inside the project directory:
+ ```bash
+ kn func subscribe \
+ --source example-broker \
+ --filter type=dev.knative.example
+ ```
+
+Repeat `--filter key=value` to require additional CloudEvent attributes or
+extensions. To change or remove subscriptions later, edit `deploy.subscriptions`
+in `func.yaml` and redeploy.
+
+## Deploy and verify delivery
+
+Use the same target namespace (``) for deployment, Trigger checks,
+and logs (pass `-n ` consistently if you are not using the current
+context's namespace).
+
+1. Deploy from inside the project directory. `func deploy` creates or updates
+ the Knative Service and creates the matching Knative Triggers on the cluster:
+
+ ```bash
+ func deploy --registry -n
+ ```
+
+1. Confirm the generated Trigger is ready (`READY=True`):
```bash
- kn func deploy
+ kn trigger list -n
```
-!!! Success "Expected output"
- ```{ .bash .no-copy }
- 🙌 Function image built: /hello:latest
- 🎯 Creating Triggers on the cluster
- ✅ Function deployed in namespace "default" and exposed at URL:
- http://hello.default.127.0.0.1.sslip.io
+1. Send a matching CloudEvent (`type: dev.knative.example`) to `example-broker`
+ — for example using the CloudEvents Player from
+ [Try Eventing](../getting-started/getting-started-eventing.md) or another
+ event source connected to that Broker.
+
+1. Verify your function received the event by checking its pod logs (or other
+ observable effect from your handler):
+
+ ```bash
+ kubectl logs -n \
+ -l serving.knative.dev/service= -c user-container
```
+
+ Confirm your handler logged the event's ID and payload. Direct
+ `func invoke` calls the function directly and does not verify Broker
+ routing or Trigger filters.
+
+
+
+## Consume Kafka records
+
+A function can also consume records directly from an Apache Kafka topic without
+a Knative Eventing Broker. When `func.yaml` declares a `run.kafka`
+configuration, `func` deploys a language-agnostic sidecar that consumes the
+topic and delivers each record to your function as a CloudEvent over HTTP, so
+your function needs no Kafka client code.
+
+**Requirements (Kafka path):**
+
+- An initialized `cloudevents` function project and container registry push/pull
+ access.
+- An accessible Apache Kafka cluster and topic.
+- The **KEDA** or **raw** deployer — direct Kafka consumption (`run.kafka`) is
+ **not** supported with the default Knative Serving deployer (KEDA requires
+ KEDA installed on the cluster).
+
+For the full walkthrough — including concepts, delivery and retries, scaling,
+idempotency, local development, and troubleshooting — see the upstream guides:
+
+- [Kafka functions guide](https://github.com/knative/func/blob/main/docs/kafka-functions/README.md){target=_blank}
+- [`run.kafka` configuration reference](https://github.com/knative/func/blob/main/docs/reference/func_yaml.md#runkafka){target=_blank}
diff --git a/docs/versioned/getting-started/about-knative-functions.md b/docs/versioned/getting-started/about-knative-functions.md
index 724c2802764..609c4f1bf7d 100644
--- a/docs/versioned/getting-started/about-knative-functions.md
+++ b/docs/versioned/getting-started/about-knative-functions.md
@@ -37,7 +37,7 @@ required for the local workflow.
`func`.
Verify `func version` prints a version number. For `kn func` plugin installation,
-see [Installing Knative Functions](../functions/install-func.md).
+see [Develop locally — Prepare](../functions/running-functions.md#prepare).
@@ -73,7 +73,9 @@ see [Installing Knative Functions](../functions/install-func.md).
The first build downloads builder images and dependencies and can take
several minutes. `localhost/hello-function:latest` is a local image name —
- nothing is pushed or deployed. Wait for a line like:
+ nothing is pushed or deployed. `func` saves this name in the `image:` line
+ in `func.yaml`; the optional deployment below clears it before selecting
+ a registry. Wait for a line like:
```text
Function running on 127.0.0.1:8080
@@ -108,13 +110,23 @@ You have finished the local workflow. To run the same function on Knative, you n
- A learning cluster — [set up a cluster](quickstart-install.md) if you do not have one, and confirm your [context and `default` namespace](quickstart-install.md#create-and-verify).
- Access to a container registry (logged in locally) with push permissions and a public image repository so the cluster can pull the image without pull secrets. Never include secrets in the project.
-1. From `hello-function`, build, push, and deploy (replace `` with your registry and namespace, for example `ghcr.io/alice` or `docker.io/alice`):
+1. Stop the locally running function with ++ctrl+c++. Inside `hello-function`,
+ open `func.yaml` and delete the `image:` line containing
+ `localhost/hello-function:latest`. A saved image name takes precedence over
+ `--registry`, so leaving it would keep the local-only name.
+
+1. Build, push, and deploy in one command—there is no need to run `func build`
+ first. Replace `` with your registry host and account namespace,
+ for example `ghcr.io/alice` or `docker.io/alice`:
```bash
- func deploy --builder pack \
- --image /hello-function:latest
+ func deploy --builder pack --registry
```
+ `func` builds and pushes `/hello-function:latest`, then creates
+ the Knative Service. It saves the registry in `func.yaml`, so subsequent
+ deployments can use `func deploy` without a registry flag.
+
1. Invoke the remote Service explicitly:
```bash
diff --git a/docs/versioned/serving/README.md b/docs/versioned/serving/README.md
index fec4107ae78..879e41c038d 100644
--- a/docs/versioned/serving/README.md
+++ b/docs/versioned/serving/README.md
@@ -3,56 +3,44 @@ audience: developer
components:
- serving
function: explanation
+hide_prev: true
+hide_next: true
---
# Knative Serving
--8<-- "about-serving.md"
-## Common use cases
-
-Examples of supported Knative Serving use cases:
-
-- Rapid deployment of serverless containers.
-- Autoscaling, including scaling pods down to zero.
-- Support for multiple networking layers, such as Contour, Kourier, and Istio, for integration into existing environments.
-
-Knative Serving supports both HTTP and [HTTPS](encryption/encryption-overview.md) networking protocols.
-
-## Installation
-
-You can install Knative Serving via the methods listed on the [installation page](../install/README.md).
-
-## Getting Started
-
-Follow [Get started with Serving](../getting-started/first-service.md) to deploy
-and call a service, observe scale-to-zero, and split traffic between revisions.
-This is the same Serving track linked from Get Started, not a separate tutorial.
-It links to the shared learning-cluster setup if you need an environment.
-
-With the `Service` resource, a deployed service will automatically have a
-matching route and configuration created. Each time the `Service` is updated, a
-new revision is created.
-
-## More samples and demos
-
-- [Knative Serving code samples](../samples/serving.md)
-
-## Debugging Knative Serving issues
-
-- [Debugging application issues](troubleshooting/debugging-application-issues.md)
-
-## Configuration and Networking
-
-- [Configuring cluster local routes](services/private-services.md)
-- [Using a custom domain](using-a-custom-domain.md)
-- [Traffic management](traffic-management.md)
-
-## Observability
-
-- [Serving Metrics API](observability/metrics/serving-metrics.md)
-
-## Known Issues
-
-See the [Knative Serving Issues](https://github.com/knative/serving/issues) page
-for a full list of known issues.
+## Start here
+
+New to Knative Serving? Follow [Try Serving](../getting-started/first-service.md)
+to deploy a container, watch it scale to zero, and split traffic between
+Revisions on a local cluster.
+
+## Choose a task
+
+- **Deploy and configure:** [create a Service](services/creating-services.md),
+ [convert a Kubernetes Deployment](convert-deployment-to-knative-service.md),
+ [deploy from a private registry](deploying-from-private-registry.md), or
+ configure [resource limits](services/configure-requests-limits-services.md),
+ [health probes](services/configure-probing.md), and [volumes](services/storage.md).
+- **Networking:** configure [private Services](services/private-services.md),
+ [custom domains](services/custom-domains.md),
+ [custom TLS certificates](services/custom-tls-certificate-domain-mapping.md),
+ or [HTTP protocols](services/http-protocol.md).
+- **Revisions and traffic:** manage [Revisions](revisions/README.md),
+ [split traffic and assign tags](traffic-management.md), or configure
+ [gradual rollouts](rolling-out-latest-revision.md).
+- **Autoscaling:** tune [autoscaling](autoscaling/README.md) defaults,
+ [concurrency](autoscaling/concurrency.md), [scale bounds](autoscaling/scale-bounds.md),
+ [scale to zero](autoscaling/scale-to-zero.md), and [request buffering](load-balancing/README.md).
+- **Observe and troubleshoot:** [collect metrics](observability/metrics/collecting-metrics.md),
+ browse the [metrics reference](observability/metrics/serving-metrics.md), or
+ [troubleshoot application issues](troubleshooting/debugging-application-issues.md).
+
+## Architecture and reference
+
+- [Architecture](architecture.md) and [Request flow](request-flow.md)
+- [Serving API reference](reference/serving-api.md)
+- [Serving code samples](../samples/serving.md)
+- [Install Knative Serving](../install/README.md)
diff --git a/docs/versioned/serving/app-security/secure-pod-defaults.md b/docs/versioned/serving/app-security/secure-pod-defaults.md
deleted file mode 100644
index 4dfdf1ec353..00000000000
--- a/docs/versioned/serving/app-security/secure-pod-defaults.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-audience: developer
-components:
- - serving
-function: how-to
----
-
-Knative Serving provides a `secure-pod-defaults` configuration option that allows operators to default Service configuration to run in the Kubernetes [restricted](https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted) Pod Security Standard profile without requiring application developers to explicitly set security properties.
-
-These settings are controlled by operators so please refer to the [administration documentation](../configuration/secure-pod-defaults.md).
-
-
diff --git a/docs/versioned/serving/autoscaling/README.md b/docs/versioned/serving/autoscaling/README.md
index 962225636c6..7a11a15b091 100644
--- a/docs/versioned/serving/autoscaling/README.md
+++ b/docs/versioned/serving/autoscaling/README.md
@@ -7,18 +7,61 @@ function: explanation
# Autoscaling
-Knative Serving provides automatic scaling, or _autoscaling_, for applications to match incoming demand. This is provided by default, by using the Knative Pod Autoscaler (KPA).
+Knative Serving automatically scales application pods to match incoming demand,
+including scaling down to zero when idle. Autoscaling works out of the box with
+the default **Knative Pod Autoscaler (KPA)** — you do not need to configure
+concurrency or scale bounds unless you want to override the defaults.
-For example, if an application is receiving no traffic and scale to zero is enabled, Knative Serving scales the application down to zero replicas. If scaling to zero is disabled, the application is scaled down to the minimum number of replicas specified for applications on the cluster. Replicas are scaled up to meet demand if traffic to the application increases.
+## Choose a tuning goal
-You can enable and disable scale to zero functionality for your cluster if you have cluster administrator permissions. See [Configuring scale to zero](scale-to-zero.md).
-
-To use autoscaling for your application if it is enabled on your cluster, you must configure [concurrency](concurrency.md) and [scale bounds](scale-bounds.md).
-
+- **Cap concurrent requests per pod (protect a database or single-threaded app):**
+ set a soft or hard [concurrency](concurrency.md) limit.
+- **Avoid cold starts or cap maximum cost:** set `min-scale` and `max-scale` in
+ [Scale bounds](scale-bounds.md).
+- **Keep the last pod warm longer before scaling to zero:** adjust
+ [Scale to zero](scale-to-zero.md) retention settings.
+- **Scale on requests per second (RPS) or CPU/memory:** choose a
+ [metric](autoscaling-metrics.md) and [target](autoscaling-targets.md), or
+ switch to the Kubernetes HPA in [Autoscaler types](autoscaler-types.md).
+- **Buffer traffic bursts through the Activator:** tune
+ [Request buffering](../load-balancing/README.md).
+
+## Tune a Service
+
+Most autoscaling settings can be applied per Revision on `spec.template.metadata.annotations`
+(cluster administrators can also set global defaults in `config-autoscaler`).
+For example, to keep at least 1 replica warm, cap scale at 5, and target 50
+concurrent requests per pod:
+
+```yaml
+apiVersion: serving.knative.dev/v1
+kind: Service
+metadata:
+ name: my-service
+spec:
+ template:
+ metadata:
+ annotations:
+ autoscaling.knative.dev/min-scale: "1"
+ autoscaling.knative.dev/max-scale: "5"
+ autoscaling.knative.dev/target: "50"
+ spec:
+ containers:
+ - image: ghcr.io/knative/helloworld-go:latest
+```
+
+Apply the manifest and verify the updated Revision is ready and has the
+expected pods:
+
+```bash
+kubectl apply -f service.yaml
+kubectl wait kservice/my-service --for=condition=Ready --timeout=120s
+kubectl get pods -l serving.knative.dev/service=my-service
+```
## Additional resources
-
-* Try out the [Go Autoscale Sample App](autoscale-go/README.md).
-* Configure your Knative deployment to use the Kubernetes Horizontal Pod Autoscaler (HPA) instead of the default KPA. For how to install HPA, see [Install optional Serving extensions](../../install/yaml-install/serving/install-serving-with-yaml.md#install-optional-serving-extensions).
-* Configure the [types of metrics](autoscaling-metrics.md) that the Autoscaler consumes.
+- Try the [Autoscale sample app](autoscale-go/README.md) to watch KPA scale
+ under load.
+- Install the optional HPA autoscaler via
+ [Install optional Serving extensions](../../install/yaml-install/serving/install-serving-with-yaml.md#install-optional-serving-extensions).
diff --git a/docs/versioned/serving/autoscaling/autoscale-go/README.md b/docs/versioned/serving/autoscaling/autoscale-go/README.md
index c0c1caaf00c..c2dc450acf5 100644
--- a/docs/versioned/serving/autoscaling/autoscale-go/README.md
+++ b/docs/versioned/serving/autoscaling/autoscale-go/README.md
@@ -11,13 +11,13 @@ A demonstration of the autoscaling capabilities of a Knative Serving Revision.
## Prerequisites
-1. A Kubernetes cluster with [Knative Serving](../../../install/yaml-install/serving/install-serving-with-yaml.md))
+1. A Kubernetes cluster with [Knative Serving](../../../install/yaml-install/serving/install-serving-with-yaml.md)
installed.
1. The `hey` load generator installed (`go install github.com/rakyll/hey@latest`).
1. Clone this repository, and move into the sample directory:
```bash
- git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
+ git clone https://github.com/knative/docs knative-docs
cd knative-docs
```
@@ -31,10 +31,10 @@ A demonstration of the autoscaling capabilities of a Knative Serving Revision.
1. Obtain the URL of the service (once `Ready`):
- ```{ .bash .no-copy }
- $ kubectl get ksvc autoscale-go
- NAME URL LATESTCREATED LATESTREADY READY REASON
- autoscale-go http://autoscale-go.default.1.2.3.4.sslip.io autoscale-go-96dtk autoscale-go-96dtk True
+ ```bash
+ kubectl wait kservice/autoscale-go --for=condition=Ready --timeout=120s
+ SERVICE_URL=$(kubectl get kservice autoscale-go -o jsonpath='{.status.url}')
+ echo "$SERVICE_URL"
```
## Load the Service
@@ -42,7 +42,7 @@ A demonstration of the autoscaling capabilities of a Knative Serving Revision.
1. Make a request to the autoscale app to see it consume some resources.
```bash
- curl "http://autoscale-go.default.1.2.3.4.sslip.io?sleep=100&prime=10000&bloat=5"
+ curl "${SERVICE_URL}?sleep=100&prime=10000&bloat=5"
```
```{ .bash .no-copy }
@@ -55,8 +55,8 @@ A demonstration of the autoscaling capabilities of a Knative Serving Revision.
```bash
hey -z 30s -c 50 \
- "http://autoscale-go.default.1.2.3.4.sslip.io?sleep=100&prime=10000&bloat=5" \
- && kubectl get pods
+ "${SERVICE_URL}?sleep=100&prime=10000&bloat=5" \
+ && kubectl get pods -l serving.knative.dev/service=autoscale-go
```
```{ .bash .no-copy }
@@ -219,21 +219,21 @@ customization (32 minutes).
```bash
hey -z 60s -c 100 \
- "http://autoscale-go.default.1.2.3.4.sslip.io?sleep=100&prime=10000&bloat=5"
+ "${SERVICE_URL}?sleep=100&prime=10000&bloat=5"
```
1. Send 60 seconds of traffic maintaining 100 qps with short requests (10 ms).
```bash
hey -z 60s -q 100 \
- "http://autoscale-go.default.1.2.3.4.sslip.io?sleep=10"
+ "${SERVICE_URL}?sleep=10"
```
1. Send 60 seconds of traffic maintaining 100 qps with long requests (1 sec).
```bash
hey -z 60s -q 100 \
- "http://autoscale-go.default.1.2.3.4.sslip.io?sleep=1000"
+ "${SERVICE_URL}?sleep=1000"
```
1. Send 60 seconds of traffic with heavy CPU usage (~1 cpu/sec/request, total
@@ -241,7 +241,7 @@ customization (32 minutes).
```bash
hey -z 60s -q 100 \
- "http://autoscale-go.default.1.2.3.4.sslip.io?prime=40000000"
+ "${SERVICE_URL}?prime=40000000"
```
1. Send 60 seconds of traffic with heavy memory usage (1 gb/request, total 5
@@ -249,7 +249,7 @@ customization (32 minutes).
```bash
hey -z 60s -c 5 \
- "http://autoscale-go.default.1.2.3.4.sslip.io?bloat=1000"
+ "${SERVICE_URL}?bloat=1000"
```
## Cleanup
diff --git a/docs/versioned/serving/autoscaling/autoscaler-types.md b/docs/versioned/serving/autoscaling/autoscaler-types.md
index 735de924dbb..81dc0555d9f 100644
--- a/docs/versioned/serving/autoscaling/autoscaler-types.md
+++ b/docs/versioned/serving/autoscaling/autoscaler-types.md
@@ -19,13 +19,13 @@ For how to install HPA, see [Install optional Serving extensions](../../install/
* Supports scale to zero functionality.
* Does not support CPU-based autoscaling.
-## Horizontal Pod Autoscaler (HPA)
+## Horizontal Pod Autoscaler { #horizontal-pod-autoscaler-hpa }
* Not part of the Knative Serving core, and you must install Knative Serving first.
* Does not support scale to zero functionality.
* Supports CPU-based autoscaling.
-## Configuring the Autoscaler implementation
+## Choose an autoscaler { #configuring-the-autoscaler-implementation }
The type of Autoscaler implementation (KPA or HPA) can be configured by using the `class` annotation.
diff --git a/docs/versioned/serving/autoscaling/concurrency.md b/docs/versioned/serving/autoscaling/concurrency.md
index 469925c247a..189680317e7 100644
--- a/docs/versioned/serving/autoscaling/concurrency.md
+++ b/docs/versioned/serving/autoscaling/concurrency.md
@@ -13,7 +13,7 @@ For per-revision concurrency, you must configure both `autoscaling.knative.dev/m
For global concurrency, you can set the `container-concurrency-target-default` value.
-## Soft versus hard concurrency limits
+## Concurrency limits { #soft-versus-hard-concurrency-limits }
It is possible to set either a _soft_ or _hard_ concurrency limit.
diff --git a/docs/versioned/serving/autoscaling/scale-to-zero.md b/docs/versioned/serving/autoscaling/scale-to-zero.md
index ddb6f7c7cac..51460900e27 100644
--- a/docs/versioned/serving/autoscaling/scale-to-zero.md
+++ b/docs/versioned/serving/autoscaling/scale-to-zero.md
@@ -93,11 +93,11 @@ This setting does not adjust how long the last replica will be kept after traffi
-## Scale to zero last pod retention period
+## Last pod retention { #scale-to-zero-last-pod-retention-period }
The `scale-to-zero-pod-retention-period` flag determines the minimum amount of time that the last pod will remain active after the Autoscaler decides to scale pods to zero.
-This contrasts with the `scale-to-zero-grace-period` flag, which determines the maximum amount of time that the last pod will remain active after the Autoscaler decides to scale pods to zero.
+By contrast, `scale-to-zero-grace-period` (above) is an upper-bound timeout for internal network programming before removing the last pod, not a pod-retention timer.
* **Global key:** `scale-to-zero-pod-retention-period`
* **Per-revision annotation key:** `autoscaling.knative.dev/scale-to-zero-pod-retention-period`
diff --git a/docs/versioned/serving/configuration/secure-pod-defaults.md b/docs/versioned/serving/configuration/secure-pod-defaults.md
index 10964b3c873..370bb061c91 100644
--- a/docs/versioned/serving/configuration/secure-pod-defaults.md
+++ b/docs/versioned/serving/configuration/secure-pod-defaults.md
@@ -5,6 +5,8 @@ components:
function: how-to
---
+# Secure Pod Defaults
+
!!! important
The default setting of `disabled` will be changed in the upcoming release of Knative 1.21 to be more secure.
diff --git a/docs/versioned/serving/convert-deployment-to-knative-service.md b/docs/versioned/serving/convert-deployment-to-knative-service.md
index 5f022a500fe..16097f644aa 100644
--- a/docs/versioned/serving/convert-deployment-to-knative-service.md
+++ b/docs/versioned/serving/convert-deployment-to-knative-service.md
@@ -16,15 +16,16 @@ Converting to a Knative Service has the following benefits:
- Reduces the footprint of the service instance because the instance scales to 0 when it becomes idle.
- Improves performance due to built-in autoscaling for the Knative Service.
-## Determine if your workload is a good fit for Knative
+## Workload fit { #determine-if-your-workload-is-a-good-fit-for-knative }
In general, if your Kubernetes workload is a good fit for Knative, you can remove a lot of your manifest to create a Knative Service.
There are three aspects you need to consider:
-- All work done is triggered by HTTP.
-- The container is stateless. All state is stored elsewhere or can be re-created.
-- Your workload uses only Secret and ConfigMap volumes.
+- All work is triggered by HTTP (or gRPC/WebSockets over HTTP).
+- The container is stateless — persistent state lives outside the pod, or uses
+ a [supported volume type](services/storage.md) (such as ConfigMaps, Secrets,
+ EmptyDir, or enabled PersistentVolumeClaims).
## Example conversion
@@ -70,11 +71,16 @@ spec:
### Knative Service
+To migrate safely without disturbing the existing Deployment, deploy the
+Knative Service under a distinct name first (for example `my-nginx-knative`),
+verify it responds as expected, and cut traffic over before deleting the old
+Deployment and Service:
+
```yaml
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
- name: my-nginx
+ name: my-nginx-knative
spec:
template:
spec:
@@ -83,3 +89,11 @@ spec:
ports:
- containerPort: 80
```
+
+Apply and verify:
+
+```bash
+kubectl apply -f my-nginx-knative.yaml
+kubectl wait kservice/my-nginx-knative --for=condition=Ready --timeout=120s
+curl "$(kubectl get kservice my-nginx-knative -o jsonpath='{.status.url}')"
+```
diff --git a/docs/versioned/serving/deploying-from-private-registry.md b/docs/versioned/serving/deploying-from-private-registry.md
index fbd4e0f9ba6..a53a5ab7d24 100644
--- a/docs/versioned/serving/deploying-from-private-registry.md
+++ b/docs/versioned/serving/deploying-from-private-registry.md
@@ -16,77 +16,53 @@ You can configure your Knative cluster to deploy images from a private registry
## Procedure
-1. Create a `imagePullSecrets` object that contains your credentials as a list of secrets:
+1. Create a `docker-registry` Secret in your target namespace. If your local `$HOME/.docker/config.json` stores direct registry credentials (rather than a host `credsStore` helper), you can create the Secret from that file:
```bash
- kubectl create secret docker-registry \
- --docker-server= \
- --docker-email= \
- --docker-username= \
- --docker-password=
+ kubectl create secret generic \
+ --namespace \
+ --from-file=.dockerconfigjson="$HOME/.docker/config.json" \
+ --type=kubernetes.io/dockerconfigjson
```
- Where:
+ If your Docker configuration uses a credential helper (`credsStore`), follow [Pull an Image from a Private Registry](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) in the Kubernetes documentation to create a `docker-registry` Secret instead.
- - `` is the name that you want to use for your secrets (the `imagePullSecrets` object). For example, `container-registry`.
+1. Choose one of the following to attach the Secret:
- - `` is the URL of the private registry where your container images are stored. Examples include [Google Container Registry](https://gcr.io/) or [DockerHub](https://docker.io/).
+ - **Single Service (recommended):** reference `imagePullSecrets` on the Service's Revision template (replace `/:` with your private image):
- * `` is the email address that is associated with
- the private registry.
-
- * `` is the username that you use to access the
- private container registry.
-
- * `` is the password that you use to access
- the private container registry.
-
- Example:
-
- ```bash
- kubectl create secret docker-registry container-registry \
- --docker-server=https://gcr.io/ \
- --docker-email=my-account-email@address.com \
- --docker-username=my-grc-username \
- --docker-password=my-gcr-password
- ```
-
-1. Optional. After you have created the `imagePullSecrets` object, you can view the secrets by running:
-
- ```bash
- kubectl get secret -o=yaml
- ```
-
-1. Optional. Add the `imagePullSecrets` object to the `default` service account in the `default` namespace.
-
- !!! note
- By default, the `default` service account in each of the [namespaces](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/) of your Knative cluster are used by your Revisions, unless the [`serviceAccountName`](https://github.com/knative/specs/blob/main/specs/serving/knative-api-specification-1.0.md#revision-2) is specified.
-
- For example, if have you named your secrets `container-registry`, you can run the following command to modify the `default` service account:
+ ```yaml
+ apiVersion: serving.knative.dev/v1
+ kind: Service
+ metadata:
+ name: private-app
+ namespace:
+ spec:
+ template:
+ spec:
+ imagePullSecrets:
+ - name:
+ containers:
+ - image: /:
+ ports:
+ - containerPort: 8080
+ ```
+
+ - **All Services in a namespace:** patch the `default` ServiceAccount in that namespace so every Revision uses the Secret unless `serviceAccountName` is overridden:
+
+ ```bash
+ kubectl patch serviceaccount default \
+ --namespace \
+ -p '{"imagePullSecrets": [{"name": ""}]}'
+ ```
+
+1. Apply the Service and verify it becomes ready and resolves the image digest on its latest Revision:
```bash
- kubectl patch serviceaccount default -p "{\"imagePullSecrets\": [{\"name\": \"container-registry\"}]}"
+ kubectl apply -f private-app.yaml
+ kubectl wait kservice/private-app --namespace --for=condition=Ready --timeout=120s
+ REVISION=$(kubectl get kservice private-app --namespace -o jsonpath='{.status.latestReadyRevisionName}')
+ kubectl get revision "$REVISION" --namespace -o jsonpath='{.status.containerStatuses[0].imageDigest}'; echo
```
- New pods that are created in the `default` namespace now include your credentials and have access to your container images in the private registry.
-
-1. Optional. Add the `imagePullSecrets` object to a Service:
-
- ```yaml
- apiVersion: serving.knative.dev/v1
- kind: Service
- metadata:
- name: hello
- spec:
- template:
- spec:
- imagePullSecrets:
- - name:
- containers:
- - image: ghcr.io/knative/helloworld-go:latest
- ports:
- - containerPort: 8080
- env:
- - name: TARGET
- value: "World"
- ```
+If your private registry uses a custom CA certificate or sits behind a corporate proxy, your cluster administrator must also configure [Registry trust and tag resolution](tag-resolution.md).
diff --git a/docs/versioned/serving/istio-authorization.md b/docs/versioned/serving/istio-authorization.md
index a7e3a093739..274ac5ed6f7 100644
--- a/docs/versioned/serving/istio-authorization.md
+++ b/docs/versioned/serving/istio-authorization.md
@@ -57,7 +57,7 @@ If the activator isn't injected:
- In STRICT mode, requests will simply be rejected.
-To understand when requests are forwarded through the activator, see the [target burst capacity](load-balancing/target-burst-capacity.md) documentation.
+To understand when requests are forwarded through the activator, see the [target burst capacity](load-balancing/README.md#target-burst-capacity) documentation.
This also means that many Istio AuthorizationPolicies won't work as expected. For example, if you set up a rule allowing requests from a particular source into a Knative service, you will see requests being rejected if they are forwarded by the activator.
diff --git a/docs/versioned/serving/load-balancing/README.md b/docs/versioned/serving/load-balancing/README.md
index 0459b44eb02..607bcd83983 100644
--- a/docs/versioned/serving/load-balancing/README.md
+++ b/docs/versioned/serving/load-balancing/README.md
@@ -5,31 +5,113 @@ components:
function: explanation
---
-# Load balancing
+# Request buffering and Activator capacity
-You can turn on Knative load balancing, by placing the _Activator service_ in the request path to act as a load balancer. To do this, you must first ensure that individual pod addressability is enabled.
+Knative Serving uses the **Activator** to receive and buffer requests when a
+Revision is scaled to zero, or when incoming traffic bursts exceed what the
+Revision's pods can handle directly.
## Activator pod selection
-Activator pods are scaled horizontally, so there may be multiple Activators in a deployment. In general, the system will perform best if the number of revision pods is larger than the number of Activator pods, and those numbers divide equally.
-
+Activator pods scale horizontally. Knative assigns a subset of Activators to
+each Revision depending on its size — more Revision pods receive a larger
+subset of Activators.
-Knative assigns a subset of Activators for each revision, depending on the revision size. More revision pods will mean a greater number of Activators for that revision.
+When the Activator is in the request path, it distributes requests to Revision
+pods using:
-The Activator load balancing algorithm works as follows:
+- **Better of two random choices** when concurrency is unlimited.
+- **First pod with available capacity** when `containerConcurrency` is 3 or
+ less; otherwise **round-robin** respecting container concurrency.
-- If concurrency is unlimited, the request is sent to the better of two random choices.
-- If concurrency is set to a value less or equal than 3, the Activator will send the request to the first pod that has capacity. Otherwise, requests will be balanced in a round robin fashion, with respect to container concurrency.
+See [Concurrency](../autoscaling/concurrency.md) for concurrency settings.
-For more information, see the documentation on [concurrency](../autoscaling/concurrency.md).
+
-## Configuring target burst capacity
+## Target burst capacity
-Target burst capacity is mainly responsible for determining whether the Activator is in the request path outside of scale-from-zero scenarios.
+_Target burst capacity_ determines how large a traffic burst a Revision can
+absorb without putting the Activator in the request path.
-Target burst capacity can be configured using a combination of the following parameters:
+- **`0`** — Activator is only in the path while scaling from zero.
+- **`-1`** — Activator is always in the path, regardless of Revision scale.
+- **Positive integer** (default **`200`**) — Activator stays in the path
+ whenever spare capacity across ready pods is smaller than this threshold.
-- Setting the targeted concurrency limits for the revision. See [concurrency](../autoscaling/concurrency.md).
-- Setting the target utilization parameters. See [target utilization](../autoscaling/concurrency.md#target-utilization).
-- Setting the target burst capacity. You can configure target burst capacity using the `target-burst-capacity` key in the `config-autoscaler` ConfigMap. See [Setting the target burst capacity](target-burst-capacity.md#setting-the-target-burst-capacity).
-- Setting the Activator capacity by using the `config-autoscaler` ConfigMap. See [Setting the Activator capacity](activator-capacity.md#setting-the-activator-capacity).
+
+
+- **Global key:** `target-burst-capacity` (in `config-autoscaler`)
+- **Per-revision annotation:** `autoscaling.knative.dev/target-burst-capacity`
+- **Possible values:** float (`-1`, `0`, or positive)
+- **Default:** `200`
+
+=== "Per Revision"
+ ```yaml
+ apiVersion: serving.knative.dev/v1
+ kind: Service
+ metadata:
+ name:
+ spec:
+ template:
+ metadata:
+ annotations:
+ autoscaling.knative.dev/target-burst-capacity: "200"
+ ```
+
+=== "Global (ConfigMap)"
+ ```yaml
+ apiVersion: v1
+ kind: ConfigMap
+ metadata:
+ name: config-autoscaler
+ namespace: knative-serving
+ data:
+ target-burst-capacity: "200"
+ ```
+
+=== "Global (Operator)"
+ ```yaml
+ apiVersion: operator.knative.dev/v1alpha1
+ kind: KnativeServing
+ metadata:
+ name: knative-serving
+ spec:
+ config:
+ autoscaler:
+ target-burst-capacity: "200"
+ ```
+
+
+
+## Activator capacity
+
+When multiple Activators run in the cluster, Knative places enough Activators
+in the request path to handle `(replicas * target + target-burst-capacity) / activator-capacity`.
+
+- **Global key:** `activator-capacity` (in `config-autoscaler`)
+- **Per-revision annotation:** none (cluster-wide administrator setting)
+- **Possible values:** integer (at least `1`)
+- **Default:** `100`
+
+=== "Global (ConfigMap)"
+ ```yaml
+ apiVersion: v1
+ kind: ConfigMap
+ metadata:
+ name: config-autoscaler
+ namespace: knative-serving
+ data:
+ activator-capacity: "200"
+ ```
+
+=== "Global (Operator)"
+ ```yaml
+ apiVersion: operator.knative.dev/v1alpha1
+ kind: KnativeServing
+ metadata:
+ name: knative-serving
+ spec:
+ config:
+ autoscaler:
+ activator-capacity: "200"
+ ```
diff --git a/docs/versioned/serving/load-balancing/activator-capacity.md b/docs/versioned/serving/load-balancing/activator-capacity.md
deleted file mode 100644
index e4753578e8a..00000000000
--- a/docs/versioned/serving/load-balancing/activator-capacity.md
+++ /dev/null
@@ -1,43 +0,0 @@
----
-audience: administrator
-components:
- - serving
-function: how-to
----
-
-# Configuring Activator capacity
-
-If there is more than one Activator in the system, Knative puts as many Activators on the request path as required to handle the current request load plus the target burst capacity. If the target burst capacity is 0, Knative only puts the Activator into the request path if the Revision is scaled to zero.
-
-Knative uses at least two Activators to enable high availability if possible. The actual number of Activators is calculated taking the _Activator capacity_ into account, by using the formula `(replicas * target + target-burst-capacity)/activator-capacity`. This means that there are enough Activators in the routing path to handle the theoretical capacity of the existing application, including any additional target burst capacity.
-
-## Setting the Activator capacity
-
-- **Global key:** `activator-capacity`
-- **Possible values:** int (at least 1)
-- **Default:** `100`
-
-**Example:**
-
-=== "Global (ConfigMap)"
- ```yaml
- apiVersion: v1
- kind: ConfigMap
- metadata:
- name: config-autoscaler
- namespace: knative-serving
- data:
- activator-capacity: "200"
- ```
-
-=== "Global (Operator)"
- ```yaml
- apiVersion: operator.knative.dev/v1alpha1
- kind: KnativeServing
- metadata:
- name: knative-serving
- spec:
- config:
- autoscaler:
- activator-capacity: "200"
- ```
diff --git a/docs/versioned/serving/load-balancing/target-burst-capacity.md b/docs/versioned/serving/load-balancing/target-burst-capacity.md
deleted file mode 100644
index ea5d35d33e8..00000000000
--- a/docs/versioned/serving/load-balancing/target-burst-capacity.md
+++ /dev/null
@@ -1,78 +0,0 @@
----
-audience: developer
-components:
- - serving
-function: explanation
----
-
-# Configuring target burst capacity
-
-_Target burst capacity_ is a [global and per-revision](../autoscaling/autoscaler-types.md#global-versus-per-revision-settings) integer setting that determines the size of traffic burst a Knative application can handle without buffering.
-If a traffic burst is too large for the application to handle, the _Activator_ service will be placed in the request path to protect the revision and optimize request load balancing.
-
-The Activator service is responsible for receiving and buffering requests for inactive revisions, or for revisions where a traffic burst is larger than the limits of what can be handled without buffering for that revision. It can also quickly spin up additional pods for capacity, and throttle how quickly requests are sent to pods.
-
-Target burst capacity can be configured using a combination of the following parameters:
-
-- Setting the targeted concurrency limits for the revision. See [concurrency](../autoscaling/concurrency.md).
-- Setting the target utilization parameters. See [target utilization](../autoscaling/concurrency.md#target-utilization).
-- Setting the target burst capacity. You can configure target burst capacity using the `target-burst-capacity` annotation key in the `config-autoscaler` ConfigMap. See [Setting the target burst capacity](#setting-the-target-burst-capacity).
-
-## Setting the target burst capacity
-
-- **Global key:** `target-burst-capacity`
-- **Per-revision annotation key:** `autoscaling.knative.dev/target-burst-capacity`
-- **Possible values:** float (`0` means the Activator is only in path when scaled to 0, `-1` means the Activator is always in path)
-- **Default:** `200`
-
-**Example:**
-
-=== "Per Revision"
- ```yaml
- apiVersion: serving.knative.dev/v1
- kind: Service
- metadata:
- annotations:
- name:
- namespace: default
- spec:
- template:
- metadata:
- annotations:
- autoscaling.knative.dev/target-burst-capacity: "200"
- ```
-
-=== "Global (ConfigMap)"
- ```yaml
- apiVersion: v1
- kind: ConfigMap
- metadata:
- name: config-autoscaler
- namespace: knative-serving
- data:
- target-burst-capacity: "200"
- ```
-
-=== "Global (Operator)"
- ```yaml
- apiVersion: operator.knative.dev/v1alpha1
- kind: KnativeServing
- metadata:
- name: knative-serving
- spec:
- config:
- autoscaler:
- target-burst-capacity: "200"
- ```
-
-!!! note
-
- Ingress gateway load balancing requires additional configuration. For more information about load balancing using an ingress
- gateway, see the [Serving API](../../serving/reference/serving-api.md) documentation.
-
-
-- If `autoscaling.knative.dev/target-burst-capacity` is set to `0`, the Activator is only added to the request path during scale from zero scenarios, and ingress load balancing will be applied.
-
-- If `autoscaling.knative.dev/target-burst-capacity` is set to `-1`, the Activator is always in the request path, regardless of the revision size.
-
-- If `autoscaling.knative.dev/target-burst-capacity` is set to another integer, the Activator may be in the path, depending on the revision scale and load.
diff --git a/docs/versioned/serving/request-flow.md b/docs/versioned/serving/request-flow.md
index 80b59c62860..f256835cda5 100644
--- a/docs/versioned/serving/request-flow.md
+++ b/docs/versioned/serving/request-flow.md
@@ -27,7 +27,7 @@ pluggable ingress layer), and are recorded on the request in an internal header.
Once a request has been assigned to a Revision, the subsequent routing depends
on the measured traffic flow; at low or zero traffic, incoming requests are
routed to the activator, while at high traffic levels ([spare capacity greater
-than `target-burst-capacity`](./load-balancing/target-burst-capacity.md))
+than `target-burst-capacity`](./load-balancing/README.md#target-burst-capacity))
traffic is routed directly to the application pods.
## Scale From Zero
@@ -50,7 +50,7 @@ started to handle a request, this is called a _cold-start_.
## High scale
When a Revision has a high amount of traffic ([the spare capacity is greater
-than `target-burst-capacity`](./load-balancing/target-burst-capacity.md)), the
+than `target-burst-capacity`](./load-balancing/README.md#target-burst-capacity)), the
ingress router is programmed directly with the pod adresses of the Revision, and
the activator is removed from the traffic flow. This reduces latency and
increases efficiency when the additional buffering of the activator is not
diff --git a/docs/versioned/serving/revisions/README.md b/docs/versioned/serving/revisions/README.md
index 5e002b2bada..f51c3fefdd2 100644
--- a/docs/versioned/serving/revisions/README.md
+++ b/docs/versioned/serving/revisions/README.md
@@ -9,33 +9,43 @@ function: explanation
--8<-- "about-revisions.md"
-## Related concepts
+Revisions are immutable snapshots of your application code and configuration:
+updating a Service's `spec.template` creates a new Revision rather than
+modifying the existing Revision's `spec`. You can still update mutable metadata
+(such as the `no-gc` annotation below) on an existing Revision.
-### Autoscaling
+## Garbage collection
-Revisions can be automatically scaled up and down according to incoming traffic. For more information, see [Autoscaling](../../serving/autoscaling/README.md){target=_blank}.
-
-### Gradual rollout of traffic to Revisions
+--8<-- "about-revisions-garbage-collection.md"
-Revisions enable progressive roll-out and roll-back of application changes. For more information, see [Configuring gradual rollout of traffic to Revisions](../../serving/rolling-out-latest-revision.md){target=_blank}.
+### Disabling garbage collection for a Revision
-### Garbage collection
+To prevent a specific Revision from being garbage collected, add the
+`serving.knative.dev/no-gc: "true"` annotation to its metadata:
---8<-- "about-revisions-garbage-collection.md"
+```bash
+kubectl annotate revision serving.knative.dev/no-gc="true"
+```
-For more information, see [Configuration options for Revisions](#configuration-options-for-revisions).
+Or in the Revision metadata:
-## Configuration options for Revisions
+```yaml
+apiVersion: serving.knative.dev/v1
+kind: Revision
+metadata:
+ name:
+ annotations:
+ serving.knative.dev/no-gc: "true"
+```
-- [Cluster administrator (global, cluster-wide) configuration options](../../serving/revisions/revision-admin-config-options.md)
-- [Developer (per Revision) configuration options](../../serving/revisions/revision-developer-config-options.md)
+For cluster-wide garbage collection thresholds, see
+[Configuring Revision garbage collection](revision-admin-config-options.md).
-## Additional resources
+## Related tasks
+- [Split traffic and tag Revisions](../traffic-management.md)
+- [Configure gradual rollouts](../rolling-out-latest-revision.md)
+- [Configure autoscaling](../autoscaling/README.md)
+- [Check Revision status](../troubleshooting/debugging-application-issues.md#check-revision-status)
+- [Manage Revisions with `kn revision`](https://github.com/knative/client/blob/main/docs/cmd/kn_revision.md){target=_blank}
- [Revision API specification](https://github.com/knative/specs/blob/main/specs/serving/knative-api-specification-1.0.md#revision){target=_blank}
-
-## Next steps
-
-- [Delete, describe, and list Revisions by using the Knative (`kn`) CLI](https://github.com/knative/client/blob/main/docs/cmd/kn_revision.md){target=_blank}
-- [Check the status of a Revision](../../serving/troubleshooting/debugging-application-issues.md#check-revision-status){target=_blank}
-- [Routing traffic between Revisions of a Service](../../serving/traffic-management.md#traffic-routing-examples){target=_blank}
diff --git a/docs/versioned/serving/revisions/revision-developer-config-options.md b/docs/versioned/serving/revisions/revision-developer-config-options.md
deleted file mode 100644
index 9c64c0d7df7..00000000000
--- a/docs/versioned/serving/revisions/revision-developer-config-options.md
+++ /dev/null
@@ -1,27 +0,0 @@
----
-audience: developer
-components:
- - serving
-function: reference
----
-
-# Developer configuration options
-
-While Revisions cannot be created manually without modifying the Configuration of a Knative Service, you can modify the spec of an existing Revision to change its behavior.
-
-## Garbage collection
-
---8<-- "about-revisions-garbage-collection.md"
-
-### Disabling garbage collection for a Revision
-
-You can configure a Revision so that it is never garbage collected by adding the `serving.knative.dev/no-gc: "true"` annotation:
-
-```yaml
-apiVersion: serving.knative.dev/v1
-kind: Revision
-metadata:
- annotations:
- serving.knative.dev/no-gc: "true"
-...
-```
diff --git a/docs/versioned/serving/services/certificate-class.md b/docs/versioned/serving/services/certificate-class.md
index a39e5552d9f..4ff8c6bc4aa 100644
--- a/docs/versioned/serving/services/certificate-class.md
+++ b/docs/versioned/serving/services/certificate-class.md
@@ -9,7 +9,7 @@ function: how-to
When `external-domain-tls` is enabled and Knative Services are created, a certificate class (`certificate-class`) is automatically chosen based on the value in the `config-network` ConfigMap located inside the `knative-serving` namespace. This ConfigMap is part of Knative Serving installation. If the certificate class is not specified, this defaults to `cert-manager.certificate.networking.knative.dev`. After `certificate-class` is configured, it is used for all Knative Services unless it is overridden with a `certificate-class` annotation.
-## Using the certificate class annotation
+## Certificate class annotation { #using-the-certificate-class-annotation }
Generally it is recommended for Knative Services to use the default `certificate-class`. However, in scenarios where there are multiple certificate providers, you might want to specify different certificate class annotations for each Service.
diff --git a/docs/versioned/serving/services/configure-probing.md b/docs/versioned/serving/services/configure-probing.md
index 788a968df11..1786b4b38a8 100644
--- a/docs/versioned/serving/services/configure-probing.md
+++ b/docs/versioned/serving/services/configure-probing.md
@@ -7,7 +7,7 @@ function: how-to
# Configuring Probing
-## General understanding of Knative Probing
+## How Knative probing works { #general-understanding-of-knative-probing }
It is important to note that Knative probing is different from Kubernetes probing.
One reason for this is that Knative tries to minimize cold-start time and thus is probing
@@ -90,12 +90,12 @@ Supported probe types are:
!!! note
- Be aware that Knative also does some defaulting (checking readiness on the traffic port using an HTTP check) and additional validation to make aggressive probing work.
+ Be aware that Knative sets a default TCP readiness probe on the traffic port when none is specified, and applies additional validation so aggressive probing works.
!!! warning
As the Queue-Proxy container does not rewrite or check defined Liveness probes, it is important to know that Kubernetes can and will restart specific containers once a Liveness probe fails. Make sure to also include the same check that you define as a Liveness probe as a Readiness probe to make sure Knative is aware of the failing container in the Pod. Otherwise, you may see, it is possible that you see connection errors during the restart of a container caused by the Liveness probe failure.
-## Progress Deadline and Startup Probes
+## Progress deadline { #progress-deadline-and-startup-probes }
It is important to know that Knative has a deadline until a Knative Service should initially start up (or rollout). This is called [progress deadline](../configuration/deployment.md#configuring-progress-deadlines). When using Startup probes, the user has to ensure that the progress deadline is set to a value that is higher than the maximum time the Startup probe can take. Consider your configuration of `initialDelaySeconds`, `success/failureThreshold`, `periodSeconds` and `timeoutSeconds` for this. Otherwise, the Startup probe might never pass before the progress deadline is reached, and the Service will never successfully start up. The Knative Service will then mark this in the status of the Service object:
diff --git a/docs/versioned/serving/services/configure-requests-limits-services.md b/docs/versioned/serving/services/configure-requests-limits-services.md
index 1f82a995d95..766d05aa67b 100644
--- a/docs/versioned/serving/services/configure-requests-limits-services.md
+++ b/docs/versioned/serving/services/configure-requests-limits-services.md
@@ -30,7 +30,7 @@ spec:
cpu: 1
```
-## Configure Queue Proxy resources
+## Queue-Proxy resources { #configure-queue-proxy-resources }
In order to set the Queue Proxy resource requests and limits you can either
set them globally in the [deployment config map](../configuration/deployment.md) or you can set them at the service level using the corresponding annotations targeting cpu, memory and ephemeral-storage resource types. The above example becomes:
diff --git a/docs/versioned/serving/services/custom-domains.md b/docs/versioned/serving/services/custom-domains.md
index 9735cd66311..cc554ecca05 100644
--- a/docs/versioned/serving/services/custom-domains.md
+++ b/docs/versioned/serving/services/custom-domains.md
@@ -165,7 +165,7 @@ DomainMappings in that namespace to use the domain name.
- **Local kind Quickstart:** do not change public DNS. Create the mapping using
`example.test` (or your chosen test domain) and use the localhost request below.
-## Verify the mapping and request
+## Verify { #verify-the-mapping-and-request }
Substitute the same domain name and namespace used when creating the DomainMapping:
diff --git a/docs/versioned/serving/services/http-protocol.md b/docs/versioned/serving/services/http-protocol.md
index acab1b7d649..be350bca6be 100644
--- a/docs/versioned/serving/services/http-protocol.md
+++ b/docs/versioned/serving/services/http-protocol.md
@@ -61,7 +61,7 @@ You can override the default behavior for each Service or global configuration.
http-protocol: "redirected"
```
-## HTTP/1 Full Duplex support per workload
+## HTTP/1 full duplex { #http1-full-duplex-support-per-workload }
Knative services can turn on the support for [HTTP/1 full duplex](https://pkg.go.dev/net/http#ResponseController.EnableFullDuplex) end-to-end on the data path.
This should be used in scenarios where the [related Golang issue](https://github.com/golang/go/issues/40747) is hit eg. the application server writes back to QP's reverse proxy before the latter has consumed the whole request.
diff --git a/docs/versioned/serving/services/ingress-class.md b/docs/versioned/serving/services/ingress-class.md
index 1f23928f80b..f0eff1ed87a 100644
--- a/docs/versioned/serving/services/ingress-class.md
+++ b/docs/versioned/serving/services/ingress-class.md
@@ -12,7 +12,7 @@ When a Knative Service is created an ingress class (`ingress-class`) is automati
!!! warning
Changing the ingress class in `config-network` ConfigMap will only affect newly created Services
-## Using the ingress class annotation
+## Ingress class annotation { #using-the-ingress-class-annotation }
Generally it is recommended for Knative Services to use the default `ingress-class`. However, in scenarios where there are multiple networking implementations, you might want to specify different ingress class annotations for each Service.
diff --git a/docs/versioned/serving/services/private-services.md b/docs/versioned/serving/services/private-services.md
index 8f1c0297cbb..e067139ce6e 100644
--- a/docs/versioned/serving/services/private-services.md
+++ b/docs/versioned/serving/services/private-services.md
@@ -15,7 +15,7 @@ In order to make Knative Services public (with a public IP address and public UR
This can be done for a single Service or for all Services on a cluster.
-## Making individual services private
+## Per-service privacy { #making-individual-services-private }
To make an individual Service private, the Service or Route can be labelled with
`networking.knative.dev/visibility=cluster-local` so that it is not published to the external gateway.
diff --git a/docs/versioned/serving/tag-resolution.md b/docs/versioned/serving/tag-resolution.md
index 59ddd671956..9348372c2d5 100644
--- a/docs/versioned/serving/tag-resolution.md
+++ b/docs/versioned/serving/tag-resolution.md
@@ -19,7 +19,14 @@ If you are using a registry that has a self-signed certificate, you must configu
### Procedure
-1. If you are using a `custom-certs` secret that contains your CA certificates, add the following spec to the default Knative Serving `controller` Deployment:
+1. Create a secret in the `knative-serving` namespace containing your root CA certificate:
+
+ ```bash
+ kubectl -n knative-serving create secret generic custom-certs \
+ --from-file=ca.crt=/path/to/ca.crt
+ ```
+
+1. Mount that `custom-certs` secret into the `controller` Deployment in `knative-serving` and set `SSL_CERT_DIR` (Knative Serving accepts [`SSL_CERT_FILE` and `SSL_CERT_DIR`](https://pkg.go.dev/crypto/x509#SystemCertPool)):
```yaml
apiVersion: apps/v1
@@ -34,26 +41,21 @@ If you are using a registry that has a self-signed certificate, you must configu
- name: controller
volumeMounts:
- name: custom-certs
- mountPath: /path/to/custom/certs
+ mountPath: /etc/ssl/custom-certs
+ readOnly: true
env:
- name: SSL_CERT_DIR
- value: /path/to/custom/certs
+ value: /etc/ssl/custom-certs
volumes:
- name: custom-certs
secret:
secretName: custom-certs
```
- Knative Serving accepts the [`SSL_CERT_FILE` and `SSL_CERT_DIR`](https://pkg.go.dev/crypto/x509#SystemCertPool) environment variables.
-
-1. Create a secret in the `knative-serving` namespace that points to your root CA certificate, and then save the current Knative Serving `controller` Deployment:
-
- ```bash
- kubectl -n knative-serving create secret generic customca --from-file=ca.crt=/root/ca.crt
- ```
+1. Apply the updated Deployment and wait for the controller rollout to complete:
```bash
- kubectl -n knative-serving get deploy/controller -o yaml > knative-serving-controller.yaml
+ kubectl -n knative-serving rollout status deployment/controller
```
## Corporate proxy
diff --git a/docs/versioned/serving/traffic-management.md b/docs/versioned/serving/traffic-management.md
index 5d6252854b5..7b5803cad57 100644
--- a/docs/versioned/serving/traffic-management.md
+++ b/docs/versioned/serving/traffic-management.md
@@ -11,7 +11,7 @@ You can manage traffic routing to different Revisions of a Knative Service by mo
When you create a Knative Service, it does not have any default `traffic` spec settings. By setting the `traffic` spec, you can split traffic over any number of fixed Revisions, or send traffic to the latest Revision by setting `latestRevision: true` in the spec for a Service.
-## Using tags to create target URLs
+## Tags and target URLs { #using-tags-to-create-target-urls }
In the following example, the spec defines an attribute called `tag`:
@@ -102,7 +102,7 @@ spec:
percent: 0
```
-## Routing and managing traffic by using the Knative CLI
+## Traffic routing with `kn` { #routing-and-managing-traffic-by-using-the-knative-cli }
You can use the following `kn` CLI command to split traffic between revisions:
@@ -134,7 +134,7 @@ The `@latest` tag means that `blue` resolves to the latest Revision of the Servi
kn service update example-service --traffic @latest=80 --traffic v1=20
```
-## Routing and managing traffic with blue/green deployment
+## Blue/green deployment { #routing-and-managing-traffic-with-bluegreen-deployment }
You can safely reroute traffic from a live version of an application to a new version by using a [blue/green deployment strategy](https://en.wikipedia.org/wiki/Blue-green_deployment).
@@ -212,9 +212,9 @@ You can safely reroute traffic from a live version of an application to a new ve
Once you redeploy this Route by reapplying the YAML resource, the second Revision of the app is now staged.
- No traffic is routed to the second Revision at the main URL, and Knative creates a new Route named `v2` for testing the newly deployed Revision.
+ No traffic is routed to the second Revision at the standalone Route's main URL (note that the original Knative Service keeps its own separate URL), and Knative exposes a tagged URL prefixed with `v2-` on this Route for testing the newly deployed Revision.
-1. Get the URL of the new Route for the second Revision, by running the command:
+1. Get the tagged URL for the second Revision, by running the command:
```bash
kubectl get route --output jsonpath="{.status.traffic[*].url}"
diff --git a/docs/versioned/serving/using-a-custom-domain.md b/docs/versioned/serving/using-a-custom-domain.md
index 5f698f2b704..46127396cac 100644
--- a/docs/versioned/serving/using-a-custom-domain.md
+++ b/docs/versioned/serving/using-a-custom-domain.md
@@ -9,11 +9,11 @@ function: how-to
You can customize the domain of an individual Knative Service, or set a global default domain for all Services created on a cluster. The fully qualified domain name for a route by default is `{route}.{namespace}.svc.cluster.local`.
-## Configuring a domain for a single Knative Service
+## Single-service domain { #configuring-a-domain-for-a-single-knative-service }
If you want to customize the domain of an individual Service, see the documentation about [`DomainMapping`](services/custom-domains.md).
-## Configuring the default domain for all Knative Services on a cluster
+## Default cluster domain { #configuring-the-default-domain-for-all-knative-services-on-a-cluster }
You can change the default domain for all Knative Services on a cluster by modifying the [`config-domain` ConfigMap](https://github.com/knative/serving/blob/main/config/core/configmaps/domain.yaml).