-
Notifications
You must be signed in to change notification settings - Fork 60
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
Need improved/HTTPS-centric GKE Ingress + ESP + gRPC example #52
Comments
Hi, same issue here. UPDATE :
UPDATE 2 : |
@paoesco Can you post how you got Grpc + Esp to work on GKE? I have been struggling finding detailed information and I seem to have hit a wall on the matter. My health check is always yellow. I have tried configuring readiness probes but it did not help |
And here it is :
|
Thank you very much but is that gRPC? The esp is configured with http and not http2. Do you not need to set the esp backend to be grpc://127.0.0.1:8080? |
I was also never able to get the readiness probe to behave correctly. Perhaps the key is making sure |
I did configure |
I have done some further digging and found what seems to be a solution for configuration esp + ingress + grpc on GKE There are 2 issues at hand which were not clear to me in the beginning. Nginx does not seem to support http/2 without ssl so you have to configure SSL on esp. Another problem is that you need to enable to the esp health check to answer on the root path (/) Let's break down the issue in 2 1. SSLIf we look at how ESP is configured we can see that if you choose ssl (using the This of course means you need to mount the certificates in the esp container as per the the esp documentation You should be able to mount the same secret used by the ingress itself 2. Health CheckI gave up trying to get the readiness probes to work and looked for a way to configure esp to respond on / with 200 while proxying everything else to the backend. Turns out that this is possible. ESP has a
So we cannot supply The trick here is to supply a whitespace as the argument for the health check path. conclusionThis is how I configured esp on my pod to take care of both issues above - name: endpoints-proxy
image: gcr.io/endpoints-release/endpoints-runtime:1
args: [
"--ssl_port=8080",
"--backend=grpc://127.0.0.1:50051",
"--service=myendpoint.endpoints.myproject-17272.cloud.goog",
"--rollout_strategy=managed",
"--service_account_key=/etc/nginx/creds/endpoints-credentials.json",
"-z",
" "
]
ports:
- containerPort: 8080
protocol: TCP
volumeMounts:
- name: ingress-tls
subPath: tls.crt
mountPath: /etc/nginx/ssl/nginx.crt
readOnly: true
- name: ingress-tls
subPath: tls.key
mountPath: /etc/nginx/ssl/nginx.key
readOnly: true This worked for me though I have not yet performed extensive testing. I point the service to port Now if anybody could tell me how to configure GRPC-WEB through google endpoints, that would complete the package |
Did you ever make progress on getting grpc-web support through google endpoints? |
@jcramb Yes I did. You can find more details on the grpc-web PR on the esp code. It works but only if you use the binary grpc-web wire format which does not support streaming |
Hello @alethenorio, |
@unludo sure The configurations above are based on the fictional config I posted in my previous post (so, for example, it should be obvious the secret name pointed by ingress is the same secret mounted in the pod) My service looks like this (assuming the pod it points to has the label apiVersion: v1
kind: Service
metadata:
name: myService
annotations:
cloud.google.com/app-protocols: '{"http2":"HTTP2"}'
spec:
type: NodePort
ports:
- name: http2
port: 8080
targetPort: 8080
protocol: TCP
selector:
app: myApp And my Ingress looks like this (Assuming use of let's encrypt through cert manager apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: myService-ingress-endpoints
annotations:
kubernetes.io/tls-acme: "true"
kubernetes.io/ingress.class: "gce"
certmanager.k8s.io/acme-http01-edit-in-place: "true"
certmanager.k8s.io/cluster-issuer: "letsencrypt-prod"
certmanager.k8s.io/acme-challenge-type: "http01"
spec:
tls:
- hosts:
- "myapp.endpoints.myprojectID.cloud.goog"
secretName: ingress-tls
backend:
serviceName: myService
servicePort: 8080 |
I had a tough time figuring out how to get an Ingress on GKE to behave with ESP, with HTTPS end-to-end. I believe the underlying issues have to do with health checks and readiness probes and how ingress-gke handles those. I commented on the following issue in that project: kubernetes/ingress-gce#18 (comment)
Once health checks can be customized, perhaps an update can be made to esp_echo_gke_ingress.yaml.
The text was updated successfully, but these errors were encountered: