-
Notifications
You must be signed in to change notification settings - Fork 975
feat(cubeproxy): add plaintext gRPC ingress on port 9090 #837
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
Open
xiaojunxiang2023
wants to merge
1
commit into
TencentCloud:master
Choose a base branch
from
xiaojunxiang2023:feat/cubeproxy-grpc-ingress
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,6 +97,15 @@ http { | |
| keepalive_timeout 80; | ||
| } | ||
|
|
||
| # Plaintext gRPC ingress. Clients dial this IP:port and set :authority to | ||
| # "<container_port>-<sandbox_id>" (no DNS required). | ||
| upstream grpc_backend { | ||
| server 0.0.0.1:1235; | ||
| balancer_by_lua_file lua/balancer_phase.lua; | ||
| keepalive 200; | ||
| keepalive_timeout 80; | ||
| } | ||
|
|
||
| lua_shared_dict local_cache 100m; | ||
|
|
||
| # Auto-pause / auto-resume coordination dicts. Owned by CubeProxy-sidecar | ||
|
|
@@ -361,6 +370,53 @@ http { | |
| } | ||
| } | ||
|
|
||
| server { | ||
| listen 9090 http2 reuseport; | ||
| server_name _; | ||
| set $cube_proxy_host_ip ""; | ||
| set $ins_id ""; | ||
| set $container_port ""; | ||
| set $backend_ip ""; | ||
| set $backend_port ""; | ||
| set $host_proxy_port 9090; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we don't need |
||
| # Auto-pause / auto-resume wiring; mirrors the 8081 server. See that block. | ||
| set $cube_sidecar_addr "127.0.0.1:8083"; | ||
| set $cube_admin_token ""; | ||
|
|
||
| # Mirror of the 8081 server's internal sub-location. | ||
| location = /_sidecar_resume { | ||
| internal; | ||
| proxy_http_version 1.1; | ||
| proxy_set_header Connection ""; | ||
| proxy_set_header Content-Length 0; | ||
| proxy_pass_request_body off; | ||
| proxy_pass_request_headers off; | ||
| proxy_connect_timeout 2s; | ||
| proxy_send_timeout 30s; | ||
| proxy_read_timeout 30s; | ||
| proxy_pass http://$cube_sidecar_addr/internal/resume?$args; | ||
| } | ||
|
|
||
| location / { | ||
| include /usr/local/openresty/nginx/conf/global/global.conf; | ||
|
|
||
| grpc_connect_timeout 3s; | ||
| grpc_read_timeout 7206s; | ||
| grpc_send_timeout 7206s; | ||
| grpc_buffering off; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why disable buffering? |
||
| grpc_set_header X-Real-IP $remote_addr; | ||
| grpc_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
|
|
||
| rewrite_by_lua_file lua/rewrite_phase.lua; | ||
|
|
||
| grpc_pass grpc://grpc_backend; | ||
|
|
||
| header_filter_by_lua_file lua/header_filter_phase.lua; | ||
|
|
||
| log_by_lua_file lua/log_phase.lua; | ||
| } | ||
| } | ||
|
|
||
| # ── CubeProxy admin server (auto-pause coordination) ────────────────────── | ||
| # | ||
| # Bound to loopback only; carries the shared-dict mutation surface used by | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like the
serverinstruction can be omited.