Bug 1328373

Summary: Deployer should try to delete deamonset and server roles before processing the logging-fluentd-template
Product: OKD Reporter: Xia Zhao <xiazhao>
Component: LoggingAssignee: Luke Meyer <lmeyer>
Status: CLOSED CURRENTRELEASE QA Contact: chunchen <chunchen>
Severity: low Docs Contact:
Priority: low    
Version: 3.xCC: aos-bugs, wsun
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-20 15:22:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Xia Zhao 2016-04-19 08:48:54 UTC
Problem description: 
In case for a redeployment inside the same logging project, deployer will fail because ds and server roles already exist. Deployer should try to delete them before creation.

Version-Release number of selected component (if applicable):
Images built from https://github.com/openshift/origin-aggregated-logging

How reproducible:
Always

Steps to Reproduce:
1. Deploy logging system according to https://github.com/openshift/origin-aggregated-logging/tree/master/deployment#using-the-logging-deployer
2. Redeploy it in the same project again, check the deployer pod status

Actual Result:
$ oc get po
NAME                     READY     STATUS      RESTARTS   AGE
logging-deployer-1ed4e   0/1       Error       0          28m
pod log said that "Error from server: daemonsets.extensions "logging-fluentd" already exists"
Deleted fluentd ds and retry with deployer, get error messages #2:
serviceaccount "logging-deployer" created
Error from server: role "oauth-editor" already exists
Error from server: role "daemonset-admin" already exists

Expected Result:
Deployer should try to delete the fluentd deamonset  and server roles before processing the logging-fluentd-template 

Additional info:

Comment 1 Luke Meyer 2016-04-19 13:23:20 UTC
I think we just need to publish another origin deployer image.

The deployer should delete the fluentd daemonset before proceeding, yes. I don't know why even an old version wouldn't... very strange.

The creation of the service accounts and roles is now intended to happen only once. The deployer will not delete or re-create them. So when running repeated deployments, you only need to process the logging-deployer-account-template the first time. You can process it again and it will just do nothing and print errors, which is fine.

I'll smoke test and put this on_qa when we have a newer image.

Comment 2 Xia Zhao 2016-04-20 03:28:00 UTC
I removed step "oc new-app logging-deployer-account-template" and the re-deployment succeeded with this latest deployer image:
docker.io/openshift/origin-logging-deployment      latest              ed54b03c2eba        11 hours ago        699.8 MB

Setting to verified. Thanks!