If you specify FlexVolume as the volume plug-in for a Container Service for Kubernetes (ACK) cluster that runs Kubernetes earlier than 1.16, the system automatically installs FlexVolume and Disk Controller in the cluster. However, the system does not automatically install alicloud-nas-controller. This topic describes how to install and upgrade FlexVolume, and how to install alicloud-nas-controller.
Prerequisites
- An ACK cluster is created. For more information, see Create a managed Kubernetes cluster.
- FlexVolume is specified as the volume plug-in of the ACK cluster.
- A kubectl client is connected to the cluster. For more information, see Step 2: Select a type of cluster credentials.
Precautions
Limits
Only the CentOS 7 and Alibaba Cloud Linux 2 operating systems are supported.
Install the components
Install FlexVolume
- Clusters that run Kubernetes 1.16 and later do not support FlexVolume. You must install CSI-Plugin in these clusters. For more information, see Differences between the CSI and FlexVolume plug-ins.
- If you specify FlexVolume as the volume plug-in for an ACK cluster that runs Kubernetes earlier than 1.16, the system automatically installs FlexVolume in the cluster. For more information, see Component configurations.
Install Disk Controller
- Clusters of ACK 1.16 and later do not support Disk Controller. You must install CSI-Provisioner in these clusters. For more information, see Differences between the CSI and FlexVolume plug-ins.
- If you specify FlexVolume as the volume plug-in for an ACK cluster that runs Kubernetes earlier than 1.16, the system automatically installs Disk Controller in the cluster. For more information, see Component configurations.
Install alicloud-nas-controller
If FlexVolume is installed in your cluster, you can manually install alicloud-nas-controller, and then dynamically provision volumes that use Apsara File Storage NAS (NAS) file systems.
kind: Deployment
apiVersion: apps/v1
metadata:
name: alicloud-nas-controller
namespace: kube-system
spec:
selector:
matchLabels:
app: alicloud-nas-controller
strategy:
type: Recreate
template:
metadata:
labels:
app: alicloud-nas-controller
spec:
tolerations:
- operator: Exists
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
priorityClassName: system-node-critical
serviceAccount: admin
hostNetwork: true
containers:
- name: nfs-provisioner
image: registry.cn-hangzhou.aliyuncs.com/acs/alicloud-nas-controller:v1.14.8.17-7b898e5-aliyun
env:
- name: PROVISIONER_NAME
value: alicloud/nas
securityContext:
privileged: true
volumeMounts:
- mountPath: /var/log
name: log
volumes:
- hostPath:
path: /var/log
name: log
Verify the installation
Check whether FlexVolume, Disk Controller, and alicloud-nas-controller are installed in the cluster.
- Run the following command to check whether FlexVolume is installed in the cluster:
kubectl get pod -nkube-system | grep flexvolume
- Run the following command to check whether Disk Controller is installed in the cluster:
kubectl get pod -nkube-system | grep alicloud-disk-controller
- Run the following command to check whether alicloud-nas-controller is installed in
the cluster:
kubectl get pod -nkube-system | grep alicloud-nas-controller
Upgrade the components
You can upgrade FlexVolume and Disk Controller in the ACK console. You cannot upgrade alicloud-nas-controller in the ACK console.
If the Kubernetes version of your ACK cluster is upgraded to 1.16 or later, the cluster still supports FlexVolume. You can upgrade FlexVolume in the ACK console.
- When you upgrade FlexVolume in the following scenarios, Submit a ticket to request technical support.
- The system fails to update FlexVolume in the ACK console.
- The version of FlexVolume is 1.12 or earlier, and volumes that use disks and Object Storage Service (OSS) buckets are provisioned in the cluster.
- You want to ensure a successful upgrade because sensitive business data is stored in the cluster and a large number of volumes are used.
- The system fails to upgrade Disk Controller. In this case, Submit a ticket to request technical support.