mirror of https://github.com/dapr/docs.git
namespace in all yaml samples
This commit is contained in:
parent
5d2fc0470e
commit
d08e5a829c
|
@ -9,7 +9,7 @@ First, check your Deployment or Pod YAML file, and check that you have the follo
|
||||||
|
|
||||||
Sample deployment:
|
Sample deployment:
|
||||||
|
|
||||||
<pre>
|
```yaml
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -36,7 +36,7 @@ spec:
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 3000
|
- containerPort: 3000
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
</pre>
|
```
|
||||||
|
|
||||||
If your pod spec template is annotated correctly and you still don't see the sidecar injected, make sure Dapr was deployed to the cluster before your deployment or pod were deployed.
|
If your pod spec template is annotated correctly and you still don't see the sidecar injected, make sure Dapr was deployed to the cluster before your deployment or pod were deployed.
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: oauth2
|
name: oauth2
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: middleware.http.oauth2
|
type: middleware.http.oauth2
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -68,6 +69,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Configuration
|
kind: Configuration
|
||||||
metadata:
|
metadata:
|
||||||
name: pipeline
|
name: pipeline
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
httpPipeline:
|
httpPipeline:
|
||||||
handlers:
|
handlers:
|
||||||
|
|
|
@ -29,6 +29,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: kafkaevent
|
name: kafkaevent
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: bindings.kafka
|
type: bindings.kafka
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -17,7 +17,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: statestore
|
name: statestore
|
||||||
namespace: production
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: state.redis
|
type: state.redis
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -65,7 +65,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: statestore
|
name: statestore
|
||||||
namespace: production
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: state.redis
|
type: state.redis
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -20,6 +20,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Configuration
|
kind: Configuration
|
||||||
metadata:
|
metadata:
|
||||||
name: default
|
name: default
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
mtls:
|
mtls:
|
||||||
enabled: "true"
|
enabled: "true"
|
||||||
|
@ -169,6 +170,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Configuration
|
kind: Configuration
|
||||||
metadata:
|
metadata:
|
||||||
name: default
|
name: default
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
mtls:
|
mtls:
|
||||||
enabled: "true"
|
enabled: "true"
|
||||||
|
@ -195,6 +197,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Configuration
|
kind: Configuration
|
||||||
metadata:
|
metadata:
|
||||||
name: default
|
name: default
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
mtls:
|
mtls:
|
||||||
enabled: "true"
|
enabled: "true"
|
||||||
|
|
|
@ -77,6 +77,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: statestore
|
name: statestore
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: state.redis
|
type: state.redis
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -95,6 +96,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: messagebus
|
name: messagebus
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: pubsub.redis
|
type: pubsub.redis
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -13,11 +13,12 @@ For this guide, we'll use Redis Streams, which is also installed by default on a
|
||||||
|
|
||||||
*Note: When running Dapr locally, a pub/sub component YAML will automatically be created if it doesn't exist in a directory called `components` in your current working directory.*
|
*Note: When running Dapr locally, a pub/sub component YAML will automatically be created if it doesn't exist in a directory called `components` in your current working directory.*
|
||||||
|
|
||||||
```yml
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: messagebus
|
name: messagebus
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: pubsub.redis
|
type: pubsub.redis
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -14,11 +14,12 @@ Using Dapr, there are no code changes needed to an app.
|
||||||
|
|
||||||
To set max-concurrency in Kubernetes, add the following annotation to your pod:
|
To set max-concurrency in Kubernetes, add the following annotation to your pod:
|
||||||
|
|
||||||
<pre>
|
```yaml
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: nodesubscriber
|
name: nodesubscriber
|
||||||
|
namespace: default
|
||||||
labels:
|
labels:
|
||||||
app: nodesubscriber
|
app: nodesubscriber
|
||||||
spec:
|
spec:
|
||||||
|
@ -36,7 +37,7 @@ spec:
|
||||||
dapr.io/port: "3000"
|
dapr.io/port: "3000"
|
||||||
<b>dapr.io/max-concurrency: "1"</b>
|
<b>dapr.io/max-concurrency: "1"</b>
|
||||||
...
|
...
|
||||||
</pre>
|
```
|
||||||
|
|
||||||
### Setting max-concurrency using the Dapr CLI
|
### Setting max-concurrency using the Dapr CLI
|
||||||
|
|
||||||
|
|
|
@ -16,11 +16,12 @@ To do that, the app simply needs to host a gRPC server and implement the [Dapr c
|
||||||
|
|
||||||
On Kubernetes, set the following annotations in your deployment YAML:
|
On Kubernetes, set the following annotations in your deployment YAML:
|
||||||
|
|
||||||
<pre>
|
```yaml
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: myapp
|
name: myapp
|
||||||
|
namespace: default
|
||||||
labels:
|
labels:
|
||||||
app: myapp
|
app: myapp
|
||||||
spec:
|
spec:
|
||||||
|
@ -38,7 +39,7 @@ spec:
|
||||||
<b>dapr.io/protocol: "grpc"
|
<b>dapr.io/protocol: "grpc"
|
||||||
dapr.io/port: "5005"</b>
|
dapr.io/port: "5005"</b>
|
||||||
...
|
...
|
||||||
</pre>
|
```
|
||||||
|
|
||||||
This tells Dapr to communicate with your app via gRPC over port `5005`.
|
This tells Dapr to communicate with your app via gRPC over port `5005`.
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: native
|
name: native
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: exporters.native
|
type: exporters.native
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -63,6 +64,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Configuration
|
kind: Configuration
|
||||||
metadata:
|
metadata:
|
||||||
name: tracing
|
name: tracing
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
tracing:
|
tracing:
|
||||||
samplingRate: "1"
|
samplingRate: "1"
|
||||||
|
@ -101,6 +103,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: native
|
name: native
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: exporters.native
|
type: exporters.native
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -117,6 +120,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Configuration
|
kind: Configuration
|
||||||
metadata:
|
metadata:
|
||||||
name: tracing
|
name: tracing
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
tracing:
|
tracing:
|
||||||
samplingRate: "1"
|
samplingRate: "1"
|
||||||
|
|
|
@ -3,6 +3,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Configuration
|
kind: Configuration
|
||||||
metadata:
|
metadata:
|
||||||
name: tracing
|
name: tracing
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
tracing:
|
tracing:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
@ -13,6 +14,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: native
|
name: native
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: exporters.native
|
type: exporters.native
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -2,6 +2,7 @@ kind: Service
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: dapr-localforwarder
|
name: dapr-localforwarder
|
||||||
|
namespace: default
|
||||||
labels:
|
labels:
|
||||||
app: dapr-localforwarder
|
app: dapr-localforwarder
|
||||||
spec:
|
spec:
|
||||||
|
@ -17,6 +18,7 @@ apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: dapr-localforwarder
|
name: dapr-localforwarder
|
||||||
|
namespace: default
|
||||||
labels:
|
labels:
|
||||||
app: dapr-localforwarder
|
app: dapr-localforwarder
|
||||||
spec:
|
spec:
|
||||||
|
|
|
@ -18,6 +18,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: zipkin
|
name: zipkin
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: exporters.zipkin
|
type: exporters.zipkin
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -34,6 +35,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Configuration
|
kind: Configuration
|
||||||
metadata:
|
metadata:
|
||||||
name: tracing
|
name: tracing
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
tracing:
|
tracing:
|
||||||
samplingRate: "1"
|
samplingRate: "1"
|
||||||
|
@ -82,6 +84,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: zipkin
|
name: zipkin
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: exporters.zipkin
|
type: exporters.zipkin
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -98,6 +101,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Configuration
|
kind: Configuration
|
||||||
metadata:
|
metadata:
|
||||||
name: tracing
|
name: tracing
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
tracing:
|
tracing:
|
||||||
samplingRate: "1"
|
samplingRate: "1"
|
||||||
|
|
|
@ -28,11 +28,12 @@ dapr run --app-id cart --app-port 5000 python app.py
|
||||||
|
|
||||||
In Kubernetes, set the `dapr.io/id` annotation on your pod:
|
In Kubernetes, set the `dapr.io/id` annotation on your pod:
|
||||||
|
|
||||||
<pre>
|
```yaml
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: python-app
|
name: python-app
|
||||||
|
namespace: default
|
||||||
labels:
|
labels:
|
||||||
app: python-app
|
app: python-app
|
||||||
spec:
|
spec:
|
||||||
|
@ -49,7 +50,7 @@ spec:
|
||||||
<b>dapr.io/id: "cart"</b>
|
<b>dapr.io/id: "cart"</b>
|
||||||
dapr.io/port: "5000"
|
dapr.io/port: "5000"
|
||||||
...
|
...
|
||||||
</pre>
|
```
|
||||||
|
|
||||||
## Invoke a service in code
|
## Invoke a service in code
|
||||||
|
|
||||||
|
|
|
@ -13,11 +13,12 @@ For this guide, we'll use Redis Streams, which is also installed by default on a
|
||||||
|
|
||||||
*Note: When running Dapr locally, a pub/sub component YAML will automatically be created if it doesn't exist in a directory called `components` in your current working directory.*
|
*Note: When running Dapr locally, a pub/sub component YAML will automatically be created if it doesn't exist in a directory called `components` in your current working directory.*
|
||||||
|
|
||||||
```yml
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: messagebus
|
name: messagebus
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: pubsub.redis
|
type: pubsub.redis
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -31,11 +31,12 @@ Install Redis (master and slave) on `namespace-a`, following [these instructions
|
||||||
|
|
||||||
Now, configure `deploy/redis.yaml`, paying attention to the hostname containing `namespace-a`.
|
Now, configure `deploy/redis.yaml`, paying attention to the hostname containing `namespace-a`.
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: messagebus
|
name: messagebus
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: pubsub.redis
|
type: pubsub.redis
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -28,6 +28,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: messagebus
|
name: messagebus
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: pubsub.redis
|
type: pubsub.redis
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -71,6 +72,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: messagebus
|
name: messagebus
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: pubsub.redis
|
type: pubsub.redis
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -94,6 +96,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: messagebus
|
name: messagebus
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: pubsub.redis
|
type: pubsub.redis
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -13,11 +13,12 @@ Create the following YAML file, named binding.yaml, and save this to the /compon
|
||||||
|
|
||||||
*Note: When running in Kubernetes, apply this file to your cluster using `kubectl apply -f binding.yaml`*
|
*Note: When running in Kubernetes, apply this file to your cluster using `kubectl apply -f binding.yaml`*
|
||||||
|
|
||||||
```yml
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: myEvent
|
name: myEvent
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: bindings.kafka
|
type: bindings.kafka
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -27,6 +27,7 @@ kind: ClusterRoleBinding
|
||||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||||
metadata:
|
metadata:
|
||||||
name: fluentd
|
name: fluentd
|
||||||
|
namespace: default
|
||||||
roleRef:
|
roleRef:
|
||||||
kind: ClusterRole
|
kind: ClusterRole
|
||||||
name: fluentd
|
name: fluentd
|
||||||
|
|
|
@ -74,6 +74,7 @@ apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: pythonapp
|
name: pythonapp
|
||||||
|
namespace: default
|
||||||
labels:
|
labels:
|
||||||
app: python
|
app: python
|
||||||
spec:
|
spec:
|
||||||
|
|
|
@ -115,6 +115,7 @@ apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: pythonapp
|
name: pythonapp
|
||||||
|
namespace: default
|
||||||
labels:
|
labels:
|
||||||
app: python
|
app: python
|
||||||
spec:
|
spec:
|
||||||
|
|
|
@ -7,11 +7,12 @@ Pub/Sub message buses are extensible and can be found in the [components-contrib
|
||||||
|
|
||||||
A pub/sub in Dapr is described using a `Component` file:
|
A pub/sub in Dapr is described using a `Component` file:
|
||||||
|
|
||||||
```yml
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: messagebus
|
name: messagebus
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: pubsub.<NAME>
|
type: pubsub.<NAME>
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -8,11 +8,12 @@ The next step is to create a Dapr component for Azure Service Bus.
|
||||||
|
|
||||||
Create the following YAML file named `azuresb.yaml`:
|
Create the following YAML file named `azuresb.yaml`:
|
||||||
|
|
||||||
```yml
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <name>
|
||||||
|
namespace: <namespace>
|
||||||
spec:
|
spec:
|
||||||
type: pubsub.azure.servicebus
|
type: pubsub.azure.servicebus
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -8,11 +8,12 @@ The next step is to create a Dapr component for Google Cloud Pub/Sub
|
||||||
|
|
||||||
Create the following YAML file named `messagebus.yaml`:
|
Create the following YAML file named `messagebus.yaml`:
|
||||||
|
|
||||||
```yml
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <NAME>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: pubsub.gcp.pubsub
|
type: pubsub.gcp.pubsub
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -20,11 +20,12 @@ The next step is to create a Dapr component for Hazelcast.
|
||||||
|
|
||||||
Create the following YAML file named `hazelcast.yaml`:
|
Create the following YAML file named `hazelcast.yaml`:
|
||||||
|
|
||||||
```yml
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: pubsub.hazelcast
|
type: pubsub.hazelcast
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -31,11 +31,12 @@ The next step is to create a Dapr component for NATS.
|
||||||
|
|
||||||
Create the following YAML file named `nats.yaml`:
|
Create the following YAML file named `nats.yaml`:
|
||||||
|
|
||||||
```yml
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: pubsub.nats
|
type: pubsub.nats
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -33,11 +33,12 @@ The next step is to create a Dapr component for RabbitMQ.
|
||||||
|
|
||||||
Create the following YAML file named `rabbitmq.yaml`:
|
Create the following YAML file named `rabbitmq.yaml`:
|
||||||
|
|
||||||
```yml
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: pubsub.rabbitmq
|
type: pubsub.rabbitmq
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -60,6 +60,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: messagebus
|
name: messagebus
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: pubsub.redis
|
type: pubsub.redis
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -13,6 +13,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: awssecretmanager
|
name: awssecretmanager
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: secretstores.aws.secretmanager
|
type: secretstores.aws.secretmanager
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -44,6 +45,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: statestore
|
name: statestore
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: state.redis
|
type: state.redis
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -106,6 +106,7 @@ In Kubernetes mode, you store the certificate for the service principal into the
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: azurekeyvault
|
name: azurekeyvault
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: secretstores.azure.keyvault
|
type: secretstores.azure.keyvault
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -138,6 +139,7 @@ In Kubernetes mode, you store the certificate for the service principal into the
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: statestore
|
name: statestore
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: state.redis
|
type: state.redis
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -163,6 +165,7 @@ In Kubernetes mode, you store the certificate for the service principal into the
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
metadata:
|
metadata:
|
||||||
name: nodeapp
|
name: nodeapp
|
||||||
|
namespace: default
|
||||||
labels:
|
labels:
|
||||||
app: node
|
app: node
|
||||||
spec:
|
spec:
|
||||||
|
@ -179,6 +182,7 @@ In Kubernetes mode, you store the certificate for the service principal into the
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: nodeapp
|
name: nodeapp
|
||||||
|
namespace: default
|
||||||
labels:
|
labels:
|
||||||
app: node
|
app: node
|
||||||
spec:
|
spec:
|
||||||
|
|
|
@ -115,6 +115,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: azurekeyvault
|
name: azurekeyvault
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: secretstores.azure.keyvault
|
type: secretstores.azure.keyvault
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -143,6 +144,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: statestore
|
name: statestore
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: state.redis
|
type: state.redis
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -202,6 +204,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: azurekeyvault
|
name: azurekeyvault
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: secretstores.azure.keyvault
|
type: secretstores.azure.keyvault
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -241,6 +244,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: statestore
|
name: statestore
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: state.redis
|
type: state.redis
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -13,6 +13,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: gcpsecretmanager
|
name: gcpsecretmanager
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: secretstores.gcp.secretmanager
|
type: secretstores.gcp.secretmanager
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -56,6 +57,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: statestore
|
name: statestore
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: state.redis
|
type: state.redis
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -15,6 +15,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: vault
|
name: vault
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: secretstores.hashicorp.vault
|
type: secretstores.hashicorp.vault
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -53,6 +54,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: statestore
|
name: statestore
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: state.redis
|
type: state.redis
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -7,11 +7,12 @@ State stores are extensible and can be found in the [components-contrib repo](ht
|
||||||
|
|
||||||
A state store in Dapr is described using a `Component` file:
|
A state store in Dapr is described using a `Component` file:
|
||||||
|
|
||||||
```yml
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: statestore
|
name: statestore
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: state.<DATABASE>
|
type: state.<DATABASE>
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -32,11 +32,12 @@ The next step is to create a Dapr component for Aerospike.
|
||||||
|
|
||||||
Create the following YAML file named `aerospike.yaml`:
|
Create the following YAML file named `aerospike.yaml`:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: state.Aerospike
|
type: state.Aerospike
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -23,7 +23,8 @@ Create the following YAML file named `cosmos.yaml`:
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: state.azure.cosmosdb
|
type: state.azure.cosmosdb
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -41,11 +42,12 @@ The above example uses secrets as plain strings. It is recommended to use a secr
|
||||||
|
|
||||||
The following example uses the Kubernetes secret store to retrieve the secrets:
|
The following example uses the Kubernetes secret store to retrieve the secrets:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <store_name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: state.azure.cosmosdb
|
type: state.azure.cosmosdb
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -22,7 +22,8 @@ Create the following YAML file named `azuretable.yaml`:
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: state.azure.tablestorage
|
type: state.azure.tablestorage
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -38,11 +39,12 @@ The above example uses secrets as plain strings. It is recommended to use a secr
|
||||||
|
|
||||||
The following example uses the Kubernetes secret store to retrieve the secrets:
|
The following example uses the Kubernetes secret store to retrieve the secrets:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: state.azure.tablestorage
|
type: state.azure.tablestorage
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -36,7 +36,8 @@ Create the following YAML file named `cassandra.yaml`:
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: state.cassandra
|
type: state.cassandra
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -62,11 +63,12 @@ The above example uses secrets as plain strings. It is recommended to use a secr
|
||||||
|
|
||||||
The following example uses the Kubernetes secret store to retrieve the username and password:
|
The following example uses the Kubernetes secret store to retrieve the username and password:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: state.cassandra
|
type: state.cassandra
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -26,6 +26,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: cloudstate
|
name: cloudstate
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: state.cloudstate
|
type: state.cloudstate
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -61,6 +62,7 @@ kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
name: test-dapr-app
|
name: test-dapr-app
|
||||||
|
namespace: default
|
||||||
labels:
|
labels:
|
||||||
app: test-dapr-app
|
app: test-dapr-app
|
||||||
spec:
|
spec:
|
||||||
|
@ -125,6 +127,7 @@ apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: Role
|
kind: Role
|
||||||
metadata:
|
metadata:
|
||||||
name: cloudstate-pod-reader
|
name: cloudstate-pod-reader
|
||||||
|
namespace: default
|
||||||
rules:
|
rules:
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
- ""
|
- ""
|
||||||
|
@ -140,6 +143,7 @@ apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: RoleBinding
|
kind: RoleBinding
|
||||||
metadata:
|
metadata:
|
||||||
name: cloudstate-read-pods-default
|
name: cloudstate-read-pods-default
|
||||||
|
namespace: default
|
||||||
roleRef:
|
roleRef:
|
||||||
apiGroup: rbac.authorization.k8s.io
|
apiGroup: rbac.authorization.k8s.io
|
||||||
kind: Role
|
kind: Role
|
||||||
|
|
|
@ -35,7 +35,8 @@ Create the following YAML file named `consul.yaml`:
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: state.consul
|
type: state.consul
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -55,11 +56,12 @@ The above example uses secrets as plain strings. It is recommended to use a secr
|
||||||
|
|
||||||
The following example uses the Kubernetes secret store to retrieve the acl token:
|
The following example uses the Kubernetes secret store to retrieve the acl token:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: state.consul
|
type: state.consul
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -26,11 +26,12 @@ The next step is to create a Dapr component for Couchbase.
|
||||||
|
|
||||||
Create the following YAML file named `couchbase.yaml`:
|
Create the following YAML file named `couchbase.yaml`:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: state.couchbase
|
type: state.couchbase
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -32,11 +32,12 @@ The next step is to create a Dapr component for etcd.
|
||||||
|
|
||||||
Create the following YAML file named `etcd.yaml`:
|
Create the following YAML file named `etcd.yaml`:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: state.etcd
|
type: state.etcd
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -16,11 +16,12 @@ The next step is to create a Dapr component for Firestore.
|
||||||
|
|
||||||
Create the following YAML file named `firestore.yaml`:
|
Create the following YAML file named `firestore.yaml`:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: state.gcp.firestore
|
type: state.gcp.firestore
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -20,11 +20,12 @@ The next step is to create a Dapr component for Hazelcast.
|
||||||
|
|
||||||
Create the following YAML file named `hazelcast.yaml`:
|
Create the following YAML file named `hazelcast.yaml`:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: state.hazelcast
|
type: state.hazelcast
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -31,11 +31,12 @@ The next step is to create a Dapr component for Memcached.
|
||||||
|
|
||||||
Create the following YAML file named `memcached.yaml`:
|
Create the following YAML file named `memcached.yaml`:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: state.memcached
|
type: state.memcached
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -39,7 +39,8 @@ Create the following YAML file named `mongodb.yaml`:
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: state.mongodb
|
type: state.mongodb
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -65,11 +66,12 @@ The above example uses secrets as plain strings. It is recommended to use a secr
|
||||||
|
|
||||||
The following example uses the Kubernetes secret store to retrieve the username and password:
|
The following example uses the Kubernetes secret store to retrieve the username and password:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: state.mondodb
|
type: state.mondodb
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -67,6 +67,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: statestore
|
name: statestore
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: state.redis
|
type: state.redis
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -23,7 +23,8 @@ Create the following YAML file named `sqlserver.yaml`:
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: state.sqlserver
|
type: state.sqlserver
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -41,7 +42,8 @@ The following example uses the Kubernetes secret store to retrieve the secrets:
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: state.sqlserver
|
type: state.sqlserver
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -36,7 +36,8 @@ Create the following YAML file named `zookeeper.yaml`:
|
||||||
apiVersion: dapr.io/v1alpha1
|
apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: <name>
|
name: <NAME>
|
||||||
|
namespace: <NAMESPACE>
|
||||||
spec:
|
spec:
|
||||||
type: state.zookeeper
|
type: state.zookeeper
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
@ -29,6 +29,7 @@ apiVersion: dapr.io/v1alpha1
|
||||||
kind: Component
|
kind: Component
|
||||||
metadata:
|
metadata:
|
||||||
name: myEvent
|
name: myEvent
|
||||||
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
type: bindings.kafka
|
type: bindings.kafka
|
||||||
metadata:
|
metadata:
|
||||||
|
|
Loading…
Reference in New Issue