diff --git a/applications/application_life_cycle_management/odc-creating-applications-using-developer-perspective.adoc b/applications/application_life_cycle_management/odc-creating-applications-using-developer-perspective.adoc index e43ddcef2797..cee9b9119589 100644 --- a/applications/application_life_cycle_management/odc-creating-applications-using-developer-perspective.adoc +++ b/applications/application_life_cycle_management/odc-creating-applications-using-developer-perspective.adoc @@ -2,6 +2,7 @@ [id="odc-creating-applications-using-developer-perspective"] = Creating applications using the Developer perspective include::modules/common-attributes.adoc[] +include::modules/serverless-document-attributes.adoc[] :context: odc-creating-applications-using-developer-perspective toc::[] @@ -18,7 +19,7 @@ The *Developer* perspective in the web console provides you the following option * *Helm Chart*: Explore the *Developer Catalog* to select the required Helm chart to simplify deployment of applications and services. ifdef::openshift-enterprise,openshift-webscale[] -Note that certain options, such as *Pipelines*, *Event Source*, and *Import Virtual Machines*, are displayed only when the xref:../../pipelines/installing-pipelines.adoc#op-installing-pipelines-operator-in-web-console_installing-pipelines[OpenShift Pipelines Operator], xref:../../serverless/install/install-serverless-operator.adoc#serverless-install-web-console_install-serverless-operator[OpenShift Serverless Operator], and xref:../../virt/install/installing-virt-web.adoc#virt-subscribing-to-the-catalog_installing-virt-web[OpenShift Virtualization Operator] are installed, respectively. +Note that certain options, such as *Pipelines*, *Event Source*, and *Import Virtual Machines*, are displayed only when the xref:../../pipelines/installing-pipelines.adoc#op-installing-pipelines-operator-in-web-console_installing-pipelines[OpenShift Pipelines Operator], xref:../../serverless/install/install-serverless-operator.adoc#serverless-install-web-console_install-serverless-operator[{ServerlessOperatorName}], and xref:../../virt/install/installing-virt-web.adoc#virt-subscribing-to-the-catalog_installing-virt-web[OpenShift Virtualization Operator] are installed, respectively. endif::[] [id="prerequisites_odc-creating-applications-using-developer-perspective"] @@ -34,7 +35,7 @@ ifdef::openshift-enterprise,openshift-webscale[] To create serverless applications, in addition to the preceding prerequisites, ensure that: -* You have xref:../../serverless/install/install-serverless-operator.adoc#install-serverless-operator[installed the OpenShift Serverless Operator]. +* You have xref:../../serverless/install/install-serverless-operator.adoc#install-serverless-operator[installed the {ServerlessOperatorName}]. * You have xref:../../serverless/install/installing-knative-serving.adoc#installing-knative-serving[created a `KnativeServing` resource in the `knative-serving` namespace]. endif::[] @@ -42,3 +43,12 @@ endif::[] include::modules/odc-creating-sample-applications.adoc[leveloffset=+1] include::modules/odc-importing-codebase-from-git-to-create-application.adoc[leveloffset=+1] + +[id="additional-resources_odc-creating-applications-using-developer-perspective"] +== Additional resources + +* For more information about Knative routing settings for {ServerlessProductName}, see xref:../../serverless/develop/serverless-configuring-routes.adoc#serverless-configuring-routes[Routing]. + +* For more information about Knative autoscaling settings for {ServerlessProductName}, see xref:../../serverless/develop/serverless-autoscaling-developer.adoc#serverless-autoscaling-developer[Autoscaling]. + +* For information about domain mapping settings for {ServerlessProductName}, see xref:../../serverless/security/serverless-custom-domains.adoc#serverless-custom-domains[Configuring a custom domain for a Knative service]. diff --git a/applications/application_life_cycle_management/snippets b/applications/application_life_cycle_management/snippets index 9f5bc7e4dde0..7bf6da9a51d0 120000 --- a/applications/application_life_cycle_management/snippets +++ b/applications/application_life_cycle_management/snippets @@ -1 +1 @@ -../snippets \ No newline at end of file +../../snippets \ No newline at end of file diff --git a/modules/odc-importing-codebase-from-git-to-create-application.adoc b/modules/odc-importing-codebase-from-git-to-create-application.adoc index 0aa4dfb952cb..3a5cc750ce76 100644 --- a/modules/odc-importing-codebase-from-git-to-create-application.adoc +++ b/modules/odc-importing-codebase-from-git-to-create-application.adoc @@ -46,14 +46,7 @@ The *Knative Service* option is displayed in the *Import from git* form only if . In the *Advanced Options* section, the *Create a route to the application* is selected by default so that you can access your application using a publicly available URL. You can clear the check box if you do not want to expose your application on a public route. . Optional: You can use the following advanced options to further customize your application: -Routing:: -Click the *Routing* link to: -* Customize the hostname for the route. -* Specify the path the router watches. -* Select the target port for the traffic from the drop-down list. -* Secure your route by selecting the *Secure Route* check box. Select the required TLS termination type and set a policy for insecure traffic from the respective drop-down lists. -+ -For serverless applications, the Knative Service manages all the routing options above. However, you can customize the target port for traffic, if required. If the target port is not specified, the default port of `8080` is used. +include::snippets/routing-odc.adoc[] Health Checks:: Click the *Health Checks* link to add Readiness, Liveness, and Startup probes to your application. All the probes have prepopulated default data; you can add the probes with the default data or customize it as required. @@ -66,20 +59,12 @@ To customize the health probes: + For each of the probes, you can specify the request type - *HTTP GET*, *Container Command*, or *TCP Socket*, from the drop-down list. The form changes as per the selected request type. You can then modify the default values for the other parameters, such as the success and failure thresholds for the probe, number of seconds before performing the first probe after the container starts, frequency of the probe, and the timeout value. - Build Configuration and Deployment:: Click the *Build Configuration* and *Deployment* links to see the respective configuration options. Some options are selected by default; you can customize them further by adding the necessary triggers and environment variables. + For serverless applications, the *Deployment* option is not displayed as the Knative configuration resource maintains the desired state for your deployment instead of a DeploymentConfig. -Scaling:: -Click the *Scaling* link to define the number of pods or instances of the application you want to deploy initially. -+ -For serverless applications, you can: - -* Set the upper and lower limit for the number of pods that can be set by the autoscaler. If the lower limit is not specified, it defaults to zero. -* Define the soft limit for the required number of concurrent requests per instance of the application at a given time. It is the recommended configuration for autoscaling. If not specified, it takes the value specified in the cluster configuration. -* Define the hard limit for the number of concurrent requests allowed per instance of the application at a given time. This is configured in the revision template. If not specified, it defaults to the value specified in the cluster configuration. +include::snippets/scaling-odc.adoc[] Resource Limit:: Click the *Resource Limit* link to set the amount of *CPU* and *Memory* resources a container is guaranteed or allowed to use when running. diff --git a/modules/serverless-autoscaling-developer-maxscale.adoc b/modules/serverless-autoscaling-developer-maxscale.adoc new file mode 100644 index 000000000000..dd549932ab22 --- /dev/null +++ b/modules/serverless-autoscaling-developer-maxscale.adoc @@ -0,0 +1,25 @@ +// Module included in the following assemblies: +// +// * serverless/develop/serverless-autoscaling-developer.adoc + +:_content-type: REFERENCE +[id="serverless-autoscaling-developer-maxscale_context"] += Maximum scale bounds + +The maximum number of replicas that can serve an application is determined by the `maxScale` annotation. If the `maxScale` annotation is not set, there is no upper limit for the number of replicas created. + +.Example service spec with `maxScale` annotation +[source,yaml] +---- +apiVersion: serving.knative.dev/v1 +kind: Service +metadata: + name: example-service + namespace: default +spec: + template: + metadata: + annotations: + autoscaling.knative.dev/maxScale: "10" +... +---- diff --git a/modules/serverless-autoscaling-developer-minscale.adoc b/modules/serverless-autoscaling-developer-minscale.adoc new file mode 100644 index 000000000000..f0174eb4afea --- /dev/null +++ b/modules/serverless-autoscaling-developer-minscale.adoc @@ -0,0 +1,33 @@ +// Module included in the following assemblies: +// +// * serverless/develop/serverless-autoscaling-developer.adoc + +:_content-type: REFERENCE +[id="serverless-autoscaling-developer-minscale_{context}"] += Minimum scale bounds + +The minimum number of replicas that can serve an application is determined by the `minScale` annotation. + +The `minScale` value defaults to `0` replicas if the following conditions are met: + +* The `minScale` annotation is not set +* Scaling to zero is enabled +* The class `KPA` is used + +If scale to zero is not enabled, the `minScale` value defaults to `1`. + +.Example service spec with `minScale` annotation +[source,yaml] +---- +apiVersion: serving.knative.dev/v1 +kind: Service +metadata: + name: example-service + namespace: default +spec: + template: + metadata: + annotations: + autoscaling.knative.dev/minScale: "0" +... +---- diff --git a/modules/serverless-autoscaling-maxscale-kn.adoc b/modules/serverless-autoscaling-maxscale-kn.adoc index edc9b7fc7d5a..eb727357e28b 100644 --- a/modules/serverless-autoscaling-maxscale-kn.adoc +++ b/modules/serverless-autoscaling-maxscale-kn.adoc @@ -1,6 +1,6 @@ -// Module is included in the following assemblies: +// Module included in the following assemblies: // -// * serverless/autoscaling/serverless-autoscaling-scale-bounds.adoc +// * serverless/develop/serverless-autoscaling-developer.adoc :_content-type: PROCEDURE [id="serverless-autoscaling-maxscale-kn_{context}"] @@ -8,6 +8,11 @@ You can use the `kn service` command with the `--max-scale` flag to create or modify the `--max-scale` value for a service. +.Prerequisites + +* Knative Serving is installed on the cluster. +* You have installed the `kn` CLI. + .Procedure * Set the maximum number of replicas for the service by using the `--max-scale` flag: diff --git a/modules/serverless-autoscaling-minscale-kn.adoc b/modules/serverless-autoscaling-minscale-kn.adoc index 89a6c93db7a2..ceb1cda9fe0d 100644 --- a/modules/serverless-autoscaling-minscale-kn.adoc +++ b/modules/serverless-autoscaling-minscale-kn.adoc @@ -1,6 +1,6 @@ -// Module is included in the following assemblies: +// Module included in the following assemblies: // -// * serverless/autoscaling/serverless-autoscaling-scale-bounds.adoc +// * serverless/develop/serverless-autoscaling-developer.adoc :_content-type: PROCEDURE [id="serverless-autoscaling-minscale_{context}"] @@ -8,6 +8,11 @@ You can use the `kn service` command with the `--min-scale` flag to create or modify the `--min-scale` value for a service. +.Prerequisites + +* Knative Serving is installed on the cluster. +* You have installed the `kn` CLI. + .Procedure * Set the minimum number of replicas for the service by using the `--min-scale` flag: diff --git a/modules/serverless-concurrency-limits-configure-hard.adoc b/modules/serverless-concurrency-limits-configure-hard.adoc index e92d175bde4b..0e0702b51812 100644 --- a/modules/serverless-concurrency-limits-configure-hard.adoc +++ b/modules/serverless-concurrency-limits-configure-hard.adoc @@ -1,6 +1,6 @@ // Module included in the following assemblies: // -// * serverless/autoscaling/serverless-autoscaling-concurrency.adoc +// * serverless/develop/serverless-autoscaling-developer.adoc :_content-type: PROCEDURE [id="serverless-concurrency-limits-configure-hard_{context}"] diff --git a/modules/serverless-concurrency-limits-configure-soft.adoc b/modules/serverless-concurrency-limits-configure-soft.adoc index 4527c790b5be..c7f909f11f69 100644 --- a/modules/serverless-concurrency-limits-configure-soft.adoc +++ b/modules/serverless-concurrency-limits-configure-soft.adoc @@ -1,6 +1,6 @@ // Module included in the following assemblies: // -// * serverless/autoscaling/serverless-autoscaling-concurrency.adoc +// * serverless/develop/serverless-autoscaling-developer.adoc :_content-type: PROCEDURE [id="serverless-concurrency-limits-configure-soft_{context}"] diff --git a/modules/serverless-concurrency-limits.adoc b/modules/serverless-concurrency-limits.adoc index 75fe8f860a6f..3c4129a1ad67 100644 --- a/modules/serverless-concurrency-limits.adoc +++ b/modules/serverless-concurrency-limits.adoc @@ -1,3 +1,8 @@ +// Module included in the following assemblies: +// +// * serverless/develop/serverless-autoscaling-developer.adoc + +:_content-type: CONCEPT [id="serverless-concurrency-limits_{context}"] = Concurrency limits and targets diff --git a/modules/serverless-target-utilization.adoc b/modules/serverless-target-utilization.adoc index 9582720fce7c..8793d407952a 100644 --- a/modules/serverless-target-utilization.adoc +++ b/modules/serverless-target-utilization.adoc @@ -1,7 +1,8 @@ // Module included in the following assemblies: // -// * /serverless/autoscaling/serverless-autoscaling-concurrency.adoc +// * serverless/develop/serverless-autoscaling-developer.adoc +:_content-type: REFERENCE [id="serverless-target-utilization_{context}"] = Concurrency target utilization diff --git a/serverless/channels/images b/serverless/channels/images deleted file mode 120000 index 5e67573196d8..000000000000 --- a/serverless/channels/images +++ /dev/null @@ -1 +0,0 @@ -../images \ No newline at end of file diff --git a/serverless/channels/modules b/serverless/channels/modules deleted file mode 120000 index 464b823aca16..000000000000 --- a/serverless/channels/modules +++ /dev/null @@ -1 +0,0 @@ -../modules \ No newline at end of file diff --git a/serverless/cli_tools/snippets b/serverless/cli_tools/snippets new file mode 120000 index 000000000000..7bf6da9a51d0 --- /dev/null +++ b/serverless/cli_tools/snippets @@ -0,0 +1 @@ +../../snippets \ No newline at end of file diff --git a/serverless/develop/serverless-autoscaling-developer.adoc b/serverless/develop/serverless-autoscaling-developer.adoc index 6531d25bb21b..906d89b8166b 100644 --- a/serverless/develop/serverless-autoscaling-developer.adoc +++ b/serverless/develop/serverless-autoscaling-developer.adoc @@ -7,13 +7,13 @@ include::modules/serverless-document-attributes.adoc[] toc::[] -Knative Serving provides automatic scaling, or _autoscaling_, for applications to match incoming demand. 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 scale-to-zero is disabled, the application is scaled down to the xref:../../serverless/develop/serverless-autoscaling-developer.adoc#serverless-autoscaling-developer-minscale[minimum number of replicas specified for applications on the cluster]. Replicas can also be scaled up to meet demand if traffic to the application increases. +Knative Serving provides automatic scaling, or _autoscaling_, for applications to match incoming demand. 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 scale-to-zero is disabled, the application is scaled down to the minimum number of replicas configured for applications on the cluster. Replicas can also be scaled up to meet demand if traffic to the application increases. -If Knative autoscaling is enabled for your cluster, you can configure concurrency and scale bounds for your application. +Autoscaling settings for Knative services can be global settings that are configured by cluster administrators, or per-revision settings that are configured for individual services. You can modify per-revision settings for your services by using the {product-title} web console, by modifying the YAML file for your service, or by using the `kn` CLI. [NOTE] ==== -Any limits or targets set in the revision template are measured against a single instance of your application. For example, setting the `target` annotation to `50` configures the autoscaler to scale the application so that each revision handles 50 requests at a time. +Any limits or targets that you set for a service are measured against a single instance of your application. For example, setting the `target` annotation to `50` configures the autoscaler to scale the application so that each revision handles 50 requests at a time. ==== [id="serverless-autoscaling-developer-scale-bounds"] @@ -23,64 +23,12 @@ Scale bounds determine the minimum and maximum numbers of replicas that can serv You can set scale bounds for an application to help prevent cold starts or control computing costs. -[id="serverless-autoscaling-developer-minscale"] -=== Minimum scale bounds - -The minimum number of replicas that can serve an application is determined by the `minScale` annotation. - -The `minScale` value defaults to `0` replicas if the following conditions are met: - -* The `minScale` annotation is not set -* Scaling to zero is enabled -* The class `KPA` is used - -If scale to zero is not enabled, the `minScale` value defaults to `1`. - -// TODO: Document KPA if supported, link to docs about setting class - -// TO DO: -// Add info / links about enabling and disabling autoscaling (admin docs) -// if `enable-scale-to-zero` is set to `false` in the `config-autoscaler` config map. - -.Example service spec with `minScale` spec -[source,yaml] ----- -apiVersion: serving.knative.dev/v1 -kind: Service -metadata: - name: example-service - namespace: default -spec: - template: - metadata: - annotations: - autoscaling.knative.dev/minScale: "0" -... ----- - +// minscale docs +include::modules/serverless-autoscaling-developer-minscale.adoc[leveloffset=+2] include::modules/serverless-autoscaling-minscale-kn.adoc[leveloffset=+3] -[id="serverless-autoscaling-developer-maxscale"] -=== Maximum scale bounds - -The maximum number of replicas that can serve an application is determined by the `maxScale` annotation. If the `maxScale` annotation is not set, there is no upper limit for the number of replicas created. - -.Example service spec with `maxScale` spec -[source,yaml] ----- -apiVersion: serving.knative.dev/v1 -kind: Service -metadata: - name: example-service - namespace: default -spec: - template: - metadata: - annotations: - autoscaling.knative.dev/maxScale: "10" -... ----- - +// maxscale docs +include::modules/serverless-autoscaling-developer-maxscale.adoc[leveloffset=+2] include::modules/serverless-autoscaling-maxscale-kn.adoc[leveloffset=+3] [id="serverless-autoscaling-developer-concurrency"] diff --git a/serverless/discover/snippets b/serverless/discover/snippets new file mode 120000 index 000000000000..7bf6da9a51d0 --- /dev/null +++ b/serverless/discover/snippets @@ -0,0 +1 @@ +../../snippets \ No newline at end of file diff --git a/serverless/install/snippets b/serverless/install/snippets new file mode 120000 index 000000000000..7bf6da9a51d0 --- /dev/null +++ b/serverless/install/snippets @@ -0,0 +1 @@ +../../snippets \ No newline at end of file diff --git a/serverless/integrations/snippets b/serverless/integrations/snippets new file mode 120000 index 000000000000..7bf6da9a51d0 --- /dev/null +++ b/serverless/integrations/snippets @@ -0,0 +1 @@ +../../snippets \ No newline at end of file diff --git a/serverless/security/snippets b/serverless/security/snippets new file mode 120000 index 000000000000..7bf6da9a51d0 --- /dev/null +++ b/serverless/security/snippets @@ -0,0 +1 @@ +../../snippets \ No newline at end of file diff --git a/snippets/routing-odc.adoc b/snippets/routing-odc.adoc new file mode 100644 index 000000000000..bab0f6a8f5d5 --- /dev/null +++ b/snippets/routing-odc.adoc @@ -0,0 +1,16 @@ +// Text snippet included in the following modules: +// +// * modules/odc-importing-codebase-from-git-to-create-application.adoc + +:_content-type: SNIPPET + +Routing:: By clicking the *Routing* link, you can perform the following actions: +* Customize the hostname for the route. +* Specify the path the router watches. +* Select the target port for the traffic from the drop-down list. +* Secure your route by selecting the *Secure Route* check box. Select the required TLS termination type and set a policy for insecure traffic from the respective drop-down lists. ++ +[NOTE] +==== +For serverless applications, the Knative service manages all the routing options above. However, you can customize the target port for traffic, if required. If the target port is not specified, the default port of `8080` is used. +==== diff --git a/snippets/scaling-odc.adoc b/snippets/scaling-odc.adoc new file mode 100644 index 000000000000..75a6983743a3 --- /dev/null +++ b/snippets/scaling-odc.adoc @@ -0,0 +1,13 @@ +// Text snippet included in the following modules: +// +// * modules/odc-importing-codebase-from-git-to-create-application.adoc + +:_content-type: SNIPPET + +Scaling:: Click the *Scaling* link to define the number of pods or instances of the application you want to deploy initially. ++ +If you are creating a Knative service, you can also configure the following settings: ++ +* Set the upper and lower limit for the number of pods that can be set by the autoscaler. If the lower limit is not specified, it defaults to zero. +* Define the soft limit for the required number of concurrent requests per instance of the application at a given time. It is the recommended configuration for autoscaling. If not specified, it takes the value specified in the cluster configuration. +* Define the hard limit for the number of concurrent requests allowed per instance of the application at a given time. This is configured in the revision template. If not specified, it defaults to the value specified in the cluster configuration.