This topic describes how to delete a cluster of Container Service for Swarm.

Check whether user traffic is routed to the Swarm cluster

  1. Check whether user traffic is sent to the Server Load Balancer (SLB) instance.

    Before you delete a Swarm cluster, make sure that no user traffic is sent to the SLB instance that is attached to the Swarm cluster. SLB allows you to view monitoring data by SLB instance or by listener. You can perform the following steps to view monitoring data and check whether user traffic is sent to the SLB instance:

    1. Log on to the SLB console.
    2. In the left-side navigation pane, choose CLB (FKA SLB) > Instances.
    3. On the Instances page, click the SLB instance that is attached to the Swarm cluster. Then, you are redirected to the details page of the SLB instance.
    4. On the Monitoring tab, you can view monitoring data and create alert rules.
  2. Check whether user traffic is forwarded to the applications that are deployed in the Swarm cluster.

    We recommend that you monitor the applications that are deployed in the Swarm cluster for a period of time and make sure that no user traffic is received before you delete the Swarm cluster. The Swarm cluster may receive network traffic due to client updates or Domain Name Service (DNS) caching. In this case, if you delete the Swarm cluster, your business may be interrupted.

Delete a Swarm cluster

After you make sure that the related Kubernetes cluster is handling external requests as expected and no user traffic is received by the Swarm cluster, you can delete the Swarm cluster. Perform the following steps to delete the Swarm cluster:

  1. Back up the configurations of the Swarm cluster.
    To ensure that you can restore the Swarm cluster in case an unknown error occurs in the Kubernetes cluster, we recommend that you back up at least the following configuration items of the Swarm cluster:
    • Node labels, network settings, volume settings, ConfigMap settings, and SLB configurations.
    • Orchestration templates and log files of the applications that are deployed in the Swarm cluster.
  2. Release resources that are used by the Swarm cluster.
    Notice When you delete a Swarm cluster, all resources that are used by the cluster are automatically released or deleted, such as Elastic Compute Service (ECS) instances, SLB instances, applications, and Services. Exercise caution when you delete the Swarm cluster.
    1. Log on to the Container Service for Kubernetes (ACK) console.
    2. In the left-side navigation pane, choose Clusters.
    3. Choose More > Delete in the Actions column of the Swarm cluster that you want to delete. For more information, see Delete an ACK cluster.
  3. Release disks.

    A disk can be attached only to one ECS instance. If you want to migrate the data stored in a data disk to the Kubernetes cluster, you can stop the ECS instance that uses the disk and then migrate the ECS instance to the Kubernetes cluster. For more information, see Migrate cluster configurations.

    If you want to migrate a data disk to the Kubernetes cluster without the data stored in the disk, you can create a new disk for the Kubernetes cluster. After the Swarm cluster is deleted, the disk that is mounted to the Swarm cluster is not automatically released. The disk changes to the Unattached state.
    Note To avoid data loss, we recommend that you back up the data stored in a disk before you release the disk.

    To release a disk that is mounted to a Swarm cluster, perform the following operations in the ECS console:

    1. Log on to the ECS console.
    2. In the left-side navigation pane, choose Storage & Snapshots > Disks.
    3. Choose More > Release in the Actions column of the disk that you want to release.