GCP Firestore (Datastore mode)

Detailed information on the GCP Firestore state store component

配置

To setup GCP Firestore state store create a component of type state.gcp.firestore. 请参阅本指南,了解如何创建和应用状态存储配置。

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: <NAME>
  namespace: <NAMESPACE>
spec:
  type: state.gcp.firestore
  version: v1
  metadata:
  - name: type
    value: <REPLACE-WITH-CREDENTIALS-TYPE> # Required. Example: "serviceaccount"
  - name: project_id
    value: <REPLACE-WITH-PROJECT-ID> # Required.
  - name: private_key_id
    value: <REPLACE-WITH-PRIVATE-KEY-ID> # Required.
  - name: private_key
    value: <REPLACE-WITH-PRIVATE-KEY> # Required.
  - name: client_email
    value: <REPLACE-WITH-CLIENT-EMAIL> # Required.
  - name: client_id
    value: <REPLACE-WITH-CLIENT-ID> # Required.
  - name: auth_uri
    value: <REPLACE-WITH-AUTH-URI> # Required.
  - name: token_uri
    value: <REPLACE-WITH-TOKEN-URI> # Required.
  - name: auth_provider_x509_cert_url
    value: <REPLACE-WITH-AUTH-X509-CERT-URL> # Required.
  - name: client_x509_cert_url
    value: <REPLACE-WITH-CLIENT-x509-CERT-URL> # Required.
  - name: entity_kind
    value: <REPLACE-WITH-ENTITY-KIND> # Optional. default: "DaprState" Example: "serviceaccount"
  - name: project_id
    value: <REPLACE-WITH-PROJECT-ID> # Required.
  - name: private_key_id
    value: <REPLACE-WITH-PRIVATE-KEY-ID> # Required.
  - name: private_key
    value: <REPLACE-WITH-PRIVATE-KEY> # Required.
  - name: client_email
    value: <REPLACE-WITH-CLIENT-EMAIL> # Required.
  - name: client_id
    value: <REPLACE-WITH-CLIENT-ID> # Required.
  - name: auth_uri
    value: <REPLACE-WITH-AUTH-URI> # Required.
  - name: token_uri
    value: <REPLACE-WITH-TOKEN-URI> # Required.
  - name: auth_provider_x509_cert_url
    value: <REPLACE-WITH-AUTH-X509-CERT-URL> # Required.
  - name: client_x509_cert_url
    value: <REPLACE-WITH-CLIENT-x509-CERT-URL> # Required.
  - name: entity_kind
    value: <REPLACE-WITH-ENTITY-KIND> # Optional. default: "DaprState"

元数据字段规范

字段 必填 详情 示例
type The credentials type "serviceaccount"
project_id The ID of the GCP project to use "project-id"
private_key_id The ID of the prvate key to use "private-key-id"
client_email The email address for the client "eample@example.com"
client_id The client id value to use for authentication "client-id"
auth_uri The authentication URI to use "https://accounts.google.com/o/oauth2/auth"
token_uri The token URI to query for Auth token "https://oauth2.googleapis.com/token"
auth_provider_x509_cert_url The auth provider certificate URL "https://www.googleapis.com/oauth2/v1/certs"
client_x509_cert_url The client certificate URL "https://www.googleapis.com/robot/v1/metadata/x509/x"
entity_kind N The entity name in Filestore. Defaults to "DaprState" "DaprState"

Setup GCP Firestone


You can use the GCP Datastore emulator to run locally using the instructions here.

You can then interact with the server using localhost:8081.


Follow the instructions here to get started with setting up Firestore in Google Cloud.

相关链接

Last modified January 1, 0001