Skip to content

Commit 7cae45f

Browse files
committed
RHDEVDOCS-2830: Adding additional autoscaling config
1 parent 22bb4a9 commit 7cae45f

27 files changed

+156
-95
lines changed

applications/creating_applications/odc-creating-applications-using-developer-perspective.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,12 @@ include::modules/odc-importing-codebase-from-git-to-create-application.adoc[leve
7070
include::modules/odc-deploying-java-applications.adoc[leveloffset=+1]
7171

7272
include::modules/odc-using-the-developer-catalog-to-add-services-or-components.adoc[leveloffset=+1]
73+
74+
[id="additional-resources_odc-creating-applications-using-developer-perspective"]
75+
== Additional resources
76+
77+
* For more information about Knative routing settings for {ServerlessProductName}, see xref:../../serverless/develop/serverless-configuring-routes.adoc#serverless-configuring-routes[Routing].
78+
79+
* 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].
80+
81+
* For more information about Knative autoscaling settings for {ServerlessProductName}, see xref:../../serverless/develop/serverless-autoscaling-developer.adoc#serverless-autoscaling-developer[Autoscaling].
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../snippets

modules/odc-importing-codebase-from-git-to-create-application.adoc

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * applications/creating_applications/odc-creating-applications-using-developer-perspective.adoc
4+
15
:_content-type: PROCEDURE
26
[id="odc-importing-codebase-from-git-to-create-application_{context}"]
37
= 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
3943
* *Deployment*, to create an application in plain Kubernetes style.
4044
* *Deployment Config*, to create an {product-title} style application.
4145
* *Serverless Deployment*, to create a Knative service.
42-
4346
+
4447
[NOTE]
4548
====
@@ -52,21 +55,8 @@ The *Serverless Deployment* option is displayed in the *Import from git* form on
5255

5356
. Optional: You can use the following advanced options to further customize your application:
5457

55-
Routing::
56-
Click the *Routing* link to:
57-
* Customize the hostname for the route.
58-
* Specify the path the router watches.
59-
* Select the target port for the traffic from the drop-down list.
60-
* 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.
61-
+
62-
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.
63-
64-
Domain mapping::
65-
If you are creating a *Serverless Deployment*, you can add a custom domain mapping to the Knative service during creation.
66-
+
67-
* In the *Advanced options* section, click *Show advanced Routing options*.
68-
** 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.
69-
** 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"*.
58+
include::snippets/routing-odc.adoc[]
59+
include::snippets/serverless-domain-mapping-odc.adoc[]
7060

7161
Health Checks::
7262
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:
7969
+
8070
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.
8171

82-
8372
Build Configuration and Deployment::
8473
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.
8574
+
8675
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.
8776

88-
Scaling::
89-
Click the *Scaling* link to define the number of pods or instances of the application you want to deploy initially.
90-
+
91-
For serverless applications, you can:
92-
93-
* 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.
94-
* 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.
95-
* 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.
77+
include::snippets/scaling-odc.adoc[]
9678

9779
Resource Limit::
9880
Click the *Resource Limit* link to set the amount of *CPU* and *Memory* resources a container is guaranteed or allowed to use when running.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * serverless/develop/serverless-autoscaling-developer.adoc
4+
5+
:_content-type: REFERENCE
6+
[id="serverless-autoscaling-developer-maxscale_context"]
7+
= Maximum scale bounds
8+
9+
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.
10+
11+
.Example service spec with `maxScale` annotation
12+
[source,yaml]
13+
----
14+
apiVersion: serving.knative.dev/v1
15+
kind: Service
16+
metadata:
17+
name: example-service
18+
namespace: default
19+
spec:
20+
template:
21+
metadata:
22+
annotations:
23+
autoscaling.knative.dev/maxScale: "10"
24+
...
25+
----
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * serverless/develop/serverless-autoscaling-developer.adoc
4+
5+
:_content-type: REFERENCE
6+
[id="serverless-autoscaling-developer-minscale_{context}"]
7+
= Minimum scale bounds
8+
9+
The minimum number of replicas that can serve an application is determined by the `minScale` annotation.
10+
11+
The `minScale` value defaults to `0` replicas if the following conditions are met:
12+
13+
* The `minScale` annotation is not set
14+
* Scaling to zero is enabled
15+
* The class `KPA` is used
16+
17+
If scale to zero is not enabled, the `minScale` value defaults to `1`.
18+
19+
.Example service spec with `minScale` annotation
20+
[source,yaml]
21+
----
22+
apiVersion: serving.knative.dev/v1
23+
kind: Service
24+
metadata:
25+
name: example-service
26+
namespace: default
27+
spec:
28+
template:
29+
metadata:
30+
annotations:
31+
autoscaling.knative.dev/minScale: "0"
32+
...
33+
----

