当前位置:网站首页>Dapr source code analysis | project overview
Dapr source code analysis | project overview
2022-06-09 16:09:00 【Wind god Shura envoy】
Source code selection of this article dapr 1.4.3 https://github.com/zcong1993/dapr-1/tree/learn-1.4.3
Concepts

overall , dapr It can be divided into several concepts :
Building blocks Building blocks
dapr Provide users with HTTP/gRPC API, By one or more component form .
for example : Secrets Modules provide access to users secrets Of API.
# Get a single secret
GET http://localhost:<daprPort>/v1.0/secrets/<secret-store-name>/<name>
# Batch acquisition
GET http://localhost:<daprPort>/v1.0/secrets/<secret-store-name>/bulk
Components modular
dapr Generalized modules abstracted for building blocks and applications .
for example : Secret Stores Components are provided externally secret Read service .
type SecretStore interface {
// Init authenticates with the actual secret store and performs other init operation
Init(metadata Metadata) error
// GetSecret retrieves a secret using a key and returns a map of decrypted string/string values
GetSecret(req GetSecretRequest) (GetSecretResponse, error)
// BulkGetSecrets retrieves all secrets in the store and returns a map of decrypted string/string values
BulkGetSecret(req BulkGetSecretRequest) (BulkGetSecretResponse, error)
}
Support Kubernetes, Hashicorp Vault, Azure KeyVault Many other kinds provider.
Configuration
organization dapr Various configurations required for operation , It is mainly divided into : Global configuration , Module configuration and runtime configuration .
Observability Observability
dapr Observability module , External provision logging, metrics, tracing Equal index .
Security
dapr Safety related , for example : Service room mTLS encryption .
Services
dapr Provided by the project cli app. From project entrance cmd Folders can also be seen :
cmd
├── daprd // The core runtime, Key points for subsequent source code reading
├── injector // k8s dapr sidecar injector
├── operator // k8s operator
├── placement // actor relevant
└── sentry // mTLS relevant
Running environment
dapr Two operation modes are supported , Namely : Independent operation and k8s function .
Self-hosted
In this mode , daprd As a sidecar The process runs in each of your app side , Yours app Can pass HTTP/gRPC Interact with it . The configuration file will be stored locally . Runtime configuration requires the use of flag Pass on .
Kubernetes
stay k8s in , daprd As a sidecar The container runs on your app pod in , And all this is dapr-sidecar-injector and dapr-operator Help you automatically complete . The configuration file also uses k8s crd Form management , The running configuration can be configured through k8s annonation To configure the .
边栏推荐
猜你喜欢

The demand for data storage is increasingly diversified, and it is a general trend to divide and conquer

若依 思维导图

The interviewer asked me how many locks were added to an update statement? I summarized the whole eight part essay

≥3.5寸液晶屏的会议控制键盘说明书

LeetCode 6076. Represents the minimum number of line segments of a line graph

面试官问我一条update语句加了多少锁?我总结了全套八股文

Timed task processing based on DRF apscheduler

epson打印机无法打印如何解决

《CSDN 涨粉攻略》11个涨粉方法,你学会了几个?

微信小程序 思维导图
随机推荐
LINQ之LEFT JOIN示例
May training (day 24) - segment tree
Cordova 开发,提示net::ERR_CLEARTEXT_NOT_PERMITTED
五月集训(第25天) —— 树状数组
重构要点学习
Garymarcus publicly shouted that Hinton and musk: deep learning is like hitting the wall. I bet 100000 dollars
PS how to import fonts
618 大促来袭,浅谈如何做好大促备战
若依 思维导图
PS how to copy a layer to another graph
Kubernetes 核心概念
How does the memory database give full play to its memory advantage?
SAP Commerce Cloud 构建过程中的文件夹可写入性问题分析
如何高效学习 思维导图
[error reporting] no module named 'torchvision‘
May training (day 30) - topology sorting
epson打印机无法打印如何解决
R语言广义线性模型函数GLM、glm函数构建逻辑回归模型(Logistic regression)、分析模型是否过离散(Overdispersion)、使用假设检验的方法来分析模型是否过度分散
基于 abp vNext 的快速开发模板
Qscrollarea use tutorial to realize the setting interface that can slide up and down