mirror of https://github.com/dapr/docs.git
Merge branch 'v1.1' into harrykimpel-newrelic-howto
This commit is contained in:
commit
c8599764bf
|
|
@ -0,0 +1,53 @@
|
|||
name: Azure Static Web Apps CI/CD
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- v1.1
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, closed]
|
||||
branches:
|
||||
- v1.1
|
||||
|
||||
jobs:
|
||||
build_and_deploy_job:
|
||||
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
|
||||
runs-on: ubuntu-latest
|
||||
name: Build and Deploy Job
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Setup Docsy
|
||||
run: cd daprdocs && git submodule update --init --recursive && sudo npm install -D --save autoprefixer && sudo npm install -D --save postcss-cli
|
||||
- name: Build And Deploy
|
||||
id: builddeploy
|
||||
uses: Azure/static-web-apps-deploy@v0.0.1-preview
|
||||
env:
|
||||
HUGO_ENV: production
|
||||
HUGO_VERSION: "0.74.3"
|
||||
with:
|
||||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PROUD_BAY_0E9E0E81E }}
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
|
||||
skip_deploy_on_missing_secrets: true
|
||||
action: "upload"
|
||||
###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
|
||||
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
|
||||
app_location: "/daprdocs" # App source code path
|
||||
api_location: "api" # Api source code path - optional
|
||||
output_location: "public" # Built app content directory - optional
|
||||
app_build_command: "hugo"
|
||||
###### End of Repository/Build Configurations ######
|
||||
|
||||
close_pull_request_job:
|
||||
if: github.event_name == 'pull_request' && github.event.action == 'closed'
|
||||
runs-on: ubuntu-latest
|
||||
name: Close Pull Request Job
|
||||
steps:
|
||||
- name: Close Pull Request
|
||||
id: closepullrequest
|
||||
uses: Azure/static-web-apps-deploy@v0.0.1-preview
|
||||
with:
|
||||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PROUD_BAY_0E9E0E81E }}
|
||||
skip_deploy_on_missing_secrets: true
|
||||
action: "close"
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
name: validate-links
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- v*
|
||||
tags:
|
||||
- v*
|
||||
pull_request:
|
||||
branches:
|
||||
- v*
|
||||
jobs:
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
PYTHON_VER: 3.7
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ env.PYTHON_VER }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ env.PYTHON_VER }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip
|
||||
pip3 install setuptools wheel twine tox mechanical-markdown
|
||||
- name: Check Markdown Files
|
||||
run: |
|
||||
for name in `find . -name "*.md"`; do echo -e "------\n$name" ; mm.py -l $name || exit 1 ;done
|
||||
|
|
@ -7,3 +7,10 @@
|
|||
[submodule "sdkdocs/php"]
|
||||
path = sdkdocs/php
|
||||
url = https://github.com/dapr/php-sdk.git
|
||||
[submodule "sdkdocs/dotnet"]
|
||||
path = sdkdocs/dotnet
|
||||
url = https://github.com/dapr/dotnet-sdk.git
|
||||
[submodule "translations/docs-zh"]
|
||||
path = translations/docs-zh
|
||||
url = https://github.com/dapr/docs-zh.git
|
||||
branch = v1.0_content
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ The following branches are currently maintained:
|
|||
|
||||
| Branch | Website | Description |
|
||||
|--------|---------|-------------|
|
||||
| [v1.0](https://github.com/dapr/docs) (primary) | https://docs.dapr.io | Latest Dapr release documentation. Typo fixes, clarifications, and most documentation goes here.
|
||||
| [v1.1](https://github.com/dapr/docs/tree/v1.1) (pre-release) | https://v1-1.docs.dapr.io/ | Pre-release documentation. Doc updates that are only applicable to v1.1+ go here.
|
||||
| [v1.1](https://github.com/dapr/docs) (primary) | https://docs.dapr.io | Latest Dapr release documentation. Typo fixes, clarifications, and most documentation goes here.
|
||||
| [v1.2](https://github.com/dapr/docs/tree/v1.2) (pre-release) | https://v1-2.docs.dapr.io/ | Pre-release documentation. Doc updates that are only applicable to v1.2+ go here.
|
||||
|
||||
For more information visit the [Dapr branch structure](https://docs.dapr.io/contributing/contributing-docs/#branch-guidance) document.
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="206px" height="206px" viewBox="0 0 206 206" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 51.3 (57544) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>dark on white</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="dark-on-white" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M63.08125,128 L51.55,128 L51.55,124.378906 C50.448432,125.761726 49.3351619,126.769528 48.2101562,127.402344 C46.2413964,128.503912 44.0031375,129.054688 41.4953125,129.054688 C37.4406047,129.054688 33.8312658,127.66017 30.6671875,124.871094 C26.8937311,121.542952 25.0070312,117.136746 25.0070312,111.652344 C25.0070312,106.074191 26.9406057,101.62111 30.8078125,98.2929688 C33.8781404,95.644518 37.4054488,94.3203125 41.3898437,94.3203125 C43.7101679,94.3203125 45.8898336,94.8124951 47.9289062,95.796875 C49.1007871,96.3593778 50.3078063,97.2851498 51.55,98.5742188 L51.55,75.1953125 L63.08125,75.1953125 L63.08125,128 Z M51.9015625,111.6875 C51.9015625,109.62499 51.1750073,107.873054 49.721875,106.431641 C48.2687427,104.990227 46.5109478,104.269531 44.4484375,104.269531 C42.151551,104.269531 40.2648511,105.13671 38.7882812,106.871094 C37.5929628,108.277351 36.9953125,109.882803 36.9953125,111.6875 C36.9953125,113.492197 37.5929628,115.097649 38.7882812,116.503906 C40.2414135,118.23829 42.1281134,119.105469 44.4484375,119.105469 C46.5343854,119.105469 48.2980397,118.390632 49.7394531,116.960938 C51.1808666,115.531243 51.9015625,113.773448 51.9015625,111.6875 Z M106.329687,128 L94.7984375,128 L94.7984375,124.378906 C93.6968695,125.761726 92.5835994,126.769528 91.4585937,127.402344 C89.4898339,128.503912 87.251575,129.054688 84.74375,129.054688 C80.6890422,129.054688 77.0797033,127.66017 73.915625,124.871094 C70.1421686,121.542952 68.2554687,117.136746 68.2554687,111.652344 C68.2554687,106.074191 70.1890432,101.62111 74.05625,98.2929688 C77.1265779,95.644518 80.6538863,94.3203125 84.6382812,94.3203125 C86.9586054,94.3203125 89.1382711,94.8124951 91.1773437,95.796875 C92.3492246,96.3593778 93.5562438,97.2851498 94.7984375,98.5742188 L94.7984375,95.375 L106.329687,95.375 L106.329687,128 Z M95.15,111.6875 C95.15,109.62499 94.4234448,107.873054 92.9703125,106.431641 C91.5171802,104.990227 89.7593853,104.269531 87.696875,104.269531 C85.3999885,104.269531 83.5132886,105.13671 82.0367187,106.871094 C80.8414003,108.277351 80.24375,109.882803 80.24375,111.6875 C80.24375,113.492197 80.8414003,115.097649 82.0367187,116.503906 C83.489851,118.23829 85.3765509,119.105469 87.696875,119.105469 C89.7828229,119.105469 91.5464772,118.390632 92.9878906,116.960938 C94.4293041,115.531243 95.15,113.773448 95.15,111.6875 Z M150.878906,111.722656 C150.878906,117.300809 148.945332,121.75389 145.078125,125.082031 C142.007797,127.730482 138.480489,129.054688 134.496094,129.054688 C132.17577,129.054688 129.996104,128.562505 127.957031,127.578125 C126.78515,127.015622 125.578131,126.08985 124.335937,124.800781 L124.335937,144.3125 L112.804687,144.3125 L112.804687,95.375 L124.335937,95.375 L124.335937,98.9960938 C125.367193,97.636712 126.480463,96.6289095 127.675781,95.9726562 C129.644541,94.8710882 131.8828,94.3203125 134.390625,94.3203125 C138.445333,94.3203125 142.054672,95.7148298 145.21875,98.5039062 C148.992206,101.832048 150.878906,106.238254 150.878906,111.722656 Z M138.890625,111.6875 C138.890625,109.835928 138.304693,108.230476 137.132812,106.871094 C135.656243,105.13671 133.757824,104.269531 131.4375,104.269531 C129.351552,104.269531 127.587898,104.984368 126.146484,106.414062 C124.705071,107.843757 123.984375,109.601552 123.984375,111.6875 C123.984375,113.75001 124.71093,115.501946 126.164062,116.943359 C127.617195,118.384773 129.37499,119.105469 131.4375,119.105469 C133.757824,119.105469 135.644524,118.23829 137.097656,116.503906 C138.292975,115.097649 138.890625,113.492197 138.890625,111.6875 Z M180.521875,106.027344 C178.904679,105.253902 177.264071,104.867188 175.6,104.867188 C171.803106,104.867188 169.342193,106.414047 168.217187,109.507812 C167.79531,110.632818 167.584375,112.144522 167.584375,114.042969 L167.584375,128 L156.053125,128 L156.053125,95.375 L167.584375,95.375 L167.584375,100.71875 C168.803131,98.820303 170.115618,97.449223 171.521875,96.6054688 C173.420322,95.4804631 175.670299,94.9179688 178.271875,94.9179688 C178.881253,94.9179688 179.631246,94.9531246 180.521875,95.0234375 L180.521875,106.027344 Z" id="dapr" fill="#000000"></path>
|
||||
<polygon id="tie" fill="#000000" fill-rule="nonzero" points="112.713867 128.237305 124.324219 128.237305 125.324219 155.49707 118.519043 160.265625 111.713867 155.49707"></polygon>
|
||||
<rect id="Rectangle-4" fill="#000000" fill-rule="nonzero" x="86.6816586" y="46" width="44.0478543" height="31" rx="2"></rect>
|
||||
<rect id="Rectangle-4" fill="#FFFFFF" fill-rule="nonzero" opacity="0.15" x="86.6816586" y="46" width="16.2935291" height="31"></rect>
|
||||
<rect id="Rectangle-3" fill="#000000" fill-rule="nonzero" x="72.7718099" y="75" width="71.2879747" height="7.44032012" rx="3.72016"></rect>
|
||||
<rect id="Rectangle-4" fill="#FFFFFF" fill-rule="nonzero" opacity="0.15" x="72.7718099" y="75" width="22.0566132" height="9.15731707"></rect>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.2 KiB |
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="480px" height="480px" viewBox="0 0 480 480" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 51.3 (57544) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>logo large</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="logo-large" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M147.109839,298.504854 L120.218166,298.504854 L120.218166,290.060213 C117.649233,293.285044 115.05301,295.635309 112.429419,297.111079 C107.838135,299.680011 102.618361,300.964459 96.7699392,300.964459 C87.3140802,300.964459 78.8968522,297.712348 71.5180026,291.208029 C62.7180414,283.446572 58.3181267,273.170995 58.3181267,260.380989 C58.3181267,247.372351 62.827356,236.987459 71.8459499,229.226003 C79.0061668,223.049632 87.2320942,219.961493 96.5239788,219.961493 C101.935135,219.961493 107.018266,221.109297 111.773525,223.404939 C114.506432,224.716735 117.321284,226.875699 120.218166,229.881897 L120.218166,175.36067 L147.109839,175.36067 L147.109839,298.504854 Z M121.038034,260.462976 C121.038034,255.653059 119.343657,251.567424 115.954852,248.205948 C112.566047,244.844472 108.466748,243.16376 103.656831,243.16376 C98.3003328,243.16376 93.9004182,245.186081 90.456955,249.230783 C87.6693897,252.510272 86.2756279,256.254299 86.2756279,260.462976 C86.2756279,264.671653 87.6693897,268.41568 90.456955,271.695169 C93.84576,275.739871 98.2456746,277.762192 103.656831,277.762192 C108.521406,277.762192 112.63437,276.095144 115.995845,272.760997 C119.357321,269.42685 121.038034,265.327551 121.038034,260.462976 Z M247.968187,298.504854 L221.076514,298.504854 L221.076514,290.060213 C218.507581,293.285044 215.911358,295.635309 213.287767,297.111079 C208.696483,299.680011 203.476709,300.964459 197.628287,300.964459 C188.172428,300.964459 179.7552,297.712348 172.376351,291.208029 C163.576389,283.446572 159.176475,273.170995 159.176475,260.380989 C159.176475,247.372351 163.685704,236.987459 172.704298,229.226003 C179.864515,223.049632 188.090442,219.961493 197.382327,219.961493 C202.793483,219.961493 207.876614,221.109297 212.631873,223.404939 C215.36478,224.716735 218.179632,226.875699 221.076514,229.881897 L221.076514,222.421098 L247.968187,222.421098 L247.968187,298.504854 Z M221.896382,260.462976 C221.896382,255.653059 220.202005,251.567424 216.8132,248.205948 C213.424395,244.844472 209.325096,243.16376 204.515179,243.16376 C199.158681,243.16376 194.758766,245.186081 191.315303,249.230783 C188.527738,252.510272 187.133976,256.254299 187.133976,260.462976 C187.133976,264.671653 188.527738,268.41568 191.315303,271.695169 C194.704108,275.739871 199.104023,277.762192 204.515179,277.762192 C209.379754,277.762192 213.492717,276.095144 216.854193,272.760997 C220.215669,269.42685 221.896382,265.327551 221.896382,260.462976 Z M351.860046,260.544963 C351.860046,273.553601 347.350817,283.938493 338.332223,291.699949 C331.172006,297.87632 322.946079,300.964459 313.654194,300.964459 C308.243038,300.964459 303.159907,299.816655 298.404648,297.521013 C295.671741,296.209217 292.856889,294.050253 289.960007,291.044055 L289.960007,336.546733 L263.068334,336.546733 L263.068334,222.421098 L289.960007,222.421098 L289.960007,230.865739 C292.364966,227.695566 294.961188,225.345301 297.748754,223.814873 C302.340038,221.24594 307.559812,219.961493 313.408234,219.961493 C322.864093,219.961493 331.281321,223.213604 338.66017,229.717923 C347.460132,237.47938 351.860046,247.754957 351.860046,260.544963 Z M323.902545,260.462976 C323.902545,256.144983 322.536112,252.400956 319.803205,249.230783 C316.359742,245.186081 311.932498,243.16376 306.521342,243.16376 C301.656767,243.16376 297.543804,244.830808 294.182328,248.164955 C290.820852,251.499102 289.140139,255.598401 289.140139,260.462976 C289.140139,265.272893 290.834516,269.358528 294.223321,272.720004 C297.612126,276.081479 301.711425,277.762192 306.521342,277.762192 C311.932498,277.762192 316.332413,275.739871 319.721218,271.695169 C322.508783,268.41568 323.902545,264.671653 323.902545,260.462976 Z M420.9895,247.2631 C417.218088,245.459381 413.392075,244.557535 409.511347,244.557535 C400.656728,244.557535 394.917709,248.164919 392.294118,255.379794 C391.310271,258.003385 390.818355,261.528782 390.818355,265.956092 L390.818355,298.504854 L363.926682,298.504854 L363.926682,222.421098 L390.818355,222.421098 L390.818355,234.883092 C393.660579,230.455782 396.721389,227.258329 400.000877,225.290636 C404.428187,222.667045 409.67529,221.355269 415.742344,221.355269 C417.163456,221.355269 418.912491,221.437255 420.9895,221.601229 L420.9895,247.2631 Z" id="dapr" fill="#0D2192"></path>
|
||||
<polygon id="tie" fill="#0D2192" fill-rule="nonzero" points="262.856535 299.058265 289.932678 299.058265 292.264747 362.629924 276.394607 373.750524 260.524466 362.629924"></polygon>
|
||||
<rect id="Rectangle-4" fill="#0D2192" fill-rule="nonzero" x="202.147624" y="107.275182" width="102.722643" height="72.2941444" rx="2"></rect>
|
||||
<rect id="Rectangle-4" fill="#FFFFFF" fill-rule="nonzero" opacity="0.0799999982" x="202.147624" y="107.275182" width="37.9976369" height="72.2941444"></rect>
|
||||
<rect id="Rectangle-3" fill="#0D2192" fill-rule="nonzero" x="169.708895" y="174.905188" width="166.248488" height="17.3513412" rx="3.72016"></rect>
|
||||
<rect id="Rectangle-4" fill="#FFFFFF" fill-rule="nonzero" opacity="0.0799999982" x="169.708895" y="174.905188" width="51.4375478" height="21.3554969"></rect>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.4 KiB |
|
|
@ -47,6 +47,8 @@
|
|||
margin: 0rem 0;
|
||||
padding: 0rem;
|
||||
|
||||
margin-bottom: 2rem;
|
||||
|
||||
max-width: 100%;
|
||||
|
||||
pre {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,18 @@ enableGitInfo = true
|
|||
# Language Configuration
|
||||
languageCode = "en-us"
|
||||
|
||||
[languages]
|
||||
[languages.en]
|
||||
title = "Dapr Docs"
|
||||
weight = 1
|
||||
contentDir = "content/en"
|
||||
languageName = "English"
|
||||
[languages.zh-hans]
|
||||
title = "Dapr 文档库"
|
||||
weight = 2
|
||||
contentDir = "content/zh-hans"
|
||||
languageName = "简体中文"
|
||||
|
||||
# Disable categories & tags
|
||||
disableKinds = ["taxonomy", "term"]
|
||||
|
||||
|
|
@ -22,6 +34,7 @@ id = "UA-149338238-3"
|
|||
[[module.mounts]]
|
||||
source = "content/en"
|
||||
target = "content"
|
||||
lang = "en"
|
||||
[[module.mounts]]
|
||||
source = "static"
|
||||
target = "static"
|
||||
|
|
@ -37,15 +50,48 @@ id = "UA-149338238-3"
|
|||
[[module.mounts]]
|
||||
source = "archetypes"
|
||||
target = "archetypes"
|
||||
|
||||
[[module.mounts]]
|
||||
source = "../sdkdocs/python/daprdocs/content/en/python-sdk-docs"
|
||||
target = "content/developing-applications/sdks/python"
|
||||
lang = "en"
|
||||
[[module.mounts]]
|
||||
source = "../sdkdocs/python/daprdocs/content/en/python-sdk-contributing"
|
||||
target = "content/contributing/"
|
||||
lang = "en"
|
||||
[[module.mounts]]
|
||||
source = "../sdkdocs/php/daprdocs/content/en/php-sdk-docs"
|
||||
target = "content/developing-applications/sdks/php"
|
||||
lang = "en"
|
||||
[[module.mounts]]
|
||||
source = "../sdkdocs/dotnet/daprdocs/content/en/dotnet-sdk-docs"
|
||||
target = "content/developing-applications/sdks/dotnet"
|
||||
lang = "en"
|
||||
[[module.mounts]]
|
||||
source = "../sdkdocs/dotnet/daprdocs/content/en/dotnet-sdk-contributing"
|
||||
target = "content/contributing/"
|
||||
lang = "en"
|
||||
|
||||
[[module.mounts]]
|
||||
source = "../translations/docs-zh/content/zh-hans"
|
||||
target = "content"
|
||||
lang = "zh-hans"
|
||||
[[module.mounts]]
|
||||
source = "../translations/docs-zh/content/contributing"
|
||||
target = "content/contributing/"
|
||||
lang = "zh-hans"
|
||||
[[module.mounts]]
|
||||
source = "../translations/docs-zh/content/sdks_python"
|
||||
target = "content/developing-applications/sdks/python"
|
||||
lang = "zh-hans"
|
||||
[[module.mounts]]
|
||||
source = "../translations/docs-zh/content/sdks_php"
|
||||
target = "content/developing-applications/sdks/php"
|
||||
lang = "zh-hans"
|
||||
[[module.mounts]]
|
||||
source = "../translations/docs-zh/content/sdks_dotnet"
|
||||
target = "content/developing-applications/sdks/dotnet"
|
||||
lang = "zh-hans"
|
||||
|
||||
# Markdown Engine - Allow inline html
|
||||
[markup]
|
||||
|
|
@ -87,16 +133,20 @@ offlineSearch = false
|
|||
github_repo = "https://github.com/dapr/docs"
|
||||
github_project_repo = "https://github.com/dapr/dapr"
|
||||
github_subdir = "daprdocs"
|
||||
github_branch = "v1.0"
|
||||
github_branch = "v1.1"
|
||||
|
||||
# Versioning
|
||||
version_menu = "v1.0 (latest)"
|
||||
version = "v1.0"
|
||||
version_menu = "v1.1 (latest)"
|
||||
version = "v1.1"
|
||||
archived_version = false
|
||||
url_latest_version = "https://docs.dapr.io"
|
||||
|
||||
[[params.versions]]
|
||||
version = "v1.0 (latest)"
|
||||
version = "v1.1 (latest)"
|
||||
url = "#"
|
||||
[[params.versions]]
|
||||
version = "v1.0"
|
||||
url = "https://v1-0.docs.dapr.io"
|
||||
[[params.versions]]
|
||||
version = "v0.11"
|
||||
url = "https://v0-11.docs.dapr.io"
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ Welcome to the Dapr documentation site!
|
|||
<h5 class="mt-0"><b>Language SDKs</b></h5>
|
||||
<p>Create Dapr applications in your preferred language using the Dapr SDKs.</p>
|
||||
<div class="media mt-3">
|
||||
<a class="pr-3" href="{{< ref sdks >}}">
|
||||
<a class="pr-3" href="{{< ref dotnet >}}">
|
||||
<img src="/images/homepage/dotnet.png" alt=".NET logo" width=30>
|
||||
</a>
|
||||
<div class="media-body">
|
||||
|
|
@ -109,7 +109,7 @@ Welcome to the Dapr documentation site!
|
|||
</div>
|
||||
</div>
|
||||
<div class="media mt-3">
|
||||
<a class="pr-4" href="{{< ref sdks >}}">
|
||||
<a class="pr-4" href="{{< ref php >}}">
|
||||
<img src="/images/homepage/php.png" alt="PHP logo" width=30>
|
||||
</a>
|
||||
<div class="media-body">
|
||||
|
|
|
|||
|
|
@ -24,6 +24,6 @@ The following are the building blocks provided by Dapr:
|
|||
| [**State management**]({{<ref "state-management-overview.md">}}) | `/v1.0/state` | Application state is anything an application wants to preserve beyond a single session. Dapr provides a key/value-based state API with pluggable state stores for persistence.
|
||||
| [**Publish and subscribe**]({{<ref "pubsub-overview.md">}}) | `/v1.0/publish` `/v1.0/subscribe`| Pub/Sub is a loosely coupled messaging pattern where senders (or publishers) publishes messages to a topic, to which subscribers subscribe. Dapr supports the pub/sub pattern between applications.
|
||||
| [**Resource bindings**]({{<ref "bindings-overview.md">}}) | `/v1.0/bindings` | A binding provides a bi-directional connection to an external cloud/on-premise service or system. Dapr allows you to invoke the external service through the Dapr binding API, and it allows your application to be triggered by events sent by the connected service.
|
||||
| [**Actors**]({{<ref "actors-overview.md">}}) | `/v1.0/actors` | An actor is an isolated, independent unit of compute and state with single-threaded execution. Dapr provides an actor implementation based on the Virtual Actor pattern which provides a single-threaded programming model and where actors are garbage collected when not in use. See * [Actor Overview](./actors#understanding-actors)
|
||||
| [**Actors**]({{<ref "actors-overview.md">}}) | `/v1.0/actors` | An actor is an isolated, independent unit of compute and state with single-threaded execution. Dapr provides an actor implementation based on the Virtual Actor pattern which provides a single-threaded programming model and where actors are garbage collected when not in use.
|
||||
| [**Observability**]({{<ref "observability-concept.md">}}) | `N/A` | Dapr system components and runtime emit metrics, logs, and traces to debug, operate and monitor Dapr system services, components and user applications.
|
||||
| [**Secrets**]({{<ref "secrets-overview.md">}}) | `/v1.0/secrets` | Dapr offers a secrets building block API and integrates with secret stores such as Azure Key Vault and Kubernetes to store the secrets. Service code can call the secrets API to retrieve secrets out of the Dapr supported secret stores.
|
||||
|
|
|
|||
|
|
@ -6,27 +6,8 @@ weight: 1000
|
|||
description: "Common questions asked about Dapr"
|
||||
---
|
||||
|
||||
## Networking and service meshes
|
||||
|
||||
### Understanding how Dapr works with service meshes
|
||||
|
||||
Dapr is a distributed application runtime. Unlike a service mesh which is focused on networking concerns, Dapr is focused on providing building blocks that make it easier for developers to build microservices. Dapr is developer-centric versus service meshes being infrastructure-centric.
|
||||
|
||||
Dapr can be used alongside any service mesh such as Istio and Linkerd. A service mesh is a dedicated network infrastructure layer designed to connect services to one another and provide insightful telemetry. A service mesh doesn’t introduce new functionality to an application.
|
||||
|
||||
That is where Dapr comes in. Dapr is a language agnostic programming model built on http and gRPC that provides distributed system building blocks via open APIs for asynchronous pub-sub, stateful services, service discovery and invocation, actors and distributed tracing. Dapr introduces new functionality to an app’s runtime. Both service meshes and Dapr run as side-car services to your application, one giving network features and the other distributed application capabilities.
|
||||
|
||||
Watch this [video](https://www.youtube.com/watch?v=xxU68ewRmz8&feature=youtu.be&t=140) on how Dapr and service meshes work together.
|
||||
|
||||
### Understanding how Dapr interoperates with the service mesh interface (SMI)
|
||||
|
||||
SMI is an abstraction layer that provides a common API surface across different service mesh technology. Dapr can leverage any service mesh technology including SMI.
|
||||
|
||||
### Differences between Dapr, Istio and Linkerd
|
||||
|
||||
Read [How does Dapr work with service meshes?](https://github.com/dapr/dapr/wiki/FAQ#how-does-dapr-work-with-service-meshes) Istio is an open source service mesh implementation that focuses on Layer7 routing, traffic flow management and mTLS authentication between services. Istio uses a sidecar to intercept traffic going into and out of a container and enforces a set of network policies on them.
|
||||
|
||||
Istio is not a programming model and does not focus on application level features such as state management, pub-sub, bindings etc. That is where Dapr comes in.
|
||||
## How does Dapr compare to service meshes such as Istio, Linkerd or OSM?
|
||||
Dapr is not a service mesh. While service meshes focus on fine grained network control, Dapr is focused on helping developers build distributed applications. Both Dapr and service meshes use the sidecar pattern and run alongside the application and they do have some overlapping features but also offer unique benefits. For more information please read the [Dapr & service meshes]({{<ref service-mesh>}}) concept page.
|
||||
|
||||
## Performance Benchmarks
|
||||
The Dapr project is focused on performance due to the inherent discussion of Dapr being a sidecar to your application. See [here]({{< ref perf-service-invocation.md >}}) for updated performance numbers.
|
||||
|
|
@ -36,7 +17,7 @@ The Dapr project is focused on performance due to the inherent discussion of Dap
|
|||
### What is the relationship between Dapr, Orleans and Service Fabric Reliable Actors?
|
||||
|
||||
The actors in Dapr are based on the same virtual actor concept that [Orleans](https://www.microsoft.com/research/project/orleans-virtual-actors/) started, meaning that they are activated when called and deactivated after a period of time. If you are familiar with Orleans, Dapr C# actors will be familiar. Dapr C# actors are based on [Service Fabric Reliable Actors](https://docs.microsoft.com/azure/service-fabric/service-fabric-reliable-actors-introduction) (which also came from Orleans) and enable you to take Reliable Actors in Service Fabric and migrate them to other hosting platforms such as Kubernetes or other on-premise environments.
|
||||
Also Dapr is about more than just actors. It provides you with a set of best practice building blocks to build into any microservices application. See [Dapr overview](https://github.com/dapr/docs/blob/master/overview/README.md).
|
||||
Also Dapr is about more than just actors. It provides you with a set of best practice building blocks to build into any microservices application. See [Dapr overview]({{< ref overview.md >}}).
|
||||
|
||||
### Differences between Dapr from an actor framework
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ This article addresses multiple security considerations when using Dapr in a dis
|
|||
|
||||
Several of the areas above are addressed through encryption of data in transit. One of the security mechanisms that Dapr employs for encrypting data in transit is [mutual authentication TLS](https://en.wikipedia.org/wiki/Mutual_authentication) or mTLS. mTLS offers a few key features for network traffic inside your application:
|
||||
|
||||
- Two way authentication - the client proving its identify to the server, and vice-versa
|
||||
- Two way authentication - the client proving its identity to the server, and vice-versa
|
||||
- An encrypted channel for all in-flight communication, after two-way authentication is established
|
||||
|
||||
Mutual TLS is useful in almost all scenarios, but especially so for systems subject to regulations such as [HIPAA](https://en.wikipedia.org/wiki/Health_Insurance_Portability_and_Accountability_Act) and [PCI](https://en.wikipedia.org/wiki/Payment_Card_Industry_Data_Security_Standard).
|
||||
|
|
@ -50,7 +50,7 @@ The diagram below shows how the Sentry system service issues certificates for ap
|
|||
<img src="/images/security-mTLS-sentry-selfhosted.png" width=1000>
|
||||
|
||||
### mTLS in Kubernetes
|
||||
The diagram below shows how the Sentry system service issues certificates for applications based on the root/issuer certificate that is provided by an operator or generated by the Sentry service as stored as a Kubernetes secret
|
||||
The diagram below shows how the Sentry system service issues certificates for applications based on the root/issuer certificate that is provided by an operator or generated by the Sentry service and stored as a Kubernetes secret
|
||||
|
||||
<img src="/images/security-mTLS-sentry-kubernetes.png" width=1000>
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ Threat modeling is a process by which potential threats, such as structural vuln
|
|||
|
||||
### February 2021
|
||||
|
||||
In February 2021, Dapr has gone a 2nd security audit targetting it's 1.0 release by Cure53.
|
||||
In February 2021, Dapr has gone through a 2nd security audit targetting it's 1.0 release by Cure53.
|
||||
The test focused on the following:
|
||||
|
||||
* Dapr runtime code base evaluation since last audit
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
---
|
||||
type: docs
|
||||
title: "Dapr and service meshes"
|
||||
linkTitle: "Service meshes"
|
||||
weight: 700
|
||||
description: >
|
||||
How Dapr compares to, and works with service meshes
|
||||
---
|
||||
|
||||
Dapr uses a sidecar architecture, running as a separate process alongside the application and includes features such as, service invocation, network security and distributed tracing. This often raises the question - how does Dapr compare to service mesh solutions such as Linkerd, Istio and Open Service Mesh (OSM)?
|
||||
|
||||
## How Dapr and service meshes compare
|
||||
While Dapr and service meshes do offer some overlapping capabilities, **Dapr is not a service mesh** where a service mesh, is defined as a *networking* service mesh. Unlike a service mesh which is focused on networking concerns, Dapr is focused on providing building blocks that make it easier for developers to build applications as microservices. Dapr is developer-centric versus service meshes being infrastructure-centric.
|
||||
|
||||
In most cases, developers do not need to be aware that the application they are building will be deployed in an environment which includes a service mesh since a service mesh intercepts network traffic. Service meshes are mostly managed and deployed by system operators. However, Dapr building block APIs are intended to be used by developers explicitly in their code.
|
||||
|
||||
Some common capabilities that Dapr shares with service meshes include:
|
||||
- Secure service-to-service communication with mTLS encryption
|
||||
- Service-to-service metric collection
|
||||
- Service-to-service distributed tracing
|
||||
- Resiliency through retries
|
||||
|
||||
Importantly Dapr provides service discovery and invocation via names which is a developer centric concern. This means that through Dapr's service invocation API, developers call a method on a service name, whereas service meshes deal with network concepts such as IPs and DNS addresses. However, Dapr does not provide capabilities for traffic behavior such as routing or traffic splitting. Traffic routing is often addressed with ingress proxies to an application and does not have to use a service mesh. In addition, Dapr does provides other application level building blocks for state management, pub/sub messaging, actors and more.
|
||||
|
||||
Another difference between Dapr and service meshes is with observability (tracing and metrics). Service meshes operate at the network level and trace the network calls between services. Dapr does this with service invocation, however Dapr also provides observability (tracing and metrics) over pub/sub calls using trace ids written into the Cloud Events envelope. This means that the metrics and tracing with Dapr is more extensive than with a service mesh for applications that use both service-to-service invocation and pub/sub to communicate.
|
||||
|
||||
The illustration below captures the overlapping features and unique capabilities that Dapr and service meshes offer:
|
||||
|
||||
<img src="/images/service-mesh.png" width=1000>
|
||||
|
||||
## Using Dapr with a service mesh
|
||||
Dapr does work with service meshes. In the case where both are deployed together, both Dapr and service mesh sidecars are running in the application environment. In this case, it is recommended to configure only Dapr or only the service mesh to perform mTLS encryption and distributed tracing.
|
||||
|
||||
Watch these recordings from the Dapr community calls showing presentations on running Dapr together with different service meshes:
|
||||
- General overview and a demo of [Dapr and Linkerd](https://youtu.be/xxU68ewRmz8?t=142)
|
||||
- Demo of running [Dapr and Istio](https://youtu.be/ngIDOQApx8g?t=335)
|
||||
|
||||
## When to choose using Dapr, a service mesh or both
|
||||
Should you be using Dapr, a service mesh or both? The answer depends on your requirements. If, for example, you are looking to use Dapr for one or more building blocks such as state management or pub/sub and considering using a service mesh just for network security or observability, you may find that Dapr is a good fit and a service mesh is not required.
|
||||
|
||||
Typically you would use a service mesh with Dapr where there is a corporate policy that traffic on the network needs to be encrypted regardless for all applications. For example, you may be using Dapr in only part of your application and other services and processes that are not using Dapr in your application also need encrypted traffic. In this scenario a service mesh is the better option and most likely you should use mTLS and distributed tracing on the service mesh and disable this on Dapr.
|
||||
|
||||
If you need traffic splitting for A/B testing scenarios you would benefit from using a service mesh, since Dapr does not provide these capabilities.
|
||||
|
||||
In some cases, where you require capabilities that are unique to both you will find it useful to leverage both Dapr and a service mesh - as mentioned above, there is no limitation for using them together.
|
||||
|
|
@ -22,7 +22,7 @@ Follow the instructions in the repository [README.md](https://github.com/dapr/do
|
|||
|
||||
The Dapr docs handles branching differently than most code repositories. Instead of having a `master` or `main` branch, every branch is labeled to match the major and minor version of a runtime release. For the full list visit the [Docs repo](https://github.com/dapr/docs#branch-guidance)
|
||||
|
||||
Overall, all updates should go into the docs branch for the latest release of Dapr. You can find this directly at https://github.com/dapr/docs, as the latest release will be the default branch. For any docs changes that are applicable to a release candidate or a pre-release version of the docs, make your changes into that particular branch.
|
||||
Overall, all updates should go into the docs branch for the latest release of Dapr. You can find this directly at [https://github.com/dapr/docs](https://github.com/dapr/docs), as the latest release will be the default branch. For any docs changes that are applicable to a release candidate or a pre-release version of the docs, make your changes into that particular branch.
|
||||
|
||||
For example, if you are fixing a typo, adding notes, or clarifying a point, make your changes into the default Dapr branch. If you are documenting an upcoming change to a component or the runtime, make your changes to the pre-release branch. Branches can be found in the [Docs repo](https://github.com/dapr/docs#branch-guidance)
|
||||
|
||||
|
|
@ -127,6 +127,10 @@ As an example, for this specific section the complete reference to the page and
|
|||
{{</* ref "contributing-docs.md#referencing-sections-in-other-pages" */>}}
|
||||
```
|
||||
|
||||
## Shortcodes
|
||||
|
||||
The following are useful shortcodes for writing Dapr documentation
|
||||
|
||||
### Images
|
||||
The markdown spec used by Docsy and Hugo does not give an option to resize images using markdown notation. Instead, raw HTML is used.
|
||||
|
||||
|
|
@ -230,5 +234,74 @@ The shortcode would be:
|
|||
{{</* youtube dQw4w9WgXcQ */>}}
|
||||
```
|
||||
|
||||
### Buttons
|
||||
|
||||
To create a button in a webpage, use the `button` shortcode.
|
||||
|
||||
#### Link to an external page
|
||||
|
||||
```
|
||||
{{</* button text="My Button" link="https://example.com" */>}}
|
||||
```
|
||||
|
||||
{{< button text="My Button" link="https://example.com" >}}
|
||||
|
||||
#### Link to another docs page
|
||||
|
||||
You can also reference pages in your button as well:
|
||||
```
|
||||
{{</* button text="My Button" page="contributing" */>}}
|
||||
```
|
||||
|
||||
{{< button text="My Button" page="contributing" >}}
|
||||
|
||||
#### Button colors
|
||||
|
||||
You can customize the colors using the Bootstrap colors:
|
||||
```
|
||||
{{</* button text="My Button" link="https://example.com" color="primary" */>}}
|
||||
{{</* button text="My Button" link="https://example.com" color="secondary" */>}}
|
||||
{{</* button text="My Button" link="https://example.com" color="success" */>}}
|
||||
{{</* button text="My Button" link="https://example.com" color="danger" */>}}
|
||||
{{</* button text="My Button" link="https://example.com" color="warning" */>}}
|
||||
{{</* button text="My Button" link="https://example.com" color="info" */>}}
|
||||
```
|
||||
|
||||
{{< button text="My Button" link="https://example.com" color="primary" >}}
|
||||
{{< button text="My Button" link="https://example.com" color="secondary" >}}
|
||||
{{< button text="My Button" link="https://example.com" color="success" >}}
|
||||
{{< button text="My Button" link="https://example.com" color="danger" >}}
|
||||
{{< button text="My Button" link="https://example.com" color="warning" >}}
|
||||
{{< button text="My Button" link="https://example.com" color="info" >}}
|
||||
|
||||
### References
|
||||
- [Docsy authoring guide](https://www.docsy.dev/docs/adding-content/)
|
||||
|
||||
## Translations
|
||||
|
||||
The Dapr Docs supports adding language translations into the docs using git submodules and Hugo's built in language support.
|
||||
|
||||
You can find an example PR of adding Chinese language support in [PR 1286](https://github.com/dapr/docs/pull/1286).
|
||||
|
||||
Steps to add a language:
|
||||
- Open an issue in the Docs repo requesting to create a new language-specific docs repo
|
||||
- Once created, create a git submodule within the docs repo:
|
||||
```sh
|
||||
git submodule add <remote_url> translations/<language_code>
|
||||
```
|
||||
- Add a language entry within `daprdocs/config.toml`:
|
||||
```toml
|
||||
[languages.<language_code>]
|
||||
title = "Dapr Docs"
|
||||
weight = 3
|
||||
contentDir = "content/<language_code>"
|
||||
languageName = "<language_name>"
|
||||
```
|
||||
- Create a mount within `daprdocs/config.toml`:
|
||||
```toml
|
||||
[[module.mounts]]
|
||||
source = "../translations/docs-<language_code>/content/<language_code>"
|
||||
target = "content"
|
||||
lang = "<language_code>"
|
||||
```
|
||||
- Repeat above step as necessary for all other translation directories
|
||||
|
|
@ -38,7 +38,7 @@ Before you submit an issue, make sure you've checked the following:
|
|||
- 👎 down-vote
|
||||
1. For bugs
|
||||
- Check it's not an environment issue. For example, if running on Kubernetes, make sure prerequisites are in place. (state stores, bindings, etc.)
|
||||
- You have as much data as possible. This usually comes in the form of logs and/or stacktrace. If running on Kubernetes or other environment, look at the logs of the Dapr services (runtime, operator, placement service). More details on how to get logs can be found [here](https://github.com/dapr/docs/tree/master/best-practices/troubleshooting/logs.md).
|
||||
- You have as much data as possible. This usually comes in the form of logs and/or stacktrace. If running on Kubernetes or other environment, look at the logs of the Dapr services (runtime, operator, placement service). More details on how to get logs can be found [here]({{< ref "logs-troubleshooting.md" >}}).
|
||||
1. For proposals
|
||||
- Many changes to the Dapr runtime may require changes to the API. In that case, the best place to discuss the potential feature is the main [Dapr repo](https://github.com/dapr/dapr).
|
||||
- Other examples could include bindings, state stores or entirely new components.
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ $app->post('/dsstatus', function(
|
|||
$app->start();
|
||||
```
|
||||
|
||||
After creating `app1.php`, and with the [SDK installed](https://github.com/dapr/php-sdk/blob/main/docs/getting-started.md),
|
||||
After creating `app1.php`, and with the [SDK installed](https://docs.dapr.io/developing-applications/sdks/php/),
|
||||
go ahead and start the app:
|
||||
|
||||
```bash
|
||||
|
|
@ -367,7 +367,7 @@ dapr run --app-id testpubsub --dapr-http-port 3500
|
|||
Then publish a message to the `deathStarStatus` topic:
|
||||
|
||||
```bash
|
||||
dapr publish --publish-app-id testpubapp --pubsub pubsub --topic deathStarStatus --data '{"status": "completed"}'
|
||||
dapr publish --publish-app-id testpubsub --pubsub pubsub --topic deathStarStatus --data '{"status": "completed"}'
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ When using state management your application can leverage features that would ot
|
|||
- Distributed concurrency and data consistency
|
||||
- Bulk [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) operations
|
||||
|
||||
Your application can used Dapr's state management API to save and read key/value pairs using a state store component, as shown in the diagram below. For example, by using HTTP POST you can save key/value pairs and by using HTTP GET you can read a key and have its value returned.
|
||||
Your application can use Dapr's state management API to save and read key/value pairs using a state store component, as shown in the diagram below. For example, by using HTTP POST you can save key/value pairs and by using HTTP GET you can read a key and have its value returned.
|
||||
|
||||
<img src="/images/state-management-overview.png" width=900>
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ Add a new `<tool></tool>` entry:
|
|||
<!-- 2. For Linux or MacOS use: /usr/local/bin/dapr -->
|
||||
<option name="COMMAND" value="C:\dapr\dapr.exe" />
|
||||
<!-- 3. Choose app, http and grpc ports that do not conflict with other daprd command entries (placement address should not change). -->
|
||||
<option name="PARAMETERS" value="run -app-id demoservice -app-port 3000 -dapr-http-port 3005 -dapr-grpc-port 52000 />
|
||||
<option name="PARAMETERS" value="run -app-id demoservice -app-port 3000 -dapr-http-port 3005 -dapr-grpc-port 52000" />
|
||||
<!-- 4. Use the folder where the `components` folder is located -->
|
||||
<option name="WORKING_DIRECTORY" value="C:/Code/dapr/java-sdk/examples" />
|
||||
</exec>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ The uppercase [HTTP middleware]({{< ref middleware-concept.md >}}) converts the
|
|||
|
||||
## Component format
|
||||
|
||||
In the following definition, the maximum requests per second are set to 10:
|
||||
In the following definition, it make content of request body into uppercase:
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ The Dapr SDKs are the easiest way for you to get Dapr into your application. Cho
|
|||
- Interact with external resources through input and output [bindings]({{< ref bindings >}})
|
||||
- Get [secrets]({{< ref secrets >}}) from secret stores
|
||||
- Interact with [virtual actors]({{< ref actors >}})
|
||||
- **Service extensions**: The Dapr service extensions allow you to create services that can:
|
||||
- **Server extensions**: The Dapr service extensions allow you to create services that can:
|
||||
- Be [invoked]({{< ref service-invocation >}}) by other services
|
||||
- [Subscribe]({{< ref pubsub >}}) to topics
|
||||
- **Actor SDK**: The Dapr Actor SDK allows you to build virtual actors with:
|
||||
|
|
@ -29,13 +29,13 @@ The Dapr SDKs are the easiest way for you to get Dapr into your application. Cho
|
|||
|
||||
## SDK languages
|
||||
|
||||
| Language | Status | Client SDK | Service Extensions | Actor SDK |
|
||||
|----------|:-----:|:----------:|:-----------:|:---------:|
|
||||
| [.NET](https://github.com/dapr/dotnet-sdk) | Stable | ✔ | ✔ </br>ASP.NET Core | ✔ |
|
||||
| [Python]({{< ref python >}}) | Stable | ✔ | ✔ </br>[gRPC]({{< ref python-grpc.md >}}) | ✔ </br>[FastAPI]({{< ref python-fastapi.md >}})<br />[Flask]({{< ref python-flask.md >}}) |
|
||||
| [Java](https://github.com/dapr/java-sdk) | Stable | ✔ | ✔ </br>Spring Boot | ✔ |
|
||||
| Language | Status | Client SDK | Server extensions | Actor SDK |
|
||||
|----------|:------|:----------:|:-----------:|:---------:|
|
||||
| [.NET]({{< ref dotnet >}}) | Stable | ✔ | [ASP.NET Core]({{< ref dotnet-aspnet >}}) | ✔ |
|
||||
| [Python]({{< ref python >}}) | Stable | ✔ | [gRPC]({{< ref python-grpc.md >}}) | [FastAPI]({{< ref python-fastapi.md >}})<br />[Flask]({{< ref python-flask.md >}}) |
|
||||
| [Java](https://github.com/dapr/java-sdk) | Stable | ✔ | Spring Boot | ✔ |
|
||||
| [Go](https://github.com/dapr/go-sdk) | Stable | ✔ | ✔ | |
|
||||
| [PHP](https://github.com/dapr/php-sdk) | Stable | ✔ | ✔ | ✔ |
|
||||
| [PHP]({{< ref php >}}) | Stable | ✔ | ✔ | ✔ |
|
||||
| [C++](https://github.com/dapr/cpp-sdk) | In development | ✔ | |
|
||||
| [Rust]() | In development | ✔ | | |
|
||||
| [Javascript]() | In development| ✔ | |
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ An SDK for Dapr should provide serialization for two use cases. First, for API o
|
|||
|
||||
```java
|
||||
DaprClient client = (new DaprClientBuilder()).build();
|
||||
client.invokeService(Verb.POST, "myappid", "saySomething", "My Message", null).block();
|
||||
client.invokeService("myappid", "saySomething", "My Message", HttpExtension.POST).block();
|
||||
```
|
||||
|
||||
In the example above, the app will receive a `POST` request for the `saySomething` method with the request payload as `"My Message"` - quoted since the serializer will serialize the input String to JSON.
|
||||
|
|
@ -139,7 +139,7 @@ redis-cli MGET "ActorStateIT_StatefulActorService||StatefulActorTest||1581130928
|
|||
{"value":"My data value."}
|
||||
```
|
||||
3. Custom serializers must serialize object to `byte[]`.
|
||||
4. Custom serializers must deserilize `byte[]` to object.
|
||||
4. Custom serializers must deserialize `byte[]` to object.
|
||||
5. When user provides a custom serializer, it should be transferred or persisted as `byte[]`. When persisting, also encode as Base64 string. This is done natively by most JSON libraries.
|
||||
```bash
|
||||
redis-cli MGET "ActorStateIT_StatefulActorService||StatefulActorTest||1581130928192||message
|
||||
|
|
@ -149,6 +149,5 @@ redis-cli MGET "ActorStateIT_StatefulActorService||StatefulActorTest||1581130928
|
|||
redis-cli MGET "ActorStateIT_StatefulActorService||StatefulActorTest||1581130928192||mydata
|
||||
"eyJ2YWx1ZSI6Ik15IGRhdGEgdmFsdWUuIn0="
|
||||
```
|
||||
6. When serializing a object that is a `byte[]`, the serializer should just pass it through since `byte[]` shoould be already handled internally in the SDK. The same happens when deserializing to `byte[]`.
|
||||
|
||||
*As of now, the [Java SDK](https://github.com/dapr/java-sdk/) is the only Dapr SDK that implements this specification. In the near future, other SDKs will also implement the same.*
|
||||
*As of now, the [Java SDK](https://github.com/dapr/java-sdk/) is the only Dapr SDK that implements this specification. In the near future, other SDKs will also implement the same.*
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Run the following command to launch a Dapr sidecar that will listen on port 3500
|
|||
dapr run --app-id myapp --dapr-http-port 3500
|
||||
```
|
||||
|
||||
With this command, no custom component folder was defined so the Dapr uses the default component definitions that were created during the init flow (these can be found under `$HOME/.dapr/components` on Linux or MacOS and under `%USERPROFILE%\.dapr\components` on Windows). These tell Dapr to the local Redis Docker container as a state store and message broker.
|
||||
With this command, no custom component folder was defined, so Dapr uses the default component definitions that were created during the init flow (these can be found under `$HOME/.dapr/components` on Linux or MacOS and under `%USERPROFILE%\.dapr\components` on Windows). These tell Dapr to use the local Redis Docker container as a state store and message broker.
|
||||
|
||||
## Step 2: Save state
|
||||
|
||||
|
|
|
|||
|
|
@ -86,8 +86,8 @@ Invoke-RestMethod -Uri 'http://localhost:3500/v1.0/secrets/my-secret-store/my-se
|
|||
|
||||
You should see output with the secret you stored in the JSON file.
|
||||
|
||||
```
|
||||
"I'm Batman"
|
||||
```json
|
||||
{"my-secret":"I'm Batman"}
|
||||
```
|
||||
|
||||
<a class="btn btn-primary" href="{{< ref quickstarts.md >}}" role="button">Next step: Explore Dapr quickstarts >></a>
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@ dapr --version
|
|||
|
||||
Output should look like this:
|
||||
```
|
||||
CLI version: 1.0.0
|
||||
Runtime version: 1.0.0
|
||||
CLI version: 1.1.0
|
||||
Runtime version: 1.1.0
|
||||
```
|
||||
|
||||
### Step 4: Verify containers are running
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ metadata:
|
|||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["secrets"]
|
||||
verbs: ["get"]
|
||||
verbs: ["get", "list"]
|
||||
---
|
||||
|
||||
kind: RoleBinding
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ Table captions:
|
|||
| [InfluxDB]({{< ref influxdb.md >}}) | | ✅ | Alpha | v1 | 1.0 |
|
||||
| [Kafka]({{< ref kafka.md >}}) | ✅ | ✅ | Alpha | v1 | 1.0 |
|
||||
| [Kubernetes Events]({{< ref "kubernetes-binding.md" >}}) | ✅ | | Alpha | v1 | 1.0 |
|
||||
| [Local Storage]({{< ref localstorage.md >}}) | | ✅ | Alpha | v1 | 1.1 |
|
||||
| [MQTT]({{< ref mqtt.md >}}) | ✅ | ✅ | Alpha | v1 | 1.0 |
|
||||
| [MySQL]({{< ref mysql.md >}}) | | ✅ | Alpha | v1 | 1.0 |
|
||||
| [PostgreSql]({{< ref postgres.md >}}) | | ✅ | Alpha | v1 | 1.0 |
|
||||
|
|
|
|||
|
|
@ -68,47 +68,48 @@ To perform a create blob operation, invoke the Azure Blob Storage binding with a
|
|||
|
||||
#### Examples
|
||||
|
||||
|
||||
##### Save text to a random generated UUID blob
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
{{% codetab %}}
|
||||
On Windows, utilize cmd prompt (PowerShell has different escaping mechanism)
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"Hello World\" }" http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
**Saving to a random generated UUID file**
|
||||
{{% codetab %}}
|
||||
On Windows, utilize cmd prompt (PowerShell has different escaping mechanism)
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"Hello World\" }" http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "Hello World" }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "Hello World" }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
**Saving to a specific file**
|
||||
##### Save text to a specific blob
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"Hello World\", \"metadata\": { \"blobName\": \"my-test-file.txt\" } }" \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"Hello World\", \"metadata\": { \"blobName\": \"my-test-file.txt\" } }" \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "Hello World", "metadata": { "blobName": "my-test-file.txt" } }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "Hello World", "metadata": { "blobName": "my-test-file.txt" } }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
|
||||
**Saving a file**
|
||||
##### Save a file to a blob
|
||||
|
||||
To upload a file, encode it as Base64 and let the Binding know to deserialize it:
|
||||
|
||||
|
|
@ -136,18 +137,18 @@ Then you can upload it as you would normally:
|
|||
|
||||
{{< tabs Windows Linux >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"YOUR_BASE_64_CONTENT\", \"metadata\": { \"blobName\": \"my-test-file.jpg\" } }" http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"YOUR_BASE_64_CONTENT\", \"metadata\": { \"blobName\": \"my-test-file.jpg\" } }" http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "YOUR_BASE_64_CONTENT", "metadata": { "blobName": "my-test-file.jpg" } }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "YOUR_BASE_64_CONTENT", "metadata": { "blobName": "my-test-file.jpg" } }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
|
|
@ -179,18 +180,20 @@ To perform a get blob operation, invoke the Azure Blob Storage binding with a `P
|
|||
|
||||
{{< tabs Windows Linux >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ \"operation\": \"get\", \"metadata\": { \"blobName\": \"myblob\" }}' http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ \"operation\": \"get\", \"metadata\": { \"blobName\": \"myblob\" }}' http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "get", "metadata": { "blobName": "myblob" }}' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "get", "metadata": { "blobName": "myblob" }}' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
#### Response
|
||||
|
||||
|
|
@ -201,6 +204,7 @@ The response body contains the value stored in the blob object.
|
|||
By default the Azure Blob Storage output binding auto generates a UUID as the blob filename and is not assigned any system or custom metadata to it. It is configurable in the metadata property of the message (all optional).
|
||||
|
||||
Applications publishing to an Azure Blob Storage output binding should send a message with the following format:
|
||||
|
||||
```json
|
||||
{
|
||||
"data": "file content",
|
||||
|
|
|
|||
|
|
@ -70,6 +70,85 @@ This component supports **output binding** with the following operations:
|
|||
|
||||
- `create`
|
||||
|
||||
### Create file
|
||||
|
||||
To perform a create operation, invoke the GCP Storage Bucket binding with a `POST` method and the following JSON body:
|
||||
|
||||
> Note: by default, a random UUID is generated. See below for Metadata support to set the name
|
||||
|
||||
```json
|
||||
{
|
||||
"operation": "create",
|
||||
"data": "YOUR_CONTENT"
|
||||
}
|
||||
```
|
||||
|
||||
#### Examples
|
||||
|
||||
|
||||
##### Save text to a random generated UUID file
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
{{% codetab %}}
|
||||
On Windows, utilize cmd prompt (PowerShell has different escaping mechanism)
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"Hello World\" }" http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "Hello World" }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
##### Save text to a specific file
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"Hello World\", \"metadata\": { \"name\": \"my-test-file.txt\" } }" \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "Hello World", "metadata": { "name": "my-test-file.txt" } }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
|
||||
##### Upload a file
|
||||
|
||||
To upload a file, pass the file contents as the data payload; you may want to encode this in e.g. Base64 for binary content.
|
||||
|
||||
Then you can upload it as you would normally:
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"(YOUR_FILE_CONTENTS)\", \"metadata\": { \"name\": \"my-test-file.jpg\" } }" http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "$(cat my-test-file.jpg)", "metadata": { "name": "my-test-file.jpg" } }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
## Related links
|
||||
|
||||
- [Basic schema for a Dapr component]({{< ref component-schema >}})
|
||||
|
|
|
|||
|
|
@ -0,0 +1,266 @@
|
|||
---
|
||||
type: docs
|
||||
title: "Local Storage binding spec"
|
||||
linkTitle: "Local Storage"
|
||||
description: "Detailed documentation on the Local Storage binding component"
|
||||
---
|
||||
|
||||
## Component format
|
||||
|
||||
To set up the Local Storage binding, create a component of type `bindings.localstorage`. See [this guide]({{< ref "howto-bindings.md#1-create-a-binding" >}}) on how to create and apply a binding configuration.
|
||||
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
name: <NAME>
|
||||
namespace: <NAMESPACE>
|
||||
spec:
|
||||
type: bindings.localstorage
|
||||
version: v1
|
||||
metadata:
|
||||
- name: rootPath
|
||||
value: <string>
|
||||
```
|
||||
|
||||
## Spec metadata fields
|
||||
|
||||
| Field | Required | Binding support | Details | Example |
|
||||
|--------------------|:--------:|--------|---------|---------|
|
||||
| rootPath | Y | Input / Output | The root path anchor to which files can be read / saved | `"/temp/files"` |
|
||||
|
||||
## Binding support
|
||||
|
||||
This component supports **output binding** with the following operations:
|
||||
|
||||
- `create` : [Create file](#create-file)
|
||||
- `get` : [Get file](#get-file)
|
||||
- `list` : [List files](#list-files)
|
||||
- `delete` : [Delete file](#delete-file)
|
||||
|
||||
### Create file
|
||||
|
||||
To perform a create file operation, invoke the Local Storage binding with a `POST` method and the following JSON body:
|
||||
|
||||
> Note: by default, a random UUID is generated. See below for Metadata support to set the name
|
||||
|
||||
```json
|
||||
{
|
||||
"operation": "create",
|
||||
"data": "YOUR_CONTENT"
|
||||
}
|
||||
```
|
||||
|
||||
#### Examples
|
||||
|
||||
|
||||
##### Save text to a random generated UUID file
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
{{% codetab %}}
|
||||
On Windows, utilize cmd prompt (PowerShell has different escaping mechanism)
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"Hello World\" }" http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "Hello World" }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
##### Save text to a specific file
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"Hello World\", \"metadata\": { \"fileName\": \"my-test-file.txt\" } }" \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "Hello World", "metadata": { "fileName": "my-test-file.txt" } }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
|
||||
##### Save a binary file
|
||||
|
||||
To upload a file, encode it as Base64. The binding should automatically detect the Base64 encoding.
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"YOUR_BASE_64_CONTENT\", \"metadata\": { \"fileName\": \"my-test-file.jpg\" } }" http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "YOUR_BASE_64_CONTENT", "metadata": { "fileName": "my-test-file.jpg" } }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
#### Response
|
||||
|
||||
The response body will contain the following JSON:
|
||||
|
||||
```json
|
||||
{
|
||||
"fileName": "<filename>"
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### Get file
|
||||
|
||||
To perform a get file operation, invoke the Local Storage binding with a `POST` method and the following JSON body:
|
||||
|
||||
```json
|
||||
{
|
||||
"operation": "get",
|
||||
"metadata": {
|
||||
"fileName": "myfile"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Example
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ \"operation\": \"get\", \"metadata\": { \"fileName\": \"myfile\" }}' http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "get", "metadata": { "fileName": "myfile" }}' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
#### Response
|
||||
|
||||
The response body contains the value stored in the file.
|
||||
|
||||
### List files
|
||||
|
||||
To perform a list files operation, invoke the Local Storage binding with a `POST` method and the following JSON body:
|
||||
|
||||
```json
|
||||
{
|
||||
"operation": "list"
|
||||
}
|
||||
```
|
||||
|
||||
If you only want to list the files beneath a particular directory below the `rootPath`, specify the relative directory name as the `fileName` in the metadata.
|
||||
|
||||
```json
|
||||
{
|
||||
"operation": "list",
|
||||
"metadata": {
|
||||
"fileName": "my/cool/directory"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Example
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ \"operation\": \"list\", \"metadata\": { \"fileName\": \"my/cool/directory\" }}' http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "list", "metadata": { "fileName": "my/cool/directory" }}' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
#### Response
|
||||
|
||||
The response is a JSON array of file names.
|
||||
|
||||
### Delete file
|
||||
|
||||
To perform a delete file operation, invoke the Local Storage binding with a `POST` method and the following JSON body:
|
||||
|
||||
```json
|
||||
{
|
||||
"operation": "delete",
|
||||
"metadata": {
|
||||
"fileName": "myfile"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Example
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ \"operation\": \"delete\", \"metadata\": { \"fileName\": \"myfile\" }}' http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "delete", "metadata": { "fileName": "myfile" }}' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
#### Response
|
||||
|
||||
An HTTP 204 (No Content) and empty body will be returned if successful.
|
||||
|
||||
## Metadata information
|
||||
|
||||
By default the Local Storage output binding auto generates a UUID as the file name. It is configurable in the metadata property of the message.
|
||||
|
||||
```json
|
||||
{
|
||||
"data": "file content",
|
||||
"metadata": {
|
||||
"fileName": "filename.txt"
|
||||
},
|
||||
"operation": "create"
|
||||
}
|
||||
```
|
||||
|
||||
## Related links
|
||||
|
||||
- [Basic schema for a Dapr component]({{< ref component-schema >}})
|
||||
- [Bindings building block]({{< ref bindings >}})
|
||||
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
|
||||
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
|
||||
- [Bindings API reference]({{< ref bindings_api.md >}})
|
||||
|
|
@ -29,8 +29,8 @@ spec:
|
|||
value: *****************
|
||||
- name: secretKey
|
||||
value: *****************
|
||||
- name: bucket
|
||||
value: mybucket
|
||||
- name: sessionToken
|
||||
value: mysession
|
||||
```
|
||||
|
||||
{{% alert title="Warning" color="warning" %}}
|
||||
|
|
@ -54,6 +54,85 @@ This component supports **output binding** with the following operations:
|
|||
|
||||
- `create`
|
||||
|
||||
### Create file
|
||||
|
||||
To perform a create operation, invoke the AWS S3 binding with a `POST` method and the following JSON body:
|
||||
|
||||
> Note: by default, a random UUID is generated. See below for Metadata support to set the name
|
||||
|
||||
```json
|
||||
{
|
||||
"operation": "create",
|
||||
"data": "YOUR_CONTENT"
|
||||
}
|
||||
```
|
||||
|
||||
#### Examples
|
||||
|
||||
|
||||
##### Save text to a random generated UUID file
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
{{% codetab %}}
|
||||
On Windows, utilize cmd prompt (PowerShell has different escaping mechanism)
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"Hello World\" }" http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "Hello World" }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
##### Save text to a specific file
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"Hello World\", \"metadata\": { \"key\": \"my-test-file.txt\" } }" \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "Hello World", "metadata": { "key": "my-test-file.txt" } }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
|
||||
##### Upload a file
|
||||
|
||||
To upload a file, pass the file contents as the data payload; you may want to encode this in e.g. Base64 for binary content.
|
||||
|
||||
Then you can upload it as you would normally:
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"(YOUR_FILE_CONTENTS)\", \"metadata\": { \"key\": \"my-test-file.jpg\" } }" http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "$(cat my-test-file.jpg)", "metadata": { "key": "my-test-file.jpg" } }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
## Related links
|
||||
|
||||
- [Basic schema for a Dapr component]({{< ref component-schema >}})
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ kubectl create namespace namespace-a
|
|||
kubectl config set-context --current --namespace=namespace-a
|
||||
```
|
||||
|
||||
Install Redis (master and slave) on `namespace-a`, following [these instructions](https://github.com/dapr/docs/blob/master/howto/setup-pub-sub-message-broker/setup-redis.md).
|
||||
Install Redis (master and slave) on `namespace-a`, following [these instructions]({{< ref "configure-state-pubsub.md" >}}).
|
||||
|
||||
Now, configure `deploy/redis.yaml`, paying attention to the hostname containing `namespace-a`.
|
||||
|
||||
|
|
@ -125,4 +125,4 @@ kubectl delete namespace namespace-b
|
|||
|
||||
- [Scope components to one or more applications]({{< ref "component-scopes.md" >}})
|
||||
- [Use secret scoping]({{< ref "secrets-scopes.md" >}})
|
||||
- [Limit the secrets that can be read from secret stores]({{< ref "secret-scope.md" >}})
|
||||
- [Limit the secrets that can be read from secret stores]({{< ref "secret-scope.md" >}})
|
||||
|
|
|
|||
|
|
@ -44,6 +44,10 @@ spec:
|
|||
value: 10
|
||||
- name: autoDeleteOnIdleInSec # Optional
|
||||
value: 10
|
||||
- name: maxReconnectionAttempts # Optional
|
||||
value: 30
|
||||
- name: connectionRecoveryInSec # Optional
|
||||
value: 2
|
||||
```
|
||||
|
||||
> __NOTE:__ The above settings are shared across all topics that use this component.
|
||||
|
|
@ -69,6 +73,8 @@ The above example uses secrets as plain strings. It is recommended to use a secr
|
|||
| prefetchCount | N |Defines the number of prefetched messages (use for high throughput / low latency scenarios)| `5`
|
||||
| defaultMessageTimeToLiveInSec | N |Default message time to live. | `10`
|
||||
| autoDeleteOnIdleInSec | N |Time in seconds to wait before auto deleting messages. | `10`
|
||||
| maxReconnectionAttempts | N |Defines the maximum number of reconnect attempts. Default: `30` | `30`
|
||||
| connectionRecoveryInSec | N |Time in seconds to wait between connection recovery attempts. Defaults: `2` | `2`
|
||||
|
||||
## Create an Azure Service Bus
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ The above example uses secrets as plain strings. It is recommended to use a secr
|
|||
| Field | Required | Details | Example |
|
||||
|--------------------|:--------:|---------|---------|
|
||||
| connectionString | Y | A comma delimited string of servers. Example: "hazelcast:3000,hazelcast2:3000" | `"hazelcast:3000,hazelcast2:3000"`
|
||||
| backOffMaxRetries | N | The maximum number of retries to process the message before returning an error. Defaults to `"0"` which means the component will not retry processing the message. `"-1"` will retry indefinitely until the message is processed or the application is shutdown. And positive number is treated as the maximum retry count. The component will wait 5 seconds between retries. | `"3"` |
|
||||
|
||||
|
||||
## Create a Hazelcast instance
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ spec:
|
|||
| caCert | Required for using TLS | Certificate authority certificate. Can be `secretKeyRef` to use a secret reference | `0123456789-0123456789`
|
||||
| clientCert | Required for using TLS | Client certificate. Can be `secretKeyRef` to use a secret reference | `0123456789-0123456789`
|
||||
| clientKey | Required for using TLS | Client key. Can be `secretKeyRef` to use a secret reference | `012345`
|
||||
| backOffMaxRetries | N | The maximum number of retries to process the message before returning an error. Defaults to `"0"` which means the component will not retry processing the message. `"-1"` will retry indefinitely until the message is processed or the application is shutdown. And positive number is treated as the maximum retry count. The component will wait 5 seconds between retries. | `"3"`
|
||||
|
||||
|
||||
### Communication using TLS
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ The above example uses secrets as plain strings. It is recommended to use a secr
|
|||
You can run a NATS server locally using Docker:
|
||||
|
||||
```bash
|
||||
docker run -d -name nats-streaming -p 4222:4222 -p 8222:8222 nats-streaming
|
||||
docker run -d --name nats-streaming -p 4222:4222 -p 8222:8222 nats-streaming
|
||||
```
|
||||
|
||||
You can then interact with the server using the client port: `localhost:4222`.
|
||||
|
|
|
|||
|
|
@ -39,8 +39,12 @@ The above example uses secrets as plain strings. It is recommended to use a secr
|
|||
|--------------------|:--------:|---------|---------|
|
||||
| redisHost | Y | Connection-string for the redis host | `localhost:6379`, `redis-master.default.svc.cluster.local:6379`
|
||||
| redisPassword | Y | Password for Redis host. No Default. Can be `secretKeyRef` to use a secret reference | `""`, `"KeFg23!"`
|
||||
| consumerID | N | The consumer group ID | `"myGroup"`
|
||||
| enableTLS | N | If the Redis instance supports TLS with public certificates, can be configured to be enabled or disabled. Defaults to `"false"` | `"true"`, `"false"`
|
||||
| consumerID | N | The consumer group ID | `"myGroup"`
|
||||
| enableTLS | N | If the Redis instance supports TLS with public certificates, can be configured to be enabled or disabled. Defaults to `"false"` | `"true"`, `"false"`
|
||||
| redeliverInterval | N | The interval between checking for pending messages to redelivery. Defaults to `"60s"`. `"0"` disables redelivery. | `"30s"`
|
||||
| processingTimeout | N | The amount time a message must be pending before attempting to redeliver it. Defaults to `"15s"`. `"0"` disables redelivery. | `"30s"`
|
||||
| queueDepth | N | The size of the message queue for processing. Defaults to `"100"`. | `"1000"`
|
||||
| concurrency | N | The number of concurrent workers that are processing messages. Defaults to `"10"`. | `"15"`
|
||||
|
||||
## Create a Redis instance
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ weight: 10000
|
|||
type: docs
|
||||
---
|
||||
|
||||
Dapr integrates with secret stores to provide apps and other components with secure store and access to secrets such as access keys and passwords. Each secret store component has a name and this name is used when accessing a secret.
|
||||
Dapr integrates with secret stores to provide apps and other components with secure storage and access to secrets such as access keys and passwords. Each secret store component has a name and this name is used when accessing a secret.
|
||||
|
||||
As with other building block components, secret store components are extensible and can be found in the [components-contrib repo](https://github.com/dapr/components-contrib).
|
||||
|
||||
|
|
@ -79,4 +79,4 @@ kubectl apply -f secret-store.yaml
|
|||
## Related links
|
||||
|
||||
- [Supported secret store components]({{< ref supported-secret-stores >}})
|
||||
- [Secrets building block]({{< ref secrets >}})
|
||||
- [Secrets building block]({{< ref secrets >}})
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ Table captions:
|
|||
| Name | Status | Component version | Since |
|
||||
|----------------------------------------------------------|--------| -------------------| ---- |
|
||||
| [AWS Secrets Manager]({{< ref aws-secret-manager.md >}}) | Alpha | v1 | 1.0 |
|
||||
| [AWS SSM Parameter Store]({{< ref aws-parameter-store.md >}}) | Alpha | v1 | 1.1 |
|
||||
|
||||
### Google Cloud Platform (GCP)
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
---
|
||||
type: docs
|
||||
title: "AWS SSM Parameter Store"
|
||||
linkTitle: "AWS SSM Parameter Store"
|
||||
description: Detailed information on the AWS SSM Parameter Store - secret store component
|
||||
---
|
||||
|
||||
## Component format
|
||||
|
||||
To setup AWS SSM Parameter Store secret store create a component of type `secretstores.aws.parameterstore`. See [this guide]({{< ref "secret-stores-overview.md#apply-the-configuration" >}}) on how to create and apply a secretstore configuration. See this guide on [referencing secrets]({{< ref component-secrets.md >}}) to retrieve and use the secret with Dapr components.
|
||||
|
||||
See [Authenticating to AWS]({{< ref authenticating-aws.md >}}) for information about authentication-related attributes.
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
name: awsparameterstore
|
||||
namespace: default
|
||||
spec:
|
||||
type: secretstores.aws.parameterstore
|
||||
version: v1
|
||||
metadata:
|
||||
- name: region
|
||||
value: "[aws_region]"
|
||||
- name: accessKey
|
||||
value: "[aws_access_key]"
|
||||
- name: secretKey
|
||||
value: "[aws_secret_key]"
|
||||
- name: sessionToken
|
||||
value: "[aws_session_token]"
|
||||
```
|
||||
{{% alert title="Warning" color="warning" %}}
|
||||
The above example uses secrets as plain strings. It is recommended to use a local secret store such as [Kubernetes secret store]({{< ref kubernetes-secret-store.md >}}) or a [local file]({{< ref file-secret-store.md >}}) to bootstrap secure key storage.
|
||||
{{% /alert %}}
|
||||
|
||||
## Spec metadata fields
|
||||
|
||||
| Field | Required | Details | Example |
|
||||
|--------------------|:--------:|-------------------------------------------------------------------------|---------------------|
|
||||
| region | Y | The specific AWS region the AWS SSM Parameter Store instance is deployed in | `"us-east-1"` |
|
||||
| accessKey | Y | The AWS Access Key to access this resource | `"key"` |
|
||||
| secretKey | Y | The AWS Secret Access Key to access this resource | `"secretAccessKey"` |
|
||||
| sessionToken | N | The AWS session token to use | `"sessionToken"` |
|
||||
## Create an AWS SSM Parameter Store instance
|
||||
|
||||
Setup AWS SSM Parameter Store using the AWS documentation: https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html.
|
||||
|
||||
## Related links
|
||||
- [Secrets building block]({{< ref secrets >}})
|
||||
- [How-To: Retrieve a secret]({{< ref "howto-secrets.md" >}})
|
||||
- [How-To: Reference secrets in Dapr components]({{< ref component-secrets.md >}})
|
||||
- [Secrets API reference]({{< ref secrets_api.md >}})
|
||||
- [Authenticating to AWS]({{< ref authenticating-aws.md >}})
|
||||
|
|
@ -78,7 +78,7 @@ The above example uses secrets as plain strings. It is recommended to use a loca
|
|||
```bash
|
||||
az aks show -g <AKSResourceGroup> -n <AKSClusterName>
|
||||
```
|
||||
For more detail about the roles to assign to integrate AKS with Azure Services [Role Assignment](https://github.com/Azure/aad-pod-identity/blob/master/docs/readmes/README.role-assignment.md).
|
||||
For more detail about the roles to assign to integrate AKS with Azure Services [Role Assignment](https://azure.github.io/aad-pod-identity/docs/getting-started/role-assignment/).
|
||||
|
||||
4. Retrieve Managed Identity ID
|
||||
|
||||
|
|
|
|||
|
|
@ -20,39 +20,42 @@ Table captions:
|
|||
|
||||
The following stores are supported, at various levels, by the Dapr state management building block:
|
||||
|
||||
> State stores can be used for actors if it supports both transactional operations and etag.
|
||||
|
||||
### Generic
|
||||
|
||||
| Name | CRUD | Transactional </br>(Supports Actors) | ETag | Status | Component version | Since |
|
||||
|----------------------------------------------------------------|------|---------------------|------|--------| -------|------|
|
||||
| [Aerospike]({{< ref setup-aerospike.md >}}) | ✅ | ❌ | ✅ | Alpha | v1 | 1.0 |
|
||||
| [Apache Cassandra]({{< ref setup-cassandra.md >}}) | ✅ | ❌ | ❌ | Alpha | v1 | 1.0 |
|
||||
| [Cloudstate]({{< ref setup-cloudstate.md >}}) | ✅ | ❌ | ✅ | Alpha | v1 | 1.0 |
|
||||
| [Couchbase]({{< ref setup-couchbase.md >}}) | ✅ | ❌ | ✅ | Alpha | v1 | 1.0 |
|
||||
| [Hashicorp Consul]({{< ref setup-consul.md >}}) | ✅ | ❌ | ❌ | Alpha | v1 | 1.0 |
|
||||
| [Hazelcast]({{< ref setup-hazelcast.md >}}) | ✅ | ❌ | ❌ | Alpha | v1 | 1.0 |
|
||||
| [Memcached]({{< ref setup-memcached.md >}}) | ✅ | ❌ | ❌ | Alpha | v1 | 1.0 |
|
||||
| [MongoDB]({{< ref setup-mongodb.md >}}) | ✅ | ✅ | ❌ | GA | v1 | 1.0 |
|
||||
| [MySQL]({{< ref setup-mysql.md >}}) | ✅ | ✅ | ✅ | Alpha | v1 | 1.0 |
|
||||
| [PostgreSQL]({{< ref setup-postgresql.md >}}) | ✅ | ✅ | ✅ | Alpha | v1 | 1.0 |
|
||||
| [Redis]({{< ref setup-redis.md >}}) | ✅ | ✅ | ✅ | GA | v1 | 1.0 |
|
||||
| [RethinkDB]({{< ref setup-rethinkdb.md >}}) | ✅ | ✅ | ✅ | Alpha | v1 | 1.0 |
|
||||
| [Zookeeper]({{< ref setup-zookeeper.md >}}) | ✅ | ❌ | ✅ | Alpha | v1 | 1.0 |
|
||||
| Name | CRUD | Transactional | ETag | Actors | Status | Component version | Since |
|
||||
|----------------------------------------------------------------|------|---------------------|------|------|--------| -------|------|
|
||||
| [Aerospike]({{< ref setup-aerospike.md >}}) | ✅ | ❌ | ✅ | ❌ | Alpha | v1 | 1.0 |
|
||||
| [Apache Cassandra]({{< ref setup-cassandra.md >}}) | ✅ | ❌ | ❌ | ❌ | Alpha | v1 | 1.0 |
|
||||
| [Cloudstate]({{< ref setup-cloudstate.md >}}) | ✅ | ❌ | ✅ | ❌ | Alpha | v1 | 1.0 |
|
||||
| [Couchbase]({{< ref setup-couchbase.md >}}) | ✅ | ❌ | ✅ | ❌ | Alpha | v1 | 1.0 |
|
||||
| [Hashicorp Consul]({{< ref setup-consul.md >}}) | ✅ | ❌ | ❌ | ❌ | Alpha | v1 | 1.0 |
|
||||
| [Hazelcast]({{< ref setup-hazelcast.md >}}) | ✅ | ❌ | ❌ | ❌ | Alpha | v1 | 1.0 |
|
||||
| [Memcached]({{< ref setup-memcached.md >}}) | ✅ | ❌ | ❌ | ❌ | Alpha | v1 | 1.0 |
|
||||
| [MongoDB]({{< ref setup-mongodb.md >}}) | ✅ | ✅ | ✅ | ✅ | GA | v1 | 1.0 |
|
||||
| [MySQL]({{< ref setup-mysql.md >}}) | ✅ | ✅ | ✅ | ✅ | Alpha | v1 | 1.0 |
|
||||
| [PostgreSQL]({{< ref setup-postgresql.md >}}) | ✅ | ✅ | ✅ | ✅ | Alpha | v1 | 1.0 |
|
||||
| [Redis]({{< ref setup-redis.md >}}) | ✅ | ✅ | ✅ | ✅ | GA | v1 | 1.0 |
|
||||
| [RethinkDB]({{< ref setup-rethinkdb.md >}}) | ✅ | ✅ | ✅ | ✅ | Alpha | v1 | 1.0 |
|
||||
| [Zookeeper]({{< ref setup-zookeeper.md >}}) | ✅ | ❌ | ✅ | ❌ | Alpha | v1 | 1.0 |
|
||||
|
||||
|
||||
### Amazon Web Services (AWS)
|
||||
| Name | CRUD | Transactional </br>(Supports Actors) | ETag | Status | Component version | Since |
|
||||
|------------------------------------------------------------------|------|---------------------|------|--------|-----|-------|
|
||||
| [AWS DynamoDB]({{< ref setup-dynamodb.md>}}) | ✅ | ❌ | ❌ | Alpha | v1 | 1.0 |
|
||||
| Name | CRUD | Transactional | ETag | Actors | Status | Component version | Since |
|
||||
|------------------------------------------------------------------|------|---------------------|------|--------|-----|-----|-------|
|
||||
| [AWS DynamoDB]({{< ref setup-dynamodb.md>}}) | ✅ | ❌ | ❌ | ❌ | Alpha | v1 | 1.0 |
|
||||
|
||||
### Google Cloud Platform (GCP)
|
||||
| Name | CRUD | Transactional </br>(Supports Actors) | ETag | Status | Component version | Since |
|
||||
|-------------------------------------------------------|------|---------------------|------|--------|-----|------|
|
||||
| [GCP Firestore]({{< ref setup-firestore.md >}}) | ✅ | ❌ | ❌ | Alpha | v1 | 1.0 |
|
||||
| Name | CRUD | Transactional | ETag | Actors | Status | Component version | Since |
|
||||
|------------------------------------------------------------------|------|---------------------|------|--------|-----|-----|-------|
|
||||
| [GCP Firestore]({{< ref setup-firestore.md >}}) | ✅ | ❌ | ❌ | ❌ | Alpha | v1 | 1.0 |
|
||||
|
||||
### Microsoft Azure
|
||||
|
||||
| Name | CRUD | Transactional </br>(Supports Actors) | ETag | Status | Component version | Since |
|
||||
|------------------------------------------------------------------|------|---------------------|------|--------| ------|-----|
|
||||
| [Azure Blob Storage]({{< ref setup-azure-blobstorage.md >}}) | ✅ | ❌ | ✅ | GA | v1 | 1.0 |
|
||||
| [Azure CosmosDB]({{< ref setup-azure-cosmosdb.md >}}) | ✅ | ✅ | ✅ | GA | v1 | 1.0 |
|
||||
| [Azure SQL Server]({{< ref setup-sqlserver.md >}}) | ✅ | ✅ | ✅ | Alpha | v1 | 1.0 |
|
||||
| [Azure Table Storage]({{< ref setup-azure-tablestorage.md >}}) | ✅ | ❌ | ✅ | Alpha | v1 | 1.0 |
|
||||
| Name | CRUD | Transactional | ETag | Actors | Status | Component version | Since |
|
||||
|------------------------------------------------------------------|------|---------------------|------|--------|-----|-----|-------|
|
||||
| [Azure Blob Storage]({{< ref setup-azure-blobstorage.md >}}) | ✅ | ❌ | ✅ | ❌ | GA | v1 | 1.0 |
|
||||
| [Azure CosmosDB]({{< ref setup-azure-cosmosdb.md >}}) | ✅ | ✅ | ✅ | ✅ | GA | v1 | 1.0 |
|
||||
| [Azure SQL Server]({{< ref setup-sqlserver.md >}}) | ✅ | ✅ | ✅ | ✅ | Alpha | v1 | 1.0 |
|
||||
| [Azure Table Storage]({{< ref setup-azure-tablestorage.md >}}) | ✅ | ❌ | ✅ | ❌ | Alpha | v1 | 1.0 |
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ description: Detailed information on the AWS DynamoDB state store component
|
|||
|
||||
## Component format
|
||||
|
||||
To setup a DynamoDB state store create a component of type `state.dynamodb`. See [this guide]({{< ref "howto-get-save-state.md#step-1-setup-a-state-store" >}}) on how to create and apply a state store configuration.
|
||||
To setup a DynamoDB state store create a component of type `state.aws.dynamodb`. See [this guide]({{< ref "howto-get-save-state.md#step-1-setup-a-state-store" >}}) on how to create and apply a state store configuration.
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
|
|
@ -16,7 +16,7 @@ metadata:
|
|||
name: <NAME>
|
||||
namespace: <NAMESPACE>
|
||||
spec:
|
||||
type: state.dynamodb
|
||||
type: state.aws.dynamodb
|
||||
version: v1
|
||||
metadata:
|
||||
- name: table
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ Run an instance of MySQL. You can run a local instance of MySQL in Docker CE wit
|
|||
This example does not describe a production configuration because it sets the password in plain text and the user name is left as the MySQL default of "root".
|
||||
|
||||
```bash
|
||||
docker run --name dapr_mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:latest
|
||||
docker run --name dapr-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:latest
|
||||
```
|
||||
|
||||
{{% /codetab %}}
|
||||
|
|
@ -78,7 +78,7 @@ We can use [Helm](https://helm.sh/) to quickly create a MySQL instance in our Ku
|
|||
|
||||
```bash
|
||||
helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||
helm install dapr_mysql bitnami/mysql
|
||||
helm install dapr-mysql bitnami/mysql
|
||||
```
|
||||
|
||||
1. Run `kubectl get pods` to see the MySQL containers now running in your cluster.
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ We can use [Helm](https://helm.sh/) to quickly create a Redis instance in our Ku
|
|||
4. Once your instance is created, you'll need to grab the Host name (FQDN) and your access key.
|
||||
- for the Host name navigate to the resources "Overview" and copy "Host name"
|
||||
- for your access key navigate to "Access Keys" under "Settings" and copy your key.
|
||||
5. Finally, we need to add our key and our host to a `redis.yaml` file that Dapr can apply to our cluster. If you're running a sample, you'll add the host and key to the provided `redis.yaml`. If you're creating a project from the ground up, you'll create a `redis.yaml` file as specified in [Configuration](#configuration). Set the `redisHost` key to `[HOST NAME FROM PREVIOUS STEP]:6379` and the `redisPassword` key to the key you copied in step 4. **Note:** In a production-grade application, follow [secret management](https://github.com/dapr/docs/blob/master/concepts/components/secrets.md) instructions to securely manage your secrets.
|
||||
5. Finally, we need to add our key and our host to a `redis.yaml` file that Dapr can apply to our cluster. If you're running a sample, you'll add the host and key to the provided `redis.yaml`. If you're creating a project from the ground up, you'll create a `redis.yaml` file as specified in [Configuration](#configuration). Set the `redisHost` key to `[HOST NAME FROM PREVIOUS STEP]:6379` and the `redisPassword` key to the key you copied in step 4. **Note:** In a production-grade application, follow [secret management]({{< ref component-secrets.md >}}) instructions to securely manage your secrets.
|
||||
|
||||
> **NOTE:** Dapr pub/sub uses [Redis Streams](https://redis.io/topics/streams-intro) that was introduced by Redis 5.0, which isn't currently available on Azure Managed Redis Cache. Consequently, you can use Azure Managed Redis Cache only for state persistence.
|
||||
{{% /codetab %}}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
type: docs
|
||||
title: "Kubernetes cluster setup"
|
||||
linkTitle: "How-to: Setup clusters"
|
||||
weight: 70000
|
||||
weight: 80000
|
||||
description: >
|
||||
How to create a Kubernetes cluster
|
||||
---
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
---
|
||||
type: docs
|
||||
title: "Setup a Google Kubernetes Engine cluster"
|
||||
linkTitle: "Google Kubernetes Engine"
|
||||
weight: 3000
|
||||
description: "Setup a Google Kubernetes Engine cluster"
|
||||
---
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
|
||||
- [Google Cloud SDK](https://cloud.google.com/sdk)
|
||||
|
||||
## Create a new cluster
|
||||
```bash
|
||||
$ gcloud services enable container.googleapis.com && \
|
||||
gcloud container clusters create $CLUSTER_NAME \
|
||||
--zone $ZONE \
|
||||
--project $PROJECT_ID
|
||||
```
|
||||
For more options refer to the [Google Cloud SDK docs](https://cloud.google.com/sdk/gcloud/reference/container/clusters/create), or instead create a cluster through the [Cloud Console](https://console.cloud.google.com/kubernetes) for a more interactive experience.
|
||||
|
||||
{{% alert title="For private GKE clusters" color="warning" %}}
|
||||
Sidecar injection will not work for private clusters without extra steps. An automatically created firewall rule for master access does not open port 4000. This is needed for Dapr sidecar injection.
|
||||
|
||||
To review the relevant firewall rule:
|
||||
```bash
|
||||
$ gcloud compute firewall-rules list --filter="name~gke-${CLUSTER_NAME}-[0-9a-z]*-master"
|
||||
```
|
||||
|
||||
To replace the existing rule and allow kubernetes master access to port 4000:
|
||||
```bash
|
||||
$ gcloud compute firewall-rules update <firewall-rule-name> --allow tcp:10250,tcp:443,tcp:4000
|
||||
```
|
||||
{{% /alert %}}
|
||||
|
||||
## Retrieve your credentials for `kubectl`
|
||||
|
||||
```bash
|
||||
$ gcloud container clusters get-credentials $CLUSTER_NAME \
|
||||
--zone $ZONE \
|
||||
--project $PROJECT_ID
|
||||
```
|
||||
|
||||
## (optional) Install Helm v3
|
||||
|
||||
1. [Install Helm v3 client](https://helm.sh/docs/intro/install/)
|
||||
|
||||
> **Note:** The latest Dapr helm chart no longer supports Helm v2. Please migrate from helm v2 to helm v3 by following [this guide](https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/).
|
||||
|
||||
2. In case you need permissions the kubernetes dashboard (i.e. configmaps is forbidden: User "system:serviceaccount:kube-system:kubernetes-dashboard" cannot list configmaps in the namespace "default", etc.) execute this command
|
||||
|
||||
```bash
|
||||
kubectl create clusterrolebinding kubernetes-dashboard -n kube-system --clusterrole=cluster-admin --serviceaccount=kube-system:kubernetes-dashboard
|
||||
```
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
type: docs
|
||||
title: "Setup an Minikube cluster"
|
||||
linkTitle: "Minikube"
|
||||
weight: 2000
|
||||
weight: 1000
|
||||
description: >
|
||||
How to setup Dapr on a Minikube cluster.
|
||||
---
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ The following table shows all the supported pod Spec annotations supported by Da
|
|||
| `dapr.io/api-token-secret` | Tells Dapr which Kubernetes secret to use for token based API authentication. By default this is not set.
|
||||
| `dapr.io/app-protocol` | Tells Dapr which protocol your application is using. Valid options are `http` and `grpc`. Default is `http`
|
||||
| `dapr.io/app-max-concurrency` | Limit the concurrency of your application. A valid value is any number larger than `0`
|
||||
| `dapr.io/app-ssl` | Tells Dapr to invoke the app over an insecure SSL connection. Applies to both HTTP and gRPC. Default is `false`.
|
||||
| `dapr.io/app-ssl` | Tells Dapr to invoke the app over an insecure SSL connection. Applies to both HTTP and gRPC. Traffic between your app and the Dapr sidecar is encrypted with a certificate issued by a non-trusted certificate authority, which is considered insecure. Default is `false`.
|
||||
| `dapr.io/metrics-port` | Sets the port for the sidecar metrics server. Default is `9090`
|
||||
| `dapr.io/sidecar-cpu-limit` | Maximum amount of CPU that the Dapr sidecar can use. See valid values [here](https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/). By default this is not set
|
||||
| `dapr.io/sidecar-memory-limit` | Maximum amount of Memory that the Dapr sidecar can use. See valid values [here](https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/). By default this is not set
|
||||
|
|
@ -35,3 +35,4 @@ The following table shows all the supported pod Spec annotations supported by Da
|
|||
| `dapr.io/sidecar-readiness-probe-period-seconds` | How often (in seconds) to perform the sidecar readiness probe. Read more [here](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes). Default is `6`
|
||||
| `dapr.io/sidecar-readiness-probe-threshold` | When the sidecar readiness probe fails, Kubernetes will try N times before giving up. In this case, the Pod will be marked Unready. Read more about `failureThreshold` [here](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes). Default is `3`
|
||||
| `dapr.io/http-max-request-size` | Increasing max size of request body http and grpc servers parameter in MB to handle uploading of big files. Default is `4` MB
|
||||
| `dapr.io/env` | List of environment variable to be injected into the sidecar. Strings consisting of key=value pairs separated by a comma.
|
||||
|
|
|
|||
|
|
@ -10,12 +10,7 @@ aliases:
|
|||
|
||||
When setting up Kubernetes you can use either the Dapr CLI or Helm.
|
||||
|
||||
As part of the Dapr initialization the following pods are installed:
|
||||
|
||||
- **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
|
||||
- **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 on what is deployed to your Kubernetes cluster read the [Kubernetes overview]({{< ref kubernetes-overview.md >}})
|
||||
|
||||
## Prerequisites
|
||||
|
||||
|
|
@ -45,19 +40,18 @@ You can install Dapr to a Kubernetes cluster using the [Dapr CLI]({{< ref instal
|
|||
|
||||
The `-k` flag initializes Dapr on the Kubernetes cluster in your current context.
|
||||
|
||||
{{% alert title="Target cluster" color="primary" %}}
|
||||
{{% alert title="Ensure correct cluster is set" color="warning" %}}
|
||||
Make sure the correct "target" cluster is set. Check `kubectl context (kubectl config get-contexts)` to verify. You can set a different context using `kubectl config use-context <CONTEXT>`.
|
||||
{{% /alert %}}
|
||||
|
||||
Run on your local machine:
|
||||
Run the following command on your local machine to init Dapr on your cluster:
|
||||
|
||||
```bash
|
||||
dapr init -k
|
||||
```
|
||||
|
||||
```
|
||||
```bash
|
||||
⌛ Making the jump to hyperspace...
|
||||
ℹ️ Note: To install Dapr using Helm, see here: https://github.com/dapr/docs/blob/master/getting-started/environment-setup.md#using-helm-advanced
|
||||
|
||||
✅ Deploying the Dapr control plane to your cluster...
|
||||
✅ Success! Dapr has been installed to namespace dapr-system. To verify, run "dapr status -k" in your terminal. To get started, go here: https://aka.ms/dapr-getting-started
|
||||
|
|
@ -71,8 +65,7 @@ The default namespace when initializing Dapr is `dapr-system`. You can override
|
|||
dapr init -k -n mynamespace
|
||||
```
|
||||
|
||||
|
||||
### Install in highly available mode:
|
||||
### Install in highly available mode
|
||||
|
||||
You can run Dapr with 3 replicas of each control plane pod in the dapr-system namespace for [production scenarios]({{< ref kubernetes-production.md >}}).
|
||||
|
||||
|
|
@ -88,28 +81,35 @@ Dapr is initialized by default with [mTLS]({{< ref "security-concept.md#sidecar-
|
|||
dapr init -k --enable-mtls=false
|
||||
```
|
||||
|
||||
### Uninstall Dapr on Kubernetes with CLI
|
||||
### Wait for the installation to complete
|
||||
|
||||
You can wait for the installation to complete its deployment with the `--wait` flag.
|
||||
|
||||
The default timeout is 300s (5 min), but can be customized with the `--timeout` flag.
|
||||
|
||||
```bash
|
||||
dapr uninstall --kubernetes
|
||||
dapr init -k --wait --timeout 600
|
||||
```
|
||||
|
||||
### Upgrade Dapr on a cluster
|
||||
To upgrade Dapr on a Kubernetes cluster you can use the CLI. See [upgrade Dapr on Kubernetes]({{< ref kubernetes-upgrade.md >}}) for more information.
|
||||
### Uninstall Dapr on Kubernetes with CLI
|
||||
|
||||
Run the following command on your local machine to uninstall Dapr on your cluster:
|
||||
|
||||
```bash
|
||||
dapr uninstall -k
|
||||
```
|
||||
|
||||
## Install with Helm (advanced)
|
||||
|
||||
You can install Dapr on Kubernetes using a Helm 3 chart.
|
||||
|
||||
|
||||
{{% alert title="Note" color="primary" %}}
|
||||
{{% alert title="Ensure you are on Helm v3" color="primary" %}}
|
||||
The latest Dapr helm chart no longer supports Helm v2. Please migrate from Helm v2 to Helm v3 by following [this guide](https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/).
|
||||
{{% /alert %}}
|
||||
|
||||
### Add and install Dapr Helm chart
|
||||
|
||||
1. Make sure [Helm 3](https://github.com/helm/helm/releases) is installed on your machine
|
||||
|
||||
2. Add Helm repo and update
|
||||
|
||||
```bash
|
||||
|
|
@ -118,47 +118,29 @@ The latest Dapr helm chart no longer supports Helm v2. Please migrate from Helm
|
|||
# See which chart versions are available
|
||||
helm search repo dapr --devel --versions
|
||||
```
|
||||
|
||||
3. Install the Dapr chart on your cluster in the `dapr-system` namespace.
|
||||
|
||||
```bash
|
||||
helm upgrade --install dapr dapr/dapr \
|
||||
--version=1.0.0 \
|
||||
--version=1.1.0 \
|
||||
--namespace dapr-system \
|
||||
--create-namespace \
|
||||
--wait
|
||||
```
|
||||
|
||||
To install in high availability mode:
|
||||
|
||||
To install in high availability mode:
|
||||
|
||||
```bash
|
||||
helm upgrade --install dapr dapr/dapr \
|
||||
--version=1.0.0 \
|
||||
--version=1.1.0 \
|
||||
--namespace dapr-system \
|
||||
--create-namespace \
|
||||
--set global.ha.enabled=true \
|
||||
--wait
|
||||
```
|
||||
|
||||
|
||||
See [Guidelines for production ready deployments on Kubernetes]({{<ref kubernetes-production.md>}}) for more information on installing and upgrading Dapr using Helm.
|
||||
|
||||
### Verify installation
|
||||
|
||||
Once the chart installation is complete, verify that the dapr-operator, dapr-placement, dapr-sidecar-injector and dapr-sentry pods are running in the `dapr-system` namespace:
|
||||
|
||||
```bash
|
||||
kubectl get pods --namespace dapr-system
|
||||
```
|
||||
|
||||
```
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
dapr-dashboard-7bd6cbf5bf-xglsr 1/1 Running 0 40s
|
||||
dapr-operator-7bd6cbf5bf-xglsr 1/1 Running 0 40s
|
||||
dapr-placement-7f8f76778f-6vhl2 1/1 Running 0 40s
|
||||
dapr-sidecar-injector-8555576b6f-29cqm 1/1 Running 0 40s
|
||||
dapr-sentry-9435776c7f-8f7yd 1/1 Running 0 40s
|
||||
```
|
||||
|
||||
|
||||
See [Guidelines for production ready deployments on Kubernetes]({{<ref kubernetes-production.md>}}) for more information on installing and upgrading Dapr using Helm.
|
||||
|
||||
### Uninstall Dapr on Kubernetes
|
||||
|
||||
|
|
@ -171,6 +153,22 @@ helm uninstall dapr --namespace dapr-system
|
|||
- Read [this guide]({{< ref kubernetes-production.md >}}) for recommended Helm chart values for production setups
|
||||
- See [this page](https://github.com/dapr/dapr/blob/master/charts/dapr/README.md) for details on Dapr Helm charts.
|
||||
|
||||
## Verify installation
|
||||
|
||||
Once the installation is complete, verify that the dapr-operator, dapr-placement, dapr-sidecar-injector and dapr-sentry pods are running in the `dapr-system` namespace:
|
||||
|
||||
```bash
|
||||
kubectl get pods --namespace dapr-system
|
||||
```
|
||||
|
||||
```bash
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
dapr-dashboard-7bd6cbf5bf-xglsr 1/1 Running 0 40s
|
||||
dapr-operator-7bd6cbf5bf-xglsr 1/1 Running 0 40s
|
||||
dapr-placement-7f8f76778f-6vhl2 1/1 Running 0 40s
|
||||
dapr-sidecar-injector-8555576b6f-29cqm 1/1 Running 0 40s
|
||||
dapr-sentry-9435776c7f-8f7yd 1/1 Running 0 40s
|
||||
```
|
||||
|
||||
## Next steps
|
||||
|
||||
|
|
|
|||
|
|
@ -22,21 +22,21 @@ You will need a Kubernetes cluster with Windows nodes. Many Kubernetes providers
|
|||
|
||||
2. Once you have set up the cluster, you should see that it has both Windows and Linux nodes available
|
||||
|
||||
```bash
|
||||
kubectl get nodes -o wide
|
||||
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
|
||||
aks-nodepool1-11819434-vmss000000 Ready agent 6d v1.17.9 10.240.0.4 <none> Ubuntu 16.04.6 LTS 4.15.0-1092-azure docker://3.0.10+azure
|
||||
aks-nodepool1-11819434-vmss000001 Ready agent 6d v1.17.9 10.240.0.35 <none> Ubuntu 16.04.6 LTS 4.15.0-1092-azure docker://3.0.10+azure
|
||||
aks-nodepool1-11819434-vmss000002 Ready agent 5d10h v1.17.9 10.240.0.129 <none> Ubuntu 16.04.6 LTS 4.15.0-1092-azure docker://3.0.10+azure
|
||||
akswin000000 Ready agent 6d v1.17.9 10.240.0.66 <none> Windows Server 2019 Datacenter 10.0.17763.1339 docker://19.3.5
|
||||
akswin000001 Ready agent 6d v1.17.9 10.240.0.97 <none> Windows Server 2019 Datacenter 10.0.17763.1339 docker://19.3.5
|
||||
```
|
||||
## Installing the Dapr Control Plane
|
||||
```bash
|
||||
kubectl get nodes -o wide
|
||||
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
|
||||
aks-nodepool1-11819434-vmss000000 Ready agent 6d v1.17.9 10.240.0.4 <none> Ubuntu 16.04.6 LTS 4.15.0-1092-azure docker://3.0.10+azure
|
||||
aks-nodepool1-11819434-vmss000001 Ready agent 6d v1.17.9 10.240.0.35 <none> Ubuntu 16.04.6 LTS 4.15.0-1092-azure docker://3.0.10+azure
|
||||
aks-nodepool1-11819434-vmss000002 Ready agent 5d10h v1.17.9 10.240.0.129 <none> Ubuntu 16.04.6 LTS 4.15.0-1092-azure docker://3.0.10+azure
|
||||
akswin000000 Ready agent 6d v1.17.9 10.240.0.66 <none> Windows Server 2019 Datacenter 10.0.17763.1339 docker://19.3.5
|
||||
akswin000001 Ready agent 6d v1.17.9 10.240.0.97 <none> Windows Server 2019 Datacenter 10.0.17763.1339 docker://19.3.5
|
||||
```
|
||||
## Installing the Dapr control plane
|
||||
|
||||
If you are installing using the Dapr CLI or via a helm chart, simply follow the normal deployment procedures:
|
||||
[Installing Dapr on a Kubernetes cluster]({{< ref "install-dapr-selfhost.md#installing-Dapr-on-a-kubernetes-cluster" >}})
|
||||
|
||||
Affinity will be automatically set for kubernetes.io/os=linux. This will be sufficient for most users, as Kubernetes requires at least one Linux node pool.
|
||||
Affinity will be automatically set for `kubernetes.io/os=linux`. This will be sufficient for most users, as Kubernetes requires at least one Linux node pool.
|
||||
|
||||
> **Note:** Dapr control plane containers are built and tested for both windows and linux, however, we generally recommend using the linux control plane containers. They tend to be smaller and have a much larger user base.
|
||||
|
||||
|
|
@ -53,109 +53,112 @@ In order to launch a Dapr application on Windows, you'll first need to create a
|
|||
|
||||
1. Create a deployment YAML
|
||||
|
||||
Here is a sample deployment with nodeAffinity set to "windows". Modify as needed for your application.
|
||||
```yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: yourwinapp
|
||||
labels:
|
||||
app: applabel
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: applablel
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: applabel
|
||||
annotations:
|
||||
dapr.io/enabled: "true"
|
||||
dapr.io/id: "addapp"
|
||||
dapr.io/port: "6000"
|
||||
dapr.io/config: "appconfig"
|
||||
spec:
|
||||
containers:
|
||||
- name: add
|
||||
image: yourreponsitory/your-windows-dapr-container:your-tag
|
||||
ports:
|
||||
- containerPort: 6000
|
||||
imagePullPolicy: Always
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: kubernetes.io/os
|
||||
operator: In
|
||||
values:
|
||||
- windows
|
||||
```
|
||||
This deployment yaml will be the same as any other dapr application, with an additional spec.template.spec.affinity section as shown above.
|
||||
Here is a sample deployment with nodeAffinity set to "windows". Modify as needed for your application.
|
||||
```yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: yourwinapp
|
||||
labels:
|
||||
app: applabel
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: applablel
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: applabel
|
||||
annotations:
|
||||
dapr.io/enabled: "true"
|
||||
dapr.io/id: "addapp"
|
||||
dapr.io/port: "6000"
|
||||
dapr.io/config: "appconfig"
|
||||
spec:
|
||||
containers:
|
||||
- name: add
|
||||
image: yourreponsitory/your-windows-dapr-container:your-tag
|
||||
ports:
|
||||
- containerPort: 6000
|
||||
imagePullPolicy: Always
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: kubernetes.io/os
|
||||
operator: In
|
||||
values:
|
||||
- windows
|
||||
```
|
||||
This deployment yaml will be the same as any other dapr application, with an additional spec.template.spec.affinity section as shown above.
|
||||
|
||||
2. Deploy to your Kubernetes cluster
|
||||
|
||||
```bash
|
||||
kubectl apply -f deploy_windows.yaml
|
||||
```
|
||||
```bash
|
||||
kubectl apply -f deploy_windows.yaml
|
||||
```
|
||||
|
||||
### Linux applications
|
||||
If you have already got a dapr application with runs on Linux, you'll still need to add affinity rules as above, but choose linux affinity instead.
|
||||
|
||||
1. Create a deployment YAML
|
||||
|
||||
Here is a sample deployment with nodeAffinity set to "linux". Modify as needed for your application.
|
||||
```yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: yourlinuxapp
|
||||
labels:
|
||||
app: yourlabel
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: yourlabel
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: yourlabel
|
||||
annotations:
|
||||
dapr.io/enabled: "true"
|
||||
dapr.io/id: "addapp"
|
||||
dapr.io/port: "6000"
|
||||
dapr.io/config: "appconfig"
|
||||
spec:
|
||||
containers:
|
||||
- name: add
|
||||
image: yourreponsitory/your-application:your-tag
|
||||
ports:
|
||||
- containerPort: 6000
|
||||
imagePullPolicy: Always
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: kubernetes.io/os
|
||||
operator: In
|
||||
values:
|
||||
- linux
|
||||
```
|
||||
Here is a sample deployment with nodeAffinity set to "linux". Modify as needed for your application.
|
||||
```yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: yourlinuxapp
|
||||
labels:
|
||||
app: yourlabel
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: yourlabel
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: yourlabel
|
||||
annotations:
|
||||
dapr.io/enabled: "true"
|
||||
dapr.io/id: "addapp"
|
||||
dapr.io/port: "6000"
|
||||
dapr.io/config: "appconfig"
|
||||
spec:
|
||||
containers:
|
||||
- name: add
|
||||
image: yourreponsitory/your-application:your-tag
|
||||
ports:
|
||||
- containerPort: 6000
|
||||
imagePullPolicy: Always
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: kubernetes.io/os
|
||||
operator: In
|
||||
values:
|
||||
- linux
|
||||
```
|
||||
|
||||
2. Deploy to your Kubernetes cluster
|
||||
```bash
|
||||
kubectl apply -f deploy_linux.yaml
|
||||
```
|
||||
|
||||
```bash
|
||||
kubectl apply -f deploy_linux.yaml
|
||||
```
|
||||
|
||||
## Cleanup
|
||||
|
||||
```
|
||||
```bash
|
||||
kubectl delete -f deploy_linux.yaml
|
||||
kubectl delete -f deploy_windows.yaml
|
||||
helm uninstall dapr
|
||||
```
|
||||
|
||||
## Related links
|
||||
|
||||
- See the [official Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/) for examples of more advanced configuration via node affinity
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
---
|
||||
type: docs
|
||||
title: "Running Dapr with a Kubernetes Job"
|
||||
linkTitle: "Kubernetes Jobs"
|
||||
weight: 70000
|
||||
description: "Use Dapr API in a Kubernetes Job context"
|
||||
type: docs
|
||||
---
|
||||
|
||||
# Kubernetes Job
|
||||
|
||||
The Dapr sidecar is designed to be a long running process, in the context of a [Kubernetes Job](https://kubernetes.io/docs/concepts/workloads/controllers/job/) this behaviour can block your job completion.
|
||||
To address this issue the Dapr sidecar has an endpoint to `Shutdown` the sidecar.
|
||||
|
||||
When running a basic [Kubernetes Job](https://kubernetes.io/docs/concepts/workloads/controllers/job/) you will need to call the `/shutdown` endpoint for the sidecar to gracefully stop and the job will be considered `Completed`.
|
||||
|
||||
When a job is finish without calling `Shutdown` your job will be in a `NotReady` state with only the `daprd` container running endlessly.
|
||||
|
||||
```yaml
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: job-with-shutdown
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
dapr.io/enabled: "true"
|
||||
dapr.io/app-id: "with-shutdown"
|
||||
spec:
|
||||
containers:
|
||||
- name: job
|
||||
image: busybox
|
||||
command: ["/bin/sh", "-c", "sleep 20 && wget localhost:3500/v1.0/shutdown"]
|
||||
restartPolicy: Never
|
||||
```
|
||||
|
||||
You can also call the `Shutdown` from any of the Dapr SDK
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
dapr "github.com/dapr/go-sdk/client"
|
||||
)
|
||||
|
||||
func main() {
|
||||
client, err := dapr.NewClient()
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
defer client.Close()
|
||||
defer client.Shutdown()
|
||||
// Job
|
||||
}
|
||||
```
|
||||
|
|
@ -6,13 +6,23 @@ weight: 10000
|
|||
description: "Overview of how to get Dapr running on your Kubernetes cluster"
|
||||
---
|
||||
|
||||
Dapr can be configured to run on any [Kubernetes cluster](https://github.com/dapr/quickstarts/tree/master/hello-kubernetes). In Kubernetes the `dapr-sidecar-injector` and `dapr-operator` services provide first class integration to launch Dapr as a sidecar container in the same pod as the service container and provide notifications of Dapr component updates provisioned into the cluster. Additionally, the `dapr-sidecar-injector` also injects the environment variables `DAPR_HTTP_PORT` and `DAPR_GRPC_PORT` into **all** the containers in the pod to enable user defined applications to easily communicate with Dapr without hardcoding Dapr port values.
|
||||
## Dapr on Kubernetes
|
||||
|
||||
The `dapr-sentry` service is a certificate authority that enables mutual TLS between Dapr sidecar instances for secure data encryption. For more information on the `Sentry` service read the [security overview]({{< ref "security-concept.md" >}})
|
||||
Dapr can be configured to run on any Kubernetes cluster. To achieve this, Dapr begins by deploying the `dapr-sidecar-injector`, `dapr-operator`, `dapr-placement`, and `dapr-sentry` Kubernetes services. These provide first-class integration to make running applications with Dapr easy.
|
||||
- **dapr-operator:** Manages [component]({{< ref components >}}) updates and Kubernetes services endpoints for Dapr (state stores, pub/subs, etc.)
|
||||
- **dapr-sidecar-injector:** Injects Dapr into [annotated](#adding-dapr-to-a-kubernetes-deployment) deployment pods and adds the environment variables `DAPR_HTTP_PORT` and `DAPR_GRPC_PORT` to enable user-defined applications to easily communicate with Dapr without hard-coding Dapr port values.
|
||||
- **dapr-placement:** Used for [actors]({{< ref 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]({{< ref "security-concept.md" >}}).
|
||||
|
||||
<img src="/images/overview_kubernetes.png" width=800>
|
||||
|
||||
Deploying and running a Dapr enabled application into your Kubernetes cluster is a simple as adding a few annotations to the deployment schemes. To give your service an `id` and `port` known to Dapr, turn on tracing through configuration and launch the Dapr sidecar container, you annotate your Kubernetes deployment like this.
|
||||
## Deploying Dapr to a Kubernetes cluster
|
||||
|
||||
Read [this guide]({{< ref kubernetes-deploy.md >}}) to learn how to deploy Dapr to your Kubernetes cluster.
|
||||
|
||||
## Adding Dapr to a Kubernetes deployment
|
||||
|
||||
Deploying and running a Dapr enabled application into your Kubernetes cluster is as simple as adding a few annotations to the deployment schemes. To give your service an `id` and `port` known to Dapr, turn on tracing through configuration and launch the Dapr sidecar container, you annotate your Kubernetes deployment like this. For more information check [dapr annotations]({{< ref kubernetes-annotations.md >}})
|
||||
|
||||
```yml
|
||||
annotations:
|
||||
|
|
@ -21,6 +31,14 @@ Deploying and running a Dapr enabled application into your Kubernetes cluster is
|
|||
dapr.io/app-port: "3000"
|
||||
dapr.io/config: "tracing"
|
||||
```
|
||||
You can see some examples [here](https://github.com/dapr/quickstarts/tree/master/hello-kubernetes/deploy) in the Kubernetes getting started sample.
|
||||
|
||||
Explore additional [Kubernetes related topics]({{<ref kubernetes>}}) for more information about working with Dapr on Kubernetes.
|
||||
## Quickstart
|
||||
|
||||
You can see some examples [here](https://github.com/dapr/quickstarts/tree/master/hello-kubernetes) in the Kubernetes getting started quickstart.
|
||||
|
||||
## Related links
|
||||
|
||||
- [Deploy Dapr to a Kubernetes cluster]({{< ref kubernetes-deploy >}})
|
||||
- [Upgrade Dapr on a Kubernetes cluster]({{< ref kubernetes-upgrade >}})
|
||||
- [Production guidelines for Dapr on Kubernetes]({{< ref kubernetes-production.md >}})
|
||||
- [Dapr Kubernetes Quickstart](https://github.com/dapr/quickstarts/tree/master/hello-kubernetes)
|
||||
|
|
|
|||
|
|
@ -15,35 +15,37 @@ Use the following resource settings might serve as a starting point. Requirement
|
|||
|
||||
| Deployment | CPU | Memory
|
||||
|-------------|-----|-------
|
||||
| Operator | Limit: 1, Request: 100m | Limit: 200Mi, Request: 100Mi
|
||||
| Sidecar Injector | Limit: 1, Request: 100m | Limit: 200Mi, Request: 30Mi
|
||||
| Sentry | Limit: 1, Request: 100m | Limit: 200Mi, Request: 30Mi
|
||||
| Placement | Limit: 1, Request: 250m | Limit: 150Mi, Request: 75Mi
|
||||
| Dashboard | Limit: 200m, Request: 50m | Limit: 200Mi, Request: 20Mi
|
||||
| **Operator** | Limit: 1, Request: 100m | Limit: 200Mi, Request: 100Mi
|
||||
| **Sidecar Injector** | Limit: 1, Request: 100m | Limit: 200Mi, Request: 30Mi
|
||||
| **Sentry** | Limit: 1, Request: 100m | Limit: 200Mi, Request: 30Mi
|
||||
| **Placement** | Limit: 1, Request: 250m | Limit: 150Mi, Request: 75Mi
|
||||
| **Dashboard** | Limit: 200m, Request: 50m | Limit: 200Mi, Request: 20Mi
|
||||
|
||||
When installing Dapr using Helm, no default limit/request values are set. Each component has a `resources` option (for example, `dapr_dashboard.resources`), which you can use to tune the Dapr control plane to fit your environment. The [Helm chart readme](https://github.com/dapr/dapr/blob/master/charts/dapr/README) has detailed information and examples. For local/dev installations, you might simply want to skip configuring the `resources` options.
|
||||
### Helm
|
||||
|
||||
When installing Dapr using Helm, no default limit/request values are set. Each component has a `resources` option (for example, `dapr_dashboard.resources`), which you can use to tune the Dapr control plane to fit your environment. The [Helm chart readme](https://github.com/dapr/dapr/blob/master/charts/dapr/README.md) has detailed information and examples. For local/dev installations, you might simply want to skip configuring the `resources` options.
|
||||
|
||||
### Optional components
|
||||
|
||||
The following Dapr control plane deployments are optional:
|
||||
|
||||
* Placement - Needed for Dapr Actors
|
||||
* Sentry - Needed for mTLS for service to service invocation
|
||||
* Dashboard - Needed for operational view of the cluster
|
||||
- **Placement** - Needed for Dapr Actors
|
||||
- **Sentry** - Needed for mTLS for service to service invocation
|
||||
- **Dashboard** - Needed for operational view of the cluster
|
||||
|
||||
## Sidecar resource settings
|
||||
|
||||
To set the resource assignments for the Dapr sidecar, see the annotations [here]({{< ref "kubernetes-annotations.md" >}}).
|
||||
The specific annotations related to resource constraints are:
|
||||
|
||||
* `dapr.io/sidecar-cpu-limit`
|
||||
* `dapr.io/sidecar-memory-limit`
|
||||
* `dapr.io/sidecar-cpu-request`
|
||||
* `dapr.io/sidecar-memory-request`
|
||||
- `dapr.io/sidecar-cpu-limit`
|
||||
- `dapr.io/sidecar-memory-limit`
|
||||
- `dapr.io/sidecar-cpu-request`
|
||||
- `dapr.io/sidecar-memory-request`
|
||||
|
||||
If not set, the dapr sidecar will run without resource settings, which may lead to issues. For a production-ready setup it is strongly recommended to configure these settings.
|
||||
|
||||
For more details on configuring resource in Kubernetes see [Assign Memory Resources to Containers and Pods](https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/) and [Assign CPU Resources to Containers and Pods](https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/)
|
||||
For more details on configuring resource in Kubernetes see [Assign Memory Resources to Containers and Pods](https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/) and [Assign CPU Resources to Containers and Pods](https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/).
|
||||
|
||||
Example settings for the dapr sidecar in a production-ready setup:
|
||||
|
||||
|
|
@ -55,13 +57,16 @@ Example settings for the dapr sidecar in a production-ready setup:
|
|||
|
||||
The CPU and memory limits above account for the fact that Dapr is intended to a high number of I/O bound operations. It is strongly recommended that you use a tool monitoring tool to baseline the sidecar (and app) containers and tune these settings based on those baselines.
|
||||
|
||||
## Highly-available mode
|
||||
|
||||
When deploying Dapr in a production-ready configuration, it's recommended to deploy with a highly available configuration of the control plane, which creates 3 replicas of each control plane pod in the dapr-system namespace.
|
||||
|
||||
## Deploying Dapr with Helm
|
||||
|
||||
When deploying to a production cluster, it's recommended to use Helm. Although the Dapr CLI can install Dapr onto a Kubernetes cluster, it is intended for use in dev/test scenarios.
|
||||
You can find information [here]({{< ref "install-dapr-selfhost.md#using-helm-advanced" >}}) on how to deploy Dapr using Helm.
|
||||
|
||||
When deploying Dapr in a production-ready configuration, it's recommended to deploy with a highly available configuration of the control plane. It is recommended to create a values file instead of specifying parameters on the command-line. This file should be checked in to source control so that you can track changes made to it.
|
||||
For a full guide on deploying Dapr with Helm visit [this guide]({{< ref "kubernetes-deploy.md#install-with-helm-advanced" >}}).
|
||||
|
||||
### Parameters file
|
||||
It is recommended to create a values file instead of specifying parameters on the command-line. This file should be checked in to source control so that you can track changes made to it.
|
||||
|
||||
For a full list of all available options you can set in the values file (or by using the `--set` command-line option), see https://github.com/dapr/dapr/blob/master/charts/dapr/README.md.
|
||||
|
||||
|
|
@ -108,18 +113,18 @@ Dapr supports zero downtime upgrades. The upgrade path includes the following st
|
|||
|
||||
### Upgrading the CLI
|
||||
|
||||
To upgrade the Dapr CLI, [download the latest version](https://github.com/dapr/cli/releases) of the CLI. After you downloaded the binary, it's recommended you put the CLI binary in your path.
|
||||
To upgrade the Dapr CLI, [download the latest version](https://github.com/dapr/cli/releases) of the CLI and ensure it's in your path.
|
||||
|
||||
### Upgrading the control plane
|
||||
|
||||
See [Steps to upgrade Dapr on a Kubernetes cluster]({{< ref kubernetes-upgrade.md >}})
|
||||
See [steps to upgrade Dapr on a Kubernetes cluster]({{< ref "kubernetes-upgrade.md#helm" >}}).
|
||||
|
||||
### Updating the data plane (sidecars)
|
||||
|
||||
The last step is to update pods that are running Dapr to pick up the new version of the Dapr runtime.
|
||||
To do that, simply issue a rollout restart command for any deployment that has the `dapr.io/enabled` annotation:
|
||||
|
||||
```
|
||||
```bash
|
||||
kubectl rollout restart deploy/<Application deployment name>
|
||||
```
|
||||
|
||||
|
|
@ -138,27 +143,29 @@ When properly configured, Dapr ensures secure communication. It can also make yo
|
|||
|
||||
It is recommended that a production-ready deployment includes the following settings:
|
||||
|
||||
1. Mutual Authentication (mTLS) should be enabled. Note that Dapr has mTLS on by default. For details on how to bring your own certificates, see [here]({{< ref "mtls.md#bringing-your-own-certificates" >}})
|
||||
1. **Mutual Authentication (mTLS)** should be enabled. Note that Dapr has mTLS on by default. For details on how to bring your own certificates, see [here]({{< ref "mtls.md#bringing-your-own-certificates" >}})
|
||||
|
||||
2. App to Dapr API authentication is enabled. This is the communication between your application and the Dapr sidecar. To secure the Dapr API from unauthorized application access, it is recommended to enable Dapr's token based auth. See [enable API token authentication in Dapr]({{< ref "api-token.md" >}}) for details
|
||||
2. **App to Dapr API authentication** is enabled. This is the communication between your application and the Dapr sidecar. To secure the Dapr API from unauthorized application access, it is recommended to enable Dapr's token based auth. See [enable API token authentication in Dapr]({{< ref "api-token.md" >}}) for details
|
||||
|
||||
3. Dapr to App API authentication is enabled. This is the communication between Dapr and your application. This ensures that Dapr knows that it is communicating with an authorized application. See [Authenticate requests from Dapr using token authentication]({{< ref "app-api-token.md" >}}) for details
|
||||
3. **Dapr to App API authentication** is enabled. This is the communication between Dapr and your application. This ensures that Dapr knows that it is communicating with an authorized application. See [Authenticate requests from Dapr using token authentication]({{< ref "app-api-token.md" >}}) for details
|
||||
|
||||
4. All component YAMLs should have secret data configured in a secret store and not hard-coded in the YAML file. See [here]({{< ref "component-secrets.md" >}}) on how to use secrets with Dapr components
|
||||
4. All component YAMLs should have **secret data configured in a secret store** and not hard-coded in the YAML file. See [here]({{< ref "component-secrets.md" >}}) on how to use secrets with Dapr components
|
||||
|
||||
5. The Dapr control plane is installed on a dedicated namespace such as `dapr-system`.
|
||||
5. The Dapr **control plane is installed on a dedicated namespace** such as `dapr-system`.
|
||||
|
||||
6. Dapr also supports scoping components for certain applications. This is not a required practice, and can be enabled according to your security needs. See [here]({{< ref "component-scopes.md" >}}) for more info.
|
||||
6. Dapr also supports **scoping components for certain applications**. This is not a required practice, and can be enabled according to your security needs. See [here]({{< ref "component-scopes.md" >}}) for more info.
|
||||
|
||||
|
||||
## Tracing and metrics configuration
|
||||
|
||||
Dapr has tracing and metrics enabled by default.
|
||||
To configure a tracing backend for Dapr visit [this]({{< ref "setup-tracing.md" >}}) link.
|
||||
Dapr has tracing and metrics enabled by default. It is *recommended* that you set up distributed tracing and metrics for your applications and the Dapr control plane in production.
|
||||
|
||||
For metrics, Dapr exposes a Prometheus endpoint listening on port 9090 which can be scraped by Prometheus.
|
||||
|
||||
It is *recommended* that you set up distributed tracing and metrics for your applications and the Dapr control plane in production.
|
||||
If you already have your own observability set-up, you can disable tracing and metrics for Dapr.
|
||||
|
||||
### Tracing
|
||||
To configure a tracing backend for Dapr visit [this]({{< ref "setup-tracing.md" >}}) link.
|
||||
|
||||
### Metrics
|
||||
For metrics, Dapr exposes a Prometheus endpoint listening on port 9090 which can be scraped by Prometheus.
|
||||
|
||||
To setup Prometheus, Grafana and other monitoring tools with Dapr, visit [this]({{< ref "monitoring" >}}) link.
|
||||
|
|
|
|||
|
|
@ -8,23 +8,45 @@ description: "Follow these steps to upgrade Dapr on Kubernetes and ensure a smoo
|
|||
|
||||
## Prerequisites
|
||||
|
||||
- [Dapr CLI]({{< ref install-dapr-cli.md >}}))
|
||||
- [Dapr CLI]({{< ref install-dapr-cli.md >}})
|
||||
- [Helm 3](https://github.com/helm/helm/releases) (if using Helm)
|
||||
|
||||
## Upgrade existing cluster to 1.0.0
|
||||
There are two ways to upgrade the Dapr control plane on a Kubernetes cluster using either the Dapr CLI or Helm. The preferred way is to use the Dapr CLI.
|
||||
## Upgrade existing cluster to 1.1.0
|
||||
There are two ways to upgrade the Dapr control plane on a Kubernetes cluster using either the Dapr CLI or Helm.
|
||||
|
||||
### Dapr CLI
|
||||
The example below shows how to upgrade to version 1.0.0
|
||||
|
||||
The example below shows how to upgrade to version 1.1.0:
|
||||
|
||||
```bash
|
||||
dapr upgrade -k --runtime-version=1.0.0
|
||||
dapr upgrade -k --runtime-version=1.0.1
|
||||
```
|
||||
|
||||
You can provide all the available Helm chart configurations using the Dapr CLI.
|
||||
See [here](https://github.com/dapr/cli#supplying-helm-values) for more info.
|
||||
|
||||
#### Troubleshooting upgrade using the CLI
|
||||
|
||||
There is a known issue running upgrades on clusters that may have previously had a version prior to 1.0.0-rc.2 installed on a cluster.
|
||||
|
||||
Most users should not encounter this issue, but there are a few upgrade path edge cases that may leave an incompatible CustomResourceDefinition installed on your cluster. The error message for this case looks like this:
|
||||
|
||||
```
|
||||
❌ Failed to upgrade Dapr: Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
|
||||
The CustomResourceDefinition "configurations.dapr.io" is invalid: spec.preserveUnknownFields: Invalid value: true: must be false in order to use defaults in the schema
|
||||
|
||||
```
|
||||
|
||||
To resolve this issue please run the follow command to upgrade the CustomResourceDefinition to a compatible version:
|
||||
|
||||
```
|
||||
kubectl replace -f https://raw.githubusercontent.com/dapr/dapr/5a15b3e0f093d2d0938b12f144c7047474a290fe/charts/dapr/crds/configuration.yaml
|
||||
```
|
||||
|
||||
Then proceed with the `dapr upgrade --runtime-version 1.1.0 -k` command as above.
|
||||
|
||||
### Helm
|
||||
|
||||
From version 1.0.0 onwards, upgrading Dapr using Helm is no longer a disruptive action since existing certificate values will automatically be re-used.
|
||||
|
||||
1. Upgrade Dapr from 1.0.0 (or newer) to any [NEW VERSION] > v1.0.0:
|
||||
|
|
@ -62,4 +84,4 @@ From version 1.0.0 onwards, upgrading Dapr using Helm is no longer a disruptive
|
|||
## Next steps
|
||||
|
||||
- [Dapr on Kubernetes]({{< ref kubernetes-overview.md >}})
|
||||
- [Dapr production guidelines]({{< ref kubernetes-production.md >}})
|
||||
- [Dapr production guidelines]({{< ref kubernetes-production.md >}})
|
||||
|
|
|
|||
|
|
@ -51,9 +51,9 @@ INFO[0001] leader is established. instance=Nicoletaz-L10.
|
|||
|
||||
```
|
||||
|
||||
From here on you can follow the sample example created for the [java-sdk](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/actors/http), [python-sdk](https://github.com/dapr/python-sdk/tree/master/examples/demo_actor) or [dotnet-sdk](https://github.com/dapr/dotnet-sdk/tree/master/samples/Actor) for running an application with Actors enabled.
|
||||
From here on you can follow the sample example created for the [java-sdk](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/actors), [python-sdk](https://github.com/dapr/python-sdk/tree/master/examples/demo_actor) or [dotnet-sdk]({{< ref "dotnet-actors-howto.md" >}}) for running an application with Actors enabled.
|
||||
|
||||
Update the state store configuration files to have the Redis host and password match the setup that you have. Additionally to enable it as a actor state store have the metadata piece added similar to the [sample Java Redis component](https://github.com/dapr/java-sdk/blob/master/examples/components/redis.yaml) definition.
|
||||
Update the state store configuration files to have the Redis host and password match the setup that you have. Additionally to enable it as a actor state store have the metadata piece added similar to the [sample Java Redis component](https://github.com/dapr/java-sdk/blob/master/examples/components/state/redis.yaml) definition.
|
||||
|
||||
```yaml
|
||||
- name: actorStateStore
|
||||
|
|
|
|||
|
|
@ -25,11 +25,11 @@ description: "Follow these steps to upgrade Dapr in self-hosted mode and ensure
|
|||
dapr init
|
||||
```
|
||||
|
||||
1. Ensure you are using the latest version of Dapr (1.0.0) with:
|
||||
1. Ensure you are using the latest version of Dapr (v1.1.0) with:
|
||||
|
||||
```bash
|
||||
$ dapr --version
|
||||
|
||||
CLI version: 1.0.0
|
||||
Runtime version: 1.0.0
|
||||
CLI version: 1.1.0
|
||||
Runtime version: 1.1.0
|
||||
```
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ type: docs
|
|||
title: "Metrics"
|
||||
linkTitle: "Metrics"
|
||||
weight: 4000
|
||||
description: "Observing Dapr metrics"
|
||||
description: "Observing Dapr metrics in Kubernetes"
|
||||
---
|
||||
|
||||
Dapr exposes a [Prometheus](https://prometheus.io/) metrics endpoint that you can scrape to gain a greater understanding of how Dapr is behaving and to setup alerts for specific conditions.
|
||||
|
|
@ -12,9 +12,40 @@ Dapr exposes a [Prometheus](https://prometheus.io/) metrics endpoint that you ca
|
|||
|
||||
The metrics endpoint is enabled by default, you can disable it by passing the command line argument `--enable-metrics=false` to Dapr system processes.
|
||||
|
||||
The default metrics port is `9090`. This can be overridden by passing the command line argument `--metrics-port` to Daprd.
|
||||
The default metrics port is `9090`. This can be overridden by passing the command line argument `--metrics-port` to Daprd. Additionally, the metrics exporter can be disabled for a specific application by setting the `dapr.io/enable-metrics: "false"` annotation to your application deployment. With the metrics exporter disabled, `daprd` will not open the metrics listening port.
|
||||
|
||||
To disable the metrics in the Dapr side car, you can use the `metric` spec configuration and set `enabled: false` to disable the metrics in the Dapr runtime.
|
||||
```yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nodeapp
|
||||
labels:
|
||||
app: node
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: node
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: node
|
||||
annotations:
|
||||
dapr.io/enabled: "true"
|
||||
dapr.io/app-id: "nodeapp"
|
||||
dapr.io/app-port: "3000"
|
||||
dapr.io/enable-metrics: "true"
|
||||
dapr.io/metrics-port: "9090"
|
||||
spec:
|
||||
containers:
|
||||
- name: node
|
||||
image: dapriosamples/hello-k8s-node:latest
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
imagePullPolicy: Always
|
||||
```
|
||||
|
||||
To disable the metrics collection in the Dapr side cars running in a specific namespace, you can use the `metric` spec configuration and set `enabled: false` to disable the metrics in the Dapr runtime.
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
|
|
@ -26,7 +57,7 @@ spec:
|
|||
tracing:
|
||||
samplingRate: "1"
|
||||
metric:
|
||||
enabled: false
|
||||
enabled: true
|
||||
```
|
||||
|
||||
## Metrics
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ the cloud or on-premises.
|
|||
The `tracing` section under the `Configuration` spec contains the following properties:
|
||||
|
||||
```yml
|
||||
tracing:
|
||||
spec:
|
||||
tracing:
|
||||
samplingRate: "1"
|
||||
zipkin:
|
||||
|
|
|
|||
|
|
@ -31,7 +31,9 @@ The table below shows the versions of Dapr releases that have been tested togeth
|
|||
|
||||
| Release date | Runtime | CLI | SDKs | Dashboard | Status |
|
||||
|--------------------|:--------:|:--------|---------|---------|---------|
|
||||
| Feb 17th 2021 | 1.0.0 | 1.0.0 | Java 1.0.0 </br>Go 1.0.0 </br>PHP 1.0.0 </br>Python 1.0.0 </br>.NET 1.0.0 | 0.6.0 | Supported (current) |
|
||||
| Feb 17th 2021 | 1.0.0</br>| 1.0.0 | Java 1.0.0 </br>Go 1.0.0 </br>PHP 1.0.0 </br>Python 1.0.0 </br>.NET 1.0.0 | 0.6.0 | Supported |
|
||||
| Mar 4th 2021 | 1.0.1</br>| 1.0.1 | Java 1.0.2 </br>Go 1.0.0 </br>PHP 1.0.0 </br>Python 1.0.0 </br>.NET 1.0.0 | 0.6.0 | Supported |
|
||||
| Apr 1st 2021 | 1.1.0</br> | 1.1.0 | Java 1.0.2 </br>Go 1.1.0 </br>PHP 1.0.0 </br>Python 1.1.0 </br>.NET 1.1.0 | 0.6.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
|
||||
|
|
@ -40,8 +42,10 @@ The table below shows the tested upgrade paths for the Dapr runtime. For example
|
|||
|
||||
| Current Runtime version | Must upgrade through | Target Runtime version | Notes
|
||||
|--------------------------|-----------------------|------------------------- |------------------------- |
|
||||
| 0.11 | N/A | 1.0.0 | Use Dapr CLI to upgrade for both self hosted and Kubernetes
|
||||
| 1.0-rc1 to 1.0-rc4 | N/A | 1.0.0 | See Dapr 1.0 release notes
|
||||
| 0.11 | N/A | 1.0.1 | Use Dapr CLI to upgrade for both self hosted and Kubernetes
|
||||
| | 1.0.1| 1.1.0 |
|
||||
| 1.0-rc1 to 1.0-rc4 | N/A | 1.0.1 | See Dapr 1.0 release notes
|
||||
| 1.0.0 or 1.0.1 | N/A | 1.1.0 | See Dapr 1.1 release notes
|
||||
|
||||
## Feature and deprecations
|
||||
There is a process for announcing feature deprecations. Deprecations are applied two (2) releases after the release in which they were announced. For example Feature X is announced to be deprecated in the 1.0.0 release notes and will then be removed in 1.2.0.
|
||||
|
|
@ -62,4 +66,4 @@ Here is an example, using a hypothetical 1.1.0 as the deprecation announcement r
|
|||
Dapr can support multiple hosting platforms for production. With the 1.0 release the two supported platforms are Kubernetes and physical machines. For Kubernetes upgrades see [Production guidelines on Kubernetes]({{< ref kubernetes-production.md >}})
|
||||
|
||||
## Related links
|
||||
* Read the [Versioning policy]({{< ref support-versioning.md >}})
|
||||
* Read the [Versioning policy]({{< ref support-versioning.md >}})
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ If your pod spec template is annotated correctly and you still don't see the sid
|
|||
|
||||
If this is the case, restarting the pods will fix the issue.
|
||||
|
||||
If you are deploying Dapr on a private GKE cluster, sidecar injection does not work without extra steps. See [Setup a Google Kubernetes Engine cluster]({{< ref setup-gke.md >}}).
|
||||
|
||||
In order to further diagnose any issue, check the logs of the Dapr sidecar injector:
|
||||
|
||||
```bash
|
||||
|
|
@ -202,4 +204,4 @@ This is usually due to one of the following issues
|
|||
|
||||
- You may have defined the `NAMESPACE` environment variable locally or deployed your components into a different namespace in Kubernetes. Check which namespace your app and the components are deployed to. Read [scoping components to one or more applications]({{< ref "component-scopes.md" >}}) for more information.
|
||||
- You may have not provided a `--components-path` with the Dapr `run` commands or not placed your components into the default components folder for your OS. Read [define a component]({{< ref "get-started-component.md" >}}) for more information.
|
||||
- You may have a syntax issue in component YAML file. Check your component YAML with the component [YAML samples]({{< ref "components.md" >}}).
|
||||
- You may have a syntax issue in component YAML file. Check your component YAML with the component [YAML samples]({{< ref "components.md" >}}).
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ dapr init [flags]
|
|||
| `--enable-mtls` | | `true` | Enable mTLS in your cluster |
|
||||
| `--help`, `-h` | | | Print this help message |
|
||||
| `--kubernetes`, `-k` | | `false` | Deploy Dapr to a Kubernetes cluster |
|
||||
| `--wait` | | `false` | Wait for Kubernetes initialization to complete |
|
||||
| `--timeout` | | `300` | The wait timeout for the Kubernetes installation |
|
||||
| `--namespace`, `-n` | | `dapr-system` | The Kubernetes namespace to install Dapr in |
|
||||
| `--network` | `DAPR_NETWORK` | | The Docker network on which to deploy the Dapr runtime |
|
||||
| `--runtime-version` | | `latest` | The version of the Dapr runtime to install, for example: `1.0.0` |
|
||||
|
|
@ -44,6 +46,15 @@ dapr init
|
|||
dapr init -k
|
||||
```
|
||||
|
||||
### Initialize Dapr in Kubernetes and wait for the installation to complete
|
||||
|
||||
You can wait for the installation to complete its deployment with the `--wait` flag.
|
||||
|
||||
The default timeout is 300s (5 min), but can be customized with the `--timeout` flag.
|
||||
```bash
|
||||
dapr init -k --wait --timeout 600
|
||||
```
|
||||
|
||||
### Initialize specified version of Dapr runtime in self-hosted mode
|
||||
```bash
|
||||
dapr init --runtime-version 0.10.0
|
||||
|
|
@ -57,4 +68,4 @@ dapr init -k --runtime-version 0.10.0
|
|||
### Initialize Dapr in [slim self-hosted mode]({{< ref self-hosted-no-docker.md >}})
|
||||
```bash
|
||||
dapr init -s
|
||||
```
|
||||
```
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ dapr run [flags] [command]
|
|||
| `--app-ssl` | | `false` | Enable https when Dapr invokes the application
|
||||
| `--components-path`, `-d` | | `Linux & Mac: $HOME/.dapr/components`, `Windows: %USERPROFILE%\.dapr\components` | The path for components directory
|
||||
| `--config`, `-c` | | `Linux & Mac: $HOME/.dapr/config.yaml`, `Windows: %USERPROFILE%\.dapr\config.yaml` | Dapr configuration file |
|
||||
| `--dapr-grpc-port` | | `3500` | The gRPC port for Dapr to listen on |
|
||||
| `--dapr-http-port` | | `50001` | The HTTP port for Dapr to listen on |
|
||||
| `--dapr-grpc-port` | | `50001` | The gRPC port for Dapr to listen on |
|
||||
| `--dapr-http-port` | | `3500` | The HTTP port for Dapr to listen on |
|
||||
| `--enable-profiling` | | `false` | Enable `pprof` profiling via an HTTP endpoint
|
||||
| `--help`, `-h` | | | Print this help message |
|
||||
| `--image` | | | The image to build the code in. Input is: `repository/image` |
|
||||
|
|
|
|||
|
|
@ -36,12 +36,12 @@ dapr upgrade -k
|
|||
|
||||
### Upgrade specified version of Dapr runtime in Kubernetes
|
||||
```bash
|
||||
dapr upgrade -k --runtime-version 1.0.0
|
||||
dapr upgrade -k --runtime-version 1.1.0
|
||||
```
|
||||
|
||||
### Upgrade specified version of Dapr runtime in Kubernetes with value set
|
||||
```bash
|
||||
dapr upgrade -k --runtime-version 1.0.0 --set global.logAsJson=true
|
||||
dapr upgrade -k --runtime-version 1.1.0 --set global.logAsJson=true
|
||||
```
|
||||
# Related links
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
{{ if .Path }}
|
||||
{{ $pathFormatted := replace .Path "\\" "/" }}
|
||||
{{ $gh_repo := ($.Param "github_repo") }}
|
||||
{{ $gh_subdir := ($.Param "github_subdir") }}
|
||||
{{ $gh_project_repo := ($.Param "github_project_repo") }}
|
||||
{{ $gh_branch := (default "master" ($.Param "github_branch")) }}
|
||||
{{ if $gh_repo }}
|
||||
<div class="td-page-meta ml-2 pb-1 pt-2 mb-0">
|
||||
{{ $gh_repo_path := printf "%s/content/%s" $gh_branch $pathFormatted }}
|
||||
{{ if and ($gh_subdir) (.Site.Language.Lang) }}
|
||||
{{ $gh_repo_path = printf "%s/%s/content/%s/%s" $gh_branch $gh_subdir ($.Site.Language.Lang) $pathFormatted }}
|
||||
{{ else if .Site.Language.Lang }}
|
||||
{{ $gh_repo_path = printf "%s/content/%s/%s" $gh_branch ($.Site.Language.Lang) $pathFormatted }}
|
||||
{{ else if $gh_subdir }}
|
||||
{{ $gh_repo_path = printf "%s/%s/content/%s" $gh_branch $gh_subdir $pathFormatted }}
|
||||
{{ end }}
|
||||
{{ $editURL := printf "%s/edit/%s" $gh_repo $gh_repo_path }}
|
||||
{{ $createURL := printf "%s/edit/%s" $gh_repo $gh_repo_path }}
|
||||
{{ $issuesURL := printf "%s/issues/new/choose" $gh_repo}}
|
||||
{{ $newPageStub := resources.Get "stubs/new-page-template.md" }}
|
||||
{{ $newPageQS := querify "value" $newPageStub.Content "filename" "change-me.md" | safeURL }}
|
||||
{{ $newPageURL := printf "%s/new/%s?%s" $gh_repo $gh_repo_path $newPageQS }}
|
||||
|
||||
<a href="{{ $editURL }}" target="_blank"><i class="fa fa-edit fa-fw"></i> {{ T "post_edit_this" }}</a>
|
||||
<a href="{{ $issuesURL }}" target="_blank"><i class="fab fa-github fa-fw"></i> {{ T "post_create_issue" }}</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<!-- Check the variable that indicates whether this is an archived doc set.
|
||||
If yes, display a banner. -->
|
||||
{{ if .Site.Params.archived_version }}
|
||||
{{ $color := "primary" }}
|
||||
{{ $latest_version := .Site.Params.url_latest_version }}
|
||||
{{ $current_version := .Site.Params.version }}
|
||||
<div class="pageinfo pageinfo-{{ $color }}">
|
||||
{{ with $current_version }}<p>The documentation you are viewing is for Dapr {{ . | markdownify }}
|
||||
which is an older version of Dapr.
|
||||
{{ with $latest_version }}For up-to-date documentation, see the
|
||||
<a href="{{ $latest_version | safeURL }}" target="_blank">latest version</a>.</p>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
{{ $color := .Get "color" | default "primary" }}
|
||||
{{ $page := .Get "page" }}
|
||||
{{ $link := .Get "link" | default "#" }}
|
||||
{{ $text := .Get "text" }}
|
||||
|
||||
{{- if $page -}}{{- $link = ref . $page -}}{{- end -}}
|
||||
|
||||
<a class="btn btn-{{ $color }}" href="{{ $link }}" role="button">{{ $text }}</a>
|
||||
|
|
@ -918,9 +918,9 @@
|
|||
}
|
||||
},
|
||||
"y18n": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
|
||||
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz",
|
||||
"integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==",
|
||||
"dev": true
|
||||
},
|
||||
"yargs": {
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 59 KiB |
|
|
@ -0,0 +1 @@
|
|||
Subproject commit fadb6c2654255864438c387a1a2b862eaf3af240
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 036fc63bf0a919843827e263ec287d55e3188b7b
|
||||
Loading…
Reference in New Issue