Nlb service cf#3791
Closed
ntner wants to merge 3 commits into
Closed
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What is the feature/update/fix?
Feature: Network Load Balancer Support for V2 Racks
We've added Network Load Balancer (NLB) support to V2 racks. Until now, every app and service on a V2 rack terminated traffic at the shared Application Load Balancer, which is HTTP/HTTPS only. With this release you can opt a rack into a Layer 4 path — public, internal, or both — and expose selected services through per-port NLB listeners declared directly in
convox.yml. TLS termination, per-NLB security groups with a CIDR allowlist, cross-zone load balancing, preserve-client-IP, and deletion protection are all supported as rack-wide defaults, with per-port overrides available on individual services.The feature ships in two layers: rack-level infrastructure you opt into with
convox rack params set, and per-service listeners you declare in each app'sconvox.yml.Rack parameters (all default
No/0.0.0.0/0; existing racks unaffected until opted in):NLBNoNLBInternalNoInternal=Yes)NLBAllowCIDR0.0.0.0/0NLBInternalAllowCIDRNLBCrossZoneNoNLBInternalCrossZoneNoNLBPreserveClientIPNoNLBInternalPreserveClientIPNoNLBDeletionProtectionNoNLBInternalDeletionProtectionNoPer-service fields on
services[*].nlb[*]inconvox.yml:portprotocoltcp|tlstcp)containerPortport)schemepublic|internalpublic)certificatetlscross_zoneNLBCrossZone/NLBInternalCrossZoneallow_cidrpreserve_client_ipNLBPreserveClientIP/ internal equivalentTLS listener details. A
tlslistener uses theELBSecurityPolicy-TLS13-1-2-2021-06policy (TLS 1.2 and 1.3, ECDHE cipher suites). The NLB terminates TLS and forwards plaintext to your container; the target group stays on TCP. Certificate validity is checked atconvox deploy— missing, non-ISSUED, cross-region, or cross-account certificates fail within seconds instead of as a stuck CloudFormation update.Safety interlocks (all errors surface at
convox rack params setorconvox deploy, before any AWS change):NLB=YeswithInternalOnly=YesNLBInternal=YeswithoutInternal=YesNLB/NLBInternalwhile apps still declarenlb:portsapp/servicepairsNLBDeletionProtection=Yescombined withNLB=No(same call)convox rack uninstallwhile either deletion protection is enabledNLBPreserveClientIP=Yeswith a user-managedInstanceSecurityGroupallow_cidrentry that is non-canonical, IPv6, duplicate, or >5scheme: publicon a rack withoutNLB=Yesconvox deployfails with remediation command in the errorCLI changes.
convox rackgains NLB / NLB Internal rows (hostname + EIPs for the public NLB).convox servicesgains anNLB PORTScolumn showing the declared listener ports, scheme, and a bracketed suffix (cz=...,allow=N,pcip=...) when per-port overrides are present. EnablingNLB=YesorNLBInternal=Yesviaconvox rack params setprints a one-line hint that provisioning typically takes 5–10 minutes.How to use it?
Update your rack:
Then enable NLB at the rack level. Parameters batch into a single call; never run them as sequential commands.
For just the public NLB:
For the internal NLB (requires
Internal=Yes):Both at once, with cross-zone on, a production CIDR allowlist, and deletion protection:
After provisioning,
convox rackshows the NLB hostname and associated EIPs:Next, declare
nlb:entries on any service in yourconvox.ymland deploy:Point a Route 53
A(alias) record at the rack's public NLB DNS name — visible inconvox rack— for the hostname you want to serve.convox servicessummarizes the NLB listeners alongside ALB listeners:A few common patterns:
protocol: tlswith a TCP target. Clients get TLS all the way to the NLB; your application process does not manage certificates. For plaintext gRPC between services on the same rack, useprotocol: tcp, scheme: internal.port:entirely if the service does not need an ALB listener at all. The service runs behind the NLB with no HTTP route.port: http:3000and annlb:entry on the same container port. The rack deduplicates the ECS port mappings so both listeners route correctly.protocol: tcptoprotocol: tlsand add acertificate:on the next deploy. AWS documents this as an in-placeModifyListenerupdate; clients see a brief protocol-boundary disruption at switchover.allow_cidron a single NLB port to restrict access to one listener without changing the rack-wideNLBAllowCIDR. Up to 5 CIDRs per rack param (5 public + 5 internal), plus additional per-port CIDRs layered on top.preserve_client_ip: trueon a single listener so your application sees real client IPs. Applies toip-type target groups (Fargate andisolate: trueservices) as well asinstance-type target groups (standard gen2 services).If you run
convox deployagainst a rack without the matching rack parameter set, or against a rack where a per-port policy conflicts with a rack-level guard, the deploy fails early with a message pointing at the exact remediation:To disable NLB again, first remove every
nlb:block from every app'sconvox.ymland redeploy, then disable deletion protection (if set) and flip the rack parameter:To uninstall a rack entirely, deletion protection must be disabled on both NLBs first; the CLI will refuse
convox rack uninstallwith an actionable error otherwise.Operational notes:
HighAvailability=Yes). The default AWS EIP quota is 5 per region. If your rack already usesPrivate=Yes, NAT gateways consume 2-3 EIPs on top. Check current usage and request a quota increase before enabling on aPrivate=Yes + 3-AZ HArack.convox rack params setreturns; the CLI prints a hint reminding you of this on theYestransition.NLBAllowCIDRandNLBInternalAllowCIDReach accept up to 5 CIDRs (comma-separated). For fine-grained per-service allowlists beyond the rack default, use the per-portallow_cidr:field on individualnlb:entries.ELBSecurityPolicy-TLS13-1-2-2021-06(TLS 1.2 and 1.3, ECDHE). A configurable policy will ship in a follow-up release if demand is there.InstanceSecurityGroupparameter to a SG you manage yourself,NLBPreserveClientIP=Yesis blocked — the NLB would forward real client IPs into an SG whose ingress rules you control, and we will not silently modify that posture. Disable preserve-client-IP in the samerack params setcall if you need to change both.Does it have a breaking change?
No breaking changes. All ten new rack parameters default to
No/0.0.0.0/0/ blank, so existing racks create zero new NLB resources on upgrade and behave identically until you opt in. Services withoutnlb:produce byte-identical CloudFormation output, and TCP-only NLB listeners without per-port overrides render identically to their earlier form. Theconvox rackoutput adds the NLB rows only when the rack has NLB enabled and exposes the corresponding stack outputs; theconvox servicesoutput's newNLB PORTScolumn is suppressed entirely when no service in the app has NLB ports declared.The new Docker labels added to the rack API task definitions produce a single task definition revision on first update, resulting in a normal rolling restart of the rack API containers — the same pattern used for every previous rack parameter addition. Gen1 apps are unaffected; NLB is gen2-only.
Downgrading to a rack version that predates these parameters requires setting
NLB=NoandNLBInternal=Nofirst, disabling deletion protection if set, and removingnlb:blocks from any active services. CloudFormation will reject the downgrade cleanly if attempted with non-default values.Requirements
To use this feature, you must update to rack version
20260421192651or newer.convox rackconvox rack update