To further enrich storage features, such as auto scaling of volumes, disk configuration modification, and storage resource monitoring, Container Service for Kubernetes (ACK) provides multiple storage components and uses the storage-operator component to manage the lifecycle of the storage components. You can modify the ConfigMap of the storage-operator component to deploy and update storage components. This reduces the complexity of container development and maintenance.
Prerequisites
An ACK managed cluster or an ACK dedicated cluster is created and the Kubernetes version of the cluster is 1.20 or later. The Container Storage Interface (CSI) plug-in is installed on the cluster. For more information, see Create an ACK managed cluster and Manually upgrade ACK clusters.
Overview
By default, the storage-operator component is installed on the cluster and is deployed as a Deployment. The storage-operator component allows you to deploy and update storage components based on the default configurations inherited from the image and the custom configurations provided by the ConfigMap.
Default configurations: storage-operator provides the default configurations of storage components. The default configurations vary based on the version of storage-operator.
Custom configurations: During runtime, storage-operator mounts and reads the ConfigMap that is used to store component configurations. You can use ConfigMaps to define version information and whether to install the component.
Integrated configurations: storage-operator integrates custom configurations and default configurations to determine whether to deploy and update components.
The storage-operator component preferably uses custom configurations. The default configurations are used only if custom configurations are not specified.
By default, storage-operator contains the following storage components:
storage-cnfs is responsible for the features provided by CNFS.
storage-controller is responsible for disk configuration modification and cross-zone migration.
storage-auto-expander is responsible for the auto scaling of volumes.
storage-monitor provides the observability capability for storage resource monitoring.
Configure the components
Default configurations provided by the image
Each version of storage-operator has a default component configuration. In this example, v1.31.1 is used.
{
"storage-auto-expander": {
"install": "true",
"type": "deployment",
"imageTag": "v1.31.1",
"imageRep": "acs/storage-auto-expander",
"crdTmpl": "/acs/templates/storage-auto-expander/crd.yaml",
"template": "/acs/templates/storage-auto-expander/install.yaml"
},
"storage-monitor": {
"install": "true",
"type": "deployment",
"imageTag": "v1.31.1",
"imageRep": "acs/storage-monitor",
"template": "/acs/templates/storage-monitor/install.yaml",
"svcTmpl": "/acs/templates/storage-monitor/service.yaml"
},
"storage-cnfs": {
"install": "true",
"type": "deployment",
"imageTag": "v1.24.39-0e24b92-aliyun",
"imageRep": "acs/storage-cnfs",
"crdTmpl": "/acs/templates/storage-cnfs/crd.yaml",
"template": "/acs/templates/storage-cnfs/install.yaml"
},
"storage-controller": {
"install": "true",
"type": "deployment",
"imageTag": "v1.31.1",
"imageRep": "acs/storage-controller",
"template": "/acs/templates/storage-controller/install.yaml"
}
}
The following table describes the parameters in the default configurations.
Parameter | Description |
| Specifies whether to deploy the component. Default value: |
| The default image version if the component is deployed. |
| The default image name if the component is deployed. |
| The template path of the Custom Resource Definition (CRD) that you want to deploy. If you leave this parameter empty, no CRD is deployed. |
| The template path of the Service that you want to deploy. |
| The template path of the component that you want to deploy. |
Use a ConfigMap to specify custom configurations
You can use ConfigMaps to modify the default configurations of storage-operator. The parameter values that are specified in the custom configurations overwrite the parameter values in the default configurations.
Deployment configurations, which are defined in the Default configurations provided by the image section in the preceding step. The parameters specify whether to install the component and the component version that is deployed. storage-operator deploys and updates storage components based on these configurations.
Other configurations are defined by environment variables. In this example,
SNAPSHOT_INTERVAL
is configured as an environment variable for the storage-snapshot-manager component.
kind: ConfigMap
apiVersion: v1
metadata:
name: storage-operator
namespace: kube-system
data:
storage-snapshot-manager: |
{
"install": "true",
"imageTag": "v1.16.aaaa",
"imageRep": "acs/storage-snapshot-manager",
"template": "/acs/templates/storage-snapshot-manager/install.yaml",
"SNAPSHOT_INTERVAL": "30"
}
storage-analyzer: '{"install": "false"}'
Manage the storage-operator component
Run the following command to verify that storage-operator is enabled.
kubectl get pods -n kube-system -lapp=storage-operator
Expected output:
NAME READY STATUS RESTARTS AGE storage-operator-57bdfd7f56-kl86k 1/1 Running 0 12m
Perform the following steps to update Terway. For more information about the introduction and release notes of storage-operator, see security-inspector.
Log on to the ACK console. In the left-side navigation pane, click Clusters.
On the Clusters page, find the cluster that you want to manage and click its name. In the left-side navigation pane, choose .
Find the storage-operator component and follow the on-screen instructions to install or update the component.