×
Community Blog Cloud Elasticity Provided by ACK One Registered Clusters: A New Tool for Business Expansion

Cloud Elasticity Provided by ACK One Registered Clusters: A New Tool for Business Expansion

The article introduces the benefits and access procedures of using ACK One registered clusters to address the challenges of scalability and flexibility in enterprise digital transformation.

By Xiaobing Meng (Zhishi)

As enterprises further deepen their digital transformation, the flexibility and scalability of infrastructure have become a key challenge. Traditional data centers are limited by physical capacity, making it difficult to achieve dynamic scaling, thus lacking the necessary scalability. In this case, cloud elasticity provided by ACK One registered clusters is the best solution to address this issue due to its high flexibility and rich resource options.

Benefits of ACK One Registered Clusters

Self-managed Kubernetes clusters in traditional data centers have limited capacity and insufficient elasticity. By connecting the self-managed Kubernetes cluster in the data center to the ACK One registered cluster for unified management, these limitations can be effectively overcome, bringing the following benefits:

Resource auto scaling: Through integration with Alibaba Cloud resources, computing resources can be scaled out on demand, improving resource utilization and reducing costs.

Cost optimization: Alibaba Cloud's pay-as-you-go billing method avoids the sunk costs of fixed investments in the data center and charges based on actual usage, which is more cost-effective.

Architecture and Access Procedure of ACK One Registered Clusters

_1

The preceding figure shows the overall architecture of the ACK One registered cluster. Currently, you can quickly connect a Kubernetes cluster in the data center to a registered cluster through the following steps:

  1. First, use the console or command-line tool to create a registered cluster. For more information, please refer to Create a registered cluster in the ACK console.
  2. Deploy the agent in the target Kubernetes cluster in the data center.
  3. Check the running status of the agent in the target cluster.
kubectl -n kube-system get pod |grep ack-cluster-agent

Expected output:

ack-cluster-agent-5f7d568f6-6fc4k              1/1     Running   0          9s
ack-cluster-agent-5f7d568f6-tf6fp              1/1     Running   0          9s

Benefits of Cloud Elasticity Provided by ACK One Registered Clusters

_2

Cloud elasticity provided by ACK One registered clusters helps enterprises solve the preceding challenges with its powerful features and flexible resource selection.

1.  Rich elastic resource options:

  • On-demand use of Elastic Container Instances (ECIs) eliminates the need to purchase servers, operates on a pay-as-you-go basis, and ensures transparent and controllable costs.
  • Ordinary Elastic Computing Service (ECS) can scale out computing resources within minutes.
  • GPU models meet the needs of high-performance computing tasks, such as AI training and big data analysis.

2.  Highly flexible scalability:

  • Dynamic scale-out and scale-in of business volume are implemented, improving the utilization of computing resources.
  • Auto scaling and recycling can be performed based on business requirements, greatly reducing the burden of manual operation and maintenance.
  • Resources can be flexibly allocated based on business requirements. When resources in the data center are insufficient, the cloud resources can be automatically scaled out to effectively solve the peak business pressure, ensuring stable operation of the system and user experience.

Scenario 1: Cloud ECS Node Pool (CPU/GPU) in the Registered Cluster

You can use ACK One registered clusters for centralized management and rapid construction of a hybrid cloud environment. When computing resources in data centers cannot meet your business requirements, you can create a node pool to scale out computing resources in the cloud.

The node pool of ACK One registered clusters provides the following benefits:

  • Support multiple operating system images, such as ContainerOS and Alibaba Cloud Linux.
  • Support different billing methods of the node, such as pay-as-you-go, subscription, and preemptible instances.
  • Support models with different architectures, such as CPU and GPU.

Next, we will perform the following steps to create and use a cloud node pool.

1.  Prepare a custom script. Since GPU models are likely to be used in actual business scenarios, you can add the following script to the custom script to detect GPU models and install the corresponding drivers based on the detection results. For more information about GPU drivers, please refer to Install the new NVIDIA driver version on the node.

#!/bin/bash
# Check whether Ispci is installed.
if ! which lspci &>/dev/null; then
  yum -y install pciutils
fi

# Check whether the node is equipped with a GPU.
if lspci | grep -i nvidia &>/dev/null; then
  echo "Install the relevant drivers because the node is a GPU-accelerated node." 
fi

Custom scripts vary based on the deployment methods of Kubernetes clusters in the data center. For more information about custom scripts, please refer to Create a node pool in a registered cluster.

2.  To facilitate subsequent scheduling, you can receive system environment variables from registered clusters in custom scripts. For more information about how to add an environment for a custom script, please refer to Create a node pool in a registered cluster.

3.  Save and configure the script definition to the registered cluster configuration items.

