5

it’s been driving me crazy for about a week now. Searched over the “whole” internet with no luck. used rexray, standard config, digital ocean setup etc.

Cannot make it working on digital ocean with block storage. Would be great if anyone could point me to some tutorial (preferable official kubernetes storage driver).

Here is my config for postgres:

          ... 
          volumeMounts:
            - name: postgres-storage
              mountPath: /var/lib/postgresql/data
      volumes:
        - name: postgres-storage
          persistentVolumeClaim:
            claimName: postgres-pv-claim

---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: postgres-pv-claim 
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 3Gi

---

apiVersion: v1
kind: PersistentVolume
metadata:
  name: postgres-volume
spec:
  capacity:
    storage: 3Gi
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain

Any help is highly appreciated.

Kiura
  • 202
  • 3
  • 9

1 Answers1

3

Kubernetes does not support Volume plugin for DigitalOcean.

But you can use this using FlexVolume plugin as external storage.

  • Digital Ocean Flex Plugin
  • Digital Ocean External Provisioner

See this comment in a PR for DigitalOcean volume support.

If you want to use DigitalOcean block storage, see Kubernetes DigitalOcean Provisioner to setup digitalocean-flexplugin.

Shahriar
  • 13,460
  • 8
  • 78
  • 95
  • Hi again, @aerokite, I carefully followed the instructions on [Kubernetes DigitalOcean Provisioner](https://github.com/kubernetes-incubator/external-storage/tree/master/digitalocean), still have the same error: `Normal SuccessfulMountVolume 2m kubelet, node-1 MountVolume.SetUp succeeded for volume "default-token-gxvtl"` `Warning FailedMount 3s kubelet, node-1 Unable to mount volumes for pod "busy-pod_default(7562c388-0a59-11e8-bdb8-7eb68b307981)": timeout expired waiting for volumes to attach/mount for pod "default"/"busy-pod". list of unattached/unmounted volumes=[vol1]` – Kiura Feb 05 '18 at 09:50
  • `kubectl get pv` ? – Shahriar Feb 05 '18 at 09:53
  • `kubectl get pv` postgres-volume 3Gi RWO Retain Released default/postgres-pv-claim – Kiura Feb 05 '18 at 09:54
  • this pv was created for postgres, then I tried the example pod, didnt work with either – Kiura Feb 05 '18 at 09:55
  • did pvc created? – Shahriar Feb 05 '18 at 09:56
  • do you use slack? – Shahriar Feb 05 '18 at 09:57
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/164539/discussion-between-kiura-and-aerokite). – Kiura Feb 05 '18 at 09:58
  • 1
    @aerokite Have you guys ever gotten this to work? I have tried for weeks and it never tries to mount. I get a weird error about a 'U' character. I opened an issue and no one responded https://github.com/kubernetes-incubator/external-storage/issues/761 – Hcabnettek May 15 '18 at 19:37
  • @Shahriar Can you please take a look at the following question:https://stackoverflow.com/q/66858780/9409877 – HKS Mar 30 '21 at 09:25