Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1569400 - Improve prometheus uninstall process
Improve prometheus uninstall process
Status: VERIFIED
Product: OpenShift Container Platform
Classification: Red Hat
Component: Monitoring (Show other bugs)
3.10.0
Unspecified Unspecified
medium Severity medium
: ---
: 3.11.0
Assigned To: Paul Gier
Junqi Zhao
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2018-04-19 04:44 EDT by Junqi Zhao
Modified: 2018-10-05 18:04 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Prometheus uninstall currently deletes the entire openshift-metrics namespace. Consequence: This has the potential to delete objects which have been created in the same namespace, but are not part of the prometheus installation. Fix: Change the uninstall process to delete only the specific objects which were created by the prometheus install. Only delete the namespace if there are no remaining objects. Result: This will allow prometheus to be installed and uninstalled while sharing a namespace with other objects.
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)

  None (edit)
Description Junqi Zhao 2018-04-19 04:44:34 EDT
Description of problem:
Prometheus is deployed to openshift-metrics namespace by default, after undeploying prometheus, prometheus namespace would be deleted, it is better to keep this namespace, maybe some other pods would be deyployed under this namespace

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


How reproducible:
Always

Steps to Reproduce:
1. Deploy prometheus and undeploy it
2. Check whether the namespace where prometheus deployed is deleted or not
3.

Actual results:
prometheus namespace would be deleted

Expected results:
prometheus namespace should be kept

Additional info:
Comment 1 Junqi Zhao 2018-04-19 04:45:38 EDT
# rpm -qa | grep openshift-ansible
openshift-ansible-roles-3.10.0-0.22.0.git.0.b6ec617.el7.noarch
openshift-ansible-playbooks-3.10.0-0.22.0.git.0.b6ec617.el7.noarch
openshift-ansible-3.10.0-0.22.0.git.0.b6ec617.el7.noarch
openshift-ansible-docs-3.10.0-0.22.0.git.0.b6ec617.el7.noarch
Comment 2 Paul Gier 2018-04-19 16:43:57 EDT
I'd prefer to keep the uninstall process as simple as possible, otherwise it's more maintenance to keep the uninstall in sync with the install.  Is there something specific that would commonly be deployed to the prometheus namespace?
Comment 4 Junqi Zhao 2018-06-11 23:04:09 EDT
metrics now is deployed under openshift-metrics namespaces, we should keep the prometheus namespace after undeploying prometheus

https://github.com/openshift/openshift-ansible/pull/8649
Comment 6 Jessica Forrester 2018-06-19 12:05:06 EDT
moving to 3.11 as the change referenced in comment 4 is being reverted and the only thing in openshift-metrics in 3.10 should be the tech preview prometheus stack, which will no longer be in this namespace in 3.11

We may need to address this in 3.11 if metrics-server does get installed into openshift-metrics versus the new openshift-monitoring namespace. Mainly concerned that if someone moves from the old prometheus tech preview installation to the new one that uninstalling the old one doesnt wipe out metrics-server.
Comment 7 Solly Ross 2018-06-19 15:23:35 EDT
It doesn't really matter where metrics-server is installed.  You could run multiple during the upgrade, as long as you update the APIService to point to the correct one.
Comment 9 Paul Gier 2018-09-02 13:07:16 EDT
PR for 3.10: https://github.com/openshift/openshift-ansible/pull/9860
Comment 10 Junqi Zhao 2018-09-02 23:02:14 EDT
Paul,

From the PR, ds, svc and other resources are deleted, the prometheus namespace is finally deleted too, and not maintained, the fix has nothing to do with the defect.
Comment 11 Junqi Zhao 2018-09-05 20:43:45 EDT
Paul,

We could close this defect as WONTFIX if the openshift-metrics namespace is deleted after undeploying prometheus, since the openshift-metrics namespace is used only by us now, I am OK with the solution
Comment 12 Paul Gier 2018-09-06 08:58:07 EDT
The updated uninstall should only delete the namespace if there are no other objects present.  So the behaviour is the same if prometheus is the only thing installed in the namespace.  However, if there is another deployment sharing the namespace, then it won't be deleted.  I thought that solved the use case here.

If it's better to keep the namespace regardless of whether it contains another deployment, I could just remove that part of the uninstall.
Comment 13 Junqi Zhao 2018-09-06 20:54:29 EDT
(In reply to Paul Gier from comment #12)
> If it's better to keep the namespace regardless of whether it contains
> another deployment, I could just remove that part of the uninstall.

Since prometheus will be deprecated in 4.0, and there is not other deployment using openshift-metrics namespace now, I think remove the openshift-metrics namespace is OK.
Comment 14 Junqi Zhao 2018-09-06 21:05:35 EDT
# rpm -qa | grep ansible
ansible-2.6.3-1.el7ae.noarch
openshift-ansible-docs-3.11.0-0.28.0.git.0.730d4be.el7.noarch
openshift-ansible-playbooks-3.11.0-0.28.0.git.0.730d4be.el7.noarch
openshift-ansible-3.11.0-0.28.0.git.0.730d4be.el7.noarch
openshift-ansible-roles-3.11.0-0.28.0.git.0.730d4be.el7.noarch

If only prometheus is using openshift-metrics namespace, ds, svc, configmaps and other resources are deleted, the namespace is kept. If there is not other deployment under openshift-metrics namespace, the  openshift-metrics namespace will be deleted

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