GithubHelp home page GithubHelp logo

dapr / samples Goto Github PK

View Code? Open in Web Editor NEW
400.0 400.0 170.0 23.9 MB

Community driven repository for Dapr samples

License: Apache License 2.0

C# 14.17% JavaScript 24.78% Shell 8.24% Dockerfile 3.03% Go 4.02% CSS 3.23% HTML 2.51% PowerShell 11.02% Python 11.33% Makefile 4.56% TypeScript 0.86% Java 10.04% Bicep 2.22%
binding dapr events pubsub service state

samples's Introduction

Any language, any framework, anywhere

Go Report Card OpenSSF Best Practices Docker Pulls Build Status E2E Tests codecov Discord License: Apache 2.0 FOSSA Status TODOs Follow on Twitter

Dapr is a portable, serverless, event-driven runtime that makes it easy for developers to build resilient, stateless and stateful microservices that run on the cloud and edge and embraces the diversity of languages and developer frameworks.

Dapr codifies the best practices for building microservice applications into open, independent, building blocks that enable you to build portable applications with the language and framework of your choice. Each building block is independent and you can use one, some, or all of them in your application.

Dapr overview

We are a Cloud Native Computing Foundation (CNCF) incubation project.

Goals

  • Enable developers using any language or framework to write distributed applications
  • Solve the hard problems developers face building microservice applications by providing best practice building blocks
  • Be community driven, open and vendor neutral
  • Gain new contributors
  • Provide consistency and portability through open APIs
  • Be platform agnostic across cloud and edge
  • Embrace extensibility and provide pluggable components without vendor lock-in
  • Enable IoT and edge scenarios by being highly performant and lightweight
  • Be incrementally adoptable from existing code, with no runtime dependency

How it works

Dapr injects a side-car (container or process) to each compute unit. The side-car interacts with event triggers and communicates with the compute unit via standard HTTP or gRPC protocols. This enables Dapr to support all existing and future programming languages without requiring you to import frameworks or libraries.

Dapr offers built-in state management, reliable messaging (at least once delivery), triggers and bindings through standard HTTP verbs or gRPC interfaces. This allows you to write stateless, stateful and actor-like services following the same programming paradigm. You can freely choose consistency model, threading model and message delivery patterns.

Dapr runs natively on Kubernetes, as a self hosted binary on your machine, on an IoT device, or as a container that can be injected into any system, in the cloud or on-premises.

Dapr uses pluggable component state stores and message buses such as Redis as well as gRPC to offer a wide range of communication methods, including direct dapr-to-dapr using gRPC and async Pub-Sub with guaranteed delivery and at-least-once semantics.

Why Dapr?

Writing highly performant, scalable and reliable distributed application is hard. Dapr brings proven patterns and practices to you. It unifies event-driven and actors semantics into a simple, consistent programming model. It supports all programming languages without framework lock-in. You are not exposed to low-level primitives such as threading, concurrency control, partitioning and scaling. Instead, you can write your code by implementing a simple web server using familiar web frameworks of your choice.

Dapr is flexible in threading and state consistency models. You can leverage multi-threading if you choose to, and you can choose among different consistency models. This flexibility enables you to implement advanced scenarios without artificial constraints. Dapr is unique because you can transition seamlessly between platforms and underlying implementations without rewriting your code.

Features

  • Event-driven Pub-Sub system with pluggable providers and at-least-once semantics
  • Input and output bindings with pluggable providers
  • State management with pluggable data stores
  • Consistent service-to-service discovery and invocation
  • Opt-in stateful models: Strong/Eventual consistency, First-write/Last-write wins
  • Cross platform virtual actors
  • Secret management to retrieve secrets from secure key vaults
  • Rate limiting
  • Built-in Observability support
  • Runs natively on Kubernetes using a dedicated Operator and CRDs
  • Supports all programming languages via HTTP and gRPC
  • Multi-Cloud, open components (bindings, pub-sub, state) from Azure, AWS, GCP
  • Runs anywhere, as a process or containerized
  • Lightweight (58MB binary, 4MB physical memory)
  • Runs as a sidecar - removes the need for special SDKs or libraries
  • Dedicated CLI - developer friendly experience with easy debugging
  • Clients for Java, .NET Core, Go, Javascript, Python, Rust and C++

Get Started using Dapr

See our Getting Started guide over in our docs.

Quickstarts and Samples

Community

We want your contributions and suggestions! One of the easiest ways to contribute is to participate in discussions on the mailing list, chat on IM or the bi-weekly community calls. For more information on the community engagement, developer and contributing guidelines and more, head over to the Dapr community repo.

Contact Us

Reach out with any questions you may have and we'll make sure to answer them as soon as possible!

Platform Link
💬 Instant Message Chat (preferred) Discord Banner
📧 Mailing List https://groups.google.com/forum/#!forum/dapr-dev
🐤 Twitter @daprdev

Community Call

Every two weeks we host a community call to showcase new features, review upcoming milestones, and engage in a Q&A. All are welcome!

📞 Visit https://aka.ms/dapr-community-call for upcoming dates and the meeting link.

Videos and Podcasts

We have a variety of keynotes, podcasts, and presentations available to reference and learn from.

📺 Visit https://docs.dapr.io/contributing/presentations/ for previous talks and slide decks.

Contributing to Dapr

See the Development Guide to get started with building and developing.

Repositories

Repo Description
Dapr The main repository that you are currently in. Contains the Dapr runtime code and overview documentation.
CLI The Dapr CLI allows you to setup Dapr on your local dev machine or on a Kubernetes cluster, provides debugging support, launches and manages Dapr instances.
Docs The documentation for Dapr.
Quickstarts This repository contains a series of simple code samples that highlight the main Dapr capabilities.
Samples This repository holds community maintained samples for various Dapr use cases.
Components-contrib The purpose of components contrib is to provide open, community driven reusable components for building distributed applications.
Dashboard General purpose dashboard for Dapr
Go-sdk Dapr SDK for Go
Java-sdk Dapr SDK for Java
JS-sdk Dapr SDK for JavaScript
Python-sdk Dapr SDK for Python
Dotnet-sdk Dapr SDK for .NET
Rust-sdk Dapr SDK for Rust
Cpp-sdk Dapr SDK for C++
PHP-sdk Dapr SDK for PHP

Code of Conduct

Please refer to our Dapr Community Code of Conduct

samples's People

Contributors

aaroncrawfis avatar artursouza avatar brunoborges avatar cgillum avatar codefromthecrypt avatar darquewarrior avatar dependabot[bot] avatar edwinvw avatar greenie-msft avatar harrykimpel avatar kendallroden avatar marcduiker avatar mcandeia avatar mchmarny avatar msfussell avatar mukundansundar avatar my-petrichor avatar paulyuk avatar pkedy avatar pravinpushkar avatar robece avatar ross-p-smith avatar shchauh avatar shubham1172 avatar taction avatar tcnghia avatar tenst avatar willtsai avatar willvelida avatar yaron2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

samples's Issues

Compose: hello-docker-compose Explanation Questions

While this example works, it left me with a few questions.

1. Why is the node app grpc port exposed to the host computer?
2. Why does the node app depend on placement?
3. The app-id is the same as the name of the service, is that important/required?

Support listing of external samples

There is a number of Dapr samples all over GitHub. Given the existing disclaimer about each sample being maintainer by its author, the dapr/samples repo should allow for listing of external samples, ones located in user's repo.

Here are some arguments for this approach:

  • Maintainability over time
  • Users clone only the repo for the sample they want to use (not repo of many samples)
  • Ability to support integrations (e.g. Dockerfile or GitHub actions in root)

This approach would still allow for curated list of samples and the dapr/samples repo would still be the go-to place for listing of Dapr demos/samples.

Few popular examples of this approach:

