Install on Kubernetes

This documentation shows how to install Alluxio on Kubernetes via Operator, a Kubernetes extension for managing applications.

Prerequisites

  • Kubernetes

    • A Kubernetes cluster with version at least 1.19, with feature gates enabled

    • Ensure the cluster’s Kubernetes Network Policy allows for connectivity between applications (Alluxio clients) and the Alluxio Pods on the defined ports

    • The Kubernetes cluster has helm 3 with version at least 3.6.0 installed

    • Image registry for storing and managing container image

  • Hardware

    • Each node should have at least 8 CPUs and 32GB of memory

    • Each node should have at least 100GB of storage space

  • Permissions. Reference: Using RBAC Authorization

    • Permission to create CRD (Custom Resource Definition)

    • Permission to create ServiceAccount, ClusterRole, and ClusterRoleBinding for the operator pod

    • Permission to create namespace that the operator will be in

Preparation

Download the files for Alluxio operator and Alluxio cluster

Please visit the Alluxio download page and select Alluxio Enterprise AI to download. After the download is complete, extract the files using the following command:

After extraction, you will obtain the following files:

  • alluxio-operator-2.0.0-helmchart.tgz is the helm chart for deploying Alluxio operator

  • alluxio-operator-2.0.0-docker.tar is the docker image for all Alluxio operator components

  • alluxio-enterprise-AI-3.3-7.0.0-docker.tar is the docker image for Alluxio

Upload the images to an image registry

An image registry is a centralized location for storing and sharing your container images. It can be either public or private. Cloud provider may come with its container registry as a service. For example, Amazon Elastic Container Registry(ECR), Azure Container Registry (ACR), and Google Container Registry (GCR). You can even run your private registry on your local system or inside your organization.

This example shows how to upload the Alluxio operator images.

Extract the helm chart for operator

The extracted alluxio-operator directory contains the Helm chart files responsible for deploying the operator.

Deployment

Deploy Alluxio operator

Create the alluxio-operator/alluxio-operator.yaml file to specify the image and version used for deploying the operator. The following example shows how to specify the operator and csi images and versions:

Move to the alluxio-operator directory and execute the following command to deploy the operator:

Deploying alluxio operator requires pulling dependent images from the public image repository. If you fail to deploy alluxio-operator because the network environment cannot access the public image repository, please refer to Configuring alluxio-operator image.

Deploy Alluxio

Create the alluxio-operator/alluxio-cluster.yaml file to deploy the Alluxio cluster. The file below shows the minimal configuration.

The properties specified under the .spec.properties field will be appended to the alluxio-site.properties configuration file and the Alluxio processes will read that file. You can find your configurations in the Alluxio coordinator, worker pod by looking at /opt/alluxio/conf/alluxio-site.properties.

The operator has already set the recommended configuration by default, which can start an Alluxio cluster. If you need to modify the configuration, you can edit the .spec.properties field in the alluxio-cluster.yaml file.

  • If your training data is stored in S3, OSS, or other storage, and the training task can access the data via s3:// or oss://, you can accelerate training by mounting the under file system into Alluxio through creating UFS resources after starting the Alluxio cluster.

  • If your training task accesses the training data through PVC or NAS, you need to mount the training data's PVC or NAS to the Alluxio pods when creating the Alluxio cluster. Please refer to Mount storage to Alluxio for details on mounting PVC or NAS/hostPath, and modify the alluxio-operator/alluxio-cluster.yaml accordingly.

Move to the alluxio-operator directory and execute the following command to deploy the Alluxio cluster:

In Alluxio 3.x, the coordinator is a stateless control component that serves jobs like distributed load and acts as API gateway for the operator.

If some components in the cluster do not reach the Running state, you can use kubectl describe pod to view detailed information and identify the issue. For specific issues encountered during deployment, refer to the FAQ section.

Alluxio cluster also includes etcd and monitoring components. If the image cannot be pulled from the public image registry, causing etcd and monitoring to fail to start, please refer to Configuring Alluxio Cluster Image.

Mount storage to Alluxio

Alluxio supports integration with various underlying storage systems, including S3, HDFS, OSS, COS, and TOS. Please refer to the Storage Integration Overview.

With the operator, you can mount underlying storage by creating UnderFileSystem resources. An UnderFileSystem corresponds to a mount point for Alluxio. Regarding the Alluxio and the underlying storage namespace, please refer to Alluxio Namespace and Under File System Namespaces.

Below, we provide several examples of commonly used underlying storage mounts.

S3

Create the alluxio-operator/ufs.yaml file to specify the UFS configuration. The following example shows how to mount an S3 bucket to Alluxio:

Find more details about mounting S3 to Alluxio in Amazon AWS S3.

OSS

Create the alluxio-operator/ufs.yaml file to specify the UFS configuration. The following example shows how to mount an OSS bucket to Alluxio:

Find more details about mounting OSS to Alluxio in Aliyun Object Storage Service.

NAS

To ensure that the Alluxio pods have access to NAS storage, you need to first mount the NAS to a path on the node. Alluxio operator supports mounting node local paths to Alluxio pods. Before creating the Alluxio cluster, you need to add the mount paths in alluxio-operator/alluxio-cluster.yaml. When the Alluxio cluster is started, these paths will be mounted into the Alluxio components.

  • The key is the host path on the node, and the value is the mounted path in the container

  • If using a NAS as the UFS, the same path needs to be mounted to the coordinator, workers and FUSE processes so that the FUSE can fall back if any error occurs

Create the alluxio-operator/ufs.yaml file to specify the UFS configuration. The following example shows how to mount a NAS or host path to Alluxio:

PVC

Originally, the user's training task accessed data by mounting a PVC to a specific path inside the container. The path inside the training task's container was bound to the PVC, allowing the task to access data via this mounted path.

Now, we're improving this process using Alluxio. When deploying the Alluxio cluster, you need to mount the training data's PVC (which was previously used for storing training data) to a path inside the Alluxio component's container. Then, this path inside the Alluxio component's container should be mounted to the Alluxio cluster. In this way, the training data's PVC is successfully mounted to the Alluxio cluster, allowing the data to be accessed and processed through Alluxio's interface.

you need to add the mount path in alluxio-cluster.yaml before creating the Alluxio cluster, mounting the existing PVC for training data to a path in the Alluxio components:

  • The key is the PVC, and the value is the mounted path in the container

  • If using a PVC as the UFS, the same path needs to be mounted to the coordinator, workers and FUSE processes so that the FUSE can fallback if any error occurs

Create the alluxio-operator/ufs.yaml file to specify the UFS configuration. The following example shows how to mount a PVC to Alluxio:

Executing the mount

First, ensure that the Alluxio cluster is up and running with a Ready status. (Or if the status is WaitingForReady, can also mount UFS)

Execute the following command to create the UnderFileSystem resource and mount that to Alluxio namespace:

Monitoring

The Alluxio cluster enables monitoring by default. You can view various Alluxio metrics visually through Grafana. Please refer to the Monitoring and Metrics section on Kubernetes Operator.

Data Access Acceleration

In the steps above, you deployed the Alluxio cluster and mounted the under file system to Alluxio. Training tasks that read data through Alluxio can improve training speed and GPU utilization. Majorly, Alluxio provides three ways for applications to access data:

Common use cases

Change the resource limitations

For every component, like worker, coordinator, and FUSE, we can change the resource by the following configuration:

  • The container will never be able to access the resource over the limits, and the requests are used during scheduling. For more information, please refer to Resource Management for Pods and Containers

  • The limit of the memory should be a little bit over the sum of the heap size(-Xmx) and the direct memory size(-XX:MaxDirectMemorySize=10g) to avoid out-of-memory problems.

Use PVC for page store

  • The PVC will be created by the operator

  • The storageClass defaults to standard, but can be specified to empty string for static binding

Mount customized config maps

  • The key is the name of the ConfigMap, and the value if the mounted path in the container

  • The /opt/alluxio/conf is already mounted by default. The custom config maps need to mount to other paths

Use the root user

The FUSE pod will always use the root user. The other processes use the user with uid 1000 by default. In the container, the user is named alluxio. To change it to the root user, use this configuration:

  • Sometimes it’s enough to specify the .spec.fsGroup = 0 only when the files can be accessed by the root group

  • The ownership of the mounted host path, such as the page store path and log path, will be transferred to root if changing to the root user.

FAQ

ETCD pod stuck in pending status

For example, if three etcd pods remain in the Pending state, you can use kubectl describe pod to view detailed information:

Based on the error message, the etcd pods are stuck in the Pending state because no storage class is set. You can resolve this issue by specifying the storage class for etcd in the alluxio-operator/alluxio-cluster.yaml file:

First, delete the Alluxio cluster and the etcd PVC, then recreate the Alluxio cluster:

Another issue is the etcd PVC specifies a storage class, but both the etcd pod and PVC remain in a pending state. For example, as shown in the detailed information of the PVC below, the storage class specified for the etcd PVC does not support dynamic provisioning, and the storage volume needs to be manually created by the cluster administrator.

For similar issues where etcd pods remain in the Pending state, you can use the above method for troubleshooting.

alluxio-alluxio-csi-fuse-pvc in pending status

After creating the cluster, you might notice that alluxio-alluxio-csi-fuse-pvc is in the Pending status. This is normal. The PVC will automatically bind to a PV and its status will change to Bound when it is used by a client pod.

Unable to access public image registry

Configuring alluxio-operator image

Deploying the Alluxio operator requires pulling dependent images from an accessible image registry. If your network environment cannot access the public image registry, you will encounter a timeout error when pulling the images:

You may notice that the cluster controller, ufs controller and collectinfo controller have started successfully, but the csi controller and csi nodeplugin remain in the ContainerCreating state. This is due to a timeout while pulling the dependent images. By using kubectl describe pod to view detailed information, you will see error messages similar to the following:

You can download the dependent images locally, upload them to your private image registry, and then modify the image addresses in the alluxio-operator.yaml file before redeploying the operator.

Component
Image Name
Version
Purpose

operator CSI

registry.k8s.io/sig-storage/csi-node-driver-registrar

v2.0.0

csi driver registrar dependency

operator CSI

registry.k8s.io/sig-storage/csi-provisioner

v2.0.5

csi provisioner dependency

cluster ETCD

docker.io/bitnami/etcd

3.5.9-debian-11-r24

etcd dependency

cluster ETCD

docker.io/bitnami/os-shell

11-debian-11-r2

os-shell dependency

cluster monitor

grafana/grafana

10.4.5

Monitoring dashboard

cluster monitor

prom/prometheus

v2.52.0

Metrics collection

The commands to pull the Docker images and upload them to your private image registry are as follows:

Update the image addresses in the alluxio-operator/alluxio-operator.yaml file, adding the provisioner and driverRegistrar image addresses:

Move to the alluxio-operator directory and execute the following command to deploy the operator:

configuring Alluxio cluster image

Starting the Alluxio cluster also involves etcd and monitoring components. If you cannot access the public image registry, you need to replace the image addresses for etcd and monitoring components with those from your private image registry. Modify the image addresses in the alluxio-operator/alluxio-cluster.yaml file accordingly.

Last updated