Skip to content

This example combines istio, grpc with a simple dart front end.

Notifications You must be signed in to change notification settings

damondouglas/dart-istio-golang-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This example combines istio, grpc with a simple dart front end. This experiment stages future work using the same technologies for a flutter application using gRPC backend services hosted on kubernetes.

Prerequisites

This README assumes the following are setup on your machine.

  1. docker 18.09.9
  2. minikube v1.4.0
  3. istio 1.4.0
  4. dart 2.7.0
  5. go 1.13

Setup

Set docker to point to minikube

$ eval $(minikube docker-env)

Build Echo service

The echo service simple reverses a string. It simply does this to prove that a backend service is processing a payload provided by the frontend.

$ make build-server

Build Echo Web

The front end is built simply using dart from protobuf generated dart client code.

$ make build-web

Build kubernetes artifacts

$ kubetcl apply -f manifest/gateway.yaml
$ kubetcl apply -f manifest/server.yaml

Acquire minikube gateway address

See determining the ingress IP and Ports from the Istio documentation for more information.

$ export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}')
$ export GATEWAY=$(minikube ip):$INGRESS_PORT

Launch web server

Run the following commands to open the web front end. Filling out anything in the input and pressing Submit should show a string reversal proving that you've set up everything correctly. Your front end web app is calling your backend gRPC.

$ docker run -it -p 5000:5000 -e PORT=5000 -e ENDPOINT=http://$GATEWAY echo-web:1.0
$ open "http://$(minikube ip):5000"