-
Notifications
You must be signed in to change notification settings - Fork 1.1k
one-click: make the CubeProxy admin port configurable #1256
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ source "${SCRIPT_DIR}/common.sh" | |
|
|
||
| postcheck_port="${CUBE_PROXY_HTTP_PORT:-80}" | ||
| postcheck_grpc_port="${CUBE_PROXY_GRPC_PORT:-9090}" | ||
| postcheck_admin_port="${CUBE_PROXY_ADMIN_PORT:-8082}" | ||
| postcheck_retries="${CUBE_PROXY_POSTCHECK_RETRIES:-30}" | ||
| postcheck_delay="${CUBE_PROXY_POSTCHECK_DELAY:-2}" | ||
| deprecated_host_port="${CUBE_PROXY_HOST_PORT:-}" | ||
|
|
@@ -17,3 +18,8 @@ log "checking cube-proxy HTTP tcp port ${postcheck_port}" | |
| wait_for_tcp_port "${postcheck_port}" "${postcheck_retries}" "${postcheck_delay}" || die "cube-proxy HTTP tcp port not ready: ${postcheck_port}" | ||
| log "checking cube-proxy gRPC tcp port ${postcheck_grpc_port}" | ||
| wait_for_tcp_port "${postcheck_grpc_port}" "${postcheck_retries}" "${postcheck_delay}" || die "cube-proxy gRPC tcp port not ready: ${postcheck_grpc_port}" | ||
| # The admin listener is what cube-lifecycle-manager drives for pause/resume. | ||
| # Without this check nginx can fail to bind it while the public ports come up | ||
| # fine, leaving the service "healthy" but lifecycle operations broken. | ||
|
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. This probe breaks the existing postcheck behavioral tests — |
||
| log "checking cube-proxy admin tcp port ${postcheck_admin_port}" | ||
| wait_for_tcp_port "${postcheck_admin_port}" "${postcheck_retries}" "${postcheck_delay}" || die "cube-proxy admin tcp port not ready: ${postcheck_admin_port}" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -648,13 +648,13 @@ EOF | |
| -e 's|^\(\s*listen \)9090\( http2 reuseport;\)|\1__CUBE_PROXY_GRPC_PORT__\2|' \ | ||
| -e 's|^\(\s*set \$host_proxy_port \)8081;|\1__CUBE_PROXY_HTTP_PORT__;|' \ | ||
| -e 's|^\(\s*set \$host_proxy_port \)8080;|\1__CUBE_PROXY_HTTPS_PORT__;|' \ | ||
| -e 's|^\(\s*listen \)127\.0\.0\.1:8082;|\1__CUBE_PROXY_ADMIN_LISTEN__:8082;|' \ | ||
| -e 's|^\(\s*listen \)127\.0\.0\.1:8082;|\1__CUBE_PROXY_ADMIN_LISTEN__:__CUBE_PROXY_ADMIN_PORT__;|' \ | ||
|
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. Stale |
||
| -e 's|/usr/local/openresty/nginx/certs/cube\.app+3\.pem|/usr/local/openresty/nginx/certs/__CUBE_PROXY_SSL_CERT__|' \ | ||
| -e 's|/usr/local/openresty/nginx/certs/cube\.app+3-key\.pem|/usr/local/openresty/nginx/certs/__CUBE_PROXY_SSL_KEY__|' \ | ||
| "${src}" | ||
| } >"${dst}" | ||
| local token | ||
| for token in __CUBE_PROXY_HTTP_PORT__ __CUBE_PROXY_HTTPS_PORT__ __CUBE_PROXY_GRPC_PORT__ __CUBE_PROXY_ADMIN_LISTEN__ __CUBE_PROXY_SSL_CERT__ __CUBE_PROXY_SSL_KEY__; do | ||
| for token in __CUBE_PROXY_HTTP_PORT__ __CUBE_PROXY_HTTPS_PORT__ __CUBE_PROXY_GRPC_PORT__ __CUBE_PROXY_ADMIN_LISTEN__ __CUBE_PROXY_ADMIN_PORT__ __CUBE_PROXY_SSL_CERT__ __CUBE_PROXY_SSL_KEY__; do | ||
| if ! grep -q -F "${token}" "${dst}"; then | ||
| rm -f "${dst}" | ||
| echo -e " ${RED}✗ cube-proxy nginx template is missing ${token}; upstream CubeProxy/nginx.conf may have changed${NC}" >&2 | ||
|
|
@@ -687,7 +687,7 @@ http { | |
| location / { return 404; } | ||
| } | ||
| server { | ||
| listen __CUBE_PROXY_ADMIN_LISTEN__:8082; | ||
| listen __CUBE_PROXY_ADMIN_LISTEN__:__CUBE_PROXY_ADMIN_PORT__; | ||
| server_name _; | ||
| location / { return 404; } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -377,6 +377,17 @@ variable "cube_proxy_replicas" { | |
| } | ||
| } | ||
|
|
||
| variable "cube_proxy_admin_port" { | ||
|
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. New variable is not plumbed through |
||
| description = "Port cube-proxy's /admin/* server listens on. cube-proxy uses host networking, so this must be free on the node; override it when something else already holds 8082." | ||
| type = number | ||
| default = 8082 | ||
|
|
||
| validation { | ||
| condition = var.cube_proxy_admin_port >= 1 && var.cube_proxy_admin_port <= 65535 && floor(var.cube_proxy_admin_port) == var.cube_proxy_admin_port | ||
| error_message = "cube_proxy_admin_port must be an integer between 1 and 65535." | ||
| } | ||
| } | ||
|
|
||
| variable "cube_lifecycle_manager_replicas" { | ||
| description = "cube-lifecycle-manager Deployment replica count. Keep 1 unless CLM HA behavior has been validated for the target deployment." | ||
| type = number | ||
|
|
||
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.
Preflight conflict check is over-broad for the admin listener — the admin server binds to
CUBE_PROXY_ADMIN_LISTEN(the node IP), not0.0.0.0, butss -lnt "( sport = :8082 )"matches any address. A loopback-only listener on 8082 (which wouldn't conflict with a node-IP bind, e.g. a local agent on127.0.0.1:8082) now aborts the install where it previously succeeded. Conservative direction (no false negatives), so non-blocking — but consider scoping the check to the actual listen address or noting in a comment that it is address-agnostic.