The storage-operator component is used to manage the lifecycle of 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. This topic describes how to configure storage components and deploy storage-operator in a Container Service for Kubernetes (ACK) cluster.
Introduction
storage-operator runs as a Deployment, which deploys and updates storage components based on the default configurations inherited from the image and the custom configurations provided by a ConfigMap.
The storage-operator component can be used only in ACK clusters.
Default configurations: storage-operator provides the default configurations of storage components. The default configurations vary based on the version of storage-operator.
Custom configurations: ConfigMaps can be used to define custom configurations of storage components, such as version information and whether to install the component.
storage-operator preferably uses custom configurations. The default configurations are used only when the custom configurations are not specified.
Each image of storage-operator contains the default configuration file.
When storage-operator runs as a Deployment, the Deployment reads configurations from a ConfigMap that is mounted on the Deployment and that contains configurations of storage components.
storage-operator determines whether to deploy and update a storage component by combining the default and custom configurations.
Step 1: Configure the components
Method 1: Use the default configurations provided by the image
ACK supports the following storage components: storage-snapshot-manager, storage-analyzer, storage-auto-expander, and storage-monitor.
storage-operator provides the default configurations of storage components. The default configurations vary based on the version of storage-operator. In this example, v1.18.8.0 is used.
{
"storage-snapshot-manager": {
"install": "true",
"imageTag": "v1.18.8.0-81508da-aliyun",
"imageRep": "acs/storage-snapshot-manager",
"template": "/acs/templates/storage-snapshot-manager/install.yaml"
},
"storage-analzyer": {
"install": "false",
"imageTag": "v1.18.8.0-06c5560-aliyun",
"imageRep": "acs/storage-analyzer",
"template": "/acs/templates/storage-analyzer/install.yaml"
},
"storage-auto-expander": {
"install": "false",
"imageTag": "v1.18.8.0-4852fd4-aliyun",
"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",
"imageTag": "v1.18.8.0-c4744b6-aliyun",
"imageRep": "acs/storage-monitor",
"template": "/acs/templates/storage-monitor/install.yaml",
"svcTmpl": "/acs/templates/storage-monitor/service.yaml"
}
}
The following table describes the parameters in the default configurations.
Parameter | Description |
install | Specifies whether to deploy the component. Default value: |
imageTag | The default image version if the component is deployed. |
imageRep | The default image name if the component is deployed. |
crdTmpl | The template path of the Custom Resource Definition (CRD) that you want to deploy. If this parameter is empty, no CRD is deployed. |
svcTmpl | The template path of the Service that you want to deploy. |
template | The template path of the component that you want to deploy. |
You can use a ConfigMap to modify the parameters.
Method 2: Use a ConfigMap to customize the configurations
In this example, the following ConfigMap template is provided:
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"}'
Take note of the following items when you use custom configurations:
The parameter values that are specified in the custom configurations overwrite the parameter values in the default configurations.
The configurations of each component consist of two parts:
Deployment configurations, which are defined in the parameter description table in the preceding step. The parameters specify whether to install the component and the component version that is deployed. storage-operator deploys and updates components based on these configurations.
Other configurations are set by environment variables. In the preceding example,
SNAPSHOT_INTERVAL
is configured as an environment variable for the storage-snapshot-manager component.
The parameters used in deployment configurations are reserved parameters and cannot be used as environment variables.
You can customize specific parameters based on the features of a component.
Step 2: Deploy the storage-operator component
Install storage-operator from the Add-ons page: For more information, see Manage components.
Run the following command to check whether storage-operator is running:
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