我安装了掌舵图表稳定版/ mssql-linux,“ pod具有未绑定的PersistentVolumeClaims”

时间:2019-03-06 00:18:42

标签: kubernetes kubernetes-helm docker-for-windows

我使用了默认安装(用于Windows的docker上的kubernetes):

helm install --name mymssql stable / mssql-linux --set acceptEula.value = Y --set edition.value = Developer

我可以看到持久卷存在 I can see that persistent volume exists

但是 enter image description here


编辑:

kubectl描述pvc

Name:          mymssql-mssql-linux-backup
Namespace:     default
StorageClass:  hostpath
Status:        Bound
Volume:        pvc-0a556593-3fa4-11e9-a695-00155dd56102
Labels:        app=mymssql-mssql-linux
               chart=mssql-linux-0.7.0
               heritage=Tiller
               release=mymssql
Annotations:   control-plane.alpha.kubernetes.io/leader={"holderIdentity":"b34171f9-3f99-11e9-b4b6-f496341cc924","leaseDurationSeconds":15,"acquireTime":"2019-03-06T00:08:59Z","renewTime":"2019-03-06T00:09:01Z","lea...
               pv.kubernetes.io/bind-completed=yes
               pv.kubernetes.io/bound-by-controller=yes
               volume.beta.kubernetes.io/storage-provisioner=docker.io/hostpath
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      1Gi
Access Modes:  RWO
Events:
  Type    Reason                 Age                From                                                                     Message
  ----    ------                 ----               ----                                                                     -------
  Normal  ExternalProvisioning   24m (x3 over 24m)  persistentvolume-controller                                              waiting for a volume to be created, either by external provisioner "docker.io/hostpath" or manually created by system administrator
  Normal  Provisioning           24m                docker.io/hostpath DESKTOP-BH16SJ1 b34171f9-3f99-11e9-b4b6-f496341cc924  External provisioner is provisioning volume for claim "default/mymssql-mssql-linux-backup"
  Normal  ProvisioningSucceeded  24m                docker.io/hostpath DESKTOP-BH16SJ1 b34171f9-3f99-11e9-b4b6-f496341cc924  Successfully provisioned volume pvc-0a556593-3fa4-11e9-a695-00155dd56102


Name:          mymssql-mssql-linux-data
Namespace:     default
StorageClass:  hostpath
Status:        Bound
Volume:        pvc-0a56634b-3fa4-11e9-a695-00155dd56102
Labels:        app=mymssql-mssql-linux
               chart=mssql-linux-0.7.0
               heritage=Tiller
               release=mymssql
Annotations:   control-plane.alpha.kubernetes.io/leader={"holderIdentity":"b34171f9-3f99-11e9-b4b6-f496341cc924","leaseDurationSeconds":15,"acquireTime":"2019-03-06T00:08:59Z","renewTime":"2019-03-06T00:09:02Z","lea...
               pv.kubernetes.io/bind-completed=yes
               pv.kubernetes.io/bound-by-controller=yes
               volume.beta.kubernetes.io/storage-provisioner=docker.io/hostpath
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      1Gi
Access Modes:  RWO
Events:
  Type    Reason                 Age                From                                                                     Message
  ----    ------                 ----               ----                                                                     -------
  Normal  ExternalProvisioning   24m (x3 over 24m)  persistentvolume-controller                                              waiting for a volume to be created, either by external provisioner "docker.io/hostpath" or manually created by system administrator
  Normal  Provisioning           24m                docker.io/hostpath DESKTOP-BH16SJ1 b34171f9-3f99-11e9-b4b6-f496341cc924  External provisioner is provisioning volume for claim "default/mymssql-mssql-linux-data"
  Normal  ProvisioningSucceeded  24m                docker.io/hostpath DESKTOP-BH16SJ1 b34171f9-3f99-11e9-b4b6-f496341cc924  Successfully provisioned volume pvc-0a56634b-3fa4-11e9-a695-00155dd56102


Name:          mymssql-mssql-linux-master
Namespace:     default
StorageClass:  hostpath
Status:        Bound
Volume:        pvc-0a574f80-3fa4-11e9-a695-00155dd56102
Labels:        app=mymssql-mssql-linux
               chart=mssql-linux-0.7.0
               heritage=Tiller
               release=mymssql
Annotations:   control-plane.alpha.kubernetes.io/leader={"holderIdentity":"b34171f9-3f99-11e9-b4b6-f496341cc924","leaseDurationSeconds":15,"acquireTime":"2019-03-06T00:08:59Z","renewTime":"2019-03-06T00:09:02Z","lea...
               pv.kubernetes.io/bind-completed=yes
               pv.kubernetes.io/bound-by-controller=yes
               volume.beta.kubernetes.io/storage-provisioner=docker.io/hostpath
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      1Gi
Access Modes:  RWO
Events:
  Type    Reason                 Age                From                                                                     Message
  ----    ------                 ----               ----                                                                     -------
  Normal  ExternalProvisioning   24m (x4 over 24m)  persistentvolume-controller                                              waiting for a volume to be created, either by external provisioner "docker.io/hostpath" or manually created by system administrator
  Normal  Provisioning           24m                docker.io/hostpath DESKTOP-BH16SJ1 b34171f9-3f99-11e9-b4b6-f496341cc924  External provisioner is provisioning volume for claim "default/mymssql-mssql-linux-master"
  Normal  ProvisioningSucceeded  24m                docker.io/hostpath DESKTOP-BH16SJ1 b34171f9-3f99-11e9-b4b6-f496341cc924  Successfully provisioned volume pvc-0a574f80-3fa4-11e9-a695-00155dd56102


Name:          mymssql-mssql-linux-translog
Namespace:     default
StorageClass:  hostpath
Status:        Bound
Volume:        pvc-0a587716-3fa4-11e9-a695-00155dd56102
Labels:        app=mymssql-mssql-linux
               chart=mssql-linux-0.7.0
               heritage=Tiller
               release=mymssql
Annotations:   control-plane.alpha.kubernetes.io/leader={"holderIdentity":"b34171f9-3f99-11e9-b4b6-f496341cc924","leaseDurationSeconds":15,"acquireTime":"2019-03-06T00:08:59Z","renewTime":"2019-03-06T00:09:02Z","lea...
               pv.kubernetes.io/bind-completed=yes
               pv.kubernetes.io/bound-by-controller=yes
               volume.beta.kubernetes.io/storage-provisioner=docker.io/hostpath
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      1Gi
Access Modes:  RWO
Events:
  Type    Reason                 Age                From                                                                     Message
  ----    ------                 ----               ----                                                                     -------
  Normal  ExternalProvisioning   24m (x4 over 24m)  persistentvolume-controller                                              waiting for a volume to be created, either by external provisioner "docker.io/hostpath" or manually created by system administrator
  Normal  Provisioning           24m                docker.io/hostpath DESKTOP-BH16SJ1 b34171f9-3f99-11e9-b4b6-f496341cc924  External provisioner is provisioning volume for claim "default/mymssql-mssql-linux-translog"
  Normal  ProvisioningSucceeded  24m                docker.io/hostpath DESKTOP-BH16SJ1 b34171f9-3f99-11e9-b4b6-f496341cc924  Successfully provisioned volume pvc-0a587716-3fa4-11e9-a695-00155dd56102

kubectl描述pv:

Name:            pvc-0a556593-3fa4-11e9-a695-00155dd56102
Labels:          <none>
Annotations:     pv.kubernetes.io/provisioned-by=docker.io/hostpath
Finalizers:      [kubernetes.io/pv-protection]
StorageClass:    hostpath
Status:          Bound
Claim:           default/mymssql-mssql-linux-backup
Reclaim Policy:  Delete
Access Modes:    RWO
Capacity:        1Gi
Node Affinity:   <none>
Message:
Source:
    Type:          HostPath (bare host directory volume)
    Path:          /host_mnt/c/Users/User/.docker/Volumes/mymssql-mssql-linux-backup/pvc-0a556593-3fa4-11e9-a695-00155dd56102
    HostPathType:
Events:            <none>


Name:            pvc-0a56634b-3fa4-11e9-a695-00155dd56102
Labels:          <none>
Annotations:     pv.kubernetes.io/provisioned-by=docker.io/hostpath
Finalizers:      [kubernetes.io/pv-protection]
StorageClass:    hostpath
Status:          Bound
Claim:           default/mymssql-mssql-linux-data
Reclaim Policy:  Delete
Access Modes:    RWO
Capacity:        1Gi
Node Affinity:   <none>
Message:
Source:
    Type:          HostPath (bare host directory volume)
    Path:          /host_mnt/c/Users/User/.docker/Volumes/mymssql-mssql-linux-data/pvc-0a56634b-3fa4-11e9-a695-00155dd56102
    HostPathType:
Events:            <none>


Name:            pvc-0a574f80-3fa4-11e9-a695-00155dd56102
Labels:          <none>
Annotations:     pv.kubernetes.io/provisioned-by=docker.io/hostpath
Finalizers:      [kubernetes.io/pv-protection]
StorageClass:    hostpath
Status:          Bound
Claim:           default/mymssql-mssql-linux-master
Reclaim Policy:  Delete
Access Modes:    RWO
Capacity:        1Gi
Node Affinity:   <none>
Message:
Source:
    Type:          HostPath (bare host directory volume)
    Path:          /host_mnt/c/Users/User/.docker/Volumes/mymssql-mssql-linux-master/pvc-0a574f80-3fa4-11e9-a695-00155dd56102
    HostPathType:
Events:            <none>


Name:            pvc-0a587716-3fa4-11e9-a695-00155dd56102
Labels:          <none>
Annotations:     pv.kubernetes.io/provisioned-by=docker.io/hostpath
Finalizers:      [kubernetes.io/pv-protection]
StorageClass:    hostpath
Status:          Bound
Claim:           default/mymssql-mssql-linux-translog
Reclaim Policy:  Delete
Access Modes:    RWO
Capacity:        1Gi
Node Affinity:   <none>
Message:
Source:
    Type:          HostPath (bare host directory volume)
    Path:          /host_mnt/c/Users/User/.docker/Volumes/mymssql-mssql-linux-translog/pvc-0a587716-3fa4-11e9-a695-00155dd56102
    HostPathType:
Events:            <none>

kubectl描述存储类

Name:                  hostpath
IsDefaultClass:        Yes
Annotations:           storageclass.kubernetes.io/is-default-class=true
Provisioner:           docker.io/hostpath
Parameters:            <none>
AllowVolumeExpansion:  <unset>
MountOptions:          <none>
ReclaimPolicy:         Delete
VolumeBindingMode:     Immediate
Events:                <none>

2 个答案:

答案 0 :(得分:1)

我试图在Windows版Docker的Kubernetes上完成这项工作,但无法完成。 Windows中的卷似乎有些问题。我尝试过修改路径,但没有实际效果。一段时间后,我注意到卷的大小存在问题,因此我下载了图表并在PV的基础上添加了1 Gi,但随后出现了有关路径断开的错误。无论如何仍然不走运。 由于我不是Windows方面的专家,因此似乎是Windows或应用程序问题。我只能建议使用其他方式运行图表(我在ubuntu上的Minikube,GKE和通过kubadm连接的计算引擎上进行了测试,该图表在没有任何其他配置的情况下就像一个超级按钮一样工作。)

如果您想继续尝试运行kubectl logs pod_name并按照那里描述的问题进行操作。

答案 1 :(得分:0)

我遇到了同样的问题,并在一篇文章中提到该问题是由于Windows目录在Docker容器内作为通用Internet文件系统(CIFS)挂载而引起的。 Linux上的SQL Server尚未正式将CIFS作为文件系统支持。

https://support.microsoft.com/en-us/help/4212960/fix-sql-server-2017-won-t-start-with-linux-container-image-on-docker

我通过使用针对Linux的较新版本的sql server来解决了该问题

helm install mymssql stable/mssql-linux --set acceptEula.value=Y --set edition.value=Developer --set service.type=LoadBalancer --set image.repository=mcr.microsoft.com/mssql/server --set image.tag=2019-latest