Create a Service in an ACK Serverless cluster
This topic explains how to create a Service in an ACK Serverless cluster.
This procedure uses the ACK console.
Prerequisites
-
An ACK Serverless cluster is created.
-
A Deployment is created. See Step 1: Create a Deployment.
Service types
ACK Serverless supports two Service types. Choose based on how your application is accessed.
ClusterIP
Assigns an internal IP address reachable only within the cluster. This is the default type.
A Headless Service can only be configured when Type is set to Cluster IP.
LoadBalancer
Exposes the Service through a Server Load Balancer (SLB) instance, accessible inside or outside the cluster. SLB routes requests to NodePort and ClusterIP Services.
Before selecting this type, review Considerations for LoadBalancer Services.
Considerations for LoadBalancer Services
Note these constraints for the Server Load Balancer type:
| Scenario | Constraint |
|---|---|
| Using an existing SLB instance | The SLB instance's listeners overwrite the Service's listeners. |
| SLB instances created with a Service | Cannot be reused for other Services — reuse may delete the instance. Only manually created SLB instances can be shared across Services. |
| Shared SLB instances | Services sharing an SLB instance must use different frontend listener ports. |
| Listener and vServer group names | Listener names and vServer group names serve as unique identifiers when sharing an SLB instance. Do not modify them. |
| Cross-cluster sharing | SLB instances cannot be shared across clusters. |
Step 1: Create a Deployment
Create a Deployment from an image (example: serverless-app-deployment). See Create an application from an image.
Step 2: Create a Service
-
Log on to the ACK console. In the left-side navigation pane, click Clusters.
-
On the Clusters page, click the target cluster name, then choose Network > Services in the left-side navigation pane.
-
On the Services page, click Create.
-
In the Create Service dialog box, configure the following parameters, then click Create.
Parameter Description Name The Service name. Example: nginx-svc.Type Determines how the Service is accessed. Valid values: Cluster IP (default) or Server Load Balancer. See Service types. Backend The Deployment backing this Service. Example: serverless-app-deployment. If blank, no Endpoint is created; associate a backend later. See Services without selectors.External traffic policy Valid values: Local or Cluster. Available only when Type is Server Load Balancer. Port mapping The Service and container ports. Container port must match the backend pod's exposed port. Annotations Custom Service annotations. For example, service.beta.kubernetes.io/alicloud-loadbalancer-bandwidth:20sets the LoadBalancer bandwidth to 20 Mbit/s. See Use annotations to configure load balancing.Label Labels to identify the Service.
After creation, manage the Service from the Actions column on the Services page.