Skip to content

Commit 6889f1e

Browse files
authored
Merge pull request #41028 from abrennan89/ODCautoscaling
RHDEVDOCS-2830: Adding additional autoscaling config
2 parents 22bb4a9 + 7cae45f commit 6889f1e

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

0 commit comments

Comments
 (0)