Kubernetes:Cinder卷不工作

时间:2017-05-02 12:45:49

标签: kubernetes openstack openstack-cinder

我试图使用Cinder PD(https://github.com/kubernetes/kubernetes/tree/master/examples/mysql-cinder-pd)启动示例mysql pod。

我创建了音量:

$ cinder show fa4d4dee-9f44-4191-ab88-8ef8d1d6b2dc
+------------------------------+--------------------------------------+
|           Property           |                Value                 |
+------------------------------+--------------------------------------+
|         attachments          |                  []                  |
|      availability_zone       |                 nova                 |
|           bootable           |                false                 |
|     consistencygroup_id      |                 None                 |
|          created_at          |      2017-05-02T08:12:32.000000      |
|         description          |                 None                 |
|          encrypted           |                False                 |
|              id              | fa4d4dee-9f44-4191-ab88-8ef8d1d6b2dc |
|           metadata           |                  {}                  |
|         multiattach          |                False                 |
|             name             |             k8s-test-pd              |
| os-vol-tenant-attr:tenant_id |   4a7d3b5645254117af1d36c4eb5201a5   |
|      replication_status      |               disabled               |
|             size             |                  2                   |
|         snapshot_id          |                 None                 |
|         source_volid         |                 None                 |
|            status            |              available               |
|          updated_at          |      2017-05-02T08:12:33.000000      |
|           user_id            |   11c0fd1d2a3a475aaeb31f1f637c2f91   |
|         volume_type          |                 None                 |
+------------------------------+--------------------------------------+

并修改了样本yaml中的volumeID。

Pod未启动且describe pod操作返回

Events:
FirstSeen   LastSeen    Count   From                SubObjectPath   Type        Reason      Message
  --------- --------    -----   ----                -------------   --------    ------      -------
  13m       13m     1   {default-scheduler }                Normal      Scheduled   Successfully assigned mysql to mm-kube-slave-1
  11m       16s     6   {kubelet mm-kube-slave-1}           Warning     FailedMount Unable to mount volumes for pod "mysql_default(9ca3450e-2f32-11e7-b455-fa163ed6d9bd)": timeout expired waiting for volumes to attach/mount for pod "default"/"mysql". list of unattached/unmounted volumes=[mysql-persistent-storage]
  11m       16s     6   {kubelet mm-kube-slave-1}           Warning     FailedSync  Error syncing pod, skipping: timeout expired waiting for volumes to attach/mount for pod "default"/"mysql". list of unattached/unmounted volumes=[mysql-persistent-storage]

我唯一的minion(安排pod)的syslog说:

May  2 12:37:29 mm-kube-slave-1 kubelet[1979]: I0502 12:37:29.573805    1979 reconciler.go:231] VerifyControllerAttachedVolume operation started for volume "kubernetes.io/cinder/fa4d4dee-9f44-4191-ab88-8ef8d1d6b2dc" (spec.Name: "mysql-persistent-storage") pod "9ca3450e-2f32-11e7-b455-fa163ed6d9bd" (UID: "9ca3450e-2f32-11e7-b455-fa163ed6d9bd")
May  2 12:37:29 mm-kube-slave-1 kubelet[1979]: E0502 12:37:29.577353    1979 nestedpendingoperations.go:262] Operation for "\"kubernetes.io/cinder/fa4d4dee-9f44-4191-ab88-8ef8d1d6b2dc\"" failed. No retries permitted until 2017-05-02 12:39:29.577306663 +0000 UTC (durationBeforeRetry 2m0s). Error: Volume "kubernetes.io/cinder/fa4d4dee-9f44-4191-ab88-8ef8d1d6b2dc" (spec.Name: "mysql-persistent-storage") pod "9ca3450e-2f32-11e7-b455-fa163ed6d9bd" (UID: "9ca3450e-2f32-11e7-b455-fa163ed6d9bd") is not yet attached according to node status
May  2 12:37:42 mm-kube-slave-1 kubelet[1979]: E0502 12:37:42.602080    1979 kubelet.go:1549] Unable to mount volumes for pod "mysql_default(9ca3450e-2f32-11e7-b455-fa163ed6d9bd)": timeout expired waiting for volumes to attach/mount for pod "default"/"mysql". list of unattached/unmounted volumes=[mysql-persistent-storage]; skipping pod
May  2 12:37:42 mm-kube-slave-1 kubelet[1979]: E0502 12:37:42.602697    1979 pod_workers.go:182] Error syncing pod 9ca3450e-2f32-11e7-b455-fa163ed6d9bd ("mysql_default(9ca3450e-2f32-11e7-b455-fa163ed6d9bd)"), skipping: timeout expired waiting for volumes to attach/mount for pod "default"/"mysql". list of unattached/unmounted volumes=[mysql-persistent-storage]

任何提示有什么问题?我使用kubeadm和Openstack提供程序设置了k8s 1.6.2(正确的openstack配置和传递给kubelet的--cloud-provider参数。带Docker的{Ubuntu Xenial 17.04.0-ce

1 个答案:

答案 0 :(得分:0)

这可能是附加/分离控制器中的错误。你能用这些信息在kube repo中打开一个问题吗?