Container Service for Kubernetes (ACK) allows you to manage containerized applications that run on the cloud in a convenient and efficient manner. This topic describes how to use the ACK console to deploy, expose, and monitor a magic cube game in an ACK cluster.
This topic demonstrates how to deploy an ack-cube application in an ACK Pro cluster by using a container image. This application is an online magic cube game. After you perform the steps in this topic, a magic cube game is deployed in an ACK Pro cluster.
ACK managed clusters consist of ACK basic clusters and ACK Pro clusters. Compared with ACK basic clusters, ACK Pro clusters provide higher stability and enhanced security, and are covered by the service level agreement (SLA) that includes compensation clauses. For more information about the billing of ACK clusters and the cloud resources used by ACK clusters, see Billing.
For more information the terms used in Kubernetes, see Terms.
If this is the first time you use ACK, you must activate ACK and grant ACK the permissions to access cloud resources. Then, create an ACK cluster and deploy a magic cube game in the cluster.
Step 1: Activate and grant permissions to ACK
If this is the first time you use ACK, you must activate ACK and grant ACK the permissions to access cloud resources.
Go to the Container Service for Kubernetes page.
Read and select Container Service for Kubernetes Terms of Service.
Click Activate Now.
Log on to the ACK console.
On the Container service needs to create default roles page, click Go to RAM console. On the Cloud Resource Access Authorization page, click Confirm Authorization Policy.
After you assign the Resource Access Management (RAM) roles to ACK, log on to the ACK console again to get started with ACK.
Step 2: Create an ACK Pro cluster
This step shows how to create an ACK Pro cluster. Default settings are used for most cluster parameters. For more information about the cluster parameters, see Create an ACK Pro cluster.
Log on to the ACK console. In the left-side navigation pane, click Clusters.
In the upper-right corner of the Clusters page, click Create Kubernetes Cluster.
On the Managed Kubernetes tab, set cluster parameters as described in the following table. Use default settings for the parameters that are not included in the table
Enter a name for the cluster.
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.
For more information about ACK Pro clusters, see Overview of ACK Pro clusters.
Select a region to deploy the cluster.
ACK clusters can be deployed only in virtual private clouds (VPCs). You must specify a VPC in the same region as the cluster.
In this example, click Create VPC and create a VPC named vpc-ack-demo in the China (Beijing) region. For more information, see Create and manage a VPC.
Select vSwitches for nodes in the cluster to communicate with each other.
In this example, click Create vSwitch and create a vSwitch named vswitch-ack-demo in the vpc-ack-demo VPC. Then, select vswitch-ack-demo in the vSwitch list. For more information, see Create and manage a vSwitch.
Access to API Server
Specify whether to expose the Kubernetes API server of the cluster to the Internet. If you want to manage the cluster over the Internet, you must expose the Kubernetes API server with an elastic IP address (EIP).
In this example, Expose API Server with EIP is selected.
Click Next:Node Pool Configurations. Configure the following parameters as described. Use default settings for the parameters that are not included in the table.
Select instance types that are used to deploy nodes.
You can specify the number of vCores and the amount of memory to filter the instance types. You can also specify an instance type in the search box to search for the instance type.
To ensure the stability of the cluster, we recommend that you select instance types with at least 4 vCores and 8 GiB of memory. For more information about Elastic Compute Service (ECS) instance types and how to select instance types, see Select ECS instance types and Instance families.
Instance types with at least 4 vCores and 8 GiB of memory
Specify the number of worker nodes.
Set the system disk for nodes.
In this example, enhanced SSD (ESSD) is selected as the disk type and the disk size is set to 40 GiB.
Select the logon type for nodes.
In this example, password logon is selected as the logon type and a password is specified.
Click Next:Component Configurations. Use default settings for all component parameters.
Click Next:Confirm Order, read and select the ACK terms of service, and then click Create Cluster.Note
It requires approximately 10 minutes to create a cluster. After the cluster is created, you can view the cluster on the Clusters page.
Step 3: Create and expose an application
This step shows how to deploy a stateless application by using a Deployment and how to expose the application to the Internet. This application is a magic cube game. For more information about the parameters used to create a Deployment, see Create a stateless application by using a Deployment.
On the Clusters page, click the name of the ACK-Demo cluster.
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, set the application name to ack-cube.
Click Next. On the Container wizard page, set container parameters.
You can enter an untagged image address or click Select Image to select the image that you want to use.
In this example,
Click Select Image Version and select an image version.
Specify the resource limits of the application. This prevents the application from occupying excessive amounts of resources.
In this example, 1 vCore and 1,024 MiB of memory are specified. Ephemeral Storage is left empty.
Specify the amount of resources that are reserved for the application. This prevents application unavailability caused by insufficient resources.
0.5 In this example, 0.5 vCores and 512 MiB of memory are specified. Ephemeral Storage is left empty.
Configure container ports.
In this example, TCP port 80 is configured and named ack-cube.
Click Next. On the Advanced wizard page, click Create to the right side of Services.
In the Create Service dialog box, set Service parameters and click Create. This creates a Service to expose the ack-cube application.
Enter a name for the Service.
The type of Service. This parameter specifies how the Service is accessed. Choose Server Load Balancer > Public Access, 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.
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 and container port are both set to 80.
In the lower-right corner of the Advanced wizard page, click Create.
After the application is created, you are redirected to the Complete wizard page. You can find the resource objects included in the application and click View Details to view application details.
Step 4: Test access to the application
This step shows how to access the application by using the Service.
On the Clusters page, click the name of the ACK-Demo cluster.
In the left-side navigation pane of the details page, choose
On the Services page, find the ack-cube-svc Service and click the IP address in the External Endpoint column to start the magic cube game.
Click Quick deployment template link to go to the Use New Resources (Standard) page in the Resource Orchestration Service (ROS) console. In the upper part of the page, select the region where you want to create a stack. In this example, China (Hohhot) is selected. Set other parameters and click Create.
You can enter a custom stack name.
You can enter a custom cluster name.Note
You cannot specify the name of an existing cluster.
vSwitch Available Zone
Select a zone.
Select an instance family.
You filter instance types by the number of vCores and memory size. You can also set the Architecture and Type parameters to filter instance types.
g6, general-purpose instance family
Worker System Disk Category
Select a system disk type for nodes.
The available disk types vary based on the instance type that you select. For more information about the disk types supported by different instance types, see Instance families. Disk types that are not displayed in the drop-down list are not supported by the instance types that you select.
Enter a password that is used to log on to the nodes.
Enter a password.
If Created is displayed in the Status parameter on the Stack Information tab, the stack is created.
If Created is not displayed in the Status parameter on the Stack Information tab, the stack is not created. You can click Quick Diagnostics to view the diagnostic details.
Test access to the application.
Wait until Created is displayed in the Status parameter on the Stack Information tab. Then, click the Outputs tab on the right of the Stack Information tab. Click the hyperlink next to CubeAddress to access the magic cube game.
You are charged a cluster management fee and a cloud service fee for the ACK Pro cluster that you use. The cluster management fee is charged by ACK. The cloud service fee is charged by the cloud services used by the ACK Pro cluster. Take note of the following items after you create an ACK Pro cluster.
If you no longer need to use the cluster, go to the Clusters page in the ACK console, find the cluster, and then choose More > Delete in the Actions column. In the Delete Cluster page, select Delete ALB Instances Created by the Cluster, Delete Alibaba Cloud DNS PrivateZone instances Created by the Cluster, Delete Associated Log Service Project, and I understand the above information and want to delete the specified cluster. Then, click OK. For more information about how to delete an ACK Pro cluster, see Delete ACK clusters.
If you need to keep the cluster, top up your account once your account balance is less than CNY 100. For more information about the billing rules of Alibaba Cloud services, see Cloud service fee.
To enable auto scaling for application pods, you can configure the Horizontal Pod Autoscaler (HPA), Cron Horizontal Pod Autoscaler (CronHPA), and Vertical Pod Autoscaler (VPA). For more information, see Auto Scaling overview.
In addition to exposing applications through Services, you can use Ingresses to enable application traffic routing at Layer 7. For more information, see Create an NGINX Ingress.
In addition to monitoring container performance, you can monitor the cluster infrastructure, application performance, and operations on your workloads. For more information, see Observability overview.
If you want to view monitoring information about applications, go to the cluster details page and choose Operations > Prometheus Monitoring in the left-side navigation pane. On the Prometheus Monitoring page, you can view monitoring information such as CPU utilization, memory utilization, and network I/O.