Deploy a 3FS cluster based on an ACK cluster

Updated at:

3FS is a high-performance distributed storage system independently developed by DeepSeek. It is designed and optimized for AI large model training, big data analytics, and high-performance computing (HPC) scenarios. 3FS integrates modern SSD storage with RDMA networking to overcome the performance bottlenecks of traditional networks. This topic describes how to deploy 3FS on Alibaba Cloud's self-developed elastic RDMA network by using Container Service for Kubernetes (ACK), a managed Kubernetes service, for rapid deployment.

Deployment solution

Deploy a 3FS cluster on elastic ephemeral disks over Alibaba Cloud eRDMA, using an ACK managed cluster for multi-node orchestration.

Important

Alibaba Cloud does not provide technical support for 3FS or guarantee its performance. For issues, contact us on GitHub or join DingTalk group 35532895.

  • eRDMA is an elastic Remote Direct Memory Access (RDMA) network developed by Alibaba Cloud for the cloud. eRDMA reuses virtual private clouds (VPCs) as the underlying link and uses a congestion control (CC) algorithm that is developed by Alibaba Cloud. eRDMA features high throughput and low latency based on RDMA supports. Compared with RDMA, eRDMA implements large-scale RDMA networking within seconds. eRDMA supports traditional HPC applications, AI applications, and Transmission Control Protocol/Internet Protocol (TCP/IP) applications.

    See eRDMA.

  • Elastic ephemeral disks provide high-performance, cost-effective temporary storage for ECS instances with custom capacities. See Elastic ephemeral disks.

  • Container Service for Kubernetes (ACK) provides fully managed, highly available Kubernetes clusters that simplify containerized application deployment and management.

    See What is ACK?

Key 3FS components

3FS consists of the following key components:

  • Metadata Service (Meta): A stateless service that handles file system metadata requests. It uses FoundationDB to perform atomic operations.

  • Storage Service (Storage): Runs on storage nodes. Data is stored in blocks on high-performance NVMe SSDs. It uses the Chain Replication with Apportioned Queries (CRAQ) protocol to manage replicas and provides write-all-read-any semantics.

  • Cluster manager (Mgmtd): Manages the cluster's configuration information and storage node status. It is responsible for electing a primary node and synchronizing updates to other components.

  • Client: 3FS provides two types of clients that balance compatibility and efficiency, making it an ideal storage interface for AI and big data workloads. One type uses Filesystem in Userspace (FUSE) for standardized access, and the other uses USRBIO for high-performance transport.

    • FUSE client: Mounts the storage cluster as a local directory through the user-space file system interface. It provides POSIX-compatible file operation interfaces such as read, write, and mkdir, without requiring application code modifications.

    • USRBIO high-performance client: Achieves microsecond-level latency and ultra-high throughput through a user-space I/O stack and RDMA, meeting the demands of AI and HPC.

All components communicate over an RDMA network, bypassing the kernel protocol stack to significantly reduce CPU load and network latency.

Prerequisites

Prepare an ECS instance with Internet access as the client for creating and managing the ACK cluster. If you already have an ECS instance with Alibaba Cloud CLI configured, skip to Set up an ACK managed cluster by using Alibaba Cloud CLI.

Important

All operations in this topic are performed on the client instance.

Prepare a client instance

Create an ECS instance as the client for deploying and managing the ACK cluster. See Create an instance with Custom Launch.

Example configurations:

  • Region and zone: Beijing Zone I

  • Instance type: ecs.g8i.large

  • Image: Alibaba Cloud Linux 3.2104 LTS 64-bit

  • Network: Public network enabled

Install and configure Alibaba Cloud CLI for the client instance

