From 17548ed57044cb4a50bc0cd7fe483e3bf6579a63 Mon Sep 17 00:00:00 2001 From: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com> Date: Tue, 28 Jun 2022 10:43:44 +0530 Subject: [PATCH 1/3] add docs for dapr annotate command Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com> --- .../support/support-preview-features.md | 3 +- .../content/en/reference/cli/cli-overview.md | 2 + .../content/en/reference/cli/dapr-annotate.md | 84 +++++++++++++++++++ 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 daprdocs/content/en/reference/cli/dapr-annotate.md diff --git a/daprdocs/content/en/operations/support/support-preview-features.md b/daprdocs/content/en/operations/support/support-preview-features.md index a45db63c6c5..ca2cbff455c 100644 --- a/daprdocs/content/en/operations/support/support-preview-features.md +++ b/daprdocs/content/en/operations/support/support-preview-features.md @@ -15,7 +15,8 @@ For CLI there is no explicit opt-in, just the version that this was first made a ## Current preview features | Feature | Description | Setting | Documentation | Version introduced | | ---------- |-------------|---------|---------------|-----------------| -| **--image-registry** flag with Dapr CLI| In self hosted mode you can set this flag to specify any private registry to pull the container images required to install Dapr| N/A | [init CLI command reference]({{}}) | v1.7 | +| **dapr annotate** command in Dapr CLI | Add Dapr annotations to Kubernetes configuration files. | N/A | [CLI annotate command reference]({{}}) | v1.8 | +| **--image-registry** flag in Dapr CLI| In self hosted mode you can set this flag to specify any private registry to pull the container images required to install Dapr| N/A | [CLI init command reference]({{}}) | v1.7 | | **Resiliency** | Allows configuring of fine-grained policies for retries, timeouts and circuitbreaking. | `Resiliency` | [Configure Resiliency Policies]({{}}) | v1.7| | **Service invocation without default `content-type`** | When enabled removes the default service invocation content-type header value `application/json` when no content-type is provided. This will become the default behavior in release v1.9.0. This requires you to explictly set content-type headers where required for your apps. | `ServiceInvocation.NoDefaultContentType` | [Service Invocation]({{}}) | v1.7 | diff --git a/daprdocs/content/en/reference/cli/cli-overview.md b/daprdocs/content/en/reference/cli/cli-overview.md index 745fc2f12b2..4ab6212c687 100644 --- a/daprdocs/content/en/reference/cli/cli-overview.md +++ b/daprdocs/content/en/reference/cli/cli-overview.md @@ -24,6 +24,7 @@ Usage: dapr [command] Available Commands: + annotate Add dapr annotations to a Kubernetes configuration. Supported platforms: Kubernetes build-info Print build info of Dapr CLI and runtime completion Generates shell completion scripts components List all Dapr components. Supported platforms: Kubernetes @@ -54,6 +55,7 @@ Use "dapr [command] --help" for more information about a command. You can learn more about each Dapr command from the links below. + - [`dapr annotate`]({{< ref dapr-annotate.md >}}) - [`dapr build-info`]({{< ref dapr-build-info.md >}}) - [`dapr completion`]({{< ref dapr-completion.md >}}) - [`dapr components`]({{< ref dapr-components.md >}}) diff --git a/daprdocs/content/en/reference/cli/dapr-annotate.md b/daprdocs/content/en/reference/cli/dapr-annotate.md new file mode 100644 index 00000000000..f10861beacd --- /dev/null +++ b/daprdocs/content/en/reference/cli/dapr-annotate.md @@ -0,0 +1,84 @@ +--- +type: docs +title: "annotate CLI command reference" +linkTitle: "annotate" +description: "Add dapr annotatations to a Kubernetes configuration" +--- + +{{% alert title="Warning" color="warning" %}} +This command is in preview. The functionality might change in the future till the command is made stable. +{{% /alert %}} + +### Description + +Add dapr annotations to a Kubernetes configuration. + +### Supported platforms + +- [Kubernetes]({{< ref kubernetes >}}) + +### Usage + +```bash +dapr annotate [flags] CONFIG-FILE +``` + +### Flags + +| Name | Environment Variable | Default | Description +| --- | --- | --- | --- | +| `--api-token-secret` | | | The secret to use for the API token | +| `--app-id, -a` | | | The app id to annotate | +| `--app-max-concurrency` | | `-1` | The maximum number of concurrent requests to allow | +| `--app-port, -p` | | `-1` | The port to expose the app on | +| `--app-protocol` | | | The protocol to use for the app | +| `--app-ssl` | | `false` | Enable SSL for the app | +| `--app-token-secret` | | | The secret to use for the app token | +| `--config, -c` | | | The config file to annotate | +| `--cpu-limit` | | | The CPU limit to set for the sidecar. See valid values [here](https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/). | +| `--cpu-request` | | | The CPU request to set for the sidecar. See valid values [here](https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/). | +| `--dapr-image` | | | The image to use for the dapr sidecar container | +| `--enable-debug` | | `false` | Enable debug | +| `--enable-metrics` | | `false` | Enable metrics | +| `--enable-profile` | | `false` | Enable profiling | +| `--env` | | | Environment variables to set (key value pairs, comma separated) | +| `--graceful-shutdown-seconds` | | `-1` | The number of seconds to wait for the app to shutdown | +| `--help, -h` | | | help for annotate | +| `--http-stream-request-body` | | `false` | Enable streaming request body for HTTP | +| `--listen-addresses` | | | The 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` | | `-1` | The delay for sidecar to use for the liveness probe. Read more [here](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes). | +| `--liveness-probe-period` | | `-1` | The period used by the sidecar for the liveness probe. Read more [here](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes). | +| `--liveness-probe-threshold` | | `-1` | The threshold used by the sidecar for the liveness probe. Read more [here](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes). | +| `--liveness-probe-timeout` | | `-1` | The timeout used by the sidecar for the liveness probe. Read more [here](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes). | +| `--log-level` | | | The log level to use | +| `--max-request-body-size` | | `-1` | The maximum request body size to use | +| `--memory-limit` | | | The memory limit to set for the sidecar. See valid values [here](https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/) | +| `--memory-request`| | | The memory request to set for the sidecar | +| `--metrics-port` | | `-1` | The port to expose the metrics on | +| `--namespace, -n` | | | The namespace the resource target is in (can only be set if `--resource` is also set) | +| `--readiness-probe-delay` | | `-1` | The delay to use for the readiness probe in the sidecar. Read more [here](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes).| +| `--readiness-probe-period` | | `-1` | The period to use for the readiness probe in the sidecar. Read more [here](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes). | +| `--readiness-probe-threshold` | | `-1` | The threshold to use for the readiness probe in the sidecar. Read more [here](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes). | +| `--readiness-probe-timeout` | | `-1` | The timeout to use for the readiness probe in the sidecar. Read more [here](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes). | +| `--resource, -r` | | | The resource to target to annotate | + +{{% alert title="Warning" color="warning" %}} +If an application ID is not provided using `--app-id, -a`, we will generate one using the format `--`. +{{% /alert %}} + +### Examples + +```bash +# Annotate the first deployment found in the input +kubectl get deploy -l app=node -o yaml | dapr annotate - | kubectl apply -f - + +# Annotate multiple deployments by name in a chain +kubectl get deploy -o yaml | dapr annotate -r nodeapp - | dapr annotate -r pythonapp - | kubectl apply -f - + +# Annotate deployment in a specific namespace from file or directory by name +dapr annotate -r nodeapp -n namespace mydeploy.yaml | kubectl apply -f - + +# Annotate deployment from url by name +dapr annotate -r nodeapp --log-level debug https://raw.githubusercontent.com/dapr/quickstarts/master/tutorials/hello-kubernetes/deploy/node.yaml | kubectl apply -f - +``` + From c8188407638ddfbbac8c9c90659f9bc88f1a8e11 Mon Sep 17 00:00:00 2001 From: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com> Date: Tue, 5 Jul 2022 22:45:19 +0530 Subject: [PATCH 2/3] fixed docs based on latest changes to CLI annotate command Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com> --- .../support/support-preview-features.md | 1 - .../content/en/reference/cli/dapr-annotate.md | 22 +++++++++++-------- .../en/reference/cli/dapr-build-info.md | 4 ++-- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/daprdocs/content/en/operations/support/support-preview-features.md b/daprdocs/content/en/operations/support/support-preview-features.md index ca2cbff455c..a2b3635e3e3 100644 --- a/daprdocs/content/en/operations/support/support-preview-features.md +++ b/daprdocs/content/en/operations/support/support-preview-features.md @@ -15,7 +15,6 @@ For CLI there is no explicit opt-in, just the version that this was first made a ## Current preview features | Feature | Description | Setting | Documentation | Version introduced | | ---------- |-------------|---------|---------------|-----------------| -| **dapr annotate** command in Dapr CLI | Add Dapr annotations to Kubernetes configuration files. | N/A | [CLI annotate command reference]({{}}) | v1.8 | | **--image-registry** flag in Dapr CLI| In self hosted mode you can set this flag to specify any private registry to pull the container images required to install Dapr| N/A | [CLI init command reference]({{}}) | v1.7 | | **Resiliency** | Allows configuring of fine-grained policies for retries, timeouts and circuitbreaking. | `Resiliency` | [Configure Resiliency Policies]({{}}) | v1.7| | **Service invocation without default `content-type`** | When enabled removes the default service invocation content-type header value `application/json` when no content-type is provided. This will become the default behavior in release v1.9.0. This requires you to explictly set content-type headers where required for your apps. | `ServiceInvocation.NoDefaultContentType` | [Service Invocation]({{}}) | v1.7 | diff --git a/daprdocs/content/en/reference/cli/dapr-annotate.md b/daprdocs/content/en/reference/cli/dapr-annotate.md index f10861beacd..347cf7f1ad2 100644 --- a/daprdocs/content/en/reference/cli/dapr-annotate.md +++ b/daprdocs/content/en/reference/cli/dapr-annotate.md @@ -5,10 +5,6 @@ linkTitle: "annotate" description: "Add dapr annotatations to a Kubernetes configuration" --- -{{% alert title="Warning" color="warning" %}} -This command is in preview. The functionality might change in the future till the command is made stable. -{{% /alert %}} - ### Description Add dapr annotations to a Kubernetes configuration. @@ -27,6 +23,7 @@ dapr annotate [flags] CONFIG-FILE | Name | Environment Variable | Default | Description | --- | --- | --- | --- | +| `--kubernetes, -k` | | | Apply annotations to Kubernetes resources. Required | | `--api-token-secret` | | | The secret to use for the API token | | `--app-id, -a` | | | The app id to annotate | | `--app-max-concurrency` | | `-1` | The maximum number of concurrent requests to allow | @@ -52,6 +49,7 @@ dapr annotate [flags] CONFIG-FILE | `--liveness-probe-timeout` | | `-1` | The timeout used by the sidecar for the liveness probe. Read more [here](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes). | | `--log-level` | | | The log level to use | | `--max-request-body-size` | | `-1` | The maximum request body size to use | +| `--http-read-buffer-size` | | `-1` | The maximum size of HTTP header read buffer in kilobytes | | `--memory-limit` | | | The memory limit to set for the sidecar. See valid values [here](https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/) | | `--memory-request`| | | The memory request to set for the sidecar | | `--metrics-port` | | `-1` | The port to expose the metrics on | @@ -61,24 +59,30 @@ dapr annotate [flags] CONFIG-FILE | `--readiness-probe-threshold` | | `-1` | The threshold to use for the readiness probe in the sidecar. Read more [here](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes). | | `--readiness-probe-timeout` | | `-1` | The timeout to use for the readiness probe in the sidecar. Read more [here](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes). | | `--resource, -r` | | | The resource to target to annotate | +| `--enable-api-logging` | | | Enable API logging for the Dapr sidecar | +| `--unix-domain-socket-path` | | | Linux domain socket path to use for communicating with the Dapr sidecar | +| `--volume-mounts` | | | List of pod volumes to be mounted to the sidecar container in read-only mode | +| `--volume-mounts-rw` | | | List of pod volumes to be mounted to the sidecar container in read-write mode | +| `--disable-builtin-k8s-secret-store` | | | Disable the built-in Kubernetes secret store | +| `--placement-host-address` | | | Comma separated list of addresses for Dapr actor placement servers | {{% alert title="Warning" color="warning" %}} -If an application ID is not provided using `--app-id, -a`, we will generate one using the format `--`. +If an application ID is not provided using `--app-id, -a`, an ID is generated using the format `--`. {{% /alert %}} ### Examples ```bash # Annotate the first deployment found in the input -kubectl get deploy -l app=node -o yaml | dapr annotate - | kubectl apply -f - +kubectl get deploy -l app=node -o yaml | dapr annotate -k - | kubectl apply -f - # Annotate multiple deployments by name in a chain -kubectl get deploy -o yaml | dapr annotate -r nodeapp - | dapr annotate -r pythonapp - | kubectl apply -f - +kubectl get deploy -o yaml | dapr annotate -k -r nodeapp - | dapr annotate -k -r pythonapp - | kubectl apply -f - # Annotate deployment in a specific namespace from file or directory by name -dapr annotate -r nodeapp -n namespace mydeploy.yaml | kubectl apply -f - +dapr annotate -k -r nodeapp -n namespace mydeploy.yaml | kubectl apply -f - # Annotate deployment from url by name -dapr annotate -r nodeapp --log-level debug https://raw.githubusercontent.com/dapr/quickstarts/master/tutorials/hello-kubernetes/deploy/node.yaml | kubectl apply -f - +dapr annotate -k -r nodeapp --log-level debug https://raw.githubusercontent.com/dapr/quickstarts/master/tutorials/hello-kubernetes/deploy/node.yaml | kubectl apply -f - ``` diff --git a/daprdocs/content/en/reference/cli/dapr-build-info.md b/daprdocs/content/en/reference/cli/dapr-build-info.md index 54c827e3341..7423033794d 100644 --- a/daprdocs/content/en/reference/cli/dapr-build-info.md +++ b/daprdocs/content/en/reference/cli/dapr-build-info.md @@ -2,12 +2,12 @@ type: docs title: "build-info CLI command reference" linkTitle: "build-info" -description: "Detailed build information on dapr-cli and daprd executables" +description: "Detailed build information on dapr CLI and daprd executables" --- ### Description -Get the version and git commit data for `dapr-cli` and `daprd` executables. +Get the version and git commit data for `dapr` and `daprd` executables. ### Supported platforms From b219617a0a7a1d1aae74874cc8a96407b5025ae3 Mon Sep 17 00:00:00 2001 From: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com> Date: Wed, 6 Jul 2022 10:27:27 +0530 Subject: [PATCH 3/3] address review comments Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com> --- daprdocs/content/en/reference/cli/dapr-annotate.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daprdocs/content/en/reference/cli/dapr-annotate.md b/daprdocs/content/en/reference/cli/dapr-annotate.md index 347cf7f1ad2..d09463f3b93 100644 --- a/daprdocs/content/en/reference/cli/dapr-annotate.md +++ b/daprdocs/content/en/reference/cli/dapr-annotate.md @@ -2,12 +2,12 @@ type: docs title: "annotate CLI command reference" linkTitle: "annotate" -description: "Add dapr annotatations to a Kubernetes configuration" +description: "Add Dapr annotatations to a Kubernetes configuration" --- ### Description -Add dapr annotations to a Kubernetes configuration. +Add Dapr annotations to a Kubernetes configuration. This enables you to add/change the Dapr annotations on a deployment files. See [Kubernetes annotations]({{< ref arguments-annotations-overview >}}) for a full description of each annotation available in the following list of flags. ### Supported platforms @@ -58,7 +58,7 @@ dapr annotate [flags] CONFIG-FILE | `--readiness-probe-period` | | `-1` | The period to use for the readiness probe in the sidecar. Read more [here](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes). | | `--readiness-probe-threshold` | | `-1` | The threshold to use for the readiness probe in the sidecar. Read more [here](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes). | | `--readiness-probe-timeout` | | `-1` | The timeout to use for the readiness probe in the sidecar. Read more [here](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes). | -| `--resource, -r` | | | The resource to target to annotate | +| `--resource, -r` | | | The Kubernetes resource target to annotate | | `--enable-api-logging` | | | Enable API logging for the Dapr sidecar | | `--unix-domain-socket-path` | | | Linux domain socket path to use for communicating with the Dapr sidecar | | `--volume-mounts` | | | List of pod volumes to be mounted to the sidecar container in read-only mode |