modules/serverless-autoscaling-maxscale-kn.adoc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
// Module is included in the following assemblies:
1+
// Module included in the following assemblies:
22
//
3-
// * serverless/autoscaling/serverless-autoscaling-scale-bounds.adoc
3+
// * serverless/develop/serverless-autoscaling-developer.adoc
44

55
:_content-type: PROCEDURE
66
[id="serverless-autoscaling-maxscale-kn_{context}"]
77
= Setting the maxScale annotation by using the Knative CLI
88

99
You can use the `kn service` command with the `--max-scale` flag to create or modify the `--max-scale` value for a service.
1010

11+
.Prerequisites
12+
13+
* Knative Serving is installed on the cluster.
14+
* You have installed the `kn` CLI.
15+
1116
.Procedure
1217

1318
* Set the maximum number of replicas for the service by using the `--max-scale` flag:

modules/serverless-autoscaling-minscale-kn.adoc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
// Module is included in the following assemblies:
1+
// Module included in the following assemblies:
22
//
3-
// * serverless/autoscaling/serverless-autoscaling-scale-bounds.adoc
3+
// * serverless/develop/serverless-autoscaling-developer.adoc
44

55
:_content-type: PROCEDURE
66
[id="serverless-autoscaling-minscale_{context}"]
77
= Setting the minScale annotation by using the Knative CLI
88

99
You can use the `kn service` command with the `--min-scale` flag to create or modify the `--min-scale` value for a service.
1010

11+
.Prerequisites
12+
13+
* Knative Serving is installed on the cluster.
14+
* You have installed the `kn` CLI.
15+
1116
.Procedure
1217

1318
* Set the minimum number of replicas for the service by using the `--min-scale` flag:

modules/serverless-concurrency-limits-configure-hard.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Module included in the following assemblies:
22
//
3-
// * serverless/autoscaling/serverless-autoscaling-concurrency.adoc
3+
// * serverless/develop/serverless-autoscaling-developer.adoc
44

55
:_content-type: PROCEDURE
66
[id="serverless-concurrency-limits-configure-hard_{context}"]

modules/serverless-concurrency-limits-configure-soft.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Module included in the following assemblies:
22
//
3-
// * serverless/autoscaling/serverless-autoscaling-concurrency.adoc
3+
// * serverless/develop/serverless-autoscaling-developer.adoc
44

55
:_content-type: PROCEDURE
66
[id="serverless-concurrency-limits-configure-soft_{context}"]

modules/serverless-concurrency-limits.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * serverless/develop/serverless-autoscaling-developer.adoc
4+
5+
:_content-type: CONCEPT
16
[id="serverless-concurrency-limits_{context}"]
27
= Concurrency limits and targets
38

modules/serverless-target-utilization.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// Module included in the following assemblies:
22
//
3-
// * /serverless/autoscaling/serverless-autoscaling-concurrency.adoc
3+
// * serverless/develop/serverless-autoscaling-developer.adoc
44

5+
:_content-type: REFERENCE
56
[id="serverless-target-utilization_{context}"]
67
= Concurrency target utilization
78

serverless/admin_guide/snippets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../snippets

serverless/channels/images

Lines changed: 0 additions & 1 deletion
This file was deleted.

serverless/channels/modules

Lines changed: 0 additions & 1 deletion
This file was deleted.

serverless/cli_tools/snippets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../snippets

serverless/develop/serverless-autoscaling-developer.adoc

Lines changed: 7 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ include::modules/serverless-document-attributes.adoc[]
77

88
toc::[]
99

10-
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.
10+
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.
1111

12-
If Knative autoscaling is enabled for your cluster, you can configure concurrency and scale bounds for your application.
12+
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.
1313

1414
[NOTE]
1515
====
16-
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.
16+
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.
1717
====
1818

1919
[id="serverless-autoscaling-developer-scale-bounds"]
@@ -23,64 +23,12 @@ Scale bounds determine the minimum and maximum numbers of replicas that can serv
2323

2424
You can set scale bounds for an application to help prevent cold starts or control computing costs.
2525

