Bug 1467265 - Logging uninstall does not remove PVC
Logging uninstall does not remove PVC
Status: VERIFIED
Product: OpenShift Container Platform
Classification: Red Hat
Component: Logging (Show other bugs)
3.5.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 3.7.0
Assigned To: Jan Wozniak
Anping Li
: NeedsTestCase
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-03 05:30 EDT by Ruben Romero Montes
Modified: 2017-10-05 13:47 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
The host and uninstall logs (20.94 KB, application/x-gzip)
2017-09-07 06:12 EDT, Anping Li
no flags Details

  None (edit)
Description Ruben Romero Montes 2017-07-03 05:30:58 EDT
Description of problem:
I would expect the PVC created by the installer to be removed when uninstalling logging using the openshift-logging playbook with the following variables:

openshift_logging_install_logging=false
openshift_logging_upgrade_logging=false
openshift_logging_es_pvc_size=1Gi

Version-Release number of selected component (if applicable):
OCP 3.5.5.26

How reproducible:
Always

Steps to Reproduce:
1. Create PV for logging
2. Install logging using openshift-logging.yml playbook
3. Remove logging using same playbook

Actual results:
$ oc get pv -n logging
NAME           CAPACITY   ACCESSMODES   RECLAIMPOLICY   STATUS    CLAIM                  REASON    AGE
logging-es-1   1Gi        RWO           Retain          Bound     logging/logging-es-0             1h
logging-es-2   1Gi        RWO           Retain          Bound     logging/logging-es-1             1h
logging-es-3   1Gi        RWO           Retain          Bound     logging/logging-es-2             1h

Expected results:
I would expect the PVC to have been deleted because a new installation will create new PVC which won't be bound because of the existing ones.

Additional info:
Comment 2 Jan Wozniak 2017-08-24 04:06:19 EDT
This PR should address your comment:

https://github.com/openshift/openshift-ansible/pull/5189
Comment 3 openshift-github-bot 2017-08-31 07:55:09 EDT
Commit pushed to master at https://github.com/openshift/openshift-ansible

https://github.com/openshift/openshift-ansible/commit/51a2d9dbadea02f22168629d44ff339b3c45d6d1
Bug 1467265 - logging: add 'purge' option with uninstall

The common uninstall would keep PVC around to prevent unwanted data loss during
reinstalls. There is a scenario where the user may want complete removal of EFK
stack including PVC.

This change adds an optional `openshift_logging_purge_logging` variable to
completely remove the EFK stack. By default, this is set to 'False' and only
works if user sets `openshift_logging_install_logging` to 'False' to initiate
the uninstallation process.
Comment 4 Anping Li 2017-09-07 06:12 EDT
Created attachment 1323020 [details]
The host and uninstall logs

The pvc was not deleted by playbook in openshift-ansible:master

[root@host2-master ~]# oc get pvc 
NAME           STATUS    VOLUME           CAPACITY   ACCESSMODES   STORAGECLASS   AGE
logging-es-0   Bound     nfsvol5          10Gi       RWO                          3h
Comment 5 Jan Wozniak 2017-09-07 10:25:27 EDT
Could you please run following commands after you tried the uninstall? Thanks!

oc get pvc --selector=logging-infra --namespace=logging
oc describe pvc logging-es-0
Comment 6 Anping Li 2017-09-07 22:17:34 EDT
Jan,  The prior pvc [1] was incorrect. it wasn't created by installer and wasn't labelled by logging-infra.  The test pass with pvc created by installer. so move bug to verified.

[1]. The prior pvc created by manually
[root@host2-master ~]# oc describe pvc logging-es-0
Name:		logging-es-0
Namespace:	logging
StorageClass:	
Status:		Bound
Volume:		nfsvol5
Labels:		<none>
Annotations:	pv.kubernetes.io/bind-completed=yes
		pv.kubernetes.io/bound-by-controller=yes
Capacity:	10Gi
Access Modes:	RWO
Events:		<none>

[2]. The pvc created by installer.
# oc get pvc logging-es-0 -o json 
{
    "apiVersion": "v1",
    "kind": "PersistentVolumeClaim",
    "metadata": {
        "annotations": {
            "pv.kubernetes.io/bind-completed": "yes",
            "pv.kubernetes.io/bound-by-controller": "yes"
        },
        "creationTimestamp": "2017-09-08T02:02:53Z",
        "labels": {
            "logging-infra": "support"
        },
        "name": "logging-es-0",
        "namespace": "logging",
        "resourceVersion": "35379",
        "selfLink": "/api/v1/namespaces/logging/persistentvolumeclaims/logging-es-0",
        "uid": "d36c0b9d-9439-11e7-bc00-fa163e8efe63"
    },
    "spec": {
        "accessModes": [
            "ReadWriteOnce"
        ],
        "resources": {
            "requests": {
                "storage": "10G"
            }
        },
        "volumeName": "nfsvol6"
    },
    "status": {
        "accessModes": [
            "ReadWriteOnce"
        ],
        "capacity": {
            "storage": "10Gi"
        },
        "phase": "Bound"
    }
}
Comment 7 Jan Wozniak 2017-09-08 03:56:26 EDT
Great! Thanks for the update. I was already getting quite creative about what could have possibly happened there as I couldn't reproduce that at all.
Comment 9 openshift-github-bot 2017-09-28 13:13:28 EDT
Commits pushed to master at https://github.com/openshift/openshift-docs

https://github.com/openshift/openshift-docs/commit/43b15d6e39513951ea0b37fd7ca72840df01bcf5
Bug 1467265 Add 'Purge' Option with Uninstall

https://github.com/openshift/openshift-docs/commit/2b4d13b2bbc62b90e46ab5c24a24f3595102e7a9
Merge pull request #5218 from bmcelvee/BZ1467265

Bug 1467265 Add 'Purge' Option with Uninstall

Note You need to log in before you can comment on or make changes to this bug.