Skip to content

Commit

Permalink
add README.md seciton
Browse files Browse the repository at this point in the history
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
  • Loading branch information
jjcollinge committed Jun 2, 2022
1 parent 8ea53f6 commit 9d71021
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,40 @@ The default is `false`.

For more details, please run the command and check the examples to apply to your shell.

### Annotate a Kubernetes manifest

To add or modify dapr annotations on an existing Kubernetes manifest, use the `dapr annotate` command:

```bash
dapr annotate [flags] mydeployment.yaml
```

This will add the `dapr.io/enabled` and the `dapr.io/app-id` annotations. The dapr app id will be genereated using the format `<namespace>-<kind>-<name>` where the values are taken from the existing Kubernetes object metadata.

To provide your own dapr app id, provide the flag `--app-id`.

All dapr annotations are available to set if a value is provided for the appropriate flag on the `dapr annotate` command.

You can also provide the Kubernetes manifest via stdin:

```bash
kubectl get deploy mydeploy -o yaml | dapr annotate - | kubectl apply -f -
```

Or you can provide the Kubernetes manifest via a URL:

```bash
dapr annotate --log-level debug https://raw.githubusercontent.com/dapr/quickstarts/master/tutorials/hello-kubernetes/deploy/node.yaml | kubectl apply -f -
```

If the input contains multiple manifests then the command will search for the first appropriate one to apply the annotations. If you'd rather it applied to a specific manifest then you can provide the `--resource` flag with the value set to the name of the object you'd like to apply the annotations to. If you have a conflict between namespaces you can also provide the namespace via the `--namespace` flag to isolate the manifest you wish to target.

If you want to annotate multiple manifests, you can chain together the `dapr annotate` commands with each applying the annotation to a specific manifest.

```bash
kubectl get deploy -o yaml | dapr annotate -r nodeapp --log-level debug - | dapr annotate --log-level debug -r pythonapp - | kubectl apply -f -
```

## Reference for the Dapr CLI

See the [Reference Guide](https://docs.dapr.io/reference/cli/) for more information about individual Dapr commands.
Expand Down

0 comments on commit 9d71021

Please sign in to comment.