Install and upgrade FlexVolume
When you create a Container Service for Kubernetes (ACK) cluster that runs a Kubernetes version earlier than 1.16 and select FlexVolume as the volume plug-in, the console automatically installs FlexVolume and the Disk Controller. However, alicloud-nas-controller is not installed by default.
Prerequisites
-
An ACK cluster is created. For more information, see Create an ACK managed cluster.
-
The volume plug-in for your ACK cluster is FlexVolume.
-
You are connected to your Kubernetes cluster by using kubectl. For more information, see Obtain the kubeconfig file and use kubectl to connect to the cluster.
Usage notes
If alicloud-nas-controller is deployed in your cluster, you must upgrade its image to v1.14.8.17-7b898e5-aliyun or later before you upgrade the cluster to Kubernetes 1.20.
If you use a community solution, such as nfs-provisioner, instead of the alicloud-nas-controller provided by Alibaba Cloud, you must find an appropriate upgrade plan from the community to prevent issues related to selfLink.
Limitations
CentOS 7 and Alibaba Cloud Linux 2 are supported.
Install components
Install FlexVolume
-
For ACK clusters that run Kubernetes 1.16 or later, FlexVolume is no longer supported. You must use CSI-Plugin. For more information, see Storage.
-
For ACK clusters that run a Kubernetes version earlier than 1.16, the console automatically installs FlexVolume when you select FlexVolume as the volume plug-in during cluster creation. For more information, see Component configurations.
Install the Disk Controller
-
For ACK clusters that run Kubernetes 1.16 or later, the Disk Controller is no longer supported. You must use CSI-Provisioner. For more information, see Storage.
-
For ACK clusters that run a Kubernetes version earlier than 1.16, the console automatically installs the Disk Controller when you select FlexVolume as the volume plug-in during cluster creation. For more information, see Component configurations.
Install alicloud-nas-controller
If FlexVolume is selected as the volume plug-in for your cluster, you can manually deploy alicloud-nas-controller to create dynamic NAS volumes.
Use the following YAML to install the component.
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
Verify that FlexVolume, the Disk Controller, and alicloud-nas-controller are deployed.
-
Run the following command to verify that FlexVolume is deployed:
kubectl get pod -nkube-system | grep flexvolume -
Run the following command to verify that the Disk Controller is deployed:
kubectl get pod -nkube-system | grep alicloud-disk-controller -
Run the following command to verify that alicloud-nas-controller is deployed:
kubectl get pod -nkube-system | grep alicloud-nas-controller
Upgrade components
You can upgrade FlexVolume and the Disk Controller in the ACK console. You cannot upgrade alicloud-nas-controller in the console.
If you upgrade an ACK cluster from a version earlier than Kubernetes 1.16 to Kubernetes 1.16 or later, the upgraded cluster continues to support the FlexVolume volume plug-in. You can upgrade FlexVolume in the ACK console.
-
Log on to the ACK console. In the left navigation pane, click Clusters.
-
On the Clusters page, click the name of your cluster. In the left navigation pane, click Components and Add-ons .
-
Click the Volumes tab. In the flexvolume or alicloud-disk-controller section, click Upgrade.
-
In the dialog box that appears, confirm the version information and click OK.
After the component is upgraded, a success message appears and displays the current version.
-
For FlexVolume upgrades, contact us to request manual upgrade assistance if:
-
The online upgrade fails.
-
The FlexVolume version is v1.12 or earlier, and you use disks or OSS volumes.
-
Your cluster hosts sensitive services, uses a large number of volumes, and requires a guaranteed successful upgrade.
-
-
If the Disk Controller upgrade fails, contact us for manual upgrade assistance.
Contact us
For manual upgrade assistance, search for the DingTalk group ID 35532895 in DingTalk and join the group.