Giter Site home page Giter Site logo

gRPC ingress routing about istio101 HOT 4 OPEN

thesandlord avatar thesandlord commented on September 6, 2024
gRPC ingress routing

from istio101.

Comments (4)

mavvverick avatar mavvverick commented on September 6, 2024 1

@thesandlord I have finally made it work after numerous attempts. I hope it will help others as there is no complete solution provided in doc or else where.

Also, Istio101 has provided me a head start in configuring istio. Thanks a ton.

apiVersion: v1
kind: Service
metadata:
  name: frontend
  labels:
    app: frontend
spec:
  ports:
  - port: 50051
    targetPort: 50051      
    name: grpc-port
  selector:
    app: frontend

---

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: frontend-grpc
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: frontend
        version: prod
    spec:
      containers:
      - name: frontend
        image: image
        imagePullPolicy: Always
        ports:
        - containerPort: 50051
          name: grpc-port
        env:
        - name: SERVICE_NAME
          value: "frontend-prod"
        - name: UPSTREAM_URI
          value: "https://jsonplaceholder.typicode.com/todos/1"
---

apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
  name: jsonplaceholder
spec:
  hosts:
  - jsonplaceholder.typicode.com
  ports:
  - number: 80
    name: http
    protocol: HTTP
  - number: 443
    name: https
    protocol: HTTPS

---

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: istio-gateway
spec:
  selector:
    istio: ingressgateway # use Istio default gateway implementation
  servers:
  - port:
      number: 9090
      name: http
      protocol: HTTP
    hosts:
    - "*"

---

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: frontend
spec:
  gateways:
  - istio-gateway
  hosts:
  - "*"
  http:
  - match:
    - uri:
        prefix: /
    route:
    - destination:
        port:
          number: 50051
        host: frontend

I have converted frontend, middleware and backend to support grcp protocol. It works absolutely fine.

from istio101.

thesandlord avatar thesandlord commented on September 6, 2024

@noisyox this is on the backburner, but I do want to get to it eventually.

from istio101.

thesandlord avatar thesandlord commented on September 6, 2024

Do you want to send a pull request?

from istio101.

mavvverick avatar mavvverick commented on September 6, 2024

yes, I will send by next week.

from istio101.

Related Issues (5)

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.