我正在尝试使用最新的
stable通过helm安装postgres并且它没有正确安装持久卷.我在Minikube中安装它,由于某种原因它似乎无法正确地hostMount.
错误(在部署,窗格和副本集上)
PersistentVolumeClaim is not bound: “postgres-postgresql” Error: lstat
/tmp/hostpath-provisioner/pvc-c713429d-e2a3-11e7-9ca9-080027231d54: no
such file or directory Error syncing pod
当我查看持久性卷时,它似乎正在正常运行.如果它有帮助,这是我的持久卷yaml:
{ "kind": "PersistentVolume","apiVersion": "v1","Metadata": { "name": "pvc-c713429d-e2a3-11e7-9ca9-080027231d54","selfLink": "/api/v1/persistentvolumes/pvc-c713429d-e2a3-11e7-9ca9-080027231d54","uid": "c71850e1-e2a3-11e7-9ca9-080027231d54","resourceVersion": "396568","creationTimestamp": "2017-12-16T20:57:50Z","annotations": { "hostPathProvisionerIdentity": "8979806c-dfba-11e7-862f-080027231d54","pv.kubernetes.io/provisioned-by": "k8s.io/minikube-hostpath" } },"spec": { "capacity": { "storage": "8Gi" },"hostPath": { "path": "/tmp/hostpath-provisioner/pvc-c713429d-e2a3-11e7-9ca9-080027231d54","type": "" },"accessModes": [ "ReadWriteOnce" ],"claimRef": { "kind": "PersistentVolumeClaim","namespace": "default","name": "postgres-postgresql","uid": "c713429d-e2a3-11e7-9ca9-080027231d54","resourceVersion": "396550" },"persistentVolumeReclaimPolicy": "Delete","storageClassName": "standard" },"status": { "phase": "Bound" } }
持续量索赔Yaml:
{ "kind": "PersistentVolumeClaim","Metadata": { "name": "postgres-postgresql","selfLink": "/api/v1/namespaces/default/persistentvolumeclaims/postgres-postgresql","resourceVersion": "396588","labels": { "app": "postgres-postgresql","chart": "postgresql-0.8.3","heritage": "Tiller","release": "postgres" },"annotations": { "control-plane.alpha.kubernetes.io/leader": "{\"holderIdentity\":\"897980a2-dfba-11e7-862f-080027231d54\",\"leaseDurationSeconds\":15,\"acquireTime\":\"2017-12-16T20:57:50Z\",\"renewTime\":\"2017-12-16T20:57:52Z\",\"leaderTransitions\":0}","pv.kubernetes.io/bind-completed": "yes","pv.kubernetes.io/bound-by-controller": "yes","volume.beta.kubernetes.io/storage-provisioner": "k8s.io/minikube-hostpath" } },"spec": { "accessModes": [ "ReadWriteOnce" ],"resources": { "requests": { "storage": "8Gi" } },"volumeName": "pvc-c713429d-e2a3-11e7-9ca9-080027231d54","status": { "phase": "Bound","capacity": { "storage": "8Gi" } } }
任何援助将不胜感激.
解决方法
您可能遇到此问题:
https://github.com/kubernetes/minikube/issues/2256
问题是当部署资源中存在“subPath”字段时,主机路径卷配置器中出现错误,如果该字段具有空值,则会发生错误.
这是一个对我有用的解决方法 – 解压缩postgresql图表并在deployment.yaml中注释掉以下行:
# subPath: {{ .Values.persistence.subPath }}
然后重新部署修改后的图表.如果您依赖于“subPath”字段,则此解决方法将不适合您.
注意:这个问题也出现在docker-for-mac上的Kubernetes上(这是我遇到的地方).
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。