Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gRPC ingress routing #8

Open
mavvverick opened this issue Sep 17, 2018 · 4 comments
Open

gRPC ingress routing #8

mavvverick opened this issue Sep 17, 2018 · 4 comments

Comments

@mavvverick
Copy link

mavvverick commented Sep 17, 2018

Hey,

can you provide me an example of Istio ingress.yaml for grpc routing with Kubernetes ? I have tried but unable to make it work with Istio.

Thanks in advance.

@thesandlord
Copy link
Owner

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

@mavvverick
Copy link
Author

mavvverick commented Dec 18, 2018

@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.

@thesandlord
Copy link
Owner

Do you want to send a pull request?

@mavvverick
Copy link
Author

yes, I will send by next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants