Giter Site home page Giter Site logo

rupeshtech / k8s-grpc-dotntecore Goto Github PK

View Code? Open in Web Editor NEW
13.0 2.0 2.0 1.6 MB

This repository contains step-by-step guide to create test and deploy grpc server in .net cre 3.0,. It also includes sample application and yaml file

Dockerfile 9.70% C# 90.30%
kubernetes grpc dotnetcore dotnet-core grpc-server azure csharp grpc-service aks

k8s-grpc-dotntecore's Introduction

gRPC

This example demonstrates step by step to create, run, deploy and  consume a gRPC service in .NetCore 3.0.
Whole process is has been categorized in 3 main section **Create, Test and Deploy**.

Detailed explanation for each step

There are seperate(detailed) document for each process describing step by step(from scratch). Each document starts for scratch till end. So read each steps carefully Detailed document for:

  1. How to Create grpc in C# (.NET Core 3.0)
  2. How to Test using grpcurl
  3. How to Deploy in Azure Kubernetes (aks)

Prerequisites

  1. You have a latest version of Visual studio.
  2. You have a .NET Core 3.0 installed.
  3. Its good to have Visual Studio Code.
  4. You have an Azure Subscription. Free $200 Azure Credit
  5. You have an image repository (this example used Azure container registry)

Step 1: Create gRPC Service

  1. Create a gRPC service using default template of Visual Studio
  2. Add a Service (named CalculationService)
  3. Register reflection in Startup.cs (install Nuget Grpc.Reflection)

For very detailed explanation of visit how to setup gRPC server in .NET

The sample application SampleGrpcService

Step 2: Deploy to kubernetes

Deploy to Aks For step by step explanation on how to setup aks

kubernetes configs yaml files

Step 3: Test gRPC Service

To test gRPC service, we'll use the grpcurl utility:

  1. Download grpculy utiltiy
  2. Run following commands

list services

grpcurl servername:port list  (for ex: grpcurl localhost:50051 list )

list methods

grpcurl servername:port list packagename.servicename (for ex: grpcurl localhost:50051 list Services.Calculator)

describe method

grpcurl servername:port describe packagename.servicename.MethodName (for ex: grpcurl localhost:50051 describe  Services.Calculator.AddNumbers)

invoke method

grpcurl -d '{requestbody}' servername:port packagename.servicename.MethodName (for ex: grpcurl -d '{"firstNumber":5,"secondNumber":3}' localhost:50051   Services.Calculator/AddNumbers)

For detailed explanation and troubleshotting grpcurl

Notes

Github grpc project https://github.com/grpc/grpc/tree/master/src/csharp

grpcurl https://github.com/fullstorydev/grpcurl

Why grpc service cannot be deployed on Azure Appservice (for windows and linux both) grpc/grpc-dotnet#578, dotnet/aspnetcore#9020 (comment)

k8s-grpc-dotntecore's People

Contributors

rupeshtech avatar

Stargazers

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

Watchers

 avatar  avatar

Forkers

beelabs omkarss

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.