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

Helm 机安装--name mymssql stable / mssql-linux --set acceptEula.value = Y --set edition.value = Developer

我可以看到持久卷存在
kubernetes - 安装 Helm 图表稳定/MSSQL的Linux我得到 “pod has unbound PersistentVolumeClaims”-LMLPHP


kubernetes - 安装 Helm 图表稳定/MSSQL的Linux我得到 “pod has unbound PersistentVolumeClaims”-LMLPHP

编辑:

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描述光伏:
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>

最佳答案

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

如果要继续尝试,请尝试运行kubectl logs pod_name并遵循此处描述的问题。

关于kubernetes - 安装 Helm 图表稳定/MSSQL的Linux我得到 “pod has unbound PersistentVolumeClaims”,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/55013632/

10-16 12:23