Configure Domain
Add domain name resources to the platform and allocate domains for use by all projects under a cluster or resources under a specific project. When creating a domain name, binding a certificate is supported.
The domain names created on the platform should be resolved to the cluster's load balancing address before they can be accessed via the domain name. Therefore, you need to ensure that the domain names added on the platform have been successfully registered and that the domain names resolve to the cluster's load balancing address.
Successfully created and allocated domain names on the platform can be utilized in the following features of Container Platform:
-
Create Inbound Rules: Network Management > Inbound Rules > Create Inbound Rule
-
Create Native Applications: Application Management > Native Applications > Create Native Application > Add Inbound Rule
-
Add Listening Ports for Load Balancing: Network Management > Load Balancer Details > Add Listening Port
Once the domain name is bound to a certificate, application developers can simply select the domain name when configuring the load balancer and inbound rules, allowing the use of the certificate that comes with the domain name for https support.
TOC
Example Domain custom resource (CR)Creating Domain by using the web consoleCreating Domain by using the CLIUse the Same Domain Across Multiple ClustersConfigure via Web ConsoleConfigure via CLISubsequent ActionsAdditional resourcesExample Domain custom resource (CR)
- If certificates are enabled, an LTS-type Secret must be created in advance. The
secret-refis secret name.
Creating Domain by using the web console
-
Go to Administrator.
-
In the left navigation bar, click Network Management > Domain Names.
-
Click Create Domain Name.
-
Configure the relevant parameters according to the following instructions.
-
Click Create.
Creating Domain by using the CLI
Use the Same Domain Across Multiple Clusters
You can configure the same domain to be used across multiple clusters by creating separate Domain resources in the global cluster with the identical spec.name value but different cluster.cpaas.io/name labels.
Configure via Web Console
-
Follow the steps in Creating Domain by using the web console.
-
Create two domain resources with the same domain name (e.g.,
app.example.com). -
For each domain, select a different Allocate Cluster (e.g., cluster-a and cluster-b).
Configure via CLI
Create two Domain custom resources in the global cluster with identical spec.name but different cluster.cpaas.io/name labels:
The domain name (spec.name) must be identical in both Domain resources, but the resource metadata.name should be unique. Both resources are created in the global cluster.
Domain for Cluster A:
Domain for Cluster B:
Subsequent Actions
-
Domain Registration: Register the domain if the created domain has not been registered.
-
Domain Resolution: Perform domain resolution if the domain does not point to the platform cluster's load balancing address.