edit-icon download-icon

Install the plug-in

Last Updated: Feb 08, 2018

Deploy the Alibaba Cloud Kubernetes storage plug-in by using the following yaml configurations.

Note: If your Kubernetes cluster is created before Feb 6th, 2018, install the Alibaba Cloud Kubernetes storage plug-in before using the data volumes. If your Kubernetes cluster is created after Feb 6th, 2018, you can directly use the data volumes without installing the Alibaba Cloud Kubernetes storage plug-in.

Limits

Currently CentOS 7 operating system is supported.

Instructions

  • The AccessKey ID and AccessKey Secret of the secret are encrypted by base64.
  • You must configure the secret if you use the Object Storage Service (OSS) data volumes. You can select to not configure the secret if you only use the NAS and cloud disks.
  • Disable the --enable-controller-attach-detach option by using kubelet if you use the flexvolume. By default, Alibaba Cloud Kubernetes clusters have disabled this option.
  • Deploy flexvolume in the kube-system user space.

Installation example

Assume that the AccessKey ID and AccessKey Secret are 12234567 and abcdefgh respectively.

The encryption example for the AccessKey in the command is as follows:

$ echo -n “12234567” | base64

$ echo -n “abcdefgh” | base64

  1. apiVersion: v1
  2. kind: Secret
  3. metadata:
  4. name: flexvolumesecret
  5. namespace: kube-system
  6. type: Opaque
  7. data:
  8. akId: ***
  9. akSecret: ***
  10. ---
  11. apiVersion: apps/v1beta2 # for versions before 1.8.0 use extensions/v1beta1
  12. kind: DaemonSet
  13. metadata:
  14. name: flexvolume
  15. namespace: kube-system
  16. labels:
  17. k8s-volume: flexvolume
  18. spec:
  19. selector:
  20. matchLabels:
  21. name: acs-flexvolume
  22. template:
  23. metadata:
  24. labels:
  25. name: acs-flexvolume
  26. spec:
  27. hostPID: true
  28. hostNetwork: true
  29. tolerations:
  30. - key: node-role.kubernetes.io/master
  31. operator: Exists
  32. effect: NoSchedule
  33. containers:
  34. - name: acs-flexvolume
  35. image: registry.cn-hangzhou.aliyuncs.com/acs/flexvolume:1.0.0
  36. imagePullPolicy: Always
  37. securityContext:
  38. privileged: true
  39. env:
  40. - name: ACS_DISK
  41. value: "true"
  42. - name: ACS_NAS
  43. value: "true"
  44. - name: ACS_OSS
  45. value: "true"
  46. resources:
  47. limits:
  48. memory: 200Mi
  49. requests:
  50. cpu: 100m
  51. memory: 200Mi
  52. volumeMounts:
  53. - name: usrdir
  54. mountPath: /host/usr/
  55. - name: etcdir
  56. mountPath: /host/etc/
  57. - name: logdir
  58. mountPath: /var/log/alicloud/
  59. - name: secrets
  60. mountPath: "/etc/.volumeak"
  61. readOnly: true
  62. volumes:
  63. - name: usrdir
  64. hostPath:
  65. path: /usr/
  66. - name: etcdir
  67. hostPath:
  68. path: /etc/
  69. - name: logdir
  70. hostPath:
  71. path: /var/log/alicloud/
  72. - name: secrets
  73. secret:
  74. secretName: flexvolumesecret
Thank you! We've received your feedback.