Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support compose global deploy mode to daemonset #999

Merged
merged 1 commit into from
May 7, 2018

Conversation

xianlubird
Copy link
Contributor

Support compose global deploy mode to daemonset

@cdrage @hangyan Pls help to review if you are free. Thanks.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 4, 2018
@hangyan
Copy link
Contributor

hangyan commented May 4, 2018

What if the user use --deployment args at the same time?

@xianlubird xianlubird force-pushed the features/global-mode branch from b33220c to 30c5ddb Compare May 4, 2018 09:59
@xianlubird
Copy link
Contributor Author

@hangyan Nice catch ! Already change code, thanks.

opt.CreateD = false
opt.CreateDS = true
if opt.Controller != "" && opt.Controller != "daemonset" {
log.Fatal("Global deploy mode can only convert to daemonset")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think fatal log is not a good idea. May be we should try to let user proceed anyway, wether use deployment( ignore deploy mode) or use ds(ignore flags). I think there should be some existing example to consult in the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for review code on weekend. Already change code to use daemonset controller as default when global mode get in. @hangyan

@xianlubird xianlubird force-pushed the features/global-mode branch from 30c5ddb to 3256551 Compare May 5, 2018 13:23
replica = 1
opt.CreateD = false
opt.CreateDS = true
opt.Controller = "daemonset"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At warn message is needed if the user specific a --deployment flag.Also in my opinion, it's better to use deployment if the user provide a --deployment flag. Because if we ignore it, we can only create a daemonset if deployMode==global, there is no way to overwrite it. But on the other side, we can create daemonset(by default) and deployment(user provide deployment flag), I think this will give the user more choices.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, agree this opinion. Change code to that if user use --deployment flag, it will convert to Deployment and default to use StatefulSet. Also add test case to this situation. @hangyan

@xianlubird xianlubird force-pushed the features/global-mode branch from 3256551 to 38984b3 Compare May 5, 2018 13:57
@xianlubird
Copy link
Contributor Author

@cdrage @hangyan Any update on this ?

replica = 1
if service.DeployMode == "global" && opt.Controller == "" {
opt.CreateD = false
opt.CreateDS = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user specify --deployment flag and DeploMode==global, a warn message is needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hangyan Done. Already add warn message

@xianlubird xianlubird force-pushed the features/global-mode branch from 38984b3 to 84b419c Compare May 7, 2018 07:20
@hangyan
Copy link
Contributor

hangyan commented May 7, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 7, 2018
@hangyan hangyan merged commit b0debf7 into kubernetes:master May 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants