mirror of https://github.com/dapr/docs.git
Merge branch 'v1.6' into v1.7
Signed-off-by: Mark Fussell <markfussell@gmail.com>
This commit is contained in:
commit
fb9f8520e6
|
|
@ -21,7 +21,7 @@ Today we are experiencing a wave of cloud adoption. Developers are comfortable w
|
|||
|
||||
This is where Dapr comes in. Dapr codifies the *best practices* for building microservice applications into open, independent APIs called building blocks, that enable you to build portable applications with the language and framework of your choice. Each building block is completely independent and you can use one, some, or all of them in your application.
|
||||
|
||||
Using Dapr you can incrementally migrate your existing applications to a microserivces architecture, thereby adopting cloud native patterns such scale out/in, resilency and independent deployments.
|
||||
Using Dapr you can incrementally migrate your existing applications to a microserivces architecture, thereby adopting cloud native patterns such scale out/in, resiliency and independent deployments.
|
||||
|
||||
In addition, Dapr is platform agnostic, meaning you can run your applications locally, on any Kubernetes cluster, on virtual or physical machines and in other hosting environments that Dapr integrates with. This enables you to build microservice applications that can run on the cloud and edge.
|
||||
|
||||
|
|
|
|||
|
|
@ -156,7 +156,42 @@ dapr run --app-id orderprocessing --components-path ./components python3 OrderPr
|
|||
|
||||
{{< /tabs >}}
|
||||
|
||||
### Watch configuration items
|
||||
### Get configuration items using gRPC API
|
||||
|
||||
Using your [favorite language](https://grpc.io/docs/languages/), create a Dapr gRPC client from the [Dapr proto](https://github.com/dapr/dapr/blob/master/dapr/proto/runtime/v1/dapr.proto). The following examples show Java, C#, Python and Javascript clients.
|
||||
|
||||
{{< tabs Java Dotnet Python Javascript >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```java
|
||||
|
||||
Dapr.ServiceBlockingStub stub = Dapr.newBlockingStub(channel);
|
||||
stub.GetConfigurationAlpha1(new GetConfigurationRequest{ StoreName = "redisconfigstore", Keys = new String[]{"myconfig"} });
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```csharp
|
||||
|
||||
var call = client.GetConfigurationAlpha1(new GetConfigurationRequest { StoreName = "redisconfigstore", Keys = new String[]{"myconfig"} });
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```python
|
||||
response = stub.GetConfigurationAlpha1(request={ StoreName: 'redisconfigstore', Keys = ['myconfig'] })
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```javascript
|
||||
client.GetConfigurationAlpha1({ StoreName: 'redisconfigstore', Keys = ['myconfig'] })
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
##### Watch configuration items
|
||||
|
||||
Create a Dapr gRPC client from the [Dapr proto](https://github.com/dapr/dapr/blob/master/dapr/proto/runtime/v1/dapr.proto) using your [preferred language](https://grpc.io/docs/languages/). Then use the proto method `SubscribeConfigurationAlpha1` on your client stub to start subscribing to events. The method accepts the following request object:
|
||||
|
||||
|
|
@ -177,7 +212,7 @@ message SubscribeConfigurationRequest {
|
|||
|
||||
Using this method, you can subscribe to changes in specific keys for a given configuration store. gRPC streaming varies widely based on language - see the [gRPC examples here](https://grpc.io/docs/languages/) for usage.
|
||||
|
||||
### Stop watching configuration items
|
||||
##### Stop watching configuration items
|
||||
|
||||
After you have subscribed to watch configuration items, the gRPC-server stream starts. This stream thread does not close itself, and you have to do by explicitly call the `UnSubscribeConfigurationRequest` API. This method accepts the following request object:
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ This is much more unusual. There may be occasions where you specifically chose t
|
|||
Theses are the specific trace context headers that are generated and propagated by Dapr for HTTP and gRPC.
|
||||
|
||||
### Trace context HTTP headers format
|
||||
When propogating a trace context header from an HTTP response to an HTTP request, these are the headers that you need to copy.
|
||||
When propagating a trace context header from an HTTP response to an HTTP request, these are the headers that you need to copy.
|
||||
|
||||
#### Traceparent Header
|
||||
The traceparent header represents the incoming request in a tracing system in a common format, understood by all vendors.
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ namespace EventService
|
|||
//Using Dapr SDK to save and get state
|
||||
await client.SaveStateAsync(DAPR_STORE_NAME, "order_1", orderId.ToString());
|
||||
await client.SaveStateAsync(DAPR_STORE_NAME, "order_2", orderId.ToString());
|
||||
var result = await client.GetStateAsync<string>(DAPR_STORE_NAME, orderId.ToString());
|
||||
var result = await client.GetStateAsync<string>(DAPR_STORE_NAME, "order_1");
|
||||
Console.WriteLine("Result after get: " + result);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,89 @@
|
|||
---
|
||||
type: docs
|
||||
title: "Dapr extension for Azure Kubernetes Service (AKS)"
|
||||
linkTitle: "Dapr extension for Azure Kubernetes Service (AKS)"
|
||||
description: "Provision Dapr on your Azure Kubernetes Service (AKS) cluster with the Dapr extension"
|
||||
weight: 4000
|
||||
---
|
||||
|
||||
# Prerequisites
|
||||
- [Azure subscription](https://azure.microsoft.com/free/?WT.mc_id=A261C142F)
|
||||
- [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli-windows?tabs=azure-cli) and the ***aks-preview*** extension.
|
||||
- [Azure Kubernetes Service (AKS) cluster](https://docs.microsoft.com/azure/aks/tutorial-kubernetes-deploy-cluster?tabs=azure-cli)
|
||||
|
||||
## Install Dapr using the AKS Dapr extension
|
||||
The recommended approach for installing Dapr on AKS is to use the AKS Dapr extension. The extension offers support for all native Dapr configuration capabilities through command-line arguments via the Azure CLI and offers the option of opting into automatic minor version upgrades of the Dapr runtime.
|
||||
|
||||
{{% alert title="Note" color="warning" %}}
|
||||
If you install Dapr through the AKS extension, our recommendation is to continue using the extension for future management of Dapr instead of the Dapr CLI. Combining the two tools can cause conflicts and result in undesired behavior.
|
||||
{{% /alert %}}
|
||||
|
||||
### How the extension works
|
||||
The Dapr extension works by provisioning the Dapr control plane on your AKS cluster through the Azure CLI. The dapr control plane consists of:
|
||||
|
||||
- **dapr-operator**: Manages component updates and Kubernetes services endpoints for Dapr (state stores, pub/subs, etc.)
|
||||
- **dapr-sidecar-injector**: Injects Dapr into annotated deployment pods and adds the environment variables `DAPR_HTTP_PORT` and `DAPR_GRPC_PORT`. This enables user-defined applications to communicate with Dapr without the need to hard-code Dapr port values.
|
||||
- **dapr-placement**: Used for actors only. Creates mapping tables that map actor instances to pods
|
||||
- **dapr-sentry**: Manages mTLS between services and acts as a certificate authority. For more information read the security overview.
|
||||
|
||||
### Extension Prerequisites
|
||||
In order to use the AKS Dapr extension, you must first enable the `AKS-ExtensionManager` and `AKS-Dapr` feature flags on your Azure subscription.
|
||||
|
||||
The below command will register the `AKS-ExtensionManager` and `AKS-Dapr` feature flags on your Azure subscription:
|
||||
|
||||
```bash
|
||||
az feature register --namespace "Microsoft.ContainerService" --name "AKS-ExtensionManager"
|
||||
az feature register --namespace "Microsoft.ContainerService" --name "AKS-Dapr"
|
||||
```
|
||||
|
||||
After a few minutes, check the status to show `Registered`. Confirm the registration status by using the az feature list command:
|
||||
|
||||
```bash
|
||||
az feature list -o table --query "[?contains(name, 'Microsoft.ContainerService/AKS-ExtensionManager')].{Name:name,State:properties.state}"
|
||||
az feature list -o table --query "[?contains(name, 'Microsoft.ContainerService/AKS-Dapr')].{Name:name,State:properties.state}"
|
||||
```
|
||||
|
||||
Next, refresh the registration of the `Microsoft.KubernetesConfiguration` and `Microsoft.ContainerService` resource providers by using the az provider register command:
|
||||
|
||||
```bash
|
||||
az provider register --namespace Microsoft.KubernetesConfiguration
|
||||
az provider register --namespace Microsoft.ContainerService
|
||||
```
|
||||
|
||||
#### Enable the Azure CLI extension for cluster extensions
|
||||
You will also need the `k8s-extension` Azure CLI extension. Install this by running the following commands:
|
||||
|
||||
```bash
|
||||
az extension add --name k8s-extension
|
||||
```
|
||||
|
||||
If the `k8s-extension` extension is already present, you can update it to the latest version using the below command:
|
||||
|
||||
```bash
|
||||
az extension update --name k8s-extension
|
||||
```
|
||||
|
||||
#### Create the extension and install Dapr on your AKS cluster
|
||||
After your subscription is registered to use Kubernetes extensions, install Dapr on your cluster by creating the Dapr extension. For example:
|
||||
|
||||
```bash
|
||||
az k8s-extension create --cluster-type managedClusters \
|
||||
--cluster-name myAKSCluster \
|
||||
--resource-group myResourceGroup \
|
||||
--name myDaprExtension \
|
||||
--extension-type Microsoft.Dapr
|
||||
```
|
||||
|
||||
Additionally, Dapr can automatically update its minor version. To enable this, set the `--auto-upgrade-minor-version` parameter to true:
|
||||
|
||||
```bash
|
||||
--auto-upgrade-minor-version true
|
||||
```
|
||||
|
||||
Once the k8-extension finishes provisioning, you can confirm that the Dapr control plane is installed on your AKS cluster by running:
|
||||
|
||||
```bash
|
||||
kubectl get pods -n dapr-system
|
||||
```
|
||||
|
||||
For further information such as configuration options and targeting specific versions of Dapr, please see the official [AKS Dapr Extension Docs](https://docs.microsoft.com/azure/aks/dapr).
|
||||
|
|
@ -36,7 +36,7 @@ The Dapr SDKs are the easiest way for you to get Dapr into your application. Cho
|
|||
| [Java]({{< ref java >}}) | Stable | ✔ | Spring Boot | ✔ |
|
||||
| [Go]({{< ref go >}}) | Stable | ✔ | ✔ | ✔ |
|
||||
| [PHP]({{< ref php >}}) | Stable | ✔ | ✔ | ✔ |
|
||||
| [Javascript](https://github.com/dapr/js-sdk) | Stable| ✔ | | ✔ |
|
||||
| [Javascript]({{< ref js >}}) | Stable| ✔ | | ✔ |
|
||||
| [C++](https://github.com/dapr/cpp-sdk) | In development | ✔ | |
|
||||
| [Rust](https://github.com/dapr/rust-sdk) | In development | ✔ | | |
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
type: docs
|
||||
title: "Kubernetes cluster setup"
|
||||
linkTitle: "How-to: Setup clusters"
|
||||
weight: 80000
|
||||
weight: 15000
|
||||
description: >
|
||||
How to create a Kubernetes cluster
|
||||
---
|
||||
|
|
@ -22,9 +22,10 @@ For more information on what is deployed to your Kubernetes cluster read the [Ku
|
|||
|
||||
You can install Dapr on any Kubernetes cluster. Here are some helpful links:
|
||||
|
||||
- [Setup KiNd Cluster]({{< ref setup-kind.md >}})
|
||||
- [Setup Minikube Cluster]({{< ref setup-minikube.md >}})
|
||||
- [Setup Azure Kubernetes Service Cluster]({{< ref setup-aks.md >}})
|
||||
- [Setup Google Cloud Kubernetes Engine](https://cloud.google.com/kubernetes-engine/docs/quickstart)
|
||||
- [Setup Google Cloud Kubernetes Engine](https://docs.dapr.io/operations/hosting/kubernetes/cluster/setup-gke/)
|
||||
- [Setup Amazon Elastic Kubernetes Service](https://docs.aws.amazon.com/eks/latest/userguide/getting-started.html)
|
||||
|
||||
{{% alert title="Hybrid clusters" color="primary" %}}
|
||||
|
|
|
|||
|
|
@ -82,8 +82,8 @@ spec:
|
|||
```
|
||||
|
||||
#### Production
|
||||
Jaeger uses Elasticsearch as the backend storage, and you can create a secret in k8s cluster to access Elasticsearch server with access control.
|
||||
|
||||
Jaeger uses Elasticsearch as the backend storage, and you can create a secret in k8s cluster to access Elasticsearch server with access control. See [Configuring and Deploying Jaeger](https://docs.openshift.com/container-platform/4.9/distr_tracing/distr_tracing_install/distr-tracing-deploying-otel.html)
|
||||
|
||||
```shell
|
||||
kubectl create secret generic jaeger-secret --from-literal=ES_PASSWORD='xxx' --from-literal=ES_USERNAME='xxx' -n ${NAMESPACE}
|
||||
|
|
|
|||
|
|
@ -91,6 +91,10 @@ kubectl logs --selector=app=dapr-sentry --namespace <DAPR_NAMESPACE>
|
|||
|
||||
Using Helm, you can provide the PEM encoded root cert, issuer cert and private key that will be populated into the Kubernetes secret used by the Sentry service.
|
||||
|
||||
{{% alert title="Avoiding downtime" color="warning" %}}
|
||||
To avoid downtime when rotating expiring certificates always sign your certificates with the same private root key.
|
||||
{{% /alert %}}
|
||||
|
||||
_Note: This example uses the OpenSSL command line tool, this is a widely distributed package, easily installed on Linux via the package manager. On Windows OpenSSL can be installed [using chocolatey](https://community.chocolatey.org/packages/openssl). On MacOS it can be installed using brew `brew install openssl`_
|
||||
|
||||
Create config files for generating the certificates, this is necessary for generating v3 certificates with the SAN (Subject Alt Name) extension fields. First save the following to a file named `root.conf`:
|
||||
|
|
@ -125,6 +129,7 @@ basicConstraints = critical, CA:true, pathlen:0
|
|||
Run the following to generate the root cert and key
|
||||
|
||||
```bash
|
||||
# skip the following line to reuse an existing root key, required for rotating expiring certificates
|
||||
openssl ecparam -genkey -name prime256v1 | openssl ec -out root.key
|
||||
openssl req -new -nodes -sha256 -key root.key -out root.csr -config root.conf -extensions v3_req
|
||||
openssl x509 -req -sha256 -days 365 -in root.csr -signkey root.key -outform PEM -out root.pem -extfile root.conf -extensions v3_req
|
||||
|
|
@ -133,6 +138,7 @@ openssl x509 -req -sha256 -days 365 -in root.csr -signkey root.key -outform PEM
|
|||
Next run the following to generate the issuer cert and key:
|
||||
|
||||
```bash
|
||||
# skip the following line to reuse an existing issuer key, required for rotating expiring certificates
|
||||
openssl ecparam -genkey -name prime256v1 | openssl ec -out issuer.key
|
||||
openssl req -new -sha256 -key issuer.key -out issuer.csr -config issuer.conf -extensions v3_req
|
||||
openssl x509 -req -in issuer.csr -CA root.pem -CAkey root.key -CAcreateserial -outform PEM -out issuer.pem -days 365 -sha256 -extfile issuer.conf -extensions v3_req
|
||||
|
|
@ -156,24 +162,50 @@ helm install \
|
|||
|
||||
If the Root or Issuer certs are about to expire, you can update them and restart the required system services.
|
||||
|
||||
{{% alert title="Avoiding downtime when rotating certificates" color="warning" %}}
|
||||
To avoid downtime when rotating expiring certificates your new certificates must be signed with the same private root key as the previous certificates.
|
||||
{{% /alert %}}
|
||||
|
||||
First, issue new certificates using the step above in [Bringing your own certificates](#bringing-your-own-certificates).
|
||||
|
||||
Now that you have the new certificates, you can update the Kubernetes secret that holds them.
|
||||
Edit the Kubernetes secret:
|
||||
Now that you have the new certificates, use Helm to upgrade the certificates:
|
||||
|
||||
```bash
|
||||
helm upgrade \
|
||||
--set-file dapr_sentry.tls.issuer.certPEM=issuer.pem \
|
||||
--set-file dapr_sentry.tls.issuer.keyPEM=issuer.key \
|
||||
--set-file dapr_sentry.tls.root.certPEM=root.pem \
|
||||
--namespace dapr-system \
|
||||
dapr \
|
||||
dapr/dapr
|
||||
```
|
||||
|
||||
Alternatively, you can update the Kubernetes secret that holds them:
|
||||
|
||||
```bash
|
||||
kubectl edit secret dapr-trust-bundle -n <DAPR_NAMESPACE>
|
||||
```
|
||||
|
||||
Replace the `ca.crt`, `issuer.crt` and `issuer.key` keys in the Kubernetes secret with their corresponding values from the new certificates.
|
||||
*__Note: The values must be base64 encoded__*
|
||||
|
||||
If you signed the new cert root with a different private key, restart all Dapr-enabled pods.
|
||||
If you signed the new cert root with the same private key the Dapr Sentry service will pick up the new certificates automatically. You can restart your application deployments using `kubectl rollout restart` with zero downtime. It is not necessary to restart all deployments at once, as long as deployments are restarted before original certificate expiration.
|
||||
|
||||
If you signed the new cert root with a different private key, you must restart the Dapr sentry service.
|
||||
|
||||
```bash
|
||||
kubectl rollout restart deploy/dapr-sentry -n <DAPR_NAMESPACE>
|
||||
```
|
||||
|
||||
Next, you must restart all Dapr-enabled pods.
|
||||
The recommended way to do this is to perform a rollout restart of your deployment:
|
||||
|
||||
```
|
||||
kubectl rollout restart deploy/myapp
|
||||
```
|
||||
|
||||
You will experience potential downtime due to mismatching certificates until all deployments have successfully been restarted (and hence loaded the new Dapr certificates).
|
||||
|
||||
### Kubernetes video demo
|
||||
Watch this video to show how to update mTLS certificates on Kubernetes
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@ The table below shows the versions of Dapr releases that have been tested togeth
|
|||
| Dev 6th 2021 | 1.4.4</br> | 1.4.0 | Java 1.3.0 </br>Go 1.2.0 </br>PHP 1.1.0 </br>Python 1.3.0 </br>.NET 1.4.0 | 0.8.0 | Unsupported |
|
||||
| Nov 11th 2021 | 1.5.0</br> | 1.5.0 | Java 1.3.0 </br>Go 1.3.0 </br>PHP 1.1.0 </br>Python 1.4.0 </br>.NET 1.5.0 </br>JS 1.0.2 | 0.9.0 | Supported |
|
||||
| Dec 6th 2021 | 1.5.1</br> | 1.5.1 | Java 1.3.0 </br>Go 1.3.0 </br>PHP 1.1.0 </br>Python 1.4.0 </br>.NET 1.5.0 </br>JS 1.0.2 | 0.9.0 | Supported |
|
||||
| Jan 25th 2022 | 1.6.0</br> | 1.6.0 | Java 1.4.0 </br>Go 1.4.0 </br>PHP 1.1.0 </br>Python 1.5.0 </br>.NET 1.6.0 </br>JS 2.0.0 | 0.9.0 | Supported (current) |
|
||||
| Jan 25th 2022 | 1.6.0</br> | 1.6.0 | Java 1.4.0 </br>Go 1.3.1 </br>PHP 1.1.0 </br>Python 1.5.0 </br>.NET 1.6.0 </br>JS 2.0.0 | 0.9.0 | Supported (current) |
|
||||
|
||||
|
||||
## Upgrade paths
|
||||
After the 1.0 release of the runtime there may be situations where it is necessary to explicitly upgrade through an additional release to reach the desired target. For example an upgrade from v1.0 to v1.2 may need go pass through v1.1
|
||||
|
|
|
|||
|
|
@ -549,7 +549,7 @@ curl -X POST http://localhost:3000/actors/stormtrooper/50/method/performAction \
|
|||
|
||||
### Invoke reminder
|
||||
|
||||
Invokes a reminder for an actor with the specified reminderName. If the actor is not already running, the app side should [activate](#activating-an-actor) it.
|
||||
Invokes a reminder for an actor with the specified reminderName. If the actor is not already running, the app side should [activate](#activating-an-actor) it.
|
||||
|
||||
#### HTTP Request
|
||||
|
||||
|
|
@ -587,7 +587,7 @@ curl -X POST http://localhost:3000/actors/stormtrooper/50/method/remind/checkReb
|
|||
|
||||
### Invoke timer
|
||||
|
||||
Invokes a timer for an actor rwith the specified timerName. If the actor is not already running, the app side should [activate](#activating-an-actor) it.
|
||||
Invokes a timer for an actor with the specified timerName. If the actor is not already running, the app side should [activate](#activating-an-actor) it.
|
||||
|
||||
#### HTTP Request
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ The `Content-Type` header tells Dapr which content type your data adheres to whe
|
|||
The value of the `Content-Type` header populates the `datacontenttype` field in the CloudEvent.
|
||||
Unless specified, Dapr assumes `text/plain`. If your content type is JSON, use a `Content-Type` header with the value of `application/json`.
|
||||
|
||||
If you want to send your own custom CloundEvent, use the `application/cloudevents+json` value for the `Content-Type` header.
|
||||
If you want to send your own custom CloudEvent, use the `application/cloudevents+json` value for the `Content-Type` header.
|
||||
|
||||
#### Metadata
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 1e23f32eafdebe571db6e19717cf5317f09a5402
|
||||
Subproject commit 18a72819a6b620e889ae4b5beecba100ee65ee34
|
||||
Loading…
Reference in New Issue