annotate CLI command reference

Add Dapr annotatations to a Kubernetes configuration

Description

Add Dapr annotations to a Kubernetes configuration. This enables you to add/change the Dapr annotations on a deployment files. See Kubernetes annotations for a full description of each annotation available in the following list of flags.

Supported platforms

Usage

  1. dapr annotate [flags] CONFIG-FILE

Flags

NameEnvironment VariableDefaultDescription
—kubernetes, -kApply annotations to Kubernetes resources. Required
—api-token-secretThe secret to use for the API token
—app-id, -aThe app id to annotate
—app-max-concurrency-1The maximum number of concurrent requests to allow
—app-port, -p-1The port to expose the app on
—app-protocolThe protocol to use for the app
—app-sslfalseEnable SSL for the app
—app-token-secretThe secret to use for the app token
—config, -cThe config file to annotate
—cpu-limitThe CPU limit to set for the sidecar. See valid values here.
—cpu-requestThe CPU request to set for the sidecar. See valid values here.
—dapr-imageThe image to use for the dapr sidecar container
—enable-debugfalseEnable debug
—enable-metricsfalseEnable metrics
—enable-profilefalseEnable profiling
—envEnvironment variables to set (key value pairs, comma separated)
—graceful-shutdown-seconds-1The number of seconds to wait for the app to shutdown
—help, -hhelp for annotate
—listen-addressesThe addresses for sidecar to listen on. To listen to all IPv4 addresses, use 0.0.0.0. To listen to all IPv6 addresses, use [::].
—liveness-probe-delay-1The delay for sidecar to use for the liveness probe. Read more here.
—liveness-probe-period-1The period used by the sidecar for the liveness probe. Read more here.
—liveness-probe-threshold-1The threshold used by the sidecar for the liveness probe. Read more here.
—liveness-probe-timeout-1The timeout used by the sidecar for the liveness probe. Read more here.
—log-levelThe log level to use
—max-request-body-size-1The maximum request body size to use
—http-read-buffer-size-1The maximum size of HTTP header read buffer in kilobytes
—memory-limitThe memory limit to set for the sidecar. See valid values here
—memory-requestThe memory request to set for the sidecar
—metrics-port-1The port to expose the metrics on
—namespace, -nThe namespace the resource target is in (can only be set if —resource is also set)
—readiness-probe-delay-1The delay to use for the readiness probe in the sidecar. Read more here.
—readiness-probe-period-1The period to use for the readiness probe in the sidecar. Read more here.
—readiness-probe-threshold-1The threshold to use for the readiness probe in the sidecar. Read more here.
—readiness-probe-timeout-1The timeout to use for the readiness probe in the sidecar. Read more here.
—resource, -rThe Kubernetes resource target to annotate
—enable-api-loggingEnable API logging for the Dapr sidecar
—unix-domain-socket-pathLinux domain socket path to use for communicating with the Dapr sidecar
—volume-mountsList of pod volumes to be mounted to the sidecar container in read-only mode
—volume-mounts-rwList of pod volumes to be mounted to the sidecar container in read-write mode
—disable-builtin-k8s-secret-storeDisable the built-in Kubernetes secret store
—placement-host-addressComma separated list of addresses for Dapr actor placement servers

Warning

If an application ID is not provided using --app-id, -a, an ID is generated using the format <namespace>-<kind>-<name>.

Examples

  1. # Annotate the first deployment found in the input
  2. kubectl get deploy -l app=node -o yaml | dapr annotate -k - | kubectl apply -f -
  3. # Annotate multiple deployments by name in a chain
  4. kubectl get deploy -o yaml | dapr annotate -k -r nodeapp - | dapr annotate -k -r pythonapp - | kubectl apply -f -
  5. # Annotate deployment in a specific namespace from file or directory by name
  6. dapr annotate -k -r nodeapp -n namespace mydeploy.yaml | kubectl apply -f -
  7. # Annotate deployment from url by name
  8. dapr annotate -k -r nodeapp --log-level debug https://raw.githubusercontent.com/dapr/quickstarts/master/tutorials/hello-kubernetes/deploy/node.yaml | kubectl apply -f -

Last modified October 4, 2022: Document removal of `http-stream-request-body` (#2853) (3f40d3d5)