This topic describes how to mount Object Storage Service (OSS) buckets as volumes in Container Service for Kubernetes (ACK) clusters.

ACK clusters support only statically provisioned OSS volumes but do not support dynamically provisioned OSS volumes. You can mount an OSS bucket by using a persistent volume (PV) and a persistent volume claim (PVC).

Prerequisites

An OSS bucket is created in the OSS console. For more information, see Create buckets.

Usage notes

The following section describes how to configure a statically provisioned OSS volume:

  • An OSS bucket can be shared by multiple pods.
  • bucket: You can mount only buckets to clusters. The subdirectories or files in a bucket cannot be mounted to an ACK cluster.
  • url: the endpoint of an OSS bucket. If the bucket and the node to which the bucket is mounted are deployed in the same region, you can use the internal endpoint of the OSS bucket.
  • akId: your AccessKey ID.
  • akSecret: your AccessKey secret.
  • otherOpts: the custom parameters that are used to mount the OSS bucket. The parameters must be in the following format: -o *** -o ***.
  • To mount an OSS bucket, do not specify subpath.
  • We recommend that you create a PV for each application.
  • Only the CentOS and Alibaba Cloud Linux operating systems are supported.

Precautions

  • OSS is a Filesystem in Userspace (FUSE) file system that can be mounted by using OSSFS. This method is suitable for read operations. For example, you can use this method to read configuration files, video files, and images.
  • OSSFS is not suitable for write operations. If you require write operations, we recommend that you use Apsara File Storage NAS (NAS) file systems.
  • You can modify parameter configurations to optimize OSSFS performance in caching and permission management. For more information, see FAQ about OSSFS, ossfs/README-CN.md, and FAQ.