diff --git a/applications/creating_applications/odc-creating-applications-using-developer-perspective.adoc b/applications/creating_applications/odc-creating-applications-using-developer-perspective.adoc index 63b7bdc513c2..f8f8fc10ce72 100644 --- a/applications/creating_applications/odc-creating-applications-using-developer-perspective.adoc +++ b/applications/creating_applications/odc-creating-applications-using-developer-perspective.adoc @@ -70,3 +70,12 @@ include::modules/odc-importing-codebase-from-git-to-create-application.adoc[leve include::modules/odc-deploying-java-applications.adoc[leveloffset=+1] include::modules/odc-using-the-developer-catalog-to-add-services-or-components.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 domain mapping settings for {ServerlessProductName}, see xref:../../serverless/security/serverless-custom-domains.adoc#serverless-custom-domains[Configuring a custom domain for a Knative service]. + +* For more information about Knative autoscaling settings for {ServerlessProductName}, see xref:../../serverless/develop/serverless-autoscaling-developer.adoc#serverless-autoscaling-developer[Autoscaling]. diff --git a/applications/creating_applications/snippets b/applications/creating_applications/snippets new file mode 120000 index 000000000000..7bf6da9a51d0 --- /dev/null +++ b/applications/creating_applications/snippets @@ -0,0 +1 @@ +../../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 81e511dbb40d..e1c0a9fca275 100644 --- a/modules/odc-importing-codebase-from-git-to-create-application.adoc +++ b/modules/odc-importing-codebase-from-git-to-create-application.adoc @@ -1,3 +1,7 @@ +// Module included in the following assemblies: +// +// * applications/creating_applications/odc-creating-applications-using-developer-perspective.adoc + :_content-type: PROCEDURE [id="odc-importing-codebase-from-git-to-create-application_{context}"] = Importing a codebase from Git to create an application @@ -39,7 +43,6 @@ The resource name must be unique in a namespace. Modify the resource name if you * *Deployment*, to create an application in plain Kubernetes style. * *Deployment Config*, to create an {product-title} style application. * *Serverless Deployment*, to create a Knative service. - + [NOTE] ==== @@ -52,21 +55,8 @@ The *Serverless Deployment* option is displayed in the *Import from git* form on . 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. - -Domain mapping:: -If you are creating a *Serverless Deployment*, you can add a custom domain mapping to the Knative service during creation. -+ -* In the *Advanced options* section, click *Show advanced Routing options*. -** If the domain mapping CR that you want to map to the service already exists, you can select it from the *Domain mapping* drop-down menu. -** If you want to create a new domain mapping CR, type the domain name into the box, and select the *Create* option. For example, if you type in `example.com`, the *Create* option is *Create "example.com"*. +include::snippets/routing-odc.adoc[] +include::snippets/serverless-domain-mapping-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. @@ -79,20 +69,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` resource. -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..3ee0c851a85e --- /dev/null +++ b/snippets/scaling-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 + +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 serverless deployment, you can also configure the following settings: ++ +* *Min Pods* determines the lower limit for the number of pods that must be running at any given time for a Knative service. This is also known as the `minScale` setting. +* *Max Pods* determines the upper limit for the number of pods that can be running at any given time for a Knative service. This is also known as the `maxScale` setting. +* *Concurrency target* determines the number of concurrent requests desired for each instance of the application at a given time. +* *Concurrency limit* determines the limit for the number of concurrent requests allowed for each instance of the application at a given time. +* *Concurrency utilization* determines the percentage of the concurrent requests limit that must be met before Knative scales up additional pods to handle additional traffic. +* *Autoscale window* defines the time window over which metrics are averaged to provide input for scaling decisions when the autoscaler is not in panic mode. A service is scaled-to-zero if no requests are received during this window. The default duration for the autoscale window is `60s`. This is also known as the stable window. diff --git a/snippets/serverless-domain-mapping-odc.adoc b/snippets/serverless-domain-mapping-odc.adoc new file mode 100644 index 000000000000..d1efc7f50451 --- /dev/null +++ b/snippets/serverless-domain-mapping-odc.adoc @@ -0,0 +1,11 @@ +// Text snippet included in the following modules: +// +// * modules/odc-importing-codebase-from-git-to-create-application.adoc + +:_content-type: SNIPPET + +Domain mapping:: If you are creating a *Serverless Deployment*, you can add a custom domain mapping to the Knative service during creation. ++ +* In the *Advanced options* section, click *Show advanced Routing options*. +** If the domain mapping CR that you want to map to the service already exists, you can select it from the *Domain mapping* drop-down menu. +** If you want to create a new domain mapping CR, type the domain name into the box, and select the *Create* option. For example, if you type in `example.com`, the *Create* option is *Create "example.com"*.