Description
Adding a volumeClaimTemplate, or existing an existing one leads to the re-creation of statefulset -> all pods are immediately terminated and route is unavailable until some of the pods is ready again.
reproduce
- deploy operator
./build/run-openshift.sh
- deploy updatedquickstart project from operator repository
cat deploy/crds/quickstart-cr.yaml apiVersion: wildfly.org/v1alpha1 kind: WildFlyServer metadata: name: quickstart spec: applicationImage: "quay.io/wildfly-quickstarts/wildfly-operator-quickstart:18.0" replicas: 2 storage: volumeClaimTemplate: spec: resources: requests: storage: 1Mi oc apply -f deploy/crds/quickstart-cr.yaml
- wait for both replicas to be ready & print ss creation timestamp & verify application readiness
oc get pods NAME READY STATUS RESTARTS AGE quickstart-0 1/1 Running 0 2m48s quickstart-1 1/1 Running 0 2m48s wildfly-operator-54455dbcd8-flnd4 1/1 Running 0 69m oc get statefulset.apps/quickstart --template={{.metadata.creationTimestamp}} 2019-10-17T13:55:03Z curl quickstart-route-wildfly.apps-crc.testing {"ip":"10.128.1.36"}
- edit the storage field (e.g. storage: 1Mi -> storage: 2Mi)
- notice the both pods are terminating, stateful set creation timestamp has changed and application route is not available until one of the pods will start again (could take a minute)
oc get pods NAME READY STATUS RESTARTS AGE quickstart-0 1/1 Terminating 0 5m42s quickstart-1 1/1 Terminating 0 5m42s wildfly-operator-54455dbcd8-flnd4 1/1 Running 0 72m oc get statefulset.apps/quickstart --template={{.metadata.creationTimestamp}} 2019-10-17T14:00:44Z curl quickstart-route-wildfly.apps-crc.testing ... Application is not available ...