26-
[id="serverless-autoscaling-developer-minscale"]
27-
=== Minimum scale bounds
28-
29-
The minimum number of replicas that can serve an application is determined by the `minScale` annotation.
30-
31-
The `minScale` value defaults to `0` replicas if the following conditions are met:
32-
33-
* The `minScale` annotation is not set
34-
* Scaling to zero is enabled
35-
* The class `KPA` is used
36-
37-
If scale to zero is not enabled, the `minScale` value defaults to `1`.
38-
39-
// TODO: Document KPA if supported, link to docs about setting class
40-
41-
// TO DO:
42-
// Add info / links about enabling and disabling autoscaling (admin docs)
43-
// if `enable-scale-to-zero` is set to `false` in the `config-autoscaler` config map.
44-
45-
.Example service spec with `minScale` spec
46-
[source,yaml]
47-
----
48-
apiVersion: serving.knative.dev/v1
49-
kind: Service
50-
metadata:
51-
name: example-service
52-
namespace: default
53-
spec:
54-
template:
55-
metadata:
56-
annotations:
57-
autoscaling.knative.dev/minScale: "0"
58-
...
59-
----
60-
26+
// minscale docs
27+
include::modules/serverless-autoscaling-developer-minscale.adoc[leveloffset=+2]
6128
include::modules/serverless-autoscaling-minscale-kn.adoc[leveloffset=+3]
6229

63-
[id="serverless-autoscaling-developer-maxscale"]
64-
=== Maximum scale bounds
65-
66-
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.
67-
68-
.Example service spec with `maxScale` spec
69-
[source,yaml]
70-
----
71-
apiVersion: serving.knative.dev/v1
72-
kind: Service
73-
metadata:
74-
name: example-service
75-
namespace: default
76-
spec:
77-
template:
78-
metadata:
79-
annotations:
80-
autoscaling.knative.dev/maxScale: "10"
81-
...
82-
----
83-
30+
// maxscale docs
31+
include::modules/serverless-autoscaling-developer-maxscale.adoc[leveloffset=+2]
8432
include::modules/serverless-autoscaling-maxscale-kn.adoc[leveloffset=+3]
8533

8634
[id="serverless-autoscaling-developer-concurrency"]

serverless/develop/snippets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../snippets

serverless/discover/snippets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../snippets

serverless/install/snippets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../snippets

serverless/integrations/snippets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../snippets

serverless/reference/snippets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../snippets

serverless/security/snippets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../snippets

serverless/update/images

Lines changed: 0 additions & 1 deletion
This file was deleted.

serverless/update/modules

Lines changed: 0 additions & 1 deletion
This file was deleted.

snippets/routing-odc.adoc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Text snippet included in the following modules:
2+
//
3+
// * modules/odc-importing-codebase-from-git-to-create-application.adoc
4+
5+
:_content-type: SNIPPET
6+
7+
Routing:: By clicking the *Routing* link, you can perform the following actions:
8+
* Customize the hostname for the route.
9+
* Specify the path the router watches.
10+
* Select the target port for the traffic from the drop-down list.
11+
* 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.
12+
+
13+
[NOTE]
14+
====
15+
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.
16+
====

snippets/scaling-odc.adoc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Text snippet included in the following modules:
2+
//
3+
// * modules/odc-importing-codebase-from-git-to-create-application.adoc
4+
5+
:_content-type: SNIPPET
6+
7+
Scaling:: Click the *Scaling* link to define the number of pods or instances of the application you want to deploy initially.
8+
+
9+
If you are creating a serverless deployment, you can also configure the following settings:
10+
+
11+
* *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.
12+
* *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.
13+
* *Concurrency target* determines the number of concurrent requests desired for each instance of the application at a given time.
14+
* *Concurrency limit* determines the limit for the number of concurrent requests allowed for each instance of the application at a given time.
15+
* *Concurrency utilization* determines the percentage of the concurrent requests limit that must be met before Knative scales up additional pods to handle additional traffic.
16+
* *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.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Text snippet included in the following modules:
2+
//
3+
// * modules/odc-importing-codebase-from-git-to-create-application.adoc
4+
5+
:_content-type: SNIPPET
6+
7+
Domain mapping:: If you are creating a *Serverless Deployment*, you can add a custom domain mapping to the Knative service during creation.
8+
+
9+
* In the *Advanced options* section, click *Show advanced Routing options*.
10+
** 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.
11+
** 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"*.

0 commit comments

Comments
 (0)