Configure Deployment resources

The config-deployment ConfigMap, known as the Deployment ConfigMap, contains settings that determine how Kubernetes Deployment resources, which back Knative services, are configured. This ConfigMap is located in the knative-serving namespace.

You can view the current config-deployment ConfigMap by running the following command:

  1. kubectl get configmap -n knative-serving config-deployment -oyaml

Example config-deployment ConfigMap

  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: config-deployment
  5. namespace: knative-serving
  6. labels:
  7. serving.knative.dev/release: devel
  8. annotations:
  9. knative.dev/example-checksum: "fa67b403"
  10. data:
  11. # This is the Go import path for the binary that is containerized
  12. # and substituted here.
  13. queue-sidecar-image: ko://knative.dev/serving/cmd/queue
  14. # List of repositories for which tag to digest resolving should be skipped
  15. registries-skipping-tag-resolving: "kind.local,ko.local,dev.local"
  16. # digest-resolution-timeout is the maximum time allowed for an image's
  17. # digests to be resolved.
  18. digest-resolution-timeout: "10s"
  19. # progress-deadline is the duration we wait for the deployment to
  20. # be ready before considering it failed.
  21. progress-deadline: "600s"
  22. # queue-sidecar-cpu-request is the requests.cpu to set for the queue proxy sidecar container.
  23. # If omitted, a default value (currently "25m"), is used.
  24. queue-sidecar-cpu-request: "25m"
  25. # queue-sidecar-cpu-limit is the limits.cpu to set for the queue proxy sidecar container.
  26. # If omitted, no value is specified and the system default is used.
  27. queue-sidecar-cpu-limit: "1000m"
  28. # queue-sidecar-memory-request is the requests.memory to set for the queue proxy container.
  29. # If omitted, no value is specified and the system default is used.
  30. queue-sidecar-memory-request: "400Mi"
  31. # queue-sidecar-memory-limit is the limits.memory to set for the queue proxy container.
  32. # If omitted, no value is specified and the system default is used.
  33. queue-sidecar-memory-limit: "800Mi"
  34. # queue-sidecar-ephemeral-storage-request is the requests.ephemeral-storage to
  35. # set for the queue proxy sidecar container.
  36. # If omitted, no value is specified and the system default is used.
  37. queue-sidecar-ephemeral-storage-request: "512Mi"
  38. # queue-sidecar-ephemeral-storage-limit is the limits.ephemeral-storage to set
  39. # for the queue proxy sidecar container.
  40. # If omitted, no value is specified and the system default is used.
  41. queue-sidecar-ephemeral-storage-limit: "1024Mi"
  42. # concurrency-state-endpoint is the endpoint that queue-proxy calls when its traffic drops to zero or
  43. # scales up from zero.
  44. concurrency-state-endpoint: ""

Configuring progress deadlines

Configuring progress deadline settings allows you to specify the maximum time, either in seconds or minutes, that you will wait for your Deployment to progress before the system reports back that the Deployment has failed progressing for the Knative Revision.

The default progress deadline is 600 seconds. This value is expressed as a Golang time.Duration string representation, and must be rounded to a second precision.

The Knative Autoscaler component scales the revision to 0, and the Knative service enters a terminal Failed state, if the initial scale cannot be achieved within the time limit defined by this setting.

You may want to configure this setting as a higher value if any of the following issues occur in your Knative deployment:

  • It takes a long time to pull the Service image, due to the size of the image.
  • It takes a long time for the Service to become READY, due to priming of the initial cache state.
  • The cluster is relies on cluster autoscaling to allocate resources for new pods.

See the Kubernetes documentation for more information.

Progress deadline setting can be configured at global level through a ConfigMap or at the per-revision level using an annotation.

  • Global key: progress-deadline
  • Per-revision annotation key: serving.knative.dev/progress-deadline
  • Possible values: time.Duration
  • Default: "600s"

Example:

Global (ConfigMap)Per Revision

  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: config-deployment
  5. namespace: knative-serving
  6. labels:
  7. serving.knative.dev/release: devel
  8. annotations:
  9. knative.dev/example-checksum: "fa67b403"
  10. data:
  11. progress-deadline: "10m"
  1. apiVersion: serving.knative.dev/v1
  2. kind: Service
  3. metadata:
  4. name: helloworld-go
  5. spec:
  6. template:
  7. metadata:
  8. annotations:
  9. serving.knative.dev/progress-deadline: "60s"
  10. spec:
  11. containers:
  12. - image: ghcr.io/knative/helloworld-go:latest

Skipping tag resolution

You can configure Knative Serving to skip tag resolution for Deployments by modifying the registries-skipping-tag-resolving ConfigMap setting.

The following example shows how to disable tag resolution for registry.example.com:

  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: config-deployment
  5. namespace: knative-serving
  6. labels:
  7. serving.knative.dev/release: devel
  8. annotations:
  9. knative.dev/example-checksum: "fa67b403"
  10. data:
  11. # List of repositories for which tag to digest resolving should be skipped
  12. registries-skipping-tag-resolving: registry.example.com

Configuring selectable RuntimeClassName

You can configure Knative Serving to configure deployments with a specified RuntimeClassName (Pod.Spec.RuntimeClassName) by modifying the runtime-class-name setting.

The setting works with Service labels and will configure either a default or one where the most labels match.

Example:

Global (ConfigMap)Operator

  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: config-deployment
  5. namespace: knative-serving
  6. data:
  7. runtime-class-name: |
  8. kata: {}
  9. gvisor:
  10. selector:
  11. my-label: selector
  1. apiVersion: operator.knative.dev/v1beta1
  2. kind: KnativeServing
  3. metadata:
  4. name: knative-serving
  5. namespace: knative-serving
  6. spec:
  7. config:
  8. deployment:
  9. runtime-class-name: |
  10. kata: {}
  11. gvisor:
  12. selector:
  13. my-label: selector

See Kubernetes RuntimeClass docs for more information.

Separately, there is a feature flag to allow manual configuration of RuntimeClassName.