Skip to main content

Publish Services

Updated at: 2025-11-19 13:58:25

Services deployed in the Virtual Kubernetes Services can be published to the public network through the ServiceExporter resource.
ServiceExporter is a custom resource type designed specifically by the Virtual Kubernetes Services to help users expose Kubernetes Service externally.
ServiceExporter supports multiple publishing methods, including automatically generated domain names and custom domain names.

Architecture for automatically generated domains

自动生成域名

The following sections describe the steps for publishing a service.

Publishing Services with Automatically Generated Domains

Publish a Service

You can expose a Kubernetes Service to the public using a platform-generated domain name.
Example:

# Service exposure using `Virtual Kubernetes Services`
apiVersion: osm.datacanvas.com/v1alpha1
kind: ServiceExporter
metadata:
name: your-service-exporter-name # Name of the ServiceExporter resource
namespace: your-name-space # The namespace you created
spec:
serviceName: your-service-name # required
servicePort: 8188 # Port of your service

Retrieve the Service Domain

You can use the following kubectl describe serviceexporter command to obtain the domain generated for your Service.

kubectl describe serviceexporter your-serviceexporter-name -n your-namespace

Example output: image

The service domain is represented as {url}:{22443}. 22443 is the fixed port used by the Virtual Kubernetes Services for external servicepublishing.
Example:

https://*****.sproxy.hd-01.alayanew.com:22443

Access the Service Endpoint

URI: Construct the URI by appending the path defined by the service.
Example service URI: /test
Example cURL request:

curl https://*****.sproxy.hd-01.alayanew.com:22443/test

Response:

{
"status": 0,
"message": "",
"data": "Welcome to use Virtual Kubernetes Services"
}

Publish Services with Custom Domains

If you require publishing services using a custom domain, please contact Customer Support.