From a8130337ee4de89a21ad460e0dc8fe626b5cfab1 Mon Sep 17 00:00:00 2001 From: Ondrej Chromy Date: Sun, 12 Jan 2025 19:02:35 +0100 Subject: [PATCH] [SRVKS-1255] Deployment resource configuration Add skipping tag resolution and RuntimeClassName Comment out Skipping tag resolution and RuntimeClassName config --- .../deployment-resources.adoc | 23 ++++++++++ ...verless-configuring-runtimeclass-name.adoc | 31 +++++++++++++ .../serverless-progress-deadline-config.adoc | 46 +++++++++++++++++++ modules/serverless-progress-deadline.adoc | 17 +++++++ .../serverless-skipping-tag-resolution.adoc | 25 ++++++++++ 5 files changed, 142 insertions(+) create mode 100644 knative-serving/config-applications/deployment-resources.adoc create mode 100644 modules/serverless-configuring-runtimeclass-name.adoc create mode 100644 modules/serverless-progress-deadline-config.adoc create mode 100644 modules/serverless-progress-deadline.adoc create mode 100644 modules/serverless-skipping-tag-resolution.adoc diff --git a/knative-serving/config-applications/deployment-resources.adoc b/knative-serving/config-applications/deployment-resources.adoc new file mode 100644 index 000000000000..ef6d8664730b --- /dev/null +++ b/knative-serving/config-applications/deployment-resources.adoc @@ -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] diff --git a/modules/serverless-configuring-runtimeclass-name.adoc b/modules/serverless-configuring-runtimeclass-name.adoc new file mode 100644 index 000000000000..107f19acfd06 --- /dev/null +++ b/modules/serverless-configuring-runtimeclass-name.adoc @@ -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 +---- diff --git a/modules/serverless-progress-deadline-config.adoc b/modules/serverless-progress-deadline-config.adoc new file mode 100644 index 000000000000..274860e1ae2c --- /dev/null +++ b/modules/serverless-progress-deadline-config.adoc @@ -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: +---- diff --git a/modules/serverless-progress-deadline.adoc b/modules/serverless-progress-deadline.adoc new file mode 100644 index 000000000000..97cd6c4992ab --- /dev/null +++ b/modules/serverless-progress-deadline.adoc @@ -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. diff --git a/modules/serverless-skipping-tag-resolution.adoc b/modules/serverless-skipping-tag-resolution.adoc new file mode 100644 index 000000000000..3db53a4a607f --- /dev/null +++ b/modules/serverless-skipping-tag-resolution.adoc @@ -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 +----