[jboss-jira] [JBoss JIRA] (WFWIP-255) Existing PVC can slip into as the storage for operator

Petr Kremensky (Jira) issues at jboss.org
Tue Oct 22 08:57:00 EDT 2019


     [ https://issues.jboss.org/browse/WFWIP-255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Petr Kremensky updated WFWIP-255:
---------------------------------
    Description: 
PVC created manually (any accessModes) by user can be slip into the Operator.

*Things to notice here:*
 * WFWIP-186 StorageSpec is intended to be mounted in ReadWriteOnce mode
 * {{foo: bar}} should never pass the validation as it is not a valid storage configuration

*reproduce*
* create PVC, use the ${OPERATOR_NAME}\-volume\-${OPERATOR_NAME}-0 name - the PVC would be in normal circumstances created by the operator
{noformat}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: quickstart-volume-quickstart-0
spec:
  accessModes:
  - ReadWriteOnce
  - ReadOnlyMany
  - ReadWriteMany
  resources:
    requests:
      storage: 1Mi
  volumeMode: Filesystem
  volumeName: pv0022
{noformat}
* deploy the project
{noformat}
apiVersion: wildfly.org/v1alpha1
kind: WildFlyServer
metadata:
  name: quickstart
spec:
  applicationImage: "quay.io/wildfly-quickstarts/wildfly-operator-quickstart:18.0"
  replicas: 1
  storage:
    foo: bar
{noformat}

The PVC created by user is reused by operator.

Additional details:
* oc get pvc quickstart-volume-quickstart-0 -o yaml
{noformat}
$ oc get pvc quickstart-volume-quickstart-0 -o yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: quickstart-volume-quickstart-0
...
spec:
  accessModes:
  - ReadWriteOnce
  - ReadOnlyMany
  - ReadWriteMany
  resources:
    requests:
      storage: 1Mi
  volumeMode: Filesystem
  volumeName: pv0022
status:
  accessModes:
  - ReadWriteOnce
  - ReadWriteMany
  - ReadOnlyMany
  capacity:
    storage: 10Gi
  phase: Bound
{noformat}

* oc get wildflyserver quickstart -o yaml
{noformat}
$ oc get wildflyserver quickstart -o yaml
apiVersion: wildfly.org/v1alpha1
kind: WildFlyServer
metadata:
  name: quickstart
...
spec:
  applicationImage: quay.io/wildfly-quickstarts/wildfly-operator-quickstart:18.0
  replicas: 1
  storage:
    foo: bar
status:
  hosts:
  - quickstart-route-statefulset.apps-crc.testing
  pods:
  - name: quickstart-0
    podIP: 10.128.1.101
    state: ACTIVE
  replicas: 1
  scalingdownPods: 0
{noformat}

* oc get pod/quickstart-0 -o yaml
{noformat}
$ oc get pod/quickstart-0 -o yaml
...
    volumeMounts:
    - mountPath: /wildfly/standalone/data
      name: quickstart-volume
...
  volumes:
  - name: quickstart-volume
    persistentVolumeClaim:
      claimName: quickstart-volume-quickstart-0
{noformat}

  was:
PVC created manually (any accessModes) by user can be slip into the Operator.

*Things to notice here:*
 * WFWIP-186 StorageSpec is intended to be mounted in ReadWriteOnce mode
 * {{foo: bar}} should never pass the validation as it is not a valid storage configuration

*reproduce*
* create PVC, use the ${OPERATOR_NAME}-volume-${OPERATOR_NAME}-0 name - the PVC would be in normal circumstances created by the operator
{noformat}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: quickstart-volume-quickstart-0
spec:
  accessModes:
  - ReadWriteOnce
  - ReadOnlyMany
  - ReadWriteMany
  resources:
    requests:
      storage: 1Mi
  volumeMode: Filesystem
  volumeName: pv0022
{noformat}
* deploy the project
{noformat}
apiVersion: wildfly.org/v1alpha1
kind: WildFlyServer
metadata:
  name: quickstart
spec:
  applicationImage: "quay.io/wildfly-quickstarts/wildfly-operator-quickstart:18.0"
  replicas: 1
  storage:
    foo: bar
{noformat}

The PVC created by user is reused by operator.

Additional details:
* oc get pvc quickstart-volume-quickstart-0 -o yaml
{noformat}
$ oc get pvc quickstart-volume-quickstart-0 -o yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: quickstart-volume-quickstart-0
...
spec:
  accessModes:
  - ReadWriteOnce
  - ReadOnlyMany
  - ReadWriteMany
  resources:
    requests:
      storage: 1Mi
  volumeMode: Filesystem
  volumeName: pv0022
status:
  accessModes:
  - ReadWriteOnce
  - ReadWriteMany
  - ReadOnlyMany
  capacity:
    storage: 10Gi
  phase: Bound
{noformat}

* oc get wildflyserver quickstart -o yaml
{noformat}
$ oc get wildflyserver quickstart -o yaml
apiVersion: wildfly.org/v1alpha1
kind: WildFlyServer
metadata:
  name: quickstart
...
spec:
  applicationImage: quay.io/wildfly-quickstarts/wildfly-operator-quickstart:18.0
  replicas: 1
  storage:
    foo: bar
status:
  hosts:
  - quickstart-route-statefulset.apps-crc.testing
  pods:
  - name: quickstart-0
    podIP: 10.128.1.101
    state: ACTIVE
  replicas: 1
  scalingdownPods: 0
{noformat}

* oc get pod/quickstart-0 -o yaml
{noformat}
$ oc get pod/quickstart-0 -o yaml
...
    volumeMounts:
    - mountPath: /wildfly/standalone/data
      name: quickstart-volume
...
  volumes:
  - name: quickstart-volume
    persistentVolumeClaim:
      claimName: quickstart-volume-quickstart-0
{noformat}



> Existing PVC can slip into as the storage for operator
> ------------------------------------------------------
>
>                 Key: WFWIP-255
>                 URL: https://issues.jboss.org/browse/WFWIP-255
>             Project: WildFly WIP
>          Issue Type: Bug
>          Components: OpenShift
>            Reporter: Petr Kremensky
>            Assignee: Jeff Mesnil
>            Priority: Major
>
> PVC created manually (any accessModes) by user can be slip into the Operator.
> *Things to notice here:*
>  * WFWIP-186 StorageSpec is intended to be mounted in ReadWriteOnce mode
>  * {{foo: bar}} should never pass the validation as it is not a valid storage configuration
> *reproduce*
> * create PVC, use the ${OPERATOR_NAME}\-volume\-${OPERATOR_NAME}-0 name - the PVC would be in normal circumstances created by the operator
> {noformat}
> apiVersion: v1
> kind: PersistentVolumeClaim
> metadata:
>   name: quickstart-volume-quickstart-0
> spec:
>   accessModes:
>   - ReadWriteOnce
>   - ReadOnlyMany
>   - ReadWriteMany
>   resources:
>     requests:
>       storage: 1Mi
>   volumeMode: Filesystem
>   volumeName: pv0022
> {noformat}
> * deploy the project
> {noformat}
> apiVersion: wildfly.org/v1alpha1
> kind: WildFlyServer
> metadata:
>   name: quickstart
> spec:
>   applicationImage: "quay.io/wildfly-quickstarts/wildfly-operator-quickstart:18.0"
>   replicas: 1
>   storage:
>     foo: bar
> {noformat}
> The PVC created by user is reused by operator.
> Additional details:
> * oc get pvc quickstart-volume-quickstart-0 -o yaml
> {noformat}
> $ oc get pvc quickstart-volume-quickstart-0 -o yaml
> apiVersion: v1
> kind: PersistentVolumeClaim
> metadata:
>   name: quickstart-volume-quickstart-0
> ...
> spec:
>   accessModes:
>   - ReadWriteOnce
>   - ReadOnlyMany
>   - ReadWriteMany
>   resources:
>     requests:
>       storage: 1Mi
>   volumeMode: Filesystem
>   volumeName: pv0022
> status:
>   accessModes:
>   - ReadWriteOnce
>   - ReadWriteMany
>   - ReadOnlyMany
>   capacity:
>     storage: 10Gi
>   phase: Bound
> {noformat}
> * oc get wildflyserver quickstart -o yaml
> {noformat}
> $ oc get wildflyserver quickstart -o yaml
> apiVersion: wildfly.org/v1alpha1
> kind: WildFlyServer
> metadata:
>   name: quickstart
> ...
> spec:
>   applicationImage: quay.io/wildfly-quickstarts/wildfly-operator-quickstart:18.0
>   replicas: 1
>   storage:
>     foo: bar
> status:
>   hosts:
>   - quickstart-route-statefulset.apps-crc.testing
>   pods:
>   - name: quickstart-0
>     podIP: 10.128.1.101
>     state: ACTIVE
>   replicas: 1
>   scalingdownPods: 0
> {noformat}
> * oc get pod/quickstart-0 -o yaml
> {noformat}
> $ oc get pod/quickstart-0 -o yaml
> ...
>     volumeMounts:
>     - mountPath: /wildfly/standalone/data
>       name: quickstart-volume
> ...
>   volumes:
>   - name: quickstart-volume
>     persistentVolumeClaim:
>       claimName: quickstart-volume-quickstart-0
> {noformat}



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the jboss-jira mailing list