Last updated：2021-05-11 10:39:26
A Kubernetes Service abstracts the policies for accessing a set of pods. It shields dynamic changes of backend pods and multi-pod load balancing, and manages Service access over the Layer 4 network in a cluster. A serverless cluster does not contain actual nodes. Therefore, node-related access methods are unavailable. Services in a serverless cluster can be exposed through Cluster IP, SLB.
ClusterIP: Fixed virtual IP addresses (cluster IP addresses) are allocated to common Services in a Kubernetes cluster so that the Services can be accessed within the cluster.
LoadBalancer: The pods in a Service act as backend real servers of SLB and can be exposed through SLB to enable public access and intra-VPC access.
You can set the access method of an associated Service when you create a workload or associate a Service with a workload when you create the Service. To create a Service, perform the following steps:
Log in to the KCE console.
In the left navigation pane, click ServerlessCluster. The cluster management page appears.
Click the ID of the cluster in which you want to create a Service. The cluster details page appears.
In the left navigation pane, choose Service Management > Service. On the service list page, click Create.
Set the name, namespace, and other basic information of the Service.
Set the access method. Two access methods are available for a serverless cluster. For more information, see the following table.
Set the associated workload in two ways: Set Selector Manually or Refer to the workload.
|Access method||Service type||Description|
|Public Access(LoadBalancer)||LoadBalancer||- This option allows Services to be exposed to the Internet through SLB so that they can be accessed over the Internet. The serverless cluster will automatically create a public SLB instance and an EIP to perform dynamic mounting and synchronization of listeners.
- The Service can be accessed over the Internet through the IP address of the SLB instance and a service port. For more information, see Access Services by using SLB.
|Via VPC(LoadBalancer)||LoadBalancer||- This option allows Services to be exposed to the VPC where the Kubernetes cluster resides through SLB so that they can be accessed by other resources or Kubernetes clusters in the VPC. The serverless cluster will automatically create a private SLB instance to perform dynamic mounting and synchronization of listeners.
- The Service can be accessed in the VPC through the IP address of the SLB instance and a service port. For more information, see Access Services by using SLB.
|Intra-Cluster(ClusterIP)||ClusterIP||- This option allows Services to be exposed to the Kubernetes cluster so that they can be accessed by other Services or containers in the cluster.
- You can access the Services in the cluster through the Service name and Service port.
Other access configurations for different SLB types are described as follows:
SLB Subnet: Select the subnet where the SLB instance resides. This item is available when the access method is Via VPC(LoadBalancer). You can select an endpoint subnet in the VPC where the cluster resides.
Annotation Parameter: Add personalized configurations of SLB through annotations, for example, the bandwidth and billing mode of SLB. For more information, see Access Services by using SLB.
On the Service list page, click Update Access Method for a Service. On the Update Service page, update the access method and other access configurations.
On the Service list page, click Delete for a Service. In the message that appears, click OK.
Did you find the above information helpful?
Please give us your feedback.
Thank you for your feedback.