kubernetes 使用iscsi 存储

  sre

d8d5b82b6059252dbe3f496b239b033b5bb5b966.jpg

apiVersion: v1
kind: PersistentVolume
metadata:
  name: test
spec:
  capacity:
    storage: 200Gi
  accessModes:
    - ReadWriteOnce
  iscsi:
    targetPortal: 172.16.28.141:3260 #Target IP:Port
    iqn: iqn.2004-12.com.inspur:mcs.as5300g2.node1 # Target IQN
    lun: 0 # 对应到Target LUN号
    fsType: ext4
    readOnly: false
---
apiVersion: "v1"
kind: PersistentVolumeClaim
metadata:
  name: "test-pvc"
spec:
  accessModes:
    - "ReadWriteOnce" # iSCSI不支持ReadWriteMany
  resources:
    requests:
      storage: "200Gi"
  volumeName: "test"
  storageClassName: "" #由于设置了默认的sc,需要强制指定为空,才会使用test pv去创建pvc

LEAVE A COMMENT

Captcha Code