GoogleCloudPlatform / GoogleCloudPlatform/endpoints-samples
[k8s] The configuration file for the custom nginx.conf example in GKE (with gRPC) is invalid.
- Dominant language
- Java
- Stars
- 88
- Forks
- 58
- PR merge metrics
- No merged PRs in 30d
Description
The current [document](https://cloud.google.com/endpoints/docs/grpc/custom-nginx) provides a nginx.conf file that does not support gRPC. (And endpoints-samples/k8s/ does not contains such `.conf`)
`nginx.conf` that supports gRPC should look something like this (auto-generated by start_esp):
```conf
# Auto-generated by start_esp
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
daemon off;
user nginx nginx;
pid /var/run/nginx.pid;
# Worker/connection processing limits
worker_processes 1;
worker_rlimit_nofile 10240;
events { worker_connections 10240; }
# Logging to stderr enables better integration with Docker and GKE/Kubernetes.
error_log stderr warn;
http {
include /etc/nginx/mime.types;
server_tokens off;
client_max_body_size 32m;
client_body_buffer_size 128k;
# HTTP subrequests
endpoints_resolver 8.8.8.8;
endpoints_certificates /etc/nginx/trusted-ca-certificates.crt;
set_real_ip_from 0.0.0.0/0;
set_real_ip_from 0::/0;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
server {
server_name "";
listen 9000 http2 backlog=16384;
access_log /dev/stdout;
location / {
# Begin Endpoints v2 Support
endpoints {
on;
server_config /etc/nginx/server_config.pb.txt;
metadata_server http://169.254.169.254;
}
# End Endpoints v2 Support
# WARNING: only first backend is used
grpc_pass 127.0.0.1:8000 override;
}
include /var/lib/nginx/extra/*.conf;
}
server {
# expose /nginx_status and /endpoints_status but on a different port to
# avoid external visibility / conflicts with the app.
listen 8090;
location /nginx_status {
stub_status on;
access_log off;
}
location /endpoints_status {
endpoints_status;
access_log off;
}
location /healthz {
return 200;
access_log off;
}
location / {
root /dev/null;
}
}
}
```
So I suggest adding the above `.conf` file.
Contributor guide
Research direction
Start by checking endpoints-samples/k8s/ and the custom-nginx documentation linked in the issue to confirm where the missing configuration belongs. Add the proposed gRPC-capable nginx.conf example, and consider the work done when the sample configuration is present and supports the documented GKE gRPC setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- grpc, kubernetes, nginx
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100