Install and upgrade FlexVolume

更新时间:
复制 MD 格式

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

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.

Note

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.

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of your cluster. In the left navigation pane, click Components and Add-ons.

  3. Click the Volumes tab. In the flexvolume or alicloud-disk-controller section, click Upgrade.

  4. 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.