Let's start with TYE

Tye is a developer tool that makes developing, testing, and deploying microservices and distributed applications easier. It includes a local orchestrator to make deploy of microservices to Kubernetes with minimal configuration.

The demo described in this post consists two projects:

  • frontend and
  • backend

frontend is an APS.NET Core application that invokes the REST service hosted in the backend. Clone the solution fromdemo repository and open the command prompt in the root of the solution.
If you want to develop and debug the demo application, please note that the configuration of the frontend must hold the correct URL of the backend:

{
  "backend": "https://localhost:44316",
  "DetailedErrors": true,
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  }
}

When running all with Tye in Kubernetes, this configuration entry is not required. The url is in that case looked up by the Tye runtime.

To run the system locally, do following. Run the tye command line in the folder with the solution.

tye run

This will produce following output:

[12:26:11 INF] Executing application from C:\Temp\tye\frontend\frontend.csproj
[12:26:12 INF] Dashboard running on http://127.0.0.1:8000
[12:26:12 INF] Building projects
[12:26:13 INF] Launching service frontend_132e1456-f: C:\Temp\tye\frontend\bin\Debug\netcoreapp3.1\frontend.exe
[12:26:13 INF] frontend_132e1456-f running on process id 7908 bound to http://localhost:62130, https://localhost:62131
[12:26:13 INF] Replica frontend_132e1456-f is moving to a ready state
[12:26:14 INF] Selected process 7908.
[12:26:14 INF] Listening for event pipe events for frontend_132e1456-f on process id 7908

Now, you can navigate to the Tye dashboard:

http://127.0.0.1:8000

You should see this dashboard:

Navigate to one of two frontend urls. You should see following:

If you navigate to the backend url (https://localhost:63973/swagger) you should see following:

Deploy to Kubernetes

First of all you need to provision the Kubernetes cluster: https://docs.microsoft.com/en-us/azure/aks/tutorial-kubernetes-deploy-cluster.
In the last step get required credentials:

az aks get-credentials --resource-group myResourceGroup --name myAKSCluster

Additionally you also need to provide the registry where docker images of frontend and backend will be pushed (https://docs.microsoft.com/en-us/azure/aks/tutorial-kubernetes-prepare-acr).

After this is done, the tye is ready do easy deploy the solution. Navigate to the solution folder and execute following:

tye deploy --interactive

You will be prompted to enter the Container Registry (ex: 'example.azurecr.io' for Azure or 'example' for dockerhub) where the Kubernetes service is installed.

Enter the Container Registry (ex: 'example.azurecr.io' for Azure or 'example' for dockerhub):

Here is the output of the commad:

The deployment process has built the docker container and pushed repositories to my registry:

image

If you navigate to the Kubernetes service in the Azure Portal you will notice our two services backend and frontend:

For more information see:
Tutorial: https://github.com/dotnet/tye/blob/master/docs/tutorials/hello-tye/00_run_locally.md
Deploying: https://github.com/dotnet/tye/blob/master/docs/tutorials/hello-tye/01_deploy.md

Demo code for this blog post: https://github.com/ddobric/tye-demo


comments powered by Disqus