Skip to content

tonysneed/Demo.TyeDapr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tye with Dapr

Installation: https://www.nuget.org/packages/Microsoft.Tye

Note: On Mac you will need to set the tools PATH explicitly for zsh. Create a .zprofile file in home directory with: export PATH="$PATH:/$HOME/.dotnet/tools"

Frontend and Backend Apps: https://github.com/dotnet/tye/blob/master/docs/recipes/dapr.md

Type with Dapr:

  • Run tye init at the solution level to create tye.yml file

  • Under name add:

    extensions:
    - name: dapr

Run at the solution level: tye run

Tye Dashboard: http://localhost:8000/

  • Click on service bindings to view app or web api.
  • Append swagger or weatherforecast to web api url.

Debugging with Tye: https://dev.to/thangchung/debugging-dapr-application-using-tye-tool-1djb

  • Run tye run --debug Backend/Backend.csproj
  • In Visual Studio attach to both FrontEnd.exe and Backend.exe processes.
  • Set breakpoints and debug.

Kubernetes One-time Setup: https://github.com/dapr/quickstarts/tree/v1.0.0/hello-kubernetes

  • Enable Kubernetes on Docker Desktop.

  • Install kubectl (Mac, Windows).

    kubectl port-forward kubernetes-dashboard-7798c48646-ctrtl 8443:8443 --namespace=kube-system
    
  • Install Kubernetes Dashboard.

    kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/alternative/kubernetes-dashboard.yaml
    kubectl proxy
    
    • Get kubernetes access token.
    kubectl -n kubernetes-dashboard get secret $(kubectl -n kubernetes-dashboard get sa/admin-user -o jsonpath="{.secrets[0].name}") -o go-template="{{.data.token | base64decode}}"
    
  • Initialize Dapr for Kubernetes.

    dapr init -k
    dapr status -k
    

Kubernetes Deployment with Tye: https://github.com/dotnet/tye/blob/main/docs/reference/deployment.md

Note: Sign into Docker Desktop to use Docker Hub container registry.

  • Deploy with Tye using interactive mode.

    tye deploy -i
    
    • When prompted enter container registry or Docker Hub account name.
  • View the services using kubectl: kubectl get service.

  • Apply port forwarding to the frontend service.

    kubectl port-forward svc/frontend 5000:80
    
  • Apply port forwarding to the backend service (optional).

    kubectl port-forward svc/backend 5050:80
    
  • When finished you can delete the application from Kubernetes.

    tye undeploy
    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published