This topic describes how to create an ACK Serverless cluster in the Container Service for Kubernetes (ACK) console. This topic also describes how to create an application from an image and view the containers in an ACK Serverless cluster.
Prerequisites
ACK and related cloud services are activated. Required default roles are assigned to ACK. For more information, see Quick start for first-time users.
Elastic Container Instance is activated in the Elastic Container Instance console.
Step 1: Create an ACK Serverless cluster
This section describes only the key parameters that are required to create an ACK Serverless cluster. You can configure other parameters and install components based on your business requirements. For more information, see Create an ACK Serverless cluster.
- Log on to the ACK console.
In the left-side navigation pane of the ACK console, click Clusters.
In the upper-right corner of the Clusters page, click Create Kubernetes Cluster.
On the page that appears, click the Serverless Kubernetes tab and configure the following parameters.
The following list describes some of the parameters:
Parameter
Description
Example
Cluster Name
Enter a name for the cluster.
NoteThe name must be 1 to 63 characters in length, and can contain digits, letters, and hyphens (-).
ask-hangzhou
Cluster Type
Select a cluster type. You can select Professional or Standard edition. We recommend that you use Container Service for Kubernetes (ACK) Pro clusters in the production environment and test environment. ACK standard clusters can meet the learning and testing needs of individual users.
Standard edition
Region
Select a region to deploy the cluster.
China (Hangzhou)
VPC
Specify the virtual private cloud (VPC) in which you want to deploy the cluster. Kubernetes clusters support only VPCs. You can select Create VPC or Select Existing VPC.
Create VPC: If you select this option, ACK automatically creates a VPC and a NAT gateway in the VPC. ACK also configures SNAT rules on the NAT gateway.
Select Existing VPC: If you select this option, you must select a VPC from the VPC drop-down list and select vSwitches in the vSwitch section. If you want to enable Internet access for the cluster to download container images or perform other operations, you must configure a NAT gateway. We recommend that you upload container images to a Container Registry instance in the region in which the cluster is deployed. This way, you can pull images over the VPC.
For more information about, see Create and manage a VPC.
Select Existing VPC
Configure SNAT
Specify whether to automatically create a NAT gateway and configure SNAT rules on the NAT gateway.
This parameter is required only if you set VPC to Create VPC.
NoteAfter you select Create VPC, you can specify whether to automatically create a NAT gateway and configure SNAT rules on the NAT gateway. If you clear this check box, you must manually create a NAT gateway and configure SNAT rules on the NAT gateway. Otherwise, the cluster deployed in the VPC cannot access the Internet.
For more information about, see Create and manage Internet NAT gateways.
Configure SNAT for VPC
Service CIDR
Set Service CIDR. The Service CIDR block must not overlap with the CIDR block of the VPC, the CIDR blocks of the ACK clusters in the VPC, or the pod CIDR block. The Service CIDR block cannot be modified after it is specified. For more information about how to plan CIDR blocks for an ACK cluster, see Plan CIDR blocks for an ACK cluster.
172.21.0.0/20
Access to API Server
By default, an internal-facing Server Load Balancer (SLB) instance is created for the Kubernetes API server of an Log on to the ACK console.. You can modify the specification of the SLB instance. For more information, see Instance specifications.
ImportantIf you delete the SLB instance, you cannot access the Kubernetes API server of the cluster.
Select or clear Expose API Server with EIP. The Kubernetes API server provides multiple HTTP-based RESTful APIs, which can be used to create, delete, modify, query, and monitor resources, such as pods and Services.
If you select this check box, an elastic IP address (EIP) is created and associated with the SLB instance. In this case, the Kubernetes API server of the cluster is exposed to the Internet through port 6443 of the EIP. You can use kubeconfig files to connect to and manage the cluster over the Internet.
If you clear this check box, no EIP is created. You can connect to and manage the cluster by using kubeconfig files only from within the VPC.
For more information, see Control public access to the API server of a cluster.
Expose API Server with EIP
Security group
You can select Create Basic Security Group, Create Advanced Security Group, or Select Existing Security Group. For more information about security groups, see Overview.Note- To enable the Select Existing Security Group option, apply to be added to the whitelist in Quota Center.
- If you select an existing security group, the system does not automatically configure security group rules. This may cause errors when you access the nodes in the cluster. You must manually configure security group rules. For more information, see Configure security group rules to enforce access control on ACK clusters.
Create Advanced Security Group
Cluster Domain
Enter a domain name for the cluster. Default value: cluster.local.
cluster.local
Terms of Service
You must read and select Terms of Service for Serverless Kubernetes before you create the cluster.
Select Terms of Service
After you configure the cluster, click Next:Component Configurations in lower-right part of the page to configure components.
Parameter
Description
Example
Service Discovery
Specify whether to enable the service discovery feature. Default value: Disable. For more information, see ACK Serverless Service discovery and DNS.
You can select PrivateZone to enable the PrivateZone service.
You can select CoreDNS to enable the CoreDNS service.
Disable
Ingress
Specify whether to install an Ingress controller. By default, Do Not Install is selected.
If you select Nginx Ingress, the NGINX Ingress controller is automatically installed. For more information about the NGINX Ingress controller, see Advanced Ingress configurations.
If you select ALB Ingress, the Application Load Balancer (ALB) Ingress controller is automatically installed. For more information about how to access Services in a cluster by using ALB Ingresses, see Access Services by using an ALB Ingress.
Do Not Install
Monitoring Service
Specify whether to install the metrics-server component. By default, Install metrics-server is not selected.
We recommend that you select Install metrics-server to enable the monitoring service.
Install metrics-server
Log Service
Specify whether to enable Log Service. You can select an existing Log Service project or create one. By default, Enable Log Service is selected.
This allows you to use Log Service with simple configurations when you create an application. For more information, see Use Log Service to collect application logs.
Create Project
Knative
Specify whether to enable Knative. By default, Enable Knative is not selected. For more information, see Knative overview.
Enable Knative
After you configure components, click Next:Confirm Order in the lower-right part of the page.
On the Confirm Order wizard page, select Terms of Service for Serverless Kubernetes in the Term of Service section and click Create Cluster.
What to do next
After the cluster is created, you can find the cluster on the Clusters page in the console.
On the Clusters page, find the created cluster and click Details in the Actions column. On the details page, click the Basic Information tab to view basic information about the cluster and click the Connection Information tab to view information about how to connect to the cluster.
Step 2: Create an application from an image
This section describes only the key parameters that are required to create an application from an image. For more information, see Create an application from an image.
1. Configure basic information
In the left-side navigation pane of the details page, choose .
In the upper-right corner of the Deployments page, click Create from Image.
On the Basic Information wizard page, configure the basic settings of the application.
Parameter
Description
Example
Name
Enter a name for the application.
serverless-app-deployment
Type
Specify the type of resource object. Valid values include Deployment and StatefulSet.
Deployment
Click Next.
2. Configure container settings
In the General section of the Container wizard page, configure the basic settings of containers.
Parameter
Description
Example
Image Name
To select an image, click Select Image. In the Select Image dialog box, select an image and click OK.
You can also enter the address of an image that is stored in a private registry. The image address must be in the following format:
domainname/namespace/imagename:tag
.In this example, an image that is stored on a Container Registry Personal Edition instance is used. The instance is deployed in the China (Hangzhou) region.
Image Version
Click Select Image Version and select an image version. If you do not specify an image version, the latest image version is used.
In this example, no image version is specified.
In the Ports section, click Add to configure one or more container ports.
Parameter
Description
Example
Name
Enter a name for the container port.
nginx
Container Port
Specify the container port that you want to expose. The port number must be from 1 to 65535.
80
Protocol
Valid values: TCP and UDP.
TCP
Click Next.
3. Configure advanced settings
In the Access Control section of the Advanced wizard page, configure a Service to expose the backend pod.
Click Create on the right side of Services. In the Create Service dialog box, configure the following parameters.
Parameter
Description
Example
Name
Enter a name for the Service.
serverless-app-svc
Type
The type of Service. This parameter determines how the Service is accessed.
Select Server Load Balancer. Then, select Public Access and Create SLB Instance. You can click Modify to change the Server Load Balancer (SLB) instance specification based on your business requirements.
In this example, the default specification Small I (slb.s1.small) is used.
Port Mapping
Specify a Service port and a container port. The container port must be the same as the one that is exposed in the backend pod.
In this example, the Service port is set to 8080 and the container port is set to 80.
You can find the created Service in the Access Control section. You can click Update or Delete to change the configurations.
Click Create.
4. Access the NGINX application
On the Complete wizard page, click View Details. You can find serverless-app-deployment on the Deployments page.
Access the NGINX application.
In the left-side navigation pane of the cluster details page, choose . On the Services page, you can find the serverless-app-svc Service.
Click the address in the External Endpoint column to access the NGINX application by using a browser.
NoteFor more information about how to access an application by using an Ingress, see Access Services by using an ALB Ingress.
Step 3: View the pod
In the left-side navigation pane of the details page, choose .
Select the pod that you want to view and click Details in the Actions column.
NoteYou can modify or delete the pod based on your needs. We recommend that you use templates to manage pods that are created by using templates. Do not directly modify or delete these pods.
On the details page of the pod, you can view the detailed information about the pod.