This topic introduces notes and steps for mounting buckets via FSX.
Permissions required to mount a bucket
If you are an Identity and Access Management (IAM) user, you must have the necessary permissions to mount a bucket and perform relevant operations. Otherwise, the mount or operation will fail. Specifically:
- Mounting a bucket requires ListBucket and HeadBucket permissions.
- Reading objects within the mounted bucket requires GetObject permission.
- Writing objects to the mounted bucket requires PutObject and AbortMultipartUpload permissions.
- Deleting objects from the mounted bucket requires DeleteObject permission.
Buckets with server-side encryption (SSE-KMS) require additional Key Management Service (KMS) permissions for reading and writing objects. To upload objects with SSE-KMS, you need the kms:GenerateDataKey permission. To download SSE-KMS-encrypted objects, you need the kms:Decrypt permission. For more information, see Server-side encryption overview. The example below illustrates a minimal set of permissions in an IAM policy.
You can add more actions to the policy statement to grant the IAM user additional permissions as needed. For actions supported by IAM policies, see IAM policy overview. Permissions to access the mounted bucket
By default, the UID and GID of the FSX process own all the objects and directories in the mounted bucket. These objects have 644 permissions and these directories have 755 permissions. You can modify these attributes using the chown and chmod commands. You can also override the default values by specifying the uid, gid, file_mode, and dir_mode parameters when mounting the bucket.
These parameters are explained below.
Example:
Set the file_mode and dir_mode parameters to 777 (chmod 777). This gives all users access to the objects and directories within the mounted bucket.
A key-based mount uses the long-term access key ID and secret access key to mount a bucket on Linux via FSX. A key-based mount does not rely on a specific cloud infrastructure and can mount buckets on various Linux systems. For more information, see Operating environment. - Type this command into your Linux terminal to create a mount point.
- Run this command to mount the bucket or a specific directory within it.
Mount a bucket
Mount a specific directory within the bucket
Run this command to mount the bucket.
Example:
Run this command to mount a specific directory within the bucket.
Example:
- The parameters are described below:
tip
The following section introduces the basic parameters for mounting buckets with FSX. You can also configure prefetch and read cache parameters when mounting a bucket. For more information, see Mount parameters. - Run this command to verify that the mount was successful.
- If successful, the command returns output containing the mount point and bucket name.
A passwordless mount uses temporary security credentials provided by Security Token Service (STS), instead of long-term access key credentials, to verify identity when mounting buckets via FSX. Exposing long-term access key credentials puts their security at risk. This method does not need these credentials.
Mounting buckets to Elastic Compute Service (ECS) instances
- Type this command into your Linux terminal to create a mount point.
- Run this command to mount the bucket or a specific directory within it.
Mount a bucket
Mount a specific directory within the bucket
Run this command to mount the bucket.
Example:
Run this command to mount the bucket.
Example:
- The parameters are described below:
tip
The following section introduces the basic parameters for mounting buckets with FSX. You can also configure prefetch and read cache parameters when mounting a bucket. For more information, see Mount parameters. - Run this command to verify that the mount was successful.
- If successful, the command returns output containing the mount point and bucket name.
Mounting buckets to Volcengine Kubernetes Engine (VKE) pods
warning
- Authentication with IAM roles for service accounts (IRSA) can be enabled only after the cluster is created. To use the IRSA authentication capability of the csi-fsx add-on, do not install the add-on when creating the cluster.
- Once IRSA authentication has been enabled for the csi-fsx add-on, it is not possible to directly switch to a different authentication method. To use a different method, uninstall the add-on and reinstall it.
- IRSA authentication cannot be used when IRSA OIDC is not enabled.
- The IAM role must fall within the OIDC identity provider type and have a trust relationship bound to the service account of the add-on.
- Once the csi-fsx add-on is installed, the authentication method cannot be changed. However, you can change the IAM role. This change only applies to new PersistentVolumes (PVs) and does not affect existing PVs. Additionally, note that changing IAM roles will trigger a brief restart of the add-on. We recommend performing this operation during off-peak hours.
- Enable IRSA for the cluster and create an IAM role that trusts the OIDC identity provider. For instructions, see Using IRSA in clusters.
- After establishing a trust relationship and installing the csi-fsx add-on, configure access key authentication for PVs in the cluster. Alternatively, you can use IRSA authentication to mount buckets to VKE pods without access keys.
- After creating a PV, add the corresponding volume when creating a workload and mount the bucket in the pod to use the PV.
By default, log files are stored in the /var/log/fsx directory.
- To view FSX client logs, navigate to /var/log/fsx/fusedaemon/tos/fusedaemon.
- To view TOS server interaction logs, navigate to /var/log/fsx/fusedaemon/tos/tos-fuse.
For deeper diagnostics and troubleshooting, you may need to set the log level to debug. Use the following commands to do so:
- Set the log level of FSX client logs to debug.
- Set the log level of TOS server interaction logs to debug.
Run the umount <mount directory> command to unmount a mount point in Linux.
If you encounter any issues while using FSX, we recommend first running the /opt/fsx/tools/sysinfo_collector.sh script. This script automatically collects system information, mount point details, system logs, and other relevant data. Then, it generates a compressed file named system_info_****_****.tar.gz in the script's directory. Submit this file via a ticket, and our team will help resolve the issue.