-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Modified OS detection logic when updating http proxy settings. #3587
Modified OS detection logic when updating http proxy settings. #3587
Conversation
/assign @justinsb |
There was a comment mentioning moving all this logic to nodeup. I don't think this should be the case, as you may require the proxy settings to be set to pull down the nodeup binary. So I've only moved the docker config part into nodeup which cleans up the bootstrap logic a little. |
pkg/model/bootstrapscript.go
Outdated
buffer.WriteString("echo DefaultEnvironment=\\\"http_proxy=${http_proxy}\\\" \\\"https_proxy=${http_proxy}\\\"") | ||
buffer.WriteString(" \\\"NO_PROXY=${no_proxy}\\\" \\\"no_proxy=${no_proxy}\\\"") | ||
buffer.WriteString(" >> /etc/systemd/system.conf\n") | ||
buffer.WriteString("echo \"export http_proxy=" + httpProxyURL + "\" >> /etc/environment\n") |
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.
perhaps using `` so you don't need to blackslash
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.
Yeah I did think initially about doing this, all the backslashes make it difficult to read. I'll fix up and test..
other than the one comment ... looks good |
89da146
to
4b876e5
Compare
Applied the suggested fix, no changes to the generated bootstrap config and seems to work. Cheers @gambol99 👍 |
d249c0a
to
0b356b7
Compare
/retest |
0b356b7
to
ce517f3
Compare
which OS's have you tested this on? |
Hi @chrislovecnm, I have tested this successfully with the following images:
|
Can we get RHEL or fedora tested :) We have RHEL customers using this feature. |
Sure, I've given this a go with the following images:
CentOS worked fine. Fedora failed, however this is for an unrelated reason. The above Fedora image falls into the following code block, however it is unsuccessfully detected and so nodeup fails: https://github.com/kubernetes/kops/blob/master/nodeup/pkg/distros/identify.go#L92 I can add support for this, but I think it makes sense to do as a separate PR. What do you think? |
Separate pr ;) |
You may not want to run atomic, just vanilla |
Ah ok, just tried with the following Fedora image and same issue:
I'll get another PR raised for Fedora support. |
ce517f3
to
c78790f
Compare
@chrislovecnm so it turns out the egressProxy functionality never worked successfully with RHEL (both pre and post-PR), because for some reason it didn't load the I've added a fix for this (source the environment file in the kops-configuration service) and tested successfully with the following image:
|
/test pull-kops-e2e-kubernetes-aws Not sure why that failed, the last update was an inclusion of |
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.
As always awesome work!!
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chrislovecnm The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. |
Thanks! :) |
Reduce duplication in configuring http proxy settings by writing it to the system-wide
/etc/environment
file and sourcing this in accordingly for the different services (docker, package management).I have tested and this now correctly covers CoreOS by resolving the following bugs (I don't believe any issues were raised for these):
/etc/sysconfig/docker
as opposed to/etc/default/docker
/etc/lsb-release
file exists for CoreOS, so the bootstrap script was incorrectly attempting to write proxy settings into the apt proxy config fileThese changes should cover CoreOS, Debian, Ubuntu, RedHat distributions including CentOS and Fedora.
NOTE: A nodeup image will need to be built for these changes to work as expected, as now we rely on nodeup to update the proxy settings within the docker config (by sourcing in the env vars set within
/etc/environment
.