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

Kubernetes Persistence Volume : not bind #589

Closed
nlamirault opened this issue Sep 15, 2016 · 3 comments
Closed

Kubernetes Persistence Volume : not bind #589

nlamirault opened this issue Sep 15, 2016 · 3 comments

Comments

@nlamirault
Copy link

nlamirault commented Sep 15, 2016

Is this a BUG REPORT or FEATURE REQUEST? (choose one): Bug ?

Minikube version (use minikube version): v0.9.0

Environment:

  • OS (e.g. from /etc/os-release): Arch Linux
  • VM Driver (e.g. cat ~/.minikube/machines/minikube/config.json | grep DriverName): VirtualBox
  • Docker version (e.g. docker -v): Docker version 1.12.1
  • Install tools:
  • Others:

What happened:
Can't bind PersistenceVolume and PersistenceVolumeClaim used in a Deployment.

What you expected to happen:
Use the Kubernetes Persistent volumes feature.

How to reproduce it (as minimally and precisely as possible):

apiVersion: v1
kind: PersistentVolume
metadata:
 name: grafana-volume
 labels:
    type: local
spec:
 capacity:
   storage: 1Gi
 accessModes:
 - ReadWriteOnce
 persistentVolumeReclaimPolicy: Retain
 hostPath:
   path: /opt/jarvis/grafana

and

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: grafana-volume-claim
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 2Gi

and :

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: grafana-core
  labels:
    app: grafana
    component: core
    environment: dev
    version: 3.1.0
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: grafana
        component: core
    spec:
      volumes:
        - name: grafana-persistent-storage
          persistentVolumeClaim:
            claimName: grafana-volume-claim
      containers:
        - image: grafana/grafana:3.1.0
          name: grafana-core
          # env:
          resources:
            # keep request = limit to keep this container in guaranteed class
            limits:
              cpu: 100m
              memory: 100Mi
            requests:
              cpu: 100m
              memory: 100Mi
          volumeMounts:
            - name: grafana-persistent-storage
              mountPath: /var/lib/grafana
$ kubectl create -f grafana-volume.yaml
$ kubectl create -f grafana-volume-claim.yaml
$ kubectl create -f grafana-deployment.yaml

Error is : PersistentVolumeClaim is not bound: "grafana-volume-claim"
The events :

FIRSTSEEN                        LASTSEEN                         COUNT     NAME           KIND         SUBOBJECT   TYPE      REASON              SOURCE                     MESSAGE
2016-09-15 15:06:24 +0200 CEST   2016-09-15 15:06:24 +0200 CEST   1         grafana-core   Deployment               Normal    ScalingReplicaSet   {deployment-controller }   Scaled up replica set grafana-core-4061014134 to 1
2016-09-15 15:06:24 +0200 CEST   2016-09-15 15:06:24 +0200 CEST   1         grafana-core-4061014134   ReplicaSet             Normal    SuccessfulCreate   {replicaset-controller }   Created pod: grafana-core-4061014134-69obd
2016-09-15 15:06:24 +0200 CEST   2016-09-15 15:06:24 +0200 CEST   1         grafana-core-4061014134-69obd   Pod                 Warning   FailedScheduling   {default-scheduler }   PersistentVolumeClaim is not bound: "grafana-volume-claim"
2016-09-15 15:06:24 +0200 CEST   2016-09-15 15:06:24 +0200 CEST   2         grafana-core-4061014134-69obd   Pod                 Warning   FailedScheduling   {default-scheduler }   PersistentVolumeClaim is not bound: "grafana-volume-claim"
2016-09-15 15:06:24 +0200 CEST   2016-09-15 15:06:25 +0200 CEST   3         grafana-core-4061014134-69obd   Pod                 Warning   FailedScheduling   {default-scheduler }   PersistentVolumeClaim is not bound: "grafana-volume-claim"
2016-09-15 15:06:24 +0200 CEST   2016-09-15 15:06:27 +0200 CEST   4         grafana-core-4061014134-69obd   Pod                 Warning   FailedScheduling   {default-scheduler }   PersistentVolumeClaim is not bound: "grafana-volume-claim"
2016-09-15 15:06:24 +0200 CEST   2016-09-15 15:06:31 +0200 CEST   5         grafana-core-4061014134-69obd   Pod                 Warning   FailedScheduling   {default-scheduler }   PersistentVolumeClaim is not bound: "grafana-volume-claim"

Anything else do we need to know:

nlamirault added a commit to zeiot-old/jarvis that referenced this issue Sep 15, 2016
Update labels and volume configuration.
Seems PersistentVolume and Persistentvolumeclaim can't be bound.
See: kubernetes/minikube#589

Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com>
@jimmidyson
Copy link
Member

Dynamic host path provisioning is only enabled in master, no release yet, so the host path needs to be manually created with 0.9.0 IIRC.

As an aside, on minikube the only persistent paths are under /mnt/sda1 & /data (which is actually just a symlink to /mnt/sda1). If you use /opt/jarvis/grafana that won't be persisted across restarts of minikube.

@nlamirault
Copy link
Author

OK ! Thanks. I will try that.

@dlorenc
Copy link
Contributor

dlorenc commented Sep 15, 2016

Closing as a dup of #566.

We'll try to get this out today.

@dlorenc dlorenc closed this as completed Sep 15, 2016
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