From ea5b1918778a47555dbdccff0ed6c5b987ed10cf Mon Sep 17 00:00:00 2001 From: Yaron Schneider Date: Tue, 14 Apr 2020 14:57:35 -0700 Subject: [PATCH] Add kubernetes configuration how-to (#521) * Add kubernetes configuration how-to * mark comment :) * update * update index --- getting-started/environment-setup.md | 4 ++++ howto/README.md | 13 +++++++------ howto/configure-k8s/README.md | 23 +++++++++++++++++++++++ 3 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 howto/configure-k8s/README.md diff --git a/getting-started/environment-setup.md b/getting-started/environment-setup.md index d328f091f..f6010501d 100644 --- a/getting-started/environment-setup.md +++ b/getting-started/environment-setup.md @@ -205,6 +205,10 @@ dapr-sidecar-injector-8555576b6f-29cqm 1/1 Running 0 40s dapr-sentry-9435776c7f-8f7yd 1/1 Running 0 40s ``` +#### Sidecar annotations + +To see all the supported annotations for the Dapr sidecar on Kubernetes, visit [this](../howto/configure-k8s/README.md) how to guide. + #### Uninstall Dapr on Kubernetes Helm 3 diff --git a/howto/README.md b/howto/README.md index ec5b7c46d..d53403fff 100644 --- a/howto/README.md +++ b/howto/README.md @@ -11,8 +11,8 @@ Here you'll find a list of How To guides that walk you through accomplishing spe - [Observerability](#observerability) - [Security](#security) - [Components](#components) +- [Hosting Platforms](#hosting-platforms) - [Developer tooling](#developer-tooling) -- [Infrastructure integration](#Infrastructure-integration) ## Service invocation @@ -32,7 +32,6 @@ Here you'll find a list of How To guides that walk you through accomplishing spe * [Control your app's throttling using rate limiting features](./control-concurrency) * [Configuring Redis for state management ](./configure-redis) - ## Pub/Sub * [Setup Dapr Pub/Sub](./setup-pub-sub-message-broker) @@ -77,6 +76,12 @@ For Actors How Tos see the SDK documentation * [Limit components for one or more applications using scopes](./components-scopes) +## Hosting Platforms +### Kubernetes Configuration + +* [Sidecar configuration on Kubernetes](./configure-k8s) +* [Autoscale on Kubernetes using KEDA and Dapr bindings](./autoscale-with-keda) + ## Developer tooling ### Using Visual Studio Code @@ -92,7 +97,3 @@ For Actors How Tos see the SDK documentation ### SDKs * [Serialization in Dapr's SDKs](./serialize) - -## Infrastructure integration - -* [Autoscale on Kubernetes using KEDA and Dapr bindings](./autoscale-with-keda) diff --git a/howto/configure-k8s/README.md b/howto/configure-k8s/README.md new file mode 100644 index 000000000..aef654d6f --- /dev/null +++ b/howto/configure-k8s/README.md @@ -0,0 +1,23 @@ +# Configuring the Dapr sidecar on Kubernetes + +On Kubernetes, Dapr uses a sidecar injector pod that automatically injects the Dapr sidecar container into a pod that has the correct annotations. +The sidecar injector is an implementation of a Kubernetes [Admission Controller](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/). + +The following table shows all the supported pod Spec annotations supported by Dapr. + +| Annotation | Description +| ----------------------------------- | -------------- | +| `dapr.io/enabled` | Setting this paramater to `true` injects the Dapr sidecar into the pod +| `dapr.io/port` | This parameter tells Dapr which port your application is listening on +| `dapr.io/id` | The unique ID of the application. Used for service discovery, state encapsulation and the pub/sub consumer ID +| `dapr.io/log-level` | Sets the log level for the Dapr sidecar. Allowed values are `debug`, `info`, `warn`, `error`. Default is `info` +| `dapr.io/config` | Tells Dapr which Configuration CRD to use +| `dapr.io/log-as-json` | Setting this parameter to `true` outputs logs in JSON format. Default is `false` +| `dapr.io/profiling` | Setting this paramater to `true` starts the Dapr profiling server on port `7777`. Default is `false` +| `dapr.io/protocol` | Tells Dapr which protocol your application is using. Valid options are `http` and `grpc`. Default is `http` +| `dapr.io/max-concurrency` | Limit the concurrency of your application. A valid value is any number larger than `0` +| `dapr.io/metrics-port` | Sets the port for the sidecar metrics server. Default is `9090` +| `dapr.io/sidecar-cpu-limit` | Maximum amount of CPU that the Dapr sidecar can use. See valid values [here](https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/). By default this is not set +| `dapr.io/sidecar-memory-limit` | Maximum amount of Memory that the Dapr sidecar can use. See valid values [here](https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/). By default this is not set +| `dapr.io/sidecar-cpu-request` | Amount of CPU that the Dapr sidecar requests. See valid values [here](https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/). By default this is not set +| `dapr.io/sidecar-memory-request` | Amount of Memory that the Dapr sidecar requests .See valid values [here](https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/). By default this is not set