This topic uses Alibaba Cloud CLI to create an ACK managed cluster without a UI. See What is Alibaba Cloud CLI.

  1. Connect to the client instance and check whether Alibaba Cloud CLI is installed.

    Note

    Alibaba Cloud CLI is installed on ECS instances by default. To re-install it, see Step 1: Install Alibaba Cloud CLI.

    aliyun version

    The following output indicates that Alibaba Cloud CLI is installed.

    [root@ixxx Z ~]# aliyun version
    3.0.245
  2. Configure the AccessKey pair in interactive mode. Ensure Internet connectivity.

    Note
    • Before using Alibaba Cloud CLI, configure the credential information, region, and language. This example uses the China (Beijing) region. Alibaba Cloud CLI automatically generates the default configuration on first run.

    • This example uses the AccessKey pair credential type. For other credential types, see Credential types.

    aliyun configure --profile AkProfile

    Example interaction:

    [root@iz****** ~]# aliyun configure --profile AkProfile
    Configuring profile 'AkProfile' in 'AK' authenticate mode...
    Access Key Id []: xxx
    Access Key Secret []: xxx
    Default Region Id []: cn-beijing
    Default Output Format [json]: json (Only support json)
    Default Language [zh|en] en:
    Saving profile[AkProfile] ...Done.

See What is Alibaba Cloud CLI

Set up an ACK managed cluster by using Alibaba Cloud CLI

Set up an ACK managed cluster with Terway ENI passthrough, eRDMA-capable ECS instances, ESSDs, containerd runtime with image acceleration, and advanced security groups.

Important
  • This section uses the automatic VPC creation method, which simultaneously creates related resources including ECS instances, VPCs, vSwitches, security groups, CLB instances, public NAT gateways, and EIPs. You may be charged for these resources. See Billing of ACK managed and dedicated clusters.

  • This section provides example operations only. In production, plan the cluster scale, network requirements, VPC configurations (VPC and vSwitches), and cluster network configurations (CNI, container CIDR block, and service CIDR block) in advance. See ACK managed cluster network planning.

  • The following command uses a subset of parameters. See Create a cluster for all parameters.

  • To create an ACK cluster in an existing VPC, specify resources such as vSwitches and security groups.

  • Cluster initialization may take some time.

image
  1. Connect to the client instance and create the cluster.

    Command to create an ACK cluster with Alibaba Cloud CLI

    aliyun cs POST /clusters --header "Content-Type=application/json" --body '{
        "name": "3FS-example",
        "cluster_type": "ManagedKubernetes",
        "kubernetes_version": "1.34.1-aliyun.1",
        "region_id": "cn-beijing",
        "snat_entry": true,
        "proxy_mode": "ipvs",
        "addons": [
            {
                "name": "terway-controlplane"
            },
            {
                "name": "terway-eniip"
            },
            {
                "name": "csi-plugin"
            },
            {
                "name": "managed-csiprovisioner"
            },
            {
                "name": "nginx-ingress-controller",
                "disabled": true
            },
            {
                "name": "ack-erdma-controller",
                "config": "{\"agent\":{\"preferDriver\":\"compat\",\"allocateAllDevices\":true}}"
            }
        ],
        "cluster_spec": "ack.pro.small",
        "charge_type": "PostPaid",
        "zone_ids": [
            "cn-beijing-i"
        ],
        "service_cidr": "192.168.0.0/16",
        "ip_stack": "ipv4",
        "is_enterprise_security_group": true,
        "nodepools": [
            {
                "nodepool_info": {
                    "name": "default-nodepool"
                },
                "scaling_group": {
                    "system_disk_category": "cloud_essd",
                    "system_disk_size": 60,
                    "system_disk_performance_level": "PL0",
                    "system_disk_encrypted": false,
                    "instance_types": [
                        "ecs.g8ise.xlarge",
                        "ecs.g8i.xlarge"
                    ],
                    "instance_charge_type": "PostPaid",
                    "platform": "AliyunLinux",
                    "image_type": "AliyunLinux3",
                    "desired_size": 4
                },
                "kubernetes_config": {
                    "pre_user_data": "bWtkaXIgLXAgL2V0Yy9jb250YWluZXJkL2NlcnQuZC9kb2NrZXIuaW8vCmNhdCA+IC9ldGMvY29udGFpbmVyZC9jZXJ0LmQvZG9ja2VyLmlvL2hvc3RzLnRvbWwgPDxFT0YKc2VydmVyID0gImh0dHBzOi8vcmVnaXN0cnktMS5kb2NrZXIuaW8iCltob3N0LiJodHRwczovL21pcnJvcnMtc3NsLmFsaXl1bmNzLmNvbS8iXQogIGNhcGFiaWxpdGllcyA9IFsicHVsbCIsICJyZXNvbHZlIl0KICBza2lwX3ZlcmlmeSA9IHRydWUKRU9G",
                    "runtime": "containerd",
                    "runtime_version": "1.6.37"
                }
            }
        ]
    }'

    The following tables describe the parameters.

    • Basic cluster configuration

      Parameter

      Value

      Configuration description

      name

      3FS-example

      The cluster name. Must be unique.

      cluster_type

      ManagedKubernetes

      Managed Kubernetes cluster.

      kubernetes_version

      1.34.1-aliyun.1

      Alibaba Cloud customized Kubernetes version.

      region_id

      cn-beijing

      Select a region that supports elastic ephemeral disks. China (Beijing) recommended.

      charge_type

      PostPaid

      Pay-as-you-go billing.

    • Network configuration

      Parameter

      Function

      Configuration description

      service_cidr

      The service CIDR block.

      Also known as Service CIDR. This is the address pool that assigns IP addresses to services within the cluster. This CIDR block cannot overlap with the VPC's CIDR block, the CIDR blocks used by existing clusters in the VPC, or the Container CIDR Block.

      ip_stack

      The IP protocol stack.

      Set to ipv4.

      is_enterprise_security_group

      Whether to create an advanced security group.

      Set to true to auto-create an advanced security group with strict access rules. See Basic and advanced security groups.

      snat_entry

      Whether the cluster VPC has Internet access.

      Set to true to create a NAT gateway and auto-configure SNAT rules for Internet access.

    • Node pool configuration (nodepools)

      • Scaling group configuration (scaling_group)

        Parameter

        Description and value

        Configuration description

        system_disk_category

        The category of the system disk (cloud_essd)

        ESSDs use 25 Gigabit Ethernet and RDMA, delivering up to 1,000,000 random IOPS per disk. See ESSDs.

        system_disk_size

        The system disk size (60 GB)

        Recommended: 40 GB or larger.

        system_disk_performance_level

        The ESSD performance level (PL0)

        Basic performance level with moderate I/O and stable latency.

        instance_types

        The instance type list

        Select instance types that support eRDMA and elastic ephemeral disks. Recommended:

        g8ise, storage-enhanced general-purpose instance family.

        platform

        The operating system (AliyunLinux)

        None.

        image_type

        The image type (AliyunLinux3)

        None.

      • Kubernetes runtime: Configure the containerd image accelerator to point to Alibaba Cloud Container Registry.

        The BASE64-encoded script in the pre_user_data configuration:

        echo "bWtkaXIgLXAgL2V0Yy9jb250YWluZXJkL2NlcnQuZC9kb2NrZXIuaW8vCmNhdCA+IC9ldGMvY29udGFpbmVyZC9jZXJ0LmQvZG9ja2VyLmlvL2hvc3RzLnRvbWwgPDxFT0YKc2VydmVyID0gImh0dHBzOi8vcmVnaXN0cnktMS5kb2NrZXIuaW8iCltob3N0LiJodHRwczovL21pcnJvcnMtc3NsLmFsaXl1bmNzLmNvbS8iXQogIGNhcGFiaWxpdGllcyA9IFsicHVsbCIsICJyZXNvbHZlIl0KICBza2lwX3ZlcmlmeSA9IHRydWUKRU9GCg==" | base64 -d
        
        mkdir -p /etc/containerd/cert.d/docker.io/
        cat > /etc/containerd/cert.d/docker.io/hosts.toml <<EOF
        server = "https://registry-1.docker.io"
        [host."https://mirrors-ssl.aliyuncs.com/"]
          capabilities = ["pull", "resolve"]
          skip_verify = true
        EOF
    • Add-on configuration (addons)

      Add-on name

      Feature

      Configuration description

      terway-controlplane

      The network plug-in control plane

      ACK supports two container network plug-ins: Terway and Flannel. This example uses Terway with Trunk ENI support.

      See Terway vs. Flannel CNI plugins.

      terway-eniip

      Support for Trunk ENI, pod-level vSwitches and security group configuration, and static IP addresses

      csi-plugin

      Volume plug-in

      The csi-plugin and csi-provisioner components dynamically create, mount, and unmount volumes. See Manage CSI components.

      managed-csiprovisioner

      Container Storage Interface (CSI) driver controller

      nginx-ingress-controller

      Ingress controller

      See Nginx Ingress controller.

      ack-erdma-controller

      Kubernetes controller for Alibaba Cloud eRDMA, providing eRDMA Interface (ERI) management, scheduling, and pod network capabilities

      • preferDriver: Use the compat driver type for RoCE driver compatibility.

      • allocateAllDevices: Allocate all eRDMA devices on nodes to pods.

      See Accelerate container networks with eRDMA.

    The command returns the cluster ID.

    {
      "cluster_id": "cb12xxxd0c",
      "instanceId": "cb1xxxd0c",
      "request_id": "6B0xxx815C7A",
      "task_id": "T-680d"
    }
  2. View cluster information.

    aliyun cs GET /clusters/cluster_id

    Replace cluster_id with the cluster ID obtained in the previous step.

    [root@iZ xxx xZ ~]# aliyun cs GET /clusters/cb1xxx d0c
    {
            "cluster_id": "cb12d4cxxx d0c",
            "cluster_spec": "ack.pro.small",
            "cluster_type": "ManagedKubernetes",
            "created": "2xxx-xxx-xxx-xxx00",
            "current_version": "1.32.1-aliyun.1",
            "deletion_protection": false,
            "disable_encryption": true,
            "external_loadbalancer_id": "lb-2zxxx xxx x5",
            "init_version": "1.32.1-aliyun.1",
            "ip_stack": "ipv4",
            "maintenance_info": {
                    "cluster_upgrade_info": {
                            "nodepools": null
                    },
                    "is_active": false
            },
            "maintenance_window": {
                    "enable": false,
                    "weekly_period": ""
            },
            "master_url": "{\"api_server_endpoint\":\"\"xxx\"intranet_api_server_endpoint\":\"https://10.59.196.223:6443\"}"

    You can also view the cluster in the ACK console.

    The cluster list shows the created cluster 3FS-example, cluster type ACK managed cluster, cluster specification Pro, status running, 4 nodes, Kubernetes version 1.32.1-aliyun.1.

  3. Install kubectl and connect to the cluster. See Connect to an ACK cluster using kubectl.

    Important
    • This example connects to the ACK cluster over the internal network. Ensure the client instance and the ACK cluster reside in the same VPC.

    • If they are in different VPCs, change the VPC of the client instance. See Change the VPC for an ECS instance.

    View all namespaces:

    kubectl get namespace
    [root@iz xxx ~]# kubectl get namespace
    NAME                  STATUS   AGE
    ack-csi-fuse          Active   46m
    ack-erdma-controller  Active   44m
    default               Active   47m
    kube-node-lease       Active   47m
    kube-public           Active   47m
    kube-system           Active   47m

  4. Install Helm V3.

    Helm manages Kubernetes application packaging and versioning. This example uses Helm to deploy the 3FS cluster. See Simplify application deployment with Helm.

    wget https://get.helm.sh/helm-v3.3.0-linux-amd64.tar.gz
    tar -xzvf helm-v3.3.0-linux-amd64.tar.gz
    mv linux-amd64/helm /usr/local/bin/helm
    helm version

    The following output indicates that Helm V3 is installed.

    [root@xxx ~]# helm version
    version.BuildInfo{Version:"v3.3.0"

Deploy a 3FS cluster on an ACK cluster

Alibaba Cloud has made lightweight technical adaptations to the open-source 3FS file system, packaging it as standardized container images and providing out-of-the-box Helm Charts for automated deployment in Kubernetes environments. The related customized code, deployment manifests, and continuous integration configurations have been fully open-sourced and hosted on GitHub, supporting developers to complete deployment with a single command.

This example deploys a 3FS cluster with two meta nodes, two mgmtd nodes, one FUSE client, and three storage nodes on ACK using Helm.

image
  1. Connect to the client instance, obtain the code repository, and switch to the deployment directory.

    git clone https://github.com/AliyunContainerService/alibabacloud-3FS.git
    cd alibabacloud-3FS/deploy/container
  2. Deploy FoundationDB Operator (FDB Operator).

    3FS uses FoundationDB (FDB) as its storage engine. Deploy FDB Operator before 3FS.

    kubectl create ns fdb
    kubectl apply -n fdb -f ./fdb-operator
    [root@ixxxx              container]# kubectl apply -n fdb -f ./fdb-operator
    customresourcedefinition.apiextensions.k8s.io/foundationdbbackups.apps.foundationdb.org created
    customresourcedefinition.apiextensions.k8s.io/foundationdbclusters.apps.foundationdb.org created
    customresourcedefinition.apiextensions.k8s.io/foundationdbrestores.apps.foundationdb.org created
    serviceaccount/fdb-kubernetes-operator-controller-manager created
    clusterrole.rbac.authorization.k8s.io/fdb-kubernetes-manager-clusterrole created
    clusterrole.rbac.authorization.k8s.io/fdb-kubernetes-operator-manager-role created
    rolebinding.rbac.authorization.k8s.io/fdb-kubernetes-operator-manager-rolebinding created
    clusterrolebinding.rbac.authorization.k8s.io/fdb-kubernetes-operator-manager-clusterrolebinding created
    deployment.apps/fdb-kubernetes-operator-controller-manager created
  3. Deploy 3FS and its required FDB cluster by using the Helm chart provided in the code repository.

    helm install 3fs ./chart -n 3fs --create-namespace --timeout 10m
    Note
    • During deployment, elastic ephemeral disks are automatically created and attached to the ECS instances hosting storage nodes.

    • Deployment may take several minutes. Containers may crash and restart during initialization, which is expected.

    After deployment completes:

    [root@i-xxx            container]# helm install 3fs ./chart -n 3fs --create-namespace --timeout 10m
    NAME: 3fs
    LAST DEPLOYED: Thu Apr 24 19:22:02 2025
    NAMESPACE: 3fs
    STATUS: deployed
    REVISION: 1
    TEST SUITE: None

    The 3FS distributed file system is now deployed on ACK with eRDMA for inter-node communication.

  4. View all pods in the 3fs namespace:

    kubectl get pods -o wide -n 3fs
    [root@i                ~]# kubectl get pods -o wide -n 3fs
    NAME                                    READY   STATUS    RESTARTS       AGE   IP            NODE                       NOMINATED NODE   READINESS GATES
    admin-cli-3fs                           1/1     Running   4 (11m ago)    23h   10.7.185.73   cn-beijing.10.7.185.56     <none>           <none>
    fdb-meta-3fs-cluster-controller-39839   2/2     Running   0              23h   10.7.185.78   cn-beijing.10.7.185.57     <none>           <none>
    fdb-meta-3fs-log-56992                  2/2     Running   0              23h   10.7.185.87   cn-beijing.10.7.185.56     <none>           <none>
    fdb-meta-3fs-log-71409                  2/2     Running   0              23h   10.7.185.80   cn-beijing.10.7.185.57     <none>           <none>
    fdb-meta-3fs-log-74648                  2/2     Running   0              23h   10.7.185.89   cn-beijing.10.7.185.57     <none>           <none>
    fdb-meta-3fs-log-79318                  2/2     Running   0              23h   10.7.185.84   cn-beijing.10.7.185.55     <none>           <none>
    fdb-meta-3fs-storage-13747              2/2     Running   0              23h   10.7.185.83   cn-beijing.10.7.185.56     <none>           <none>
    fdb-meta-3fs-storage-24732              2/2     Running   0              23h   10.7.185.88   cn-beijing.10.7.185.58     <none>           <none>
    fdb-meta-3fs-storage-35553              2/2     Running   0              23h   10.7.185.77   cn-beijing.10.7.185.55     <none>           <none>
    fuse-3fs                                1/1     Running   4 (23h ago)    23h   10.7.185.74   cn-beijing.10.7.185.58     <none>           <none>
    meta-3fs-100                            1/1     Running   4 (23h ago)    23h   10.7.185.72   cn-beijing.10.7.185.57     <none>           <none>
    meta-3fs-101                            1/1     Running   4 (23h ago)    23h   10.7.185.82   cn-beijing.10.7.185.58     <none>           <none>
    mgmtd-3fs-1                            1/1     Running   4 (23h ago)    23h   10.7.185.75   cn-beijing.10.7.185.56     <none>           <none>
    mgmtd-3fs-2                            1/1     Running   4 (23h ago)    23h   10.7.185.79   cn-beijing.10.7.185.57     <none>           <none>
    storage-3fs-10000                       1/1     Running   3 (23h ago)    23h   10.7.185.85   cn-beijing.10.7.185.55     <none>           <none>
    storage-3fs-10001                       1/1     Running   4 (23h ago)    23h   10.7.185.81   cn-beijing.10.7.185.58     <none>           <none>
    storage-3fs-10002                       1/1     Running   4 (23h ago)    23h   10.7.185.86   cn-beijing.10.7.185.57     <none>           <none>
  5. Log on to the 3FS cluster management console:

    kubectl attach -n 3fs admin-cli-3fs -it

    Press Ctrl+D to display the prompt, then enter list-nodes to view the node information of the 3FS cluster. Press Ctrl+D to exit.

    [root@iz xxx container]# kubectl attach -n 3fs admin-cli-3fs -it
    If you don't see a command prompt, try pressing enter.
    / > list-nodes
    bash: line 1: /usr/sbin/ibdev2netdev: No such file or directory
    [2025-04-24T11:26:23.323018337+00:00 admin_cli:    1 IBDevice.cc:165 ERROR] Failed to run ibdev2netdev, ret code 127
    [2025-04-24T11:26:23.323066545+00:00 admin_cli:    1 IBDevice.cc:215 WARNING] Failed to load ibdev2netdev, maybe running in container.
    [2025-04-24T11:26:23.324204434+00:00 admin_cli:    1 IBDevice.cc:380 WARNING] IBDevice erdma_0:1's netdev is unknown, maybe running in container.
    [2025-04-24T11:26:23.324213256+00:00 admin_cli:    1 IBDevice.cc:441 CRITICAL] IBDevice erdma_0:1 can't set zone by IP, fallback to UNKNOWN
    Id      Type      Status                Hostname          Pid  Tags  LastHeartbeatTime      ConfigVersion  ReleaseVersion
    1       MGMTD     PRIMARY_MGMTD         mgmtd-3fs-1       1    []    N/A                    0(UPTODATE)    250228-dev-1-999999-f5fd8c05
    2       MGMTD     HEARTBEAT_CONNECTED   mgmtd-3fs-2       1    []    2025-04-24 11:26:16    0(UPTODATE)    250228-dev-1-999999-f5fd8c05
    100     META      HEARTBEAT_CONNECTED   meta-3fs-100       1    []    2025-04-24 11:26:20    0(UPTODATE)    250228-dev-1-999999-f5fd8c05
    101     META      HEARTBEAT_CONNECTED   meta-3fs-101       1    []    2025-04-24 11:26:13    0(UPTODATE)    250228-dev-1-999999-f5fd8c05
    10000   STORAGE   HEARTBEAT_CONNECTED   storage-3fs-10000  1    []    2025-04-24 11:26:21    0(UPTODATE)    250228-dev-1-999999-f5fd8c05
    10001   STORAGE   HEARTBEAT_CONNECTED   storage-3fs-10001  1    []    2025-04-24 11:26:22    0(UPTODATE)    250228-dev-1-999999-f5fd8c05
    10002   STORAGE   HEARTBEAT_CONNECTED   storage-3fs-10002  1    []    2025-04-24 11:26:22    0(UPTODATE)    250228-dev-1-999999-f5fd8c05
  6. Check the FUSE client:

    kubectl exec -n 3fs fuse-3fs -it -- ls /mnt/3fs
    [root@xxx container]# kubectl exec -n 3fs fuse-3fs -it -- ls /mnt/3fs
    3fs-virt
    • 3fs-virt is a special folder for the 3FS FUSE client.

    • The /mnt/3fs directory is also mounted on the ECS instances. You can run tools such as fio on the instances to test performance.