-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Add kubeadm option to etcd_deployment_type to replace the etcd_kubeadm_enabled variable #8317
Add kubeadm option to etcd_deployment_type to replace the etcd_kubeadm_enabled variable #8317
Conversation
Hi @necatican. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There are two issues where I require some guidance :)
Maybe we could place it in the etcd.yml and read it on
/cc cristicalin |
6653e1d
to
f162b2e
Compare
Overall this looks good, thanks for the effort @necatican !
You don't need to define
I think the answer above covers this point as well. Since we are making a change to the public env vars I would ask you to document this in https://github.com/kubernetes-sigs/kubespray/blob/master/docs/upgrades.md and take the opportunity to describe the etcd deployment types in https://github.com/kubernetes-sigs/kubespray/blob/master/docs/etcd.md Another point I want to make is that we should get things ready for tagging 2.18 and this feels a bit on a short notice so I would hold it off until we tag 2.18 and merge it after. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ok-to-test
Agree, I plan on drafting the release note (which should be easier as I'll use the k8s release note generator) soon, so let's hold after 2.18 is tag |
I made a typo here, I moved I will document the changes and etcd deployment types 😄 Thanks for the feedback! |
Since it pertains to etcd you can move it to |
f162b2e
to
c6048b9
Compare
c6048b9
to
2717a3c
Compare
2717a3c
to
bab8021
Compare
/retest |
/hold cancel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this.
It is nice to merge 2 options into a single one, that is helpful for users also.
Just one question in the line.
The other part seems good for me.
etcd_deployment_type: kubeadm | ||
when: | ||
- etcd_kubeadm_enabled is defined and etcd_kubeadm_enabled | ||
ignore_errors: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why here needs to specify ignore_errors: true?
I could not find cases require it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello,
Thanks for the review! ❤️
I didn't want to fail the playbook for this change. The current implementation warns the user and moves on by setting etcd_deployment_type
.
I initially put the ignore_errors
statement below the failed_when
task, but that didn't make ansible-lint
happy.
roles/kubespray-defaults/tasks/main.yaml:28: ignore-errors Use failed_when and specify error conditions instead of using ignore_errors
Should I warn the user and fail the playbook run instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if setting etcd_kubeadm_enabled by users and outputting the warning message of line 30, I guess any expected errors don't happen.
I might miss something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The warning message would be better addressed in roles/kubernetes/preinstall/tasks/0020-verify-settings.yml rather than here and have this block just do the set_fact
step for backward compatibility.
You can add a #todo comment to clean this when we drop backward compatibility support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the reviews. It makes sense to put the check into verify settings. I was torn between choosing a place but haven't thought about putting those tasks into separate files. 😅
I'm trying to find a better way to alert the user. Throwing a fail stops the playbook, but if I don't fail the task and ignore it, the warning is easy to miss due to being green. I can think of two possible ways and would like to get some guidance on how to resolve this. I couldn't find a good way to issue warnings using Ansible.
This one is just a simple debug task, it shows up as yellow due to changed_when
- name: Warn the user if they are still using `etcd_kubeadm_enabled`
debug:
msg: "WARNING! => `etcd_kubeadm_enabled` is deprecated and will be removed in a future release. You can set `etcd_deployment_type` to `kubeadm` instead of setting `etcd_kubeadm_enabled` to `true`."
changed_when: etcd_kubeadm_enabled
run_once: yes
when: etcd_kubeadm_enabled is defined
We can use the following assert task in the future when we decide to drop the compatibility support.
- name: Warn the user if they are still using `etcd_kubeadm_enabled`
assert:
that: not etcd_kubeadm_enabled
msg: "WARNING! => `etcd_kubeadm_enabled` is deprecated and will be removed in a future release. You can set `etcd_deployment_type` to `kubeadm` instead of setting `etcd_kubeadm_enabled` to `true`."
changed_when: true
failed_when: false
run_once: yes
when: etcd_kubeadm_enabled is defined
Or should we drop the compatibility support right now and force users to change the variable? It could mess up with someone's automation but should not be a huge issue overall.
cc: @cristicalin @oomichi (Sorry for the second ping. I somehow submitted the previous comment as a review. GitHub deleted the comment itself when I tried to delete the review. 😅)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I would not drop backward compatibility at this stage (see the mess I caused with docker to containerd as an example of the fallout).
You can assert any incompatible setting which should stop the playbook like etcd_kubeadm_enabled
set to True
and etcd_deployment_type
!= kubeadm
. And then output a warning with debug
if etcd_kubeadm_enabled
is still, unfortunately this is an ansible limitation and I'm not aware of a better way to output deprecation messages in ansible than just using debug
. Happy to learn though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again ❤️
I have added an assertion to check incompatible settings. It will lay dormant for a while though since we run kubespray-defaults
before assertions. However, it might be useful in the future, when we decide to deprecate etcd_kubeadm_enabled
.
I also added changed_when: true
to debug task, so it will be a bit more noticeable.
Thanks for updating, now looks good to me. /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: necatican, oomichi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…m_enabled variable Signed-off-by: necatican <necaticanyildirim@gmail.com>
Signed-off-by: necatican <necaticanyildirim@gmail.com>
Signed-off-by: necatican <necaticanyildirim@gmail.com>
d9775a8
to
24d78a6
Compare
/lgtm |
…m_enabled variable (kubernetes-sigs#8317) * Add kubeadm option to etcd_deployment_type to replace the etcd_kubeadm_enabled variable Signed-off-by: necatican <necaticanyildirim@gmail.com> * Add etcd kubeadm deployment documentation Signed-off-by: necatican <necaticanyildirim@gmail.com> * Refactor warning for the deprecated 'etcd_kubeadm_enabled' variable Signed-off-by: necatican <necaticanyildirim@gmail.com>
…m_enabled variable (kubernetes-sigs#8317) * Add kubeadm option to etcd_deployment_type to replace the etcd_kubeadm_enabled variable Signed-off-by: necatican <necaticanyildirim@gmail.com> * Add etcd kubeadm deployment documentation Signed-off-by: necatican <necaticanyildirim@gmail.com> * Refactor warning for the deprecated 'etcd_kubeadm_enabled' variable Signed-off-by: necatican <necaticanyildirim@gmail.com>
…m_enabled variable (kubernetes-sigs#8317) * Add kubeadm option to etcd_deployment_type to replace the etcd_kubeadm_enabled variable Signed-off-by: necatican <necaticanyildirim@gmail.com> * Add etcd kubeadm deployment documentation Signed-off-by: necatican <necaticanyildirim@gmail.com> * Refactor warning for the deprecated 'etcd_kubeadm_enabled' variable Signed-off-by: necatican <necaticanyildirim@gmail.com>
…m_enabled variable (kubernetes-sigs#8317) * Add kubeadm option to etcd_deployment_type to replace the etcd_kubeadm_enabled variable Signed-off-by: necatican <necaticanyildirim@gmail.com> * Add etcd kubeadm deployment documentation Signed-off-by: necatican <necaticanyildirim@gmail.com> * Refactor warning for the deprecated 'etcd_kubeadm_enabled' variable Signed-off-by: necatican <necaticanyildirim@gmail.com>
…m_enabled variable (kubernetes-sigs#8317) * Add kubeadm option to etcd_deployment_type to replace the etcd_kubeadm_enabled variable Signed-off-by: necatican <necaticanyildirim@gmail.com> * Add etcd kubeadm deployment documentation Signed-off-by: necatican <necaticanyildirim@gmail.com> * Refactor warning for the deprecated 'etcd_kubeadm_enabled' variable Signed-off-by: necatican <necaticanyildirim@gmail.com>
…m_enabled variable (kubernetes-sigs#8317) * Add kubeadm option to etcd_deployment_type to replace the etcd_kubeadm_enabled variable Signed-off-by: necatican <necaticanyildirim@gmail.com> * Add etcd kubeadm deployment documentation Signed-off-by: necatican <necaticanyildirim@gmail.com> * Refactor warning for the deprecated 'etcd_kubeadm_enabled' variable Signed-off-by: necatican <necaticanyildirim@gmail.com>
…m_enabled variable (kubernetes-sigs#8317) * Add kubeadm option to etcd_deployment_type to replace the etcd_kubeadm_enabled variable Signed-off-by: necatican <necaticanyildirim@gmail.com> * Add etcd kubeadm deployment documentation Signed-off-by: necatican <necaticanyildirim@gmail.com> * Refactor warning for the deprecated 'etcd_kubeadm_enabled' variable Signed-off-by: necatican <necaticanyildirim@gmail.com>
…m_enabled variable (kubernetes-sigs#8317) * Add kubeadm option to etcd_deployment_type to replace the etcd_kubeadm_enabled variable Signed-off-by: necatican <necaticanyildirim@gmail.com> * Add etcd kubeadm deployment documentation Signed-off-by: necatican <necaticanyildirim@gmail.com> * Refactor warning for the deprecated 'etcd_kubeadm_enabled' variable Signed-off-by: necatican <necaticanyildirim@gmail.com>
…m_enabled variable (kubernetes-sigs#8317) * Add kubeadm option to etcd_deployment_type to replace the etcd_kubeadm_enabled variable Signed-off-by: necatican <necaticanyildirim@gmail.com> * Add etcd kubeadm deployment documentation Signed-off-by: necatican <necaticanyildirim@gmail.com> * Refactor warning for the deprecated 'etcd_kubeadm_enabled' variable Signed-off-by: necatican <necaticanyildirim@gmail.com>
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #8302
Special notes for your reviewer:
Does this PR introduce a user-facing change?: