Uploaded image for project: 'WildFly WIP'
  1. WildFly WIP
  2. WFWIP-185

PVC not deleted by deleting WildFlyServer CR

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Blocker
    • OpenShift
    • None
    • Hide

      1. Create CR WildFlyServer and wait little bit to be everything up

      apiVersion: wildfly.org/v1alpha1
      kind: WildFlyServer
      metadata:
        creationTimestamp: '2019-08-30T14:09:39Z'
        generation: 1
        name: simple-jaxrs-eap72
        namespace: mchoma
        resourceVersion: '3641299'
        selfLink: >-
          /apis/wildfly.org/v1alpha1/namespaces/mchoma/wildflyservers/simple-jaxrs-eap72
        uid: ce339f61-cb2f-11e9-b93c-fa163e9a0fb6
      spec:
        applicationImage: 'docker-registry.default.svc:5000/mchoma-xtf-builds/simple-jaxrs-eap72'
        env: []
        size: 2
        storage:
          volumeClaimTemplate:
            apiVersion: v1
            kind: PersistentVolumeClaim
            metadata:
              annotations: {}
              labels: {}
              name: simple-jaxrs-eap72-volume
            spec:
              accessModes:
                - ReadWriteMany
              resources:
                limits: {}
                requests:
                  storage: 1Mi
      status:
        hosts:
          - simple-jaxrs-eap72-mchoma.apps.multinode-nfs-mchoma-001.dynamic.xpaas
        pods:
          - name: simple-jaxrs-eap72-0
            podIP: 10.128.3.34
          - name: simple-jaxrs-eap72-1
            podIP: 10.130.0.102
      

      2. delete CR

      oc delete WildFlyServer simple-jaxrs-eap72
      

      Statefull Set is deleted. Pod is Deleted. But PVC is always there.

      oc delete WildFlyServer simple-jaxrs-eap72
      wildflyserver.wildfly.org "simple-jaxrs-eap72" deleted
      [mchoma@10 ~]$ oc get pvc
      NAME                                             STATUS    VOLUME    CAPACITY   ACCESS MODES   STORAGECLASS   AGE
      simple-jaxrs-eap72-volume-simple-jaxrs-eap72-0   Bound     vol36     1Gi        RWO,RWX                       2m
      simple-jaxrs-eap72-volume-simple-jaxrs-eap72-1   Bound     vol10     1Gi        RWO,RWX                       2m
      
      Show
      1. Create CR WildFlyServer and wait little bit to be everything up apiVersion: wildfly.org/v1alpha1 kind: WildFlyServer metadata: creationTimestamp: '2019-08-30T14:09:39Z' generation: 1 name: simple-jaxrs-eap72 namespace: mchoma resourceVersion: '3641299' selfLink: >- /apis/wildfly.org/v1alpha1/namespaces/mchoma/wildflyservers/simple-jaxrs-eap72 uid: ce339f61-cb2f-11e9-b93c-fa163e9a0fb6 spec: applicationImage: 'docker-registry. default .svc:5000/mchoma-xtf-builds/simple-jaxrs-eap72' env: [] size: 2 storage: volumeClaimTemplate: apiVersion: v1 kind: PersistentVolumeClaim metadata: annotations: {} labels: {} name: simple-jaxrs-eap72-volume spec: accessModes: - ReadWriteMany resources: limits: {} requests: storage: 1Mi status: hosts: - simple-jaxrs-eap72-mchoma.apps.multinode-nfs-mchoma-001.dynamic.xpaas pods: - name: simple-jaxrs-eap72-0 podIP: 10.128.3.34 - name: simple-jaxrs-eap72-1 podIP: 10.130.0.102 2. delete CR oc delete WildFlyServer simple-jaxrs-eap72 Statefull Set is deleted. Pod is Deleted. But PVC is always there. oc delete WildFlyServer simple-jaxrs-eap72 wildflyserver.wildfly.org "simple-jaxrs-eap72" deleted [mchoma@10 ~]$ oc get pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE simple-jaxrs-eap72-volume-simple-jaxrs-eap72-0 Bound vol36 1Gi RWO,RWX 2m simple-jaxrs-eap72-volume-simple-jaxrs-eap72-1 Bound vol10 1Gi RWO,RWX 2m

    Description

      When I delete WildFlyServer CR PVC created by this CR is not deleted as StatefullSet and Pods are .

      I see Statefull Set and Pod has ownerReferences attribute referencing to parent.

      ownerReferences
      List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.

      I dont see such attribute specified in PVC

      # Please edit the object below. Lines beginning with a '#' will be ignored,
      # and an empty file will abort the edit. If an error occurs while saving this file will be
      # reopened with the relevant failures.
      #
      apiVersion: v1
      kind: PersistentVolumeClaim
      metadata:
        annotations:
          pv.kubernetes.io/bind-completed: "yes"
          pv.kubernetes.io/bound-by-controller: "yes"
        creationTimestamp: 2019-08-30T13:12:27Z
        finalizers:
        - kubernetes.io/pvc-protection
        labels:
          app.kubernetes.io/managed-by: wildfly-operator
          app.kubernetes.io/name: simple-jaxrs-eap72
          app.openshift.io/runtime: wildfly
        name: simple-jaxrs-eap72-volume-simple-jaxrs-eap72-0
        namespace: mchoma
        resourceVersion: "3633284"
        selfLink: /api/v1/namespaces/mchoma/persistentvolumeclaims/simple-jaxrs-eap72-volume-simple-jaxrs-eap72-0
        uid: d0aac389-cb27-11e9-b93c-fa163e9a0fb6
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 1Mi
        volumeName: vol57
      status:
        accessModes:
        - ReadWriteMany
        - ReadWriteOnce
        capacity:
          storage: 1Gi
        phase: Bound
      

      Attachments

        Activity

          People

            jmesnil1@redhat.com Jeff Mesnil
            mchoma@redhat.com Martin Choma
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: