[英]kubernetes create pod with iscsi volume
I'm new to K8s and now i'm stuck with create a pod with iscsi volume I'm using openfiler as iscsi target, provide a LUN to K8s host nodes. 我是K8s的新手,现在我坚持使用iscsi卷创建pod,我将openfiler用作iscsi目标,为K8s主机节点提供LUN。 I can see the disk through "multipath -l": 我可以通过“ multipath -l”看到磁盘:
mpatha (14f504e46494c455265305742724d2d7949544e2d736c4744) dm-3 OPNFILER,VIRTUAL-DISK
size=1.0G features='0' hwhandler='0' wp=rw
|-+- policy='service-time 0' prio=0 status=active
| `- 33:0:0:0 sdb 8:16 active undef unknown
`-+- policy='service-time 0' prio=0 status=enabled
`- 34:0:0:0 sdc 8:32 active undef unknown
or "cat /proc/scsi/scsi" 或“ cat / proc / scsi / scsi”
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: VMware Model: Virtual disk Rev: 2.0
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi3 Channel: 00 Id: 00 Lun: 00
Vendor: NECVMWar Model: VMware SATA CD00 Rev: 1.00
Type: CD-ROM ANSI SCSI revision: 05
Host: scsi33 Channel: 00 Id: 00 Lun: 00
Vendor: OPNFILER Model: VIRTUAL-DISK Rev: 0
Type: Direct-Access ANSI SCSI revision: 04
Host: scsi34 Channel: 00 Id: 00 Lun: 00
Vendor: OPNFILER Model: VIRTUAL-DISK Rev: 0
Type: Direct-Access ANSI SCSI revision: 04
My deployment yaml file: 我的部署yaml文件:
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql-test
labels:
tier: db
system: test
name: mysql
spec:
replicas: 1
template:
metadata:
name: mysql
labels:
name: mysql
tier: db
spec:
containers:
- name: mysql
image: linhnm/lab:linhnm-wp
volumeMounts:
- mountPath: /var/lib/mysql
name: pv-sql
volumes:
- name: pv-sql
iscsi:
targetPortal: 172.20.30.76:3260
iqn: iqn.2006-01.com.openfiler:tsn.11934dc96acf
lun: 0
fsType: ext4
readOnly: false
selector:
matchLabels:
tier: db
name: mysql
My K8s cluster cannot create a pod, and here's event in describe pod command: 我的K8s集群无法创建Pod,这是describe pod命令中的事件:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 3m default-scheduler Successfully assigned mysql-test-7f5d55b8d8-tdxkk to worker1
Normal SuccessfulAttachVolume 3m attachdetach-controller AttachVolume.Attach succeeded for volume "pv-sql"
Normal SuccessfulMountVolume 3m kubelet, worker1 MountVolume.SetUp succeeded for volume "default-token-wqhhj"
Warning FailedMount 1m kubelet, worker1 Unable to mount volumes for pod "mysql-test-7f5d55b8d8-tdxkk_default(bef99831-8cc9-11e8-a98d-00505695a133)": timeout expired waiting for volumes to attach or mount for pod "default"/"mysql-test-7f5d55b8d8-tdxkk". list of unmounted volumes=[pv-sql]. list of unattached volumes=[pv-sql default-token-wqhhj]
Warning FailedMount 43s (x8 over 2m) kubelet, worker1 MountVolume.WaitForAttach failed for volume "pv-sql" : failed to get any path for iscsi disk, last err seen:
Could not attach disk: Timeout after 10s
Can anyone show me what should I adjust my lab? 谁能告诉我该怎么调整我的实验室? Or what material I should read to go over this problem? 或者我应该读什么材料来解决这个问题? Thank you 谢谢
Finally, I think that i found what cause the problem. 最后,我认为我找到了导致问题的原因。 It might be my openfiler iscsi server. 可能是我的openfiler iscsi服务器。 After create another linux iscsi server with targetd and change my volume manifest to new ones properties, K8s cluster can create pod, then attach volume smoothly. 创建另一台具有目标的linux iscsi服务器并将我的卷清单更改为新的属性后,K8s集群可以创建pod,然后平滑地附加卷。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.