Skip to content

Commit

Permalink
[SRVKS-1255] Deployment resource configuration
Browse files Browse the repository at this point in the history
Add skipping tag resolution and RuntimeClassName

Comment out Skipping tag resolution and RuntimeClassName config
  • Loading branch information
ochromy committed Jan 12, 2025
1 parent 60dc1b6 commit a813033
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 0 deletions.
23 changes: 23 additions & 0 deletions knative-serving/config-applications/deployment-resources.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
:_content-type: ASSEMBLY
include::_attributes/common-attributes.adoc[]
[id="deployment-resources"]
= Deployment resources
:context: deployment-resources

toc::[]

The `config-deployment` ConfigMap, also referred to as the Deployment ConfigMap, contains settings that define how Kubernetes Deployment resources supporting Knative services are configured. The `config-deployment` ConfigMap is located in the `knative-serving` namespace.

//Options examples?

//Skipping tag resolution
//include::modules/serverless-skipping-tag-resolution.adoc[leveloffset=+1]

//Configuring selectable RuntimeClassName
//include::modules/serverless-configuring-runtimeclass-name.adoc[leveloffset=+1]

//Progress Deadline
include::modules/serverless-progress-deadline.adoc[leveloffset=+1]

//Configuring Progress Deadline
include::modules/serverless-progress-deadline-config.adoc[leveloffset=+2]
31 changes: 31 additions & 0 deletions modules/serverless-configuring-runtimeclass-name.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Module included in the following assemblies:
//
// * serverless/knative-serving/config-applications/deployment-resources.adoc

:_content-type: PROCEDURE
[id="serverless-configuring-runtimeclass-name_{context}"]
= Configuring selectable RuntimeClassName

You can configure Serving to set a specific `RuntimeClassName` for Deployments by updating the `runtime-class-name` setting in the `config-deployment` ConfigMap.

This setting interacts with Service labels, applying either the default `RuntimeClassName` or the one that matches the most labels associated with the Service.

.Procedure

* In the `config-deployment` ConfigMap, set the `RuntimeClassName` specification for the `runtime-class-name` setting.
+
.Example of configured RuntimeClassName setting
[source,yaml]
----
apiVersion: v1
kind: ConfigMap
metadata:
name: config-deployment
namespace: knative-serving
data:
runtime-class-name: |
kata: {}
gvisor:
selector:
my-label: selector
----
46 changes: 46 additions & 0 deletions modules/serverless-progress-deadline-config.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Module included in the following assemblies:
//
// * serverless/knative-serving/config-applications/deployment-resources.adoc

:_content-type: PROCEDURE
[id="serverless-progress-deadline-config_{context}"]
= Configuring the progress deadline

You can configure progress deadline settings to specify the maximum time allowed for your deployment to progress before the system reports a failure for the Knative Revision. This time limit can be specified in seconds or minutes.

By default, the progress deadline is set to 600 seconds. This value is specified as a Golang `time.Duration` string and must be rounded to the nearest second.

.Procedure

You can configure the progress deadline globally or at the per-revision level:

* To configure the progress deadline setting at a global level, set the value of `progress-deadline` in the `config-deployment` ConfigMap.
+
.Example of progress deadline globally set to 60 seconds
[source,yaml]
----
apiVersion: v1
kind: ConfigMap
metadata:
name: config-deployment
namespace: knative-serving
data:
progress-deadline: "60s"
----
* To configure the progress deadline setting at a per-revision level, add a `progress-deadline` annotation key to your service.
+
.Example of progress deadline per-revision set to 60 seconds
[source,yaml]
----
apiVersion: serving.knative.dev/v1
kind: Service
# ...
spec:
template:
metadata:
annotations:
serving.knative.dev/progress-deadline: "60s"
spec:
containers:
- image: <image>
----
17 changes: 17 additions & 0 deletions modules/serverless-progress-deadline.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Module included in the following assemblies:
//
// * serverless/knative-serving/config-applications/deployment-resources.adoc

:_content-type: CONCEPT
[id="serverless-progress-deadline_{context}"]
= Progress deadline

By default, services have a progress deadline that defines the time limit for a service to complete its initial startup.

Consider increasing the progress deadline if you encounter any of these conditions in your deployment:

* The service image takes a long time to pull due to its size.
* The service takes a long time to become `READY` because of initial cache priming.
* The cluster relies on autoscaling to allocate resources for new pods.
If the initial scale is not achieved within the specified time limit, the Knative Autoscaler component scales the revision to `0`, and the Knative service enters a terminal `Failed` state.
25 changes: 25 additions & 0 deletions modules/serverless-skipping-tag-resolution.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Module included in the following assemblies:
//
// * serverless/knative-serving/config-applications/deployment-resources.adoc

:_content-type: PROCEDURE
[id="serverless-skipping-tag-resolution_{context}"]
= Skipping tag resolution

You can configure Knative Serving to skip tag resolution by modifying the `registries-skipping-tag-resolving` setting in the `config-deployment` ConfigMap.

.Procedure

* Modify the `registries-skipping-tag-resolving` setting with the list of registries for which tag resoution will be skipped.
+
.Example of configured tag resolution skipping
[source,yaml]
----
apiVersion: v1
kind: ConfigMap
metadata:
name: config-deployment
namespace: knative-serving
data:
registries-skipping-tag-resolving: registry.example.com, another.registry.com
----

0 comments on commit a813033

Please sign in to comment.