×

This guide describes how cluster administrators can manage settings for developer-created custom resources (CRs) that are created from the Knative Serving CR.

Overriding system deployment configurations

You can override the default configurations for some specific deployments by modifying the deployments spec in the KnativeServing custom resource (CR).

Currently, overriding default configuration settings for the replicas, labels, annotations, and nodeSelector fields are supported.

In the following example, a KnativeServing CR overrides the webhook deployment so that:

  • The deployment has 3 replicas.

  • The label is set to example-label: label.

  • The label example-label: label is added.

  • The nodeSelector field is set to select nodes with the disktype: hdd label.

The KnativeServing CR label and annotation settings override the deployment’s labels and annotations for both the deployment itself and the resulting pods.

KnativeServing CR example
apiVersion: operator.knative.dev/v1alpha1
kind: KnativeServing
metadata:
  name: ks
  namespace: knative-serving
spec:
  high-availability:
    replicas: 2
  deployments:
  - name: webhook
    replicas: 3
    labels:
      example-label: label
    annotations:
      example-annotation: annotation
    nodeSelector:
      disktype: hdd

Configuring the EmptyDir extension

This extension controls whether emptyDir volumes can be specified.

To enable using emptyDir volumes, you must modify the KnativeServing custom resource (CR) to include the following YAML:

...
spec:
  config:
    features:
      "kubernetes.podspec-volumes-emptydir": enabled
...

HTTPS redirection global settings

You can enable HTTPS redirection for all services on the cluster by configuring the httpProtocol spec for the KnativeServing custom resource, as shown in the following example:

apiVersion: operator.knative.dev/v1alpha1
kind: KnativeServing
metadata:
  name: knative-serving
spec:
  config:
    network:
      httpProtocol: "redirected"
...