Keycloak - Unable to mount volumes volumes=[keycloak-data] for pod

182 views
Skip to first unread message

Charles Moulliard

unread,
Oct 6, 2016, 2:33:28 AM10/6/16
to fabric8
Hi,

I have deployed Fabric8 DevOps Keycloak (v2.2.265) top of minshift 0.7.1 but when OpenShift tries to create the pod, this volume mount error is reported

"Unable to mount volumes for pod "keycloak-1-3jj5j_default(7e5d9628-8b8d-11e6-8b41-3e2f06937091)": timeout expired waiting for volumes to attach/mount for pod "keycloak-1-3jj5j"/"default". list of unattached/unmounted volumes=[keycloak-data]

How can I find more info about the root cause of the issue ?
Is there a workaround ?

Regards

Charles

Charles Moulliard

unread,
Oct 6, 2016, 2:38:18 AM10/6/16
to fabric8
The oc get pvc commands reports the status pending

oc get pvc
NAME              STATUS    VOLUME            CAPACITY   ACCESSMODES   AGE
keycloak-config   Pending   keycloak-config   0                        1h
keycloak-data     Pending   keycloak-data     0                        1h

James Strachan

unread,
Oct 6, 2016, 3:57:38 AM10/6/16
to Charles Moulliard, fabric8
that looks like you have PVC's but no PVs. Try run:

  gofabric8 volumes


--
You received this message because you are subscribed to the Google Groups "fabric8" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabric8+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
James
-------
Red Hat

Twitter: @jstrachan
Email: james.s...@gmail.com
Blog: https://medium.com/@jstrachan/

open source microservices platform

Charles Moulliard

unread,
Oct 6, 2016, 4:20:15 AM10/6/16
to James Strachan, fabric8
I have created a hostPath persistent volume 

oc get pv
NAME      CAPACITY   ACCESSMODES   STATUS      CLAIM     REASON    AGE
pv0001    5Gi        RWO           Available                       14m

oc get pv/pv0001 -o yaml
apiVersion: v1
kind: PersistentVolume
metadata:
  creationTimestamp: 2016-10-06T08:04:10Z
  name: pv0001
  resourceVersion: "463"
  selfLink: /api/v1/persistentvolumes/pv0001
  uid: 76679e94-8b9b-11e6-8a87-3a0042a8fc5d
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 5Gi
  hostPath:
    path: /data/pv0001/
  persistentVolumeReclaimPolicy: Retain
status:
  phase: Available

--
Charles Moulliard
Apache Committer & PMC / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

Charles Moulliard

unread,
Oct 6, 2016, 4:24:01 AM10/6/16
to James Strachan, fabric8

My problem is resolved after running the command gofabric8 volumes.

Is it described somewhere what "volumes" cmd is currently doing (=> creating pv or pvc, ...) ?

James Strachan

unread,
Oct 6, 2016, 4:25:02 AM10/6/16
to Charles Moulliard, fabric8
it creates the PVs for any pending PVCs

Charles Moulliard

unread,
Oct 6, 2016, 4:31:38 AM10/6/16
to James Strachan, fabric8
When it (= gofabric8 volumes) creates the PV corresponding to a PVC, will th default storage used be "hostPath" ?

Charles Moulliard

unread,
Oct 6, 2016, 4:33:20 AM10/6/16
to James Strachan, fabric8
Additional question. If my project includes under src/fabric8 a pvc.yaml file, will f-m-p fabric8:run deploys the pvc & also creates the corresponding pv ? If this is not the case, that means that I must create manually the pv corresponding file ?

James Strachan

unread,
Oct 6, 2016, 4:40:55 AM10/6/16
to Charles Moulliard, fabric8
`gofabric8 volumes` will create PVs using hostPath yes. On real clouds you need real PVs using the underlying storage (e.g. EBS on AWS).

If you have a PVC in src/main/fabric8 then `mvn fabric8:run` will create the PVC yes. Creating a PVC doesn't automatically create the PV though by default; though kubernetes has introduced a dynamic PV option. 

For now though you typically need to create some PVs so that the PVC can bind

Charles Moulliard

unread,
Oct 6, 2016, 4:54:26 AM10/6/16
to James Strachan, fabric8
When I issue these commands manually

oc create -f scripts/openshift/pv-keycloak-data.yaml
oc create -f scripts/openshift/pvc-keycloak-data.yaml

the status of the PVC is still "pending". 

How the link is done between the PVC & PV ?

pv of keycloak-data =>

apiVersion: v1
kind: PersistentVolume
metadata:
  name: "keycloak-data"
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 5Gi
  hostPath:
    path: "/data/keycloak-data"

and

pvc of keycloak-data =>

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: "keycloak-data"
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi





Reply all
Reply to author
Forward
0 new messages