Because pods are created and deleted frequently, their IP addresses change constantly. A Kubernetes Service provides a stable network endpoint for a group of pods and distributes traffic across them, decoupling frontend clients from backend pods. Use the ACK console to create a Deployment and expose it with a Service.
Prerequisites
Before you begin, ensure that you have:
An ACK Serverless cluster. For more information, see ACK Serverless quick start
How Services work
A label selector identifies which pods a Service targets. When the Service receives traffic, it distributes requests across all pods whose labels match the selector.
The following table shows the three Service types and when to use each:
| Service type | Access pattern | Use when |
|---|---|---|
| Cluster IP | Internal cluster IP address only (default) | Exposing the app to other workloads within the same cluster |
| Node Port | <NodeIP>:<NodePort> from outside the cluster | Direct node-level access; not available for ACK Serverless clusters |
| Server Load Balancer | Internet-facing or internal SLB instance | Exposing the app to external users or internal VPC consumers |
For the full Kubernetes Service specification, see Kubernetes Services.
Step 1: Create a Deployment
Log on to the ACK console. In the left-side navigation pane, click Clusters.
On the Clusters page, click the name of the target cluster. In the left-side navigation pane, choose Workloads > Deployments.
In the upper-right corner of the Deployments page, click Create from YAML.
Select a sample template or paste a custom YAML manifest, then click Create. The following example deploys two NGINX replicas and exposes port 80:
apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment-basic labels: app: nginx spec: replicas: 2 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.7.9 # Replace with your image ports: - containerPort: 80 # This port is referenced in the Service port mappingOn the Deployments page, click the Deployment name or click Details in the Actions column to confirm it is running.

Step 2: Create a Service
In the left-side navigation pane of the cluster details page, choose Network > Services.
On the Services page, click Create.
In the Create Service dialog box, configure the parameters described in the following table, then click Create.
Parameter Description Name A name for the Service. Service Type How the Service is accessed. See Service type details for guidance. External Traffic Policy Available only for Node Port and Server Load Balancer types. Local routes traffic only to pods on the node that received the request. Cluster allows traffic to be routed to pods on any node in the cluster. For a comparison, see Differences between external traffic policies. Backend The Deployment to associate with this Service. If left blank, no Endpoint objects are created. See Services without selectors. Port Mapping Maps the Service port ( portfield in YAML) to the container port (targetPortfield in YAML). The container port must match the port exposed in the backend pod.Annotations Key-value annotations that configure the underlying SLB instance. Select Custom Annotation or Alibaba Cloud Annotation from the Type drop-down list. For example, service.beta.kubernetes.io/alicloud-loadbalancer-bandwidth:2caps bandwidth at 2 Mbit/s. For all supported annotations, see Use annotations to configure CLB instances.Label Labels used to identify this Service. On the Services page, confirm the Service appears in the list. To access the backend application, click the hyperlink next to External Endpoint on the Service details page.
Service type details
Cluster IP
Cluster IP exposes the Service on an internal cluster IP address, making it reachable only from within the cluster. This is the default type and is suitable for services consumed only by other workloads in the same cluster.
To use a headless Service — for example, to integrate with a custom service discovery mechanism — select the Headless Service checkbox. This option is available only when Service Type is set to Cluster IP.
Node Port
Node Port maps a static port on each node to the Service, allowing access from outside the cluster at <NodeIP>:<NodePort>. The system automatically creates a Cluster IP Service to handle internal routing.
Node Port is supported only for ACK clusters. ACK Serverless clusters do not support this type.
Server Load Balancer
Server Load Balancer (SLB) creates or reuses an SLB instance to expose the Service externally (internet-facing) or internally (VPC-facing). Traffic can be routed to Node Port or Cluster IP Services.
SLB instance options:
Create SLB Instance: Click Modify to change the instance specification.
Use Existing SLB Instance: Select an SLB instance from your account.
Usage notes:
If you use an existing SLB instance, the listeners of the SLB instance overwrite the listeners of the Service.
Services sharing the same SLB instance must use different frontend listener ports to avoid port conflicts.
Do not rename listeners or vServer groups that Kubernetes manages — Kubernetes uses these names as unique identifiers.
SLB instances cannot be shared across clusters.
An SLB instance created automatically for a Service cannot be reused by other Services. Only SLB instances created manually in the console or via API can be shared across multiple Services.
What's next
To update or delete the Service, click Update or Delete in the Actions column on the Services page.
To configure advanced load balancing settings, see Use annotations to configure CLB instances.
To learn about external traffic policy trade-offs, see Differences between external traffic policies.