【问题标题】:installing helm chart stable/mssql-linux I got "pod has unbound PersistentVolumeClaims"安装 helm chart stable/mssql-linux 我得到“pod has unbound PersistentVolumeClaims”
【发布时间】:2019-03-06 00:18:42
【问题描述】:

我用的是默认安装(windows上的kubernetes on docker):

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

我可以看到持久卷存在

但是


编辑:

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>

【问题讨论】:

  • 你能给出 Kubectl describe pvc , kubectl describe pv kubectl describe storgeclass 的输出吗?
  • 嗨@karthik,我添加了这个。谢谢
  • 嗨,我有类似的问题,我正在努力解决。请提供kubectl describe pod sql_podname的结果

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


【解决方案1】:

我尝试在 Docker for Windows 上的 Kubernetes 上完成这项工作,但我无法完成它。似乎 Windows 中的卷存在一些问题。我试过修补路径,但没有真正的效果。一段时间后,我注意到卷的大小存在问题,因此我下载了图表并将 1 Gi 添加到 PV,但随后我收到有关损坏路径的错误。反正还是倒霉。 因为我不是 Windows 专家,这似乎是 Windows 或应用程序问题。我只能建议使用其他方式运行图表(我在 ubuntu 上的 Minikube、GKE 和由 kubadm 连接的计算引擎上对其进行了测试,图表就像一个魅力一样工作,无需任何额外配置)。

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

【讨论】:

  • 不幸的是,我遇到了同样的情况,并且似乎没有我正在映像的日志,因为它还没有成功启动。
  • 你可以试试 GKE 或 minikube,在那里运行没有问题。就我而言,我能够从 pod 访问日志。您可以尝试在新主题中更广泛地描述您的问题,我们可以尝试进行故障排除。
【解决方案2】:

我遇到了同样的问题,并且偶然看到一篇文章,该文章解释了该问题是由于 Windows 的目录作为通用 Internet 文件系统 (CIFS) 安装在 Docker 容器内而引起的。 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

我通过使用更新版本的 sql server for linux 解决了这个问题

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-06-07
    • 2020-05-13
    • 2021-11-29
    • 1970-01-01
    • 1970-01-01
    • 2020-12-04
    • 2022-08-18
    • 1970-01-01
    相关资源
    最近更新 更多