-
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 external_openstack_cacert file from host #11377
base: master
Are you sure you want to change the base?
Conversation
|
Welcome @Nathanael-Mtd! |
Hi @Nathanael-Mtd. 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-sigs/prow repository. |
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
/lgtm |
/retest |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ant31, mzaian, Nathanael-Mtd 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 |
New changes are detected. LGTM label has been removed. |
134496f
to
5060928
Compare
Hi @yankay, I made a mistake the last time with a merge request instead of rebase (but fixed since weeks), and lgtm tag was removed. Can you re-check if it's ok, and @ErikJiang can you review this PR please ? |
5060928
to
fc7d1de
Compare
Can you squash the fix commit into the first ? Except that, this should be good. |
fc7d1de
to
3a9ca13
Compare
@VannTen Done. Thank you |
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.
I missed a few things, see comments.
roles/kubernetes-apps/external_cloud_controller/openstack/tasks/main.yml
Outdated
Show resolved
Hide resolved
roles/kubernetes-apps/external_cloud_controller/openstack/tasks/main.yml
Outdated
Show resolved
Hide resolved
mode: "0640" | ||
when: | ||
- inventory_hostname == groups['kube_control_plane'][0] | ||
- external_openstack_cacert is defined |
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.
Same as above
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.
Not actually resolved, please remove the is defined check
3a9ca13
to
6b6530f
Compare
@VannTen I changed the behavior to make the same configuration as cinder by using cacert directly from hostPath instead of secret |
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.
(also, don't forge to run pre-commit before pushing (I know I always do !), it helps catch some stuff.
mode: "0640" | ||
when: | ||
- inventory_hostname == groups['kube_control_plane'][0] | ||
- external_openstack_cacert is defined |
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.
Not actually resolved, please remove the is defined check
@@ -110,3 +111,9 @@ spec: | |||
- name: cloud-config-volume | |||
secret: | |||
secretName: external-openstack-cloud-config | |||
{% if external_openstack_cacert is defined and external_openstack_cacert != "" %} |
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.
Same here
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.
Done, I think it's fine now !
ae70919
to
59be5f5
Compare
Hum, I didn't mean to remove all the check , only the `is defined` part.
The idea basically is that every time we have something like =
```yaml
when:
- some_var is defined
- some_var == 'some_value'
```
we should almost always have instead `some_var` defined to a default value in the role defaults/ folder, and only:
```
when:
- some == 'some_value'
```
Is that clearer ? And sorry for the misunderstanding
|
Yes but I tried to be coherent with cinder config before : https://github.com/kubernetes-sigs/kubespray/blob/master/roles/kubernetes-apps/csi_driver/cinder/tasks/main.yml#L13 |
Don't worry, the codebase does not follow this strictly (T_T) but it should !
That's why I ask for that kind of cleanups in review, so we can tend towards a better state.
|
Re-reading your changes, isn't that a breaking change ?
If I read correctly, changing from slurp to copy means that user who have the external_openstack_cacert on the remote host but not on the ansible control host will be in trouble, right ?
/hold
(until we clarify this)
Could we instead not change that, but define a new variable external_openstack_cacert_content (or a similar name) which would override the result of slurp ?
This would also keep the secret mount instead of the hostPath, which is not great (external cloud controller could conceivably run on different hosts than the control plane).
Thanks !
|
Hmm yeah it seems to be a breaking change. That's what I found out during my deployment |
The change appear to have been made in #7603 but I don't get why it changed from copy to slurp 🤔 |
Oh, I think that's linked to UIDs/GIDs, and I just saw that I use root user in my clusters instead of kube and kube-cert. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Same as with the in-tree openstack cloud controller, copy external_openstack_cacert file retrieved from ansible host to the control-plane for secret creation.
Does this PR introduce a user-facing change?: