From 03083e13208a1493518734600aa3486ff67b60c4 Mon Sep 17 00:00:00 2001 From: Aaron Crawfis Date: Wed, 16 Dec 2020 10:05:23 -0800 Subject: [PATCH] Update component information --- .../operations/components/component-schema.md | 53 ++++++++++++------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/daprdocs/content/en/operations/components/component-schema.md b/daprdocs/content/en/operations/components/component-schema.md index 366bb26e5..43435891d 100644 --- a/daprdocs/content/en/operations/components/component-schema.md +++ b/daprdocs/content/en/operations/components/component-schema.md @@ -6,28 +6,45 @@ weight: 100 description: "The basic schema for a Dapr component" --- +Dapr defines and registers components using a [CustomResourceDefinition](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/). All components are defined as a CRD and can be applied to any hosting environment where Dapr is running, not just Kubernetes. + +## Format + ```yaml apiVersion: dapr.io/v1alpha1 kind: Component metadata: - name: # Required. Example: prod-statestore. - namespace: # Optional. Example: app-ns + name: [COMPONENT-NAME] + namespace: [COMPONENT-NAMESPACE] spec: - type: # Required. Example: state.redis - version: v1 # Required - initTimeout: # Optional. Default: 30s - ignoreErrors: # Optional. Default: false - metadata: # Required. - - name: - value: + type: [COMPONENT-TYPE] + version: v1 + initTimeout: [TIMEOUT-DURATION] + ignoreErrors: [BOOLEAN] + metadata: + - name: [METADATA-NAME] + value: [METADATA-VALUE] ``` -| Field | Details | -| ------------- | ------------- | -| metadata.name | The name of the component | -| metadata.namespace | The namespace for the component | -| metadata | A key/value pair of component specific configuration | -| spec.type | The type of the component | -| spec.version | The version of the component | -| spec.initTimeout | The timeout duration for the initialization of the component. durations examples: 10s, 10m, 1h | -| spec.ignoreErrors | Tells the Dapr sidecar to continue initialization of the component fails to load | \ No newline at end of file +## Fields + +| Field | Required | Details | Example | +|--------------------|:--------:|---------|---------| +| apiVersion | Y | The version of the Dapr (and Kubernetes if applicable) API you are calling | `dapr.io/v1alpha1` +| kind | Y | The type of CRD. For components is must always be `Component` | `Component` +| **metadata** | - | **Information about the component registration** | +| metadata.name | Y | The name of the component | `prod-statestore` +| metadata.namespace | N | The namespace for the component for hosting environments with namespaces | `myapp-namespace` +| **spec** | - | **Detailed information on the component resource** +| spec.type | Y | The type of the component | `state.redis` +| spec.version | Y | The version of the component | `v1` +| spec.initTimeout | N | The timeout duration for the initialization of the component. Default is 30s | `5m`, `1h`, `20s` +| spec.ignoreErrors | N | Tells the Dapr sidecar to continue initialization if the component fails to load. Default is false | `false` +| **spec.metadata** | - | **A key/value pair of component specific configuration. See your component definition for fields**| + +## Further reading +- [Supported state stores]({{< ref supported-state-stores >}}) +- [Supported pub/sub brokers]({{< ref supported-pubsub >}}) +- [Supported secret stores]({{< ref supported-secret-stores >}}) +- [Supported bindings]({{< ref supported-bindings >}}) +- [Set component scopes]({{< ref component-scopes.md >}}) \ No newline at end of file