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

kubernetes tls echo demo #177

Closed
gertcuykens opened this issue Apr 20, 2018 · 5 comments
Closed

kubernetes tls echo demo #177

gertcuykens opened this issue Apr 20, 2018 · 5 comments
Assignees

Comments

@gertcuykens
Copy link

gertcuykens commented Apr 20, 2018

docker build -t grpc-web-test --build-arg with_examples=true web/net/grpc/gateway/docker/ubuntu_16_04
docker run --rm -it -p 8080:8080 grpc-web-test

works http://localhost:8080/net/grpc/gateway/examples/echo/echotest.html

---
apiVersion: v1
kind: Service
metadata:
  name: grpc-web-test
  labels:
    name: grpc-web-test
    env: production
spec:
  type: ClusterIP
  ports:
  - name: web
    port: 8080
    targetPort: 8080
    protocol: TCP
  selector:
    name: grpc-web-test
    env: production

---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: grpc-web-test
spec:
  replicas: 1
  revisionHistoryLimit: 3
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 0
  template:
    metadata:
      labels:
        name: grpc-web-test
        env: production
    spec:

      containers:

      - name: web
        image: grpc-web-test
        imagePullPolicy: Always
        ports:
        - containerPort: 8080
        resources:
          requests:
            cpu: 500m
            memory: 500Mi
          limits:
            cpu: 1
            memory: 1Gi

      nodeSelector:
      # role-app: "true"

---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: grpc-web-test
  annotations:
    ingress.kubernetes.io/rewrite-target: /

spec:
  tls:
  - hosts:
    - ............
    secretName: ssl
  rules:
  - host: .................
    http:
      paths:
        - path: /
          backend:
            serviceName: grpc-web-test
            servicePort: 8080
% kubectl logs grpc-web-test-7899c4766d-cv8wc
nginx: [alert] could not open error log file: open() "./logs/error.log" failed (2: No such file or directory)
2018/04/20 15:51:52 [notice] 11#0: using the "epoll" event method
2018/04/20 15:51:52 [notice] 11#0: nginx/1.11.13
2018/04/20 15:51:52 [notice] 11#0: built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9)
2018/04/20 15:51:52 [notice] 11#0: OS: Linux 4.13.0-36-generic
2018/04/20 15:51:52 [notice] 11#0: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2018/04/20 15:51:58 [alert] 11#0: *3 http request count is zero while closing request, client: 172.16.164.192, server: 0.0.0.0:8080

Doesn't work because somewhere http is hardcoded instead of https
image

PS what about collaborating with https://github.com/kubernetes/ingress-nginx to have a grpc-web annotation build in?

kubernetes/ingress-nginx#2391

@stanley-cheung
Copy link
Collaborator

We have switched the default proxy from Nginx to Envoy. Envoy supports gRPC-Web out of the box. A sample envoy config file can be found here.

Will this make it simpler to build a Kubernetes demo out of?

@gertcuykens
Copy link
Author

gertcuykens commented Jul 22, 2018

Wait because ingress-nginx want to support that too kubernetes/ingress-nginx#2391 out of the box but it seems that it's not straight forward to do so. If you manage to figure it it out in your first nginx approach can you please transfer your knowledge to your own google team members please so team ingress-nginx can pic it up from there. Also did you create a nginx ticket already for grpc-web support on nginx? Thanks

Didn't try it yet but to me creating a envoy ingress controller compared to a nginx ingress controler is way more difficult

@stanley-cheung
Copy link
Collaborator

Sorry I misunderstood. I thought this is about creating a demo with *any proxy.

We still kept the nginx code so they should still work.

@gertcuykens
Copy link
Author

gertcuykens commented Jul 25, 2018

Correct me if I am wrong but ingress-nginx is inline with https://kubernetes.io/docs/concepts/services-networking/ingress Almost all envoy solutions are inventing there own ingress layer. Don't mind envoy as long it's combined with the ingress standard. It will become kubernetes anarchy if we don't work together on a ingress specification

@stanley-cheung
Copy link
Collaborator

Sorry I have to declare Bug Bankrupcy on some of these older issues. If this is still an issue, please open a new one.

loyalpartner pushed a commit to loyalpartner/grpc-web that referenced this issue Sep 4, 2020
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

3 participants