简体   繁体   English

Postgresql通过Helm没有安装

[英]Postgresql via Helm not installing

I am attempting to install postgres via helm using the latest stable and it isn't installing the persistent volume properly. 我正在尝试使用最新的稳定版通过helm安装postgres,而不是正确安装持久卷。 I am installing it in Minikube and for some reason it doesn't appear to be able to hostMount properly. 我在Minikube中安装它,由于某种原因它似乎无法正确地hostMount。

Error (on the deployment, pod, and replica set) 错误(在部署,窗格和副本集上)

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 PersistentVolumeClaim未绑定:“postgres-postgresql”错误:lstat / tmp / hostpath-provisioner / pvc-c713429d-e2a3-11e7-9ca9-080027231d54:没有此类文件或目录错误同步窗格

When I look at the persistent volume it appears to be running properly. 当我查看持久性卷时,它似乎正常运行。 In case it helps here is my persistent volume yaml: 如果它有帮助,这是我的持久卷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",
      "apiVersion": "v1",
      "resourceVersion": "396550"
    },
    "persistentVolumeReclaimPolicy": "Delete",
    "storageClassName": "standard"
  },
  "status": {
    "phase": "Bound"
  }
}

Persistent Volume Claim Yaml: 持续量索赔Yaml:

{
  "kind": "PersistentVolumeClaim",
  "apiVersion": "v1",
  "metadata": {
    "name": "postgres-postgresql",
    "namespace": "default",
    "selfLink": "/api/v1/namespaces/default/persistentvolumeclaims/postgres-postgresql",
    "uid": "c713429d-e2a3-11e7-9ca9-080027231d54",
    "resourceVersion": "396588",
    "creationTimestamp": "2017-12-16T20:57:50Z",
    "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",
    "storageClassName": "standard"
  },
  "status": {
    "phase": "Bound",
    "accessModes": [
      "ReadWriteOnce"
    ],
    "capacity": {
      "storage": "8Gi"
    }
  }
}

Any assistance would be appreciated. 任何援助将不胜感激。

You may be running into this issue: https://github.com/kubernetes/minikube/issues/2256 您可能遇到过这个问题: https//github.com/kubernetes/minikube/issues/2256

The problem is there's a bug in the hostpath volume provisioner that encounters an error when the 'subPath' field is present in the Deployment resource (event if the field has an empty value). 问题是当部署资源中存在“subPath”字段时,主机路径卷配置器中出现错误,如果该字段具有空值,则会发生错误。

Here's a workaround that worked for me - unpack the postgresql chart and comment out the following line in deployment.yaml: 这是一个对我有用的解决方法 - 解压缩postgresql图表并在deployment.yaml中注释掉以下行:

      # subPath: {{ .Values.persistence.subPath }}

Then redeploy the modified chart. 然后重新部署修改后的图表。 If you're reliant on the 'subPath' field, this workaround won't work for you. 如果您依赖于“subPath”字段,则此解决方法将不适合您。

Note: This issue is also present on Kubernetes on Docker-for-Mac (which is where I've encountered it). 注意:这个问题也出现在Docker-for-Mac上的Kubernetes上(这是我遇到的地方)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM