Overview
Workloads managed at Control Plane can be configured to serve requests using any domain name you own. Domains are scoped to an Org and are associated with one GVC. The domain can then be configured to handle requests for one or multiple Workloads within that GVC. Domains that are configured at Control Plane are automatically secured using TLS certificates, load balanced, and DNS geo-routed to the nearest healthy location assigned to the GVC.Domain Name Validation
Domain names must be valid domain names with TLDs allowed. The domain name validation follows standard DNS domain name rules.Default Domain Names
If a Domain is not mapped to a GVC, the default domain names provided to Workloads are:- Canonical endpoints (Global):
cpln.app
- Individual location endpoints:
controlplane.us
Configure a Domain
Refer to the Configure a Domain guide for additional details.Domain Configuration Example
Here’s a comprehensive example of a domain configuration:Domain Verification
An apex domain, also known as a root domain, refers to a domain name that does not have any subdomain prefix (e.g., example.com). If you want to use subdomains configured in NS mode, you must create and verify the apex domain in the org. Even if the apex domain is not used for any workloads, it must be verified to allow these subdomains to be created. If multiple Orgs are creating subdomains using the same apex domain, the apex domain verification only needs to be performed in one of the Orgs, but subdomains in Orgs that don’t have the apex domain will require a TXT record be added to DNS for verification.As a best practice, create the apex domain in the Org designated for your production environment.
Hostname Behavior
TheHost
header that will be sent in the request to the target workload will depend on the type of Workload and which domain was used for the request.
For serverless workloads, even if the request was served using a custom domain, the Host
header will be the canonical endpoint of the workload.
For standard or stateful workloads, the Host
header will be the name of domain used for the request.
Whenever the Host
header is manipulated, the X-Forwarded-Host
header will be appended with the original Host
from the request.
Routing Modes
Control Plane provides two routing modes for directing requests to your domain:Path Based Routing
Path based routing allows requests to a specific path prefix be routed to a specific workload. Multiple paths can be defined, but there must be at least one path. This is accomplished by adding a CNAME record to DNS and configuring the domain withdnsMode: cname
.
Advantages of using Path Based routing:
- You maintain full control of DNS for the domain.
- CDN / WAF Compatible.
- If the domain
sub.example.com
is configured to point to the GVC that containsworkload_one
andworkload_two
. The pathworkload_one
can be configured to route requests toworkload_one
and the pathworkload_two
can be configured route requests toworkload_two
.
All path prefix values must be unique and there must be at least one path defined. Routes are automatically sorted by prefix length (longest first), then by host prefix length, then by trailing slash preference.
Path Prefix Replacement
ThereplacePrefix
property allows a path prefix to be replaced when forwarding the request to the Workload.
For example: A request to the URL https://sub.example.com/users/
can have the path prefix /users/
replaced with the path prefix /v2/users/
when forwarding the request internally to the target Workload.
This does not work for regex-based paths
Root Path Prefix
The/
path will match any unmatched path prefixes for the subdomain.
Path Order
The order of the path prefix list is adjustable. When a request to the Domain is received, the first match will be processed.When combining the
/
path prefix with other path prefixes, the /
path will automatically be placed last in the list because it matches
ALL requests.Port Selection
Theport
property allows each route to specify a port that will route requests to the respective port at the running workload.
For serverless workloads, assigning the port is optional since only one port can serve traffic.
For standard and stateful workloads that serve traffic on multiple ports, specific ports can be assigned on a route. If no port is assigned, external requests will be routed to the first port configured on the container.
Replica Selection
Thereplica
property allows stateful workloads with replicaDirect enabled to specify a replica number to route traffic directly to a specific replica. The replica number must be an integer greater than or equal to 0.
If no replica is specified, traffic will be routed to all replicas of the workload.
Header Operations
Theheaders
property allows routes to be configured to manipulate HTTP headers for all requests to that route. Header operations allow you to set or override headers before forwarding requests to the workload.
Supported Operations:
set
: Sets or overrides headers to all HTTP requests for this route
%REQUESTED_SERVER_NAME%
: The server name requested by the client%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%
: The client IP address without port%START_TIME%
: The request start time
When a domain is serving path based requests, the domain port protocol must be compatible with the selected protocol of the
port configured on the container. (i.e., HTTP2 is compatible with HTTP2 and GRPC, HTTP is compatible with HTTP, etc.)
Regex Based Routing
Instead of specifying routes based on a path prefix, paths can be specified using regex. For example: A path regex can be specified as:/user/.*/profile
to match routes like: /user/bob/profile
or /user/mary/profile
If at least one regex path is found, routes will not be sorted. You must specify either a prefix OR regex for each route, but not both.
Subdomain Based Routing
Subdomain based routing allows a domain to be mapped to all workloads in a GVC. This is accomplished by adding NS records to DNS which delegate DNS to Control Plane for this domain only and configuring the domain withdnsMode: ns
.
Advantages of using Subdomain routing:
- Best choice when a unique DNS subdomain is required for each workload.
- One-time configuration.
- Works for all current and future workloads in a GVC.
- If the domain
sub.example.com
is configured to the GVC that contains workloads namedworkload_one
andworkload_two
, Control Plane will create the following subdomains and route requests to the respective workloads:
DNS Modes
Control Plane supports two DNS modes for domain configuration:CNAME Mode (dnsMode: cname
)
In CNAME mode, Control Plane will configure workloads to accept traffic for the domain but will not manage DNS records for the domain. End users configure CNAME records in their own DNS pointed to the canonical workload endpoint.
Certificate Challenge Types:
certChallengeType: http01
: Uses HTTP-01 challenge for certificate validationcertChallengeType: dns01
: Uses DNS-01 challenge for certificate validation
When using CNAME mode with subdomain based routing (
gvcLink
), a custom server certificate must be configured for all ports that enable TLS.NS Mode (dnsMode: ns
)
In NS mode, Control Plane will manage the subdomains and create all necessary DNS records. End users configure an NS record to forward DNS requests to the Control Plane managed DNS servers.
Certificate Challenge Types:
certChallengeType: dns01
: Uses DNS-01 challenge for certificate validation (only supported option)
HTTP-01 challenge type is not supported for domains with NS mode.
APEX Domain Considerations
- An apex domain (e.g., example.com) can serve requests to Workloads using either path based or subdomain based routing.
- If subdomain based routing is desired, a Custom Server Certificate must be configured.
- If your DNS provider does not allow apex domains to point to a CNAME record, a service such as CloudFront or Cloudflare must be used to proxy the apex domain to Control Plane.
-
Apex domains can only use CNAME mode (
dnsMode: cname
).
These DNS providers do not allow apex domains to have a CNAME record:
- GoDaddy
- Route53
Port Configuration
Using the UI console, the port configuration section can be accessed when editing a domain and usingAdvanced Mode
.
External Port
Thenumber
property specifies the external port number. Typically, TLS requests to a configured domain are served on the standard TLS port 443.
Default Configuration:
- Port number:
443
(default) - Protocol:
http2
(default)
Protocol
Theprotocol
property specifies the protocol used for the port. The following protocols are supported:
http2
(default)http
tcp
(when using a dedicated load balancer)
TLS Settings
The default TLS protocol version isminProtocolVersion: TLSV1_2
. The minimum TLS protocol version is TLSV1_0
.
The minimum version should be set as high as possible, with a maximum supported value of TLSV1_3
. All modern browsers support the default of TLSV1_2
.
Supported TLS protocol versions:
TLSV1_3
(TLS 1.3)TLSV1_2
(TLS 1.2) - DefaultTLSV1_1
(TLS 1.1)TLSV1_0
(TLS 1.0)
Cipher Suites
ThecipherSuites
property configures the allowed cipher suites for TLS connections. The following cipher suites are added by default and can be removed / re-added:
- ECDHE-ECDSA-AES256-GCM-SHA384
- ECDHE-ECDSA-CHACHA20-POLY1305
- ECDHE-ECDSA-AES128-GCM-SHA256
- ECDHE-RSA-AES256-GCM-SHA384
- ECDHE-RSA-CHACHA20-POLY1305
- ECDHE-RSA-AES128-GCM-SHA256
- AES256-GCM-SHA384
- AES128-GCM-SHA256
- DES-CBC3-SHA
- ECDHE-RSA-AES128-SHA
- ECDHE-RSA-AES256-SHA
- AES128-SHA
- AES256-SHA
If there is an attempt to disable the TLS settings on a domain, it will always revert to the default configuration unless the domain is using a non-standard port and a non-HTTP protocol (e.g., using TCP with a dedicated load balancer).
Client Certificate Forwarding
TheclientCertificate
property configures client certificate forwarding for TLS connections. Client certificates included in a request to a Domain can be configured to be forwarded to the destination Workload.
The x-forwarded-client-cert
(XFCC) HTTP header will contain the client certificate details.
The certificate authority PEM, stored as a Secret of type keypair
, can be associated with the Domain via the secretLink
property and used to verify the authority of the client certificate. The secret must contain a client certificate authority cert in PEM format used to verify requests which include client certificates. The key subject must match the domain and the key usage properties must be configured for client certificate authorization.
If a certificate authority PEM is not associated with a Domain, no verification is performed.
CRL lists are not verified / checked, but they can be checked by the Workload by keeping a list of allowed or revoked client certificate hashes. When a request is received by the Workload, the hash field in the XFCC header can be checked against the allowed or revoked list and an allow / deny decision can be made.
To generate the certificate hash, execute the following command:
Verify that the CA certificate includes the correct x509 key usage fields (critical, digitalSignature, keyEncipherment) + extendedKeyUsage = serverAuth and that the CN of the client certificate matches the domain name selected.
Custom Server Certificate
TheserverCertificate
property configures a custom server certificate for the domain. A Custom Server Certificate can be assigned to a Domain by selecting an existing Secret of type keypair
via the secretLink
property.
This certificate is used when configuring:
- An apex domain that is configured with subdomain based routing.
- A domain that is fronted by a proxy (such as CloudFlare).
- A domain that prefers not to use a certificate generated by Control Plane.
keypair
. When the port number is 443 and this is not supplied, a certificate is provisioned automatically.
If a custom server certificate is configured on a domain, it is the responsibility of the user to ensure that the certificate is valid and not expired.
CORS Settings
CORS stands for Cross-Origin Resource Sharing. It is a mechanism that allows web browsers to securely make requests to a different domain or origin than the one from which the web page was served. By default, web browsers enforce a policy called the Same-Origin Policy, which restricts JavaScript code running in a web page from making requests to a different domain. CORS provides a way to relax this policy and enable cross-origin requests, but in a controlled and secure manner. When a web page makes a cross-origin request, the server needs to include specific CORS headers in its response to indicate which origins are allowed to access its resources. These headers include information such as the allowed methods, allowed headers, and whether credentials (such as cookies or HTTP authentication) can be included in the request. CORS helps to prevent malicious scripts from performing unauthorized actions on behalf of a user, while still allowing legitimate cross-origin requests between trusted domains. It plays a crucial role in enabling modern web applications to interact with APIs and services hosted on different domains. The following are CORS properties that are configurable on the domain. Depending on the application being served, these setting could be configured from the application. The following CORS properties can be configured:allowCredentials
- Determines whether the client-side code (typically running in a web browser) is allowed to include credentials (such as cookies, HTTP authentication, or client-side SSL certificates) in cross-origin requests.
maxAge
- Maximum amount of time that a preflight request result can be cached by the client browser. Must match the regex pattern:
^[\d\.]+[wdhm]+$
(e.g., “24h”, “1d”, “3600s”)
- Maximum amount of time that a preflight request result can be cached by the client browser. Must match the regex pattern:
allowOrigins
- Determines which origins are allowed to access a particular resource on a server from a web browser.
- Each origin can be specified as either:
exact
: A specific origin string (e.g.,https://example.com
)regex
: A regex pattern to match origins
- Examples:
- Wildcard Origin:
*
- Specific Origin:
https://example.com
- Wildcard Origin:
- Each origin can be specified as either:
- Determines which origins are allowed to access a particular resource on a server from a web browser.
allowMethods
- Specifies the HTTP methods (such as GET, POST, PUT, DELETE, etc.) that are allowed for a cross-origin request to a specific resource.
allowHeaders
- Specifies the custom HTTP headers that are allowed in a cross-origin request to a specific resource. Header names are automatically converted to lowercase.
exposeHeaders
- Specifies which response headers are exposed to the client-side code (typically running in a web browser) in a cross-origin request. Header names are automatically converted to lowercase.
Dedicated Load Balancer Options
When a GVC has the dedicated load balancer option enabled, additional settings are available for any domains using it. See the GVC dedicated load balancer reference page for additional details.NumTrustedProxies
ThenumTrustedProxies
property gives control over the number of trusted proxies that are configured in front of Control Plane.
Changing it, controls the source ip address used for request logging, firewall settings and for the X-Envoy-External-Address header passed to workloads.
If set to 1, then the last address in an existing X-Forwarded-For header will be used in place of the source client IP address.
If set to 2, then the second to last address in an existing X-Forwarded-For header will be used in place of the source client IP address.
When set to 2, any request where the XFF header does not have at least two addresses or does not exist then the source client IP address will be used instead.
Custom Ports
Any custom port number can be used with the exception of the following excluded ports:- 8012
- 8022
- 9090
- 9091
- 15000
- 15001
- 15006
- 15020
- 15021
- 15090
- 41000
Configuration Options
When a dedicated load balancer is enabled on a GVC, the domains that are configured to serve workloads within that GVC will have the following options that can be configured:acceptAllHosts
TheacceptAllHosts
property configures the domain to allow all traffic (i.e. wildcard support) to the configured workloads, regardless of what the Host header or SNI is for the request. There should only ever be at most one Domain configured with this setting for a single GVC. If there are multiple, then requests will only route for one of the two Domains.
acceptAllSubdomains
TheacceptAllSubdomains
property configures the domain to allow all traffic to *.${Domain}
for the domain. No other Domains in the same GVC should be configured for any subdomains of this Domain since their routing rules will be ignored.
hostPrefix
For domains using Path Based Routing thehostPrefix
property will be enabled and can be used for each path when the domain has the acceptAllHosts
or acceptAllSubdomains
property enabled.
This option allows forwarding traffic for different host header prefixes to specific workloads.
The host prefix must match the regex pattern: ^[0-9a-zA-Z-\._]*$
You cannot use both
hostPrefix
and hostRegex
on the same route.hostRegex
For domains using Path Based Routing thehostRegex
property will be enabled and can be used for each path when the domain has the acceptAllHosts
or acceptAllSubdomains
property enabled.
This option allows forwarding traffic for different host headers to specific workloads by regular expression.
You cannot use both
hostPrefix
and hostRegex
on the same route.Replica Direct Routing
Domains can be configured, in conjunction with astateful
workload, for replica direct endpoints.
These links will direct traffic directly to the specified replica of a workload.
Configuration
To configure a Domain for replica direct routing, you need to set theworkloadLink
property on the Domain to the link of the workload.
The domain will also need to be configured as a cname
domain with the dns01
cert challenge type.
The domain needs at least one port with exactly one route per port.
Validation Rules:
- When
workloadLink
is configured,certChallengeType
cannot behttp01
- Every port must have exactly one route
- All routes must reference the same workload as the domain’s
workloadLink
- The domain cannot have both
gvcLink
andworkloadLink
configured
Example
DNS names
When a Domain is configured for replica direct routing, the DNS names for each replica will be:<workload-name>-<replica>-<location>.<domain>
Example
my-workload-0-aws-us-west-2.example.com
DNS records
Replica direct domains require specific DNS records in order to work correctly.- One CNAME record to redirect the dns01 certificate challenge to Control Plane
Host TTL Type Value _acme-challenge 300 CNAME _acme-challenge.cpln.app - A CNAME record for EACH replica of the workload to redirect traffic to Control Plane
Host TTL Type Value my-workload-0-aws-us-west-2 300 CNAME my-workload-<gvcAlias>-0.aws-us-west-2.controlplane.us my-workload-1-aws-us-west-2 300 CNAME my-workload-<gvcAlias>-1.aws-us-west-2.controlplane.us my-workload-2-aws-us-west-2 300 CNAME my-workload-<gvcAlias>-2.aws-us-west-2.controlplane.us
Permissions
The permissions below are used to define policies together with one or more of the four principal types:Permission | Description | Implies |
---|---|---|
create | Create new domain | |
delete | Delete a domain | |
edit | Modify existing domains (only tags can be changed) | view, use |
manage | Full access | create, delete, edit, manage, use, view |
use | Allow a principal to use this domain | view |
view | Read-only access |
Access Report
Displays the permissions granted to principals for the domain.Domain Status
The domain status field indicates the current state of the domain configuration and deployment. Supported Status Values:initializing
: Domain is being set upready
: Domain is fully configuredpendingDnsConfig
: Waiting for DNS configuration to be verified, this may happen if DNS is updated but has not yet propagatedpendingCertificate
: Waiting for certificate provisioningusedByGvc
: Domain is being used by a GVC with legacy configurationwarning
: Domain has configuration warningserrored
: Domain configuration has errors
endpoints
: Array of endpoint URLs and their associated workload linkswarning
: Warning message describing any issueslocations
: Array of location-specific certificate status informationfingerprint
: Unique identifier for the domain configurationdnsConfig
: Array of DNS configuration records required for the domain
DNS Configuration Records
ThednsConfig
field contains the DNS records that need to be configured for the domain to function properly.
DNS Record Structure:
type
: DNS record type (e.g., “CNAME”, “NS”, “TXT”)ttl
: Time to live value (positive integer)host
: Hostname for the DNS recordvalue
: DNS record value
CLI
To view the CLI documentation for domains, click here.Domain Certificate Management
Control Plane automatically handles the creation and renewal of TLS certificates for Domains. This ensures that your Domains are always secured with up-to-date certificates without requiring manual intervention. The certificates issued are valid for 90 days and refresh every 60 days.Certificate Creation and Renewal Process
Control Plane uses the Let’s Encrypt ACME protocol to automatically create and renew certificates for Domains. Any certificates issued by Let’s Encrypt are published to the Certificate Transparency logs and discoverable by the public. If you prefer to use a different certificate authority, you can configure a custom server certificate on the Domain.-
NS Domains: Control Plane utilizes the Let’s Encrypt DNS-01 verification process.
This involves creating a DNS TXT record at
_acme-challenge.${domain}
to prove Domain ownership, allowing Let’s Encrypt to issue a certificate. Control Plane manages the creation of the DNS record, and the certificate is issued by Let’s Encrypt. When the Domain is attached to a GVC to have a subdomain for each workload, the certificate includes a wildcard for the subdomain. -
CNAME Domains: Control Plane uses the Let’s Encrypt HTTP-01 verification process.
This involves serving a specific HTTP resource to prove Domain ownership at
http://${domain}/.well-known/acme-challenge/
, allowing Let’s Encrypt to issue a certificate. Control Plane configures the Domain with a redirect to our HTTP-01 solver, and then the certificate is issued by Let’s Encrypt. Wildcard certificates cannot be created using the HTTP-01 verification process, so CNAME Domains should not be attached to a GVC unless a custom server certificate is used.
If you choose to use a custom server certificate, ensure you monitor its expiration and renew it as necessary to avoid service
disruptions.
Domain Validation Rules
The following validation rules apply to domain configuration:Route Limits
- Maximum of 150 routes per domain
- Routes must be unique (no duplicate prefix/regex and host combinations)
- All routes must reference workloads within the same GVC
Port Configuration Limits
- Maximum of 10 ports per domain
- Each port can have a maximum of 150 routes
DNS Mode Constraints
- Apex domains can only use CNAME mode (
dnsMode: cname
) - NS mode requires DNS-01 certificate challenge type
- CNAME mode with subdomain routing requires custom server certificate
Workload Link Constraints
- Cannot configure both
gvcLink
andworkloadLink
on the same domain - When
workloadLink
is configured:- Cannot use HTTP-01 certificate challenge type
- Every port must have exactly one route
- All routes must reference the same workload
Wildcard Support Constraints
- Cannot enable both
acceptAllHosts
andacceptAllSubdomains
simultaneously hostPrefix
andhostRegex
can only be used whenacceptAllHosts
oracceptAllSubdomains
is enabled
Domain Configuration Errors
During the Domain configuration process, several errors might occur. These errors are viewable in the UI/API as a result of the Domain status being modified and are also available in Grafana as thedomain_warning
metric.
A default alert is also created to notify the default contact when any Domain is in a warning state.
Below are some common issues and their implications:
Common Errors
-
Certificate Renewal Blocked: The Domain’s certificate renewal is blocked.
This can occur if the Domain is using a CNAME DNS mode and the renewal is blocked due to firewall or external CDN/WAF configurations.
To test if the request from Let’s Encrypt is being blocked, you can use the following curl command:
location:
in the response will NOT be targeted to http01-solver.cpln.io
.
Example of an invalid redirect to HTTPS:
-L
flag to follow the redirect:
-
Domain Used by GVC: This Domain is currently in use by a GVC using the legacy configuration of the GVC
spec.domain
property. The Domain configuration will be ignored until no GVC is using it. This results in ausedByGvc
status with a warning message indicating the Domain’s current usage. - Invalid GVC: At least one of the configured routes does not map to a valid GVC. Check the routes and verify that the GVC and workloads targeted by the Domain or routes exist.
- No Valid Routes Configured: No valid routes are configured for the Domain. Routes need to be added or updated for the Domain to be usable.
- Disallowed Port or Protocol: A port other than 443 or 80 is used, or the protocol is set to TCP and the GVC assigned is not configured with a dedicated load balancer. If you need to use a port other than 443 or 80, you can enable dedicated load balancer on the GVC.
- Invalid Workload: A route is not mapped to a valid workload and will not be included in the configuration. This requires updating the route to map to a valid workload or removing the route that is no longer needed.
- HostPrefix Ignored: If the GVC does not have dedicated load balancer enabled and the Domain is not configured for wildcard support, any hostPrefix for a route is ignored.
Logging and Monitoring
Errors and warnings are displayed in the status of the Domain objects and are displayed in the UI. A Grafana metric ofdomain_warning
is updated for each Domain.
An alarm is configured to notify the default contact using this metric when any Domain is in a warning state.