Closed jstrachan closed 6 years ago
@chmouel fancy having a go?
this would mean after a reboot folks would just have to type gofabric8 erase-pvc keycloak-db-postgresql-data
and hopefully keycloak would eventually startup again. They'd have to login again from scratch mind; but at least KC would startup so they could login
So seems like if we have this original pvc :
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
maven.fabric8.io/source-url: jar:file:/home/jenkins/workspace/8io_fabric8-platform_master-4P5FOSFKYBLAPGDO7GHHNEOGKKERYH26KXBFORI5V7MRVJFY3QWA/apps/keycloak-db/target/keycloak-db-4.0.204.jar!/META-INF/fabric8/openshift.yml
pv.kubernetes.io/bind-completed: "yes"
pv.kubernetes.io/bound-by-controller: "yes"
creationTimestamp: 2017-10-02T14:57:42Z
labels:
app: keycloak-db
group: io.fabric8.platform.apps
provider: fabric8
version: 4.0.204
name: keycloak-db-postgresql-data
namespace: fabric8
resourceVersion: "1305"
selfLink: /api/v1/namespaces/fabric8/persistentvolumeclaims/keycloak-db-postgresql-data
uid: 0af44356-a782-11e7-97d7-fa163e649f97
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
volumeName: pv0001
status:
accessModes:
- ReadWriteOnce
- ReadWriteMany
- ReadOnlyMany
capacity:
storage: 100Gi
phase: Bound
We would strip it down and keep only these fields :
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
maven.fabric8.io/source-url: jar:file:/home/jenkins/workspace/8io_fabric8-platform_master-4P5FOSFKYBLAPGDO7GHHNEOGKKERYH26KXBFORI5V7MRVJFY3QWA/apps/keycloak-db/target/keycloak-db-4.0.204.jar!/META-INF/fabric8/openshift.yml
labels:
app: keycloak-db
group: io.fabric8.platform.apps
provider: fabric8
version: 4.0.204
name: keycloak-db-postgresql-data
namespace: fabric8
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
Should we keep the creationDate
too?
sounds good! I'd trash the creationDate too really
when working with fabric8 its very common for keycloak to barf. e.g. reboot your laptop and try to restart your minikube/minishift VM and keycloak won't start. WIT has similar issues too when you recreate the PVC for keycloak.
So it'd be handy to have a
gofabric8 erase-pvc
command like this...i.e. it'd find the PVC; delete it, then recreate an empty version which has the same labels and spec but removing the
spec. volumeName
value (so its not bound to the PV) and with no status. Also remove the annotations added by the storage implementation like these:Then extra bonus points for also deleting all pods which reference this PVC. Even more brownie points for also deleting all pods which depend on those pods (e.g. keycloak DB and keycloak pods - ditto for WIT etc) though for now only immediate dependencies would probably do the trick