4.  Create and scale out a node pool.

5.  Run the following command to view the scale-out result.

kubectl get no

Expected output: Nodes in the <RegionID>.<IP> format are ECS nodes that are scaled out by using a node pool.

NAME                               STATUS   ROLES           AGE     VERSION
cn-***.192.168.XX.XXX              Ready    <none>          5h43m   v1.28.2
idc-worker-001                     Ready    <none>          5h51m   v1.28.2
idc-worker-002                     Ready    <none>          5h54m   v1.28.2
master-0906-001                    Ready    control-plane   4d3h    v1.28.2

6.  Run the following command to create a pod in the node pool of the registered cluster.

kubectl apply -f - <<EOF
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: nginx
  name: nginx-deployment-cloud
  namespace: default
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      nodeSelector:
        alibabacloud.com/nodepool-id: np6d13af2bb56546128***   # This is the ID of the node pool of the registered cluster.
      containers:
        - image: 'registry.cn-hangzhou.aliyuncs.com/eci_open/nginx:1.14.2'
          imagePullPolicy: IfNotPresent
          name: nginx
          ports:
            - containerPort: 80
              protocol: TCP
          resources:
            limits:
              cpu: 500m
EOF

Scenario 2: Use ack-virtual-node to Schedule Business Pods to ECI

You can schedule pods to elastic container instances that are deployed as virtual nodes. This way, you do not need to purchase or manage ECS instances, so as to efficiently use resources.

Next, we will perform the following steps to deploy ack-virtual-node and schedule pods to ECI:

1.  Install the ack-virtual-node component through registered cluster operation and maintenance or the command-line tool. For more information about components, please refer to Schedule pods to elastic container instances that are deployed as virtual nodes.

2.  Run the following command to view the deployment status of the virtual node.

kubectl get no

Expected output: Nodes in the virtual-kubelet- format are virtual nodes.

NAME                               STATUS   ROLES           AGE     VERSION
idc-worker-001                     Ready    <none>          6h21m   v1.28.2
idc-worker-002                     Ready    <none>          6h24m   v1.28.2
master-0906-001                    Ready    control-plane   4d3h    v1.28.2
virtual-kubelet-cn-***             Ready    agent           4d      v1.28.2

3.  Run the following command to schedule pods to ECI by using the specified label alibabacloud.com/eci=true.

kubectl run nginx --image=registry.cn-hangzhou.aliyuncs.com/eci_open/nginx:1.14.2 -l alibabacloud.com/eci=true

Scenario 3: Use ack-co-scheduler to Achieve Multilevel Elastic Resource Scheduling

By combining ack-co-scheduler components with cloud node pools and ECIs, multilevel resource scheduling is implemented. The resources in the data center are preferentially used, then the cloud node pools, and finally the resources of ECIs, ensuring the rational allocation and efficient use of resources.

  1. Install the ack-co-scheduler component through registered cluster operation and maintenance or the command-line tool. For more information about components, please refer to Use ack-co-scheduler to achieve multilevel resource scheduling.
  2. Implement multilevel scheduling when resources in the data center are insufficient.

a) Run the following command to create a scheduling policy. If resources in the data center are insufficient, business is scheduled to the node pool of the registered cluster.

kubectl apply -f - <<EOF
apiVersion: scheduling.alibabacloud.com/v1alpha1
kind: ResourcePolicy
metadata:
  name: schedued-to-node-pool
spec:
  selector:
    app: nginx
  strategy: prefer
  units:
  - resource: idc   
  - resource: ecs
    nodeSelector:
      alibabacloud.com/nodepool-id: np6d13af2bb**  # This is the ID of the cloud node pool. If resources in the data center are insufficient, business is scheduled to the cloud node pool.
EOF

b) Run the following command to create a scheduling policy. If resources in the data center are insufficient, business is scheduled to the ECI.

kubectl apply -f - <<EOF
apiVersion: scheduling.alibabacloud.com/v1alpha1
kind: ResourcePolicy
metadata:
  name: schedued-to-eci
spec:
  selector:
    app: nginx
  strategy: prefer
  units:
  - resource: idc   
  - resource: eci # When the resources in the data center are insufficient, business is scheduled to ECI.
EOF

Summary

The cloud node pool provided by ACK One registered clusters offers enterprises unprecedented flexibility and scalability due to its rich elastic resource options and simple operation procedures. Alibaba Cloud can quickly respond to business requirements for general computing, container instances, and high-performance computing tasks, thereby helping enterprises move towards digital transformation more efficiently.

Visit the ACK One official website now to learn more details and start your intelligent expansion journey!

0 1 0
Share on

Alibaba Container Service

175 posts | 31 followers

You may also like

Comments