Compose: Some questions on running Hello Docker Compose.

Still trying to understand this:

Q) The Node app exposes port 3000, but here we map 50002 to 50002, why and what if multiple ports are exposed by service?
nodeapp:
build: ./node
ports:
- "50002:50002"

Q) a single -app-port, what if the container exposes multiple ports, 80, 443?
nodeapp-dapr:
image: "daprio/daprd:edge"
command: ["./daprd",
"-app-id", "nodeapp",
"-app-port", "3000",

Q)
Do I need to stop the default containers that Dapr Init creates ?

Q)
Is the placement service only necessary when using actors ?

Q)
Will these services display with dashboard and zipking ?
If so how do I access them ? the default urls are not displaying the services.

thx... :-)

"couldn't find trust anchors in environment variable DAPR_TRUST_ANCHORS" in hello-docker-compose example

When I try to run this example, I get the msg "couldn't find trust anchors in environment variable DAPR_TRUST_ANCHORS".
I just change the port of node app and related config in Dockerfile and docker-compose.

Here is the full output:
$ hello-docker-compose > docker-compose up
Starting hello-docker-compose_placement_1 ... done
Starting hello-docker-compose_redis_1 ... done
Starting hello-docker-compose_pythonapp_1 ... done
Recreating hello-docker-compose_nodeapp_1 ... done
Starting hello-docker-compose_pythonapp-dapr_1 ... done
Recreating hello-docker-compose_nodeapp-dapr_1 ... done
Attaching to hello-docker-compose_redis_1, hello-docker-compose_placement_1, hello-docker-compose_pythonapp_1, hello-docker-compose_pythonapp-dapr_1, hello-docker-compose_nodeapp_1, hello-docker-compose_nodeapp-dapr_1
nodeapp_1 | Node App listening on port 7500!
placement_1 | time="2021-08-24T09:03:26.130927792Z" level=info msg="starting Dapr Placement Service -- version 1.3.0 -- commit 4bab7576ed68a9ece1a4743a7925f18ef583775a" instance=3f2415963b28 scope=dapr.placement type=log ver=unknown
placement_1 | time="2021-08-24T09:03:26.131061238Z" level=info msg="log level set to: info" instance=3f2415963b28 scope=dapr.placement type=log ver=1.3.0
placement_1 | time="2021-08-24T09:03:26.131151741Z" level=info msg="metrics server started on :9090/" instance=3f2415963b28 scope=dapr.metrics type=log ver=1.3.0
placement_1 | time="2021-08-24T09:03:26.131524408Z" level=info msg="Raft server is starting on 127.0.0.1:8201..." instance=3f2415963b28 scope=dapr.placement.raft type=log ver=1.3.0
placement_1 | time="2021-08-24T09:03:26.131556461Z" level=info msg="placement service started on port 50006" instance=3f2415963b28 scope=dapr.placement type=log ver=1.3.0
pythonapp-dapr_1 | time="2021-08-24T09:03:27.041031503Z" level=info msg="starting Dapr Runtime -- version edge -- commit 1f9adeed5be68005070ed85b63b52ee41331d4bc" app_id=pythonapp instance=636e33cae739 scope=dapr.runtime type=log ver=edge
pythonapp-dapr_1 | time="2021-08-24T09:03:27.041093688Z" level=info msg="log level set to: info" app_id=pythonapp instance=636e33cae739 scope=dapr.runtime type=log ver=edge
placement_1 | time="2021-08-24T09:03:26.131771597Z" level=info msg="Healthz server is listening on :8080" instance=3f2415963b28 scope=dapr.placement type=log ver=1.3.0
pythonapp-dapr_1 | time="2021-08-24T09:03:27.041247478Z" level=info msg="metrics server started on :9090/" app_id=pythonapp instance=636e33cae739 scope=dapr.metrics type=log ver=edge
placement_1 | time="2021-08-24T09:03:27.159422221Z" level=info msg="cluster leadership acquired" instance=3f2415963b28 scope=dapr.placement type=log ver=1.3.0
placement_1 | time="2021-08-24T09:03:27.159573792Z" level=info msg="leader is established." instance=3f2415963b28 scope=dapr.placement type=log ver=1.3.0
pythonapp-dapr_1 | time="2021-08-24T09:03:27.042136674Z" level=fatal msg="couldn't find trust anchors in environment variable DAPR_TRUST_ANCHORS" app_id=pythonapp instance=636e33cae739 scope=dapr.runtime type=log ver=edge
redis_1 | 1:C 24 Aug 2021 09:03:26.133 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis_1 | 1:C 24 Aug 2021 09:03:26.133 # Redis version=6.2.5, bits=64, commit=00000000, modified=0, pid=1, just started
redis_1 | 1:C 24 Aug 2021 09:03:26.133 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
hello-docker-compose_pythonapp-dapr_1 exited with code 1
redis_1 | 1:M 24 Aug 2021 09:03:26.134 * monotonic clock: POSIX clock_gettime
redis_1 | 1:M 24 Aug 2021 09:03:26.135 * Running mode=standalone, port=6379.
redis_1 | 1:M 24 Aug 2021 09:03:26.135 # Server initialized
redis_1 | 1:M 24 Aug 2021 09:03:26.135 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
redis_1 | 1:M 24 Aug 2021 09:03:26.136 * Loading RDB produced by version 6.2.5
redis_1 | 1:M 24 Aug 2021 09:03:26.136 * RDB age 87 seconds
redis_1 | 1:M 24 Aug 2021 09:03:26.136 * RDB memory usage when created 0.77 Mb
redis_1 | 1:M 24 Aug 2021 09:03:26.136 * DB loaded from disk: 0.000 seconds
redis_1 | 1:M 24 Aug 2021 09:03:26.136 * Ready to accept connections
nodeapp-dapr_1 | time="2021-08-24T09:03:27.792156548Z" level=info msg="starting Dapr Runtime -- version edge -- commit 1f9adeed5be68005070ed85b63b52ee41331d4bc" app_id=nodeapp instance=6f70900c093c scope=dapr.runtime type=log ver=edge
nodeapp-dapr_1 | time="2021-08-24T09:03:27.792204756Z" level=info msg="log level set to: info" app_id=nodeapp instance=6f70900c093c scope=dapr.runtime type=log ver=edge
nodeapp-dapr_1 | time="2021-08-24T09:03:27.792342536Z" level=info msg="metrics server started on :9090/" app_id=nodeapp instance=6f70900c093c scope=dapr.metrics type=log ver=edge
nodeapp-dapr_1 | time="2021-08-24T09:03:27.794419449Z" level=fatal msg="couldn't find trust anchors in environment variable DAPR_TRUST_ANCHORS" app_id=nodeapp instance=6f70900c093c scope=dapr.runtime type=log ver=edge
hello-docker-compose_nodeapp-dapr_1 exited with code 1

Add external project eShopOnDapr

Is it possible to add this https://github.com/dotnet-architecture/eShopOnDapr to the External Samples? It is the code sample for the Microsoft free ebook "Dapr for .NET Developers" https://docs.microsoft.com/en-us/dotnet/architecture/dapr-for-net-developers/

Not only does this book have lots of code examples, but it also shows how to use Visual Studio to make containers and then run them with Docker Compose and allows debugging with Visual Studio. All this uses the Visual Studio tooling which makes things much easier! Thanks.

npm gyp error when trying to run the sample

I am trying to run this hello-typescript sample.

PS > node --version
v16.13.2

When I run the third step npm install, I get the following error.

npm ERR! gyp ERR! cwd E:\Vivek\Trials\Ddd\Dapr\Samples\hello-typescript\node_modules\grpc
npm ERR! gyp ERR! node -v v16.13.2
npm ERR! gyp ERR! node-gyp -v v8.3.0
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error 

Not sure what I am missing.

Here is the log file that got generated in the folder C:\Users\UserName\AppData\Local\npm-cache_logs

2022-01-20T04_52_56_304Z-debug.log

Pub-Sub Sample Using .NET

I was unable to find a good Pub-Sub sample using the .NET SDK.

I have created a sample on my own and would like to open a PR to include it in this repo.

