Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating Persistent Volumes #17

Open
blachniet opened this issue Aug 5, 2017 · 3 comments
Open

Creating Persistent Volumes #17

blachniet opened this issue Aug 5, 2017 · 3 comments

Comments

@blachniet
Copy link
Contributor

I had to manually create persistent volumes in order to get this example to work. Is that expected, or is there likely something wrong with my configuration of minikube?

If it's expected that the user should manually create the persistent volumes, I'd be happy to update the instructions and share my example. Here's what I did:

kubectl create -f pv.yaml
# pv.yaml
kind: PersistentVolume
apiVersion: v1
metadata:
  name: pv0
  labels:
    type: local
spec:
  storageClassName: default
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/tmp/data/pv0"
---
kind: PersistentVolume
apiVersion: v1
metadata:
  name: pv1
  labels:
    type: local
spec:
  storageClassName: default
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/tmp/data/pv1"
---
kind: PersistentVolume
apiVersion: v1
metadata:
  name: pv2
  labels:
    type: local
spec:
  storageClassName: default
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/tmp/data/pv2"
@tankchintan
Copy link

@blachniet how did you tie back the PVs to the stateful set? Since even after creating the PVs I am getting the same error as before i.e.

SchedulerPredicates failed due to PersistentVolumeClaim is not bound: "data-consul-0", which is unexpected., SchedulerPredicates failed due to PersistentVolumeClaim is not bound: "data-consul-0", which is unexpected., SchedulerPredicates failed due to PersistentVolumeClaim is not bound: "data-consul-0", which is unexpected.`

@blachniet
Copy link
Contributor Author

I don't think that there was anything else I needed to do in order to tie the stateful set to the PVs. The persistent volumne claims in the stateful set should match to the PVs created by this configuration.

@larrycai
Copy link

larrycai commented Nov 1, 2017

@blachniet yes, I met this problem as well, and manually created 3 PVs to make it work

@tankchintan agree with @blachniet , PVC will automatically select from the PV pools (make sure you have 3 available, also I don't set storageClassName: default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants