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
Request a trial version of Alluxio enterprise DA by contacting your Alluxio account representative at sales@alluxio.com
. Follow their instructions to download the files into the directory you prepared.
Obtain the following files:
alluxio-operator-2.0.0-helmchart.tgz
is the helm chart for deploying Alluxio operatoralluxio-operator-2.0.0-docker.tar
is the docker image for all Alluxio operator componentsalluxio-enterprise-DA-3.2-8.0.0-docker.tar
is the docker image for Alluxioalluxio-enterprise-DA-3.2-8.0.0-release.tar.gz
is a tarball containing jars to incorporate with specific compute integrations to enable them to connect to the Alluxio cluster This file will not be used within this document's instructions, but will be expected to be available when preparing the compute cluster.
Also obtain the license string referred to as <ALLUXIO_LICENSE_STRING>
in later sections.
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 providers generally provide container registries as a service, such as Amazon Elastic Container Registry(ECR), Azure Container Registry (ACR), and Google Container Registry (GCR). Private registries may also be provided from your local system or within private networks of 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:
Deploy Alluxio
Create the alluxio-operator/alluxio-cluster.yaml
file to deploy the Alluxio cluster. The file below shows the minimal configuration.
Please see Resource Prerequisites and Compatibility for resource planning recommendations.
The operator has set the recommended configuration for production deployment by default. If you need to modify the configuration, you can edit the .spec.properties
field in the alluxio-cluster.yaml
file. The section for common use cases describes some general scenarios to modify these properties.
The properties specified under the
.spec.properties
field will be appended to thealluxio-site.properties
configuration file and the Alluxio processes will read that file. You can find your configurations in the Alluxio coordinator or worker pods by looking at/opt/alluxio/conf/alluxio-site.properties
.
If your data is stored in a storage such as S3 and the compute task can access the data via
s3://
, you can accelerate the workload by mounting the under file system into Alluxio through creating UFS resources after starting the Alluxio cluster.
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 usekubectl 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 the section for unable to access public image registry.
Mount storage to Alluxio
Alluxio supports integration with various underlying storage systems, including S3 and HDFS. 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 an examples of using S3 as the underlying storage mount.
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.
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.
Common use cases
Change the resource limitations
For every component, like worker and coordinator, 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 over the sum of the heap size(
-Xmx
) and the direct memory size(-XX:MaxDirectMemorySize=10g
) to avoid out-of-memory problems.For demo purpose, recommend to set smaller resource limits, for example
Use PVC for page store
Page store here refer to the cache Alluxio uses.
The PVC will be created by the operator
The
storageClass
defaults tostandard
, but can be specified to empty string for static binding
Mount customized config maps
A custom config map can be used to provide configuration files on pods. Although it can be used for other purposes such as environment variables, the following example will focus on files.
Create a new config map from a local file:
Declare the config map with its mount point.
The key is the name of the
ConfigMap
, and the value if the mounted path in the containerThe
/opt/alluxio/conf
is already mounted by default. This means other files cannot be mounted directly within theconf/
directory. The custom config maps need to mount to other paths.Using the cache filter json file as an example, mount it to
/opt/alluxio/conf/cachefilter/cache_filter.json
and set this path as the value ofalluxio.user.client.cache.filter.config.file
for Alluxio to read it.
Add a file onto pods as a secret
This mechanism can be used to provide credentials files on pods.
Create a new secret from a local file:
Specify which secrets to load and the file path on the pods.
Use the root user
The 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 groupThe 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.
Use external ETCD
If you have an external ETCD cluster, you can specify the endpoints for Alluxio to use.
When Client-to-server transport security with HTTPS, certificates are used for SSL/TLS connections to ETCD. For this, have a signed key pair (server.crt
, pkcs8_key.pem
) ready.
Here it needs a PKCS8 key, you can use the following command to convert the key:
Create secrets in Kubernetes with the created server.crt
and pkcs8_key.pem
. For example,
Configure the etcd properties in the alluxio-cluster.yaml
file and specify the secrets for the coordinator and worker:
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.
Unable to access public image registry
Starting the Alluxio cluster also involves etcd and monitoring components. If you cannot access the public image registry, you need to provide the images for these components from your private image registry.
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 |
---|---|---|---|
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:
Modify the image addresses in the alluxio-operator/alluxio-cluster.yaml
file accordingly.
Last updated