Docker compose file to run dapr sidecar and asp.net core web api

Hi , can someone please help me out get up and run dapr sidecar and asp.net core web API application, please suggest any change need to do in my docker compose file. version: '3.4'
services:
deviceapi:
image: ${DOCKER_REGISTRY-}deviceapi
build:
context: .
dockerfile: Dockerfile
ports:
- "3000:80"
depends_on:
- db
networks:
- my-dapr-network
db:
image: "mcr.microsoft.com/mssql/server"
environment:
SA_PASSWORD: "Cr0wc0n@123"
ACCEPT_EULA: "Y"
networks:
- my-dapr-network
deviceapp-dapr:
image: "daprio/daprd:edge"
command: ["./daprd",
"-app-id", "deviceservice",
"-app-port", "5000",
"-placement-host-address", "placement:50006",
"-dapr-grpc-port", "50001",
"-components-path", "/components"]
volumes:
- "./components/:/components"
depends_on:
- deviceapi
network_mode: "service:deviceapi"

placement:
image: "daprio/dapr"
command: ["./placement", "-port", "50006"]
ports:
- "50006:50006"
networks:
- my-dapr-network
redis:
image: "redis:alpine"
ports:
- "6381:6379"
networks:
- my-dapr-network

networks:
my-dapr-network:

Split demo 1 components

For clarity and to follow pattern from the other demos, split the components from 2020-05-Build/demos/demo1/provider-net/components/producer.yaml into individual files and add the auto-generated files (pubsub.yaml, statestore.yaml) to the .gitignore list.

What is the approach for docker image repositories on sample repo?

Hi!

I just realized that I missed to change the image for the middleware-clientcredential sample app see here (private repo):

image: cse21.azurecr.io/msgraphapp:sample

I wanted to change this to docker.io/dapriosamples/middleware-msgraphapp:edge because I started by copy the quickstart middleware sample and modified the makefile to create and push the image here:

DOCKER_IMAGE_PREFIX ?=middleware-
APPS ?=msgraphapp
SAMPLE_REGISTRY ?=docker.io/dapriosamples
REL_VERSION ?=edge

But I guess there is no build pipeline set up? How should we handle this?

I could push the image to my docker hub account, but not sure if this is a a good long term approach?

Add Pluggable Component .NET template

Considerations:

  • It should only be possible to run on UNIX-like systems - Unix Domain Sockets dependency.
  • It should refer to .NET official documentation

Add a sample for TypeScript applications

Describe the proposal

It'd be great if there is also a sample available for a TypeScript based Dapr application.

Currently I'm running the app via

{
  "name": "my-app",
  ...
  "scripts": {
    "dapr": "dapr run --app-id my-app --app-port 3000 ts-node-dev lib/main.ts"
  },
  "dependencies": {
    ...
  },
  "devDependencies": {
    "ts-node-dev": "^1.0.0-pre.44",
    ...
  }
}
npm run dapr

but not sure if this is the most elegant / recommended way for running TS based Dapr applications locally.

Btw., having the samples repo and the docs/howto section (which again contains samples) is very confusing as I've to search always in two places.

hello-docker-compose zipkin tracing not working

I want to trace call made by python app to node app. This is normally working when I do dapr from command prompt.

  • I am using WSL2 for running docker.

  • Deployment of hello-docker-compose is success too.

To add traceability I have added following thing in docker-compose.

zipkin:
    image: "openzipkin/zipkin"
    ports:
      - "9412:9411"
    networks:
      - hello-dapr  

In components I have added following file. ( trace.yaml)

apiVersion: dapr.io/v1alpha1
kind: Configuration
metadata:
  name: zipkin
  namespace: default
