[solved] iSCSI into Container fails


#1

Hello, just trying to get iSCSI into a container.

$ kubectl describe pod iscsi-web 
Name:         iscsi-web
Namespace:    default
Node:         k2/192.168.253.52
Start Time:   Fri, 22 Jun 2018 09:26:14 +0200
Labels:       <none>
Annotations:  <none>
Status:       Pending
IP:           
Containers:
  web:
    Container ID:   
    Image:          nginx
    Image ID:       
    Port:           <none>
    Host Port:      <none>
    State:          Waiting
      Reason:       ContainerCreating
    Ready:          False
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /usr/share/nginx/html from www (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-tccr2 (ro)
Conditions:
  Type           Status
  Initialized    True 
  Ready          False 
  PodScheduled   True 
Volumes:
  www:
    Type:               ISCSI (an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod)
    TargetPortal:       172.9.10.254:3260
    IQN:                iqn.2004-04.com.qnap:ts-212:iscsi.mbr.d55afc
    Lun:                0
    ISCSIInterface      default
    FSType:             ext4
    ReadOnly:           false
    Portals:            []
    DiscoveryCHAPAuth:  false
    SessionCHAPAuth:    false
    SecretRef:          <nil>
    InitiatorName:      <none>
  default-token-tccr2:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-tccr2
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason                  Age               From                     Message
  ----     ------                  ----              ----                     -------
  Normal   Scheduled               2m                default-scheduler        Successfully assigned iscsi-web to k2
  Normal   SuccessfulAttachVolume  2m                attachdetach-controller  AttachVolume.Attach succeeded for volume "www"
  Normal   SuccessfulMountVolume   2m                kubelet, k2              MountVolume.SetUp succeeded for volume "default-token-tccr2"
  Warning  FailedMount             32s               kubelet, k2              Unable to mount volumes for pod "iscsi-web_default(8bb6a069-75ed-11e8-9e95-000c2965b974)": timeout expired waiting for volumes to attach or mount for pod "default"/"iscsi-web". list of unmounted volumes=[www]. list of unattached volumes=[www default-token-tccr2]
  Warning  FailedMount             1s (x7 over 32s)  kubelet, k2              MountVolume.WaitForAttach failed for volume "www" : executable file not found in $PATH

What does that mean? Seems like attaching the iSCSI works, but not the mount into the container? config:

cat iscsi.yml 
apiVersion: v1
kind: Pod
metadata:
  name: iscsi-web
spec:
  volumes:
  - name: www
    iscsi:
      targetPortal: "172.9.10.254:3260"
      iqn: "iqn.2004-04.com.qnap:ts-212:iscsi.mbr.d55afc"
      lun: 0
      fsType: ext4
      readOnly: false
  containers:
  - name: web
    image: nginx
    volumeMounts:
    - mountPath: "/usr/share/nginx/html"
      name: www

#2

problem solved. Only one of my three nodes had the open-iscsi-package installed. The container started on the other one …