sanmuyan 你好,这是由于你阿里云的ack集群没有安装diskcsi这个插件导致的,我刚刚解决了这个问题。
你只需要在ack集群里面部署这个c’si插件即可解决,下面的yaml清单。
官方的文档地址在这里:https://github.com/kubernetes-sigs/alibaba-cloud-csi-driver/blob/master/docs/disk.md
apiVersion: storage.k8s.io/v1
kind: CSIDriver
metadata:
name: diskplugin.csi.alibabacloud.com
spec:
attachRequired: false
---
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: csi-plugin
namespace: kube-system
spec:
selector:
matchLabels:
app: csi-plugin
template:
metadata:
labels:
app: csi-plugin
spec:
tolerations:
- operator: "Exists"
priorityClassName: system-node-critical
serviceAccount: admin
hostNetwork: true
hostPID: true
containers:
- name: disk-driver-registrar
image: registry.cn-hangzhou.aliyuncs.com/acs/csi-node-driver-registrar:v1.1.0
imagePullPolicy: Always
args:
- "--v=5"
- "--csi-address=/var/lib/kubelet/plugins/diskplugin.csi.alibabacloud.com/csi.sock"
- "--kubelet-registration-path=/var/lib/kubelet/plugins/diskplugin.csi.alibabacloud.com/csi.sock"
volumeMounts:
- name: kubelet-dir
mountPath: /var/lib/kubelet/
- name: registration-dir
mountPath: /registration
- name: csi-diskplugin
securityContext:
privileged: true
capabilities:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
image: registry.cn-hangzhou.aliyuncs.com/acs/csi-plugin:v1.14.5.47-5577bcb-aliyun
imagePullPolicy: "Always"
args:
- "--endpoint=$(CSI_ENDPOINT)"
- "--v=5"
- "--driver=diskplugin.csi.alibabacloud.com"
env:
- name: CSI_ENDPOINT
value: unix://var/lib/kubelet/plugins/diskplugin.csi.alibabacloud.com/csi.sock
- name: ACCESS_KEY_ID
value: "你的KEY"
- name: ACCESS_KEY_SECRET
value: "你的SECRET"
- name: MAX_VOLUMES_PERNODE
value: "15"
- name: DISK_TAGED_BY_PLUGIN
value: "true"
volumeMounts:
- name: kubelet-dir
mountPath: /var/lib/kubelet
mountPropagation: "Bidirectional"
- name: container-dir
mountPath: /var/lib/container
mountPropagation: "Bidirectional"
- mountPath: /dev
mountPropagation: "HostToContainer"
name: host-dev
- mountPath: /var/log/
name: host-log
- name: etc
mountPath: /host/etc
volumes:
- name: registration-dir
hostPath:
path: /var/lib/kubelet/plugins_registry
type: DirectoryOrCreate
- name: container-dir
hostPath:
path: /var/lib/container
type: DirectoryOrCreate
- name: kubelet-dir
hostPath:
path: /var/lib/kubelet
type: Directory
- name: host-dev
hostPath:
path: /dev
- name: host-log
hostPath:
path: /var/log/
- name: etc
hostPath:
path: /etc
- name: ossconnectordir
hostPath:
path: /usr/
updateStrategy:
type: RollingUpdate