spec:
  tracing:
    samplingRate: "1"
    zipkin:
      endpointAddress: "http://zipkin:9411/api/v2/spans"

I am not able to see any tracing.

To check that zipkin is available on specified endpointAddress , I did following things.

I have run ubuntu container in same hello-dapr network. Try to ping zipkin and it is working so container is there.

Another thing I did is manually load data to zipkin using curl and that also work successful.

Now I am not getting that why python app to nodejs app communication is not traced.

Am I missing something in configuration ?

Emphasis on multiple languages

These samples tend to emphasize the fact that dapr is multi-language neutral and include multiple languages in the sample.

The distributed calculator requires downloading and installing multiple languages just to get going. I see this as a potential barrier.

Would there be a chance of having distributed calculator samples that are only one language as well as the one that shows all the languages? This way we can chose which one resonates more - one that emphasizes that using HTTP and gRPC provides language disintermediation and one that makes it easy for someone who only uses one language and would like a simplified sample.

Twitter Sentiment Setup Bash Script Issues

Environment Used: macOS / zsh shell

  1. On Demo 3, the docs say to run the bash setup script with the following command:

./setup.sh myDemo westus2 '1.0.0' '1.19.6'

However, when you run it in such manner, the script fails because the positional parameters are out of order - the current script actually expects: ./setup.sh myDemo '1.0.0' westus2 '1.19.6' where the Dapr version precedes the location.

Cross checking how the PowerShell script is written, the order matches the docs (I.E. resourceGroup, location, DaprVersion, K8sVersion)

  1. The default K8s version, 1.19.6, is deprecated and cannot be deployed.

  2. On lines 107 and 108 when the getIp function is called for viewer and publiczipkin, the text output usage: sleep seconds is printed out on the screen every second.

Java Sample using DAPR on AKS

Hi there, we carried out some upskilling in Dapr for a project using Java Microservices architecture and wondered if it was a good fit to live under your samples? Happy to have a chat as we have a few weeks of wrapping up our project that we could lean in and shape the sample

You can have a look at it here: - https://github.com/mahmutcanga/java-banking-pubsub-dapr-sample

We are also thinking about putting this in Azure Samples - but would love a reach out!

Issue relating to repository middleware-oauth-google

Hi Team, @paulyuk

relating to repository middleware-oauth-google,
As per echoapp.yaml file, its searching for image from repository location image: dapriosamples/middleware-echoapp:latest.

Let me know if we need to push image to this repo or its already exist in it?
Do we need to pass imagepullsecrets etc so that image can be available to read?

Currently for me http://dummy.com/v1.0/invoke/echoapp/method/echo?text=hello link is not connecting.

dapr-apim-integration sample: echo-service and event-subscriber need a tracing config and fail to start

echo-service and event-subscriber have the annotation:

dapr.io/config: "tracing"

and fail to start as they can't find this config.

Fix:

  • Create a tracing config in file k8s/tracing.config.yaml:
apiVersion: dapr.io/v1alpha1
kind: Configuration
metadata:
  name: tracing
  namespace: default
spec:
  tracing:
    samplingRate: "1"
    zipkin:
      endpointAddress: "http://zipkin.default.svc.cluster.local:9411/api/v2/spans"
kubectl apply -f k8s/tracing.config.yaml

Install Zipkin:

kubectl create deployment zipkin --image openzipkin/zipkin
kubectl expose deployment zipkin --type ClusterIP --port 9411

Redeploy echo-service and event-subscriber.

My environment:

  • Dapr 1.5.1
  • Kubernetes: v1.21.2

dapr-apim-integration sample: event-subscriber missing dapr.io/app-id annotation

In file: https://github.com/dapr/samples/blob/master/dapr-apim-integration/k8s/event-subscriber.yaml

When I run: kubectl get pods

I see no pods for event-subscriber.

When I run kubctl get deploy event-subscriber -o yaml, I see an error under status:

message: 'admission webhook "sidecar-injector.dapr.io" denied the request: value
      for the dapr.io/app-id annotation is empty'

Updating and applying k8s/event-subscriber.yaml fixes this issue:

# dapr.io/id: "event-subscriber"
dapr.io/app-id: "event-subscriber"

My environment:

  • Dapr 1.5.1
  • Kubernetes: v1.21.2

Update k8s registry references

Describe the feature

Per kubernetes/k8s.io#4780, Kubernetes is migrating its image registry to registry.k8s.io, and this repository is impacted.

We have to update the references of k8s.gcr.io to registry.k8s.io by April 3rd to remain up-to-date.

Here's a quick search for k8s.gcr.io on this repo. [search result]. Note that there may be other valid references (like, in the form of generated code, etc) which we have to be aware of.

Release Note

RELEASE NOTE:

  • Update k8s registry from k8s.gcr.io to registry.k8s.io

Documentation error?

Hi,

Recently we have decided to give dapr a try with our microservices.
Yesterday when I started to test with docker the following config was strange to me,
the -app-port config on the sidecards looks wrong. Shouldn't it be listening to what the actual app is listening too (It is the same as the cli right? https://docs.dapr.io/reference/cli/dapr-run/)?

I am setting it up with redis pubsub and two dotnet core webapis and with following this config I couldn't get it to work so I change the -app-port from 3000 to the port my app was really listening too and it worked.
But I think maybe its because in your case it is gRPC? I'm not sure.

But thanks for the documentation anyway at least it is there in most cases its not for other libraries/packages. 😊

version: '3'
services:
  ############################
  # Node app + Dapr sidecar
  ############################
  nodeapp:
    build: ./node
    ports:
      - "50002:50002"
    depends_on:
      - redis
      - placement
    networks:
      - hello-dapr
  nodeapp-dapr:
    image: "daprio/daprd:edge"
    command: ["./daprd",
     "-app-id", "nodeapp",
     "-app-port", "3000",
     "-placement-host-address", "placement:50006",
     "-dapr-grpc-port", "50002",
     "-components-path", "/components"]
    volumes:
        - "./components/:/components"
    depends_on:
      - nodeapp
    network_mode: "service:nodeapp"
  ############################
  # Python app + Dapr sidecar
  ############################
  pythonapp:
    build: ./python
    depends_on:
      - redis
      - placement
    networks:
      - hello-dapr
  pythonapp-dapr:
    image: "daprio/daprd:edge"
    command: ["./daprd",
    "-app-id", "pythonapp",
    "-placement-host-address", "placement:50006",
    "-components-path", "/components"]
    volumes:
      - "./components/:/components"
    depends_on:
      - pythonapp
    network_mode: "service:pythonapp"
  ############################
  # Dapr placement service
  ############################
  placement:
    image: "daprio/dapr"
    command: ["./placement", "-port", "50006"]
    ports:
      - "50006:50006"
    networks:
      - hello-dapr
  ############################
  # Redis state store
  ############################
  redis:
    image: "redis:alpine"
    ports:
      - "6380:6379"
    networks:
      - hello-dapr
networks:
    hello-dapr:

New HowTo use dapr with an ingress controller

Describe the proposal

Add a new sample that extends distributed calculator to demonstrate how we can enable communication from outside world to dapr apps running on a cluster using ingress controller. Most common choices for ingress controllers are NGINX and haproxy.

dapr-apim-integration sample: No prompt or instructions to install Dapr in Kubernetes

The sample assumes Dapr in already installed on the Kubernetes cluster. The prerequisites do mention "Kubernetes cluster with Dapr" but point to installing Dapr locally.

Proposed fix:

The install steps are:

Install Dapr CLI: https://docs.dapr.io/getting-started/install-dapr-cli/
e.g. on Linux:

wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash

Then install Dapr in the cluster:

dapr init -k

My environment:

  • Dapr 1.5.1
  • Kubernetes: v1.21.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.