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
Fix work yum in Install packages requirements for bootstrap #3630
Conversation
…e/7/x86_64 if Install packages in CentOS using proxy
If you have proxy needed for yum it should be already configured within yum.conf, at least our node provision does that, and then you don't need such env here |
I understand you. I need enter to every node and change file yum.conf before run kubespray? |
@patsevanton it would be provision job, if you do that manually then yes. |
@Atoms Add proxy to /etc/yum.conf if http_proxy is defined |
Check commit Add proxy to /etc/yum.conf if http_proxy is defined `TASK [bootstrap-os : Add proxy to /etc/yum.conf if http_proxy is defined] *********************************************************************** TASK [bootstrap-os : Install packages requirements for bootstrap] ******************************************************************************* TASK [bootstrap-os : Install pip for bootstrap] ************************************************************************************************* Line in /etc/yum.conf
PR work, kuberspray installed kubernetes |
ci check this |
ERROR: Job failed: image pull failed: Back-off pulling image "quay.io/kubespray/kubespray:v2.7" |
All tests passed :) |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Atoms 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 |
Hi, The second option worked for us before the change to yum proxy was made 8 days ago. |
Are you using proxy like squid? |
yeah we are using squid as proxy server at the moment. |
kuberspray did work before merge? |
it failed at bootstrap-os tasks fatal: [somehostname]: FAILED! => { |
Were you set proxy (for playbook)? |
the proxy were set in inventory/sample/group_vars/all/all.yml Set these proxy values in order to update package manager and docker daemon to use proxies Refer to roles/kubespray-defaults/defaults/main.yml before modifying no_proxy |
here is the config we have: #my proxy setting ` [Service] and nothing set in /etc/yum.conf |
I think this custom setting. Let try install kubespray without
but before run:
|
If we comment out the task "Add proxy to /etc/yum.conf..." it works for us. |
Without
dont work without /etc/profile.d/proxy.sh /etc/profile.d/proxy.sh - this is custom settings. Need create clean OS without /etc/profile.d/proxy.sh and try install kubespray. |
1 similar comment
@puthi Are you agree at your configuration if i create new Pull Request where create /etc/profile.d/proxy.sh (when run kubespray) with proxy setting and delete line proxy in /etc/yum.conf ?? |
Yeah I think that would work for environment which require proxy. |
In my opinion, we never used Story about our infra - We manage all OS repos with ansible, and we have |
If I understand correctly, yum use curl and curl respect those environment variables. We have this setup working in our environment too. But like I mentioned in my first comment, if you want to be safe you can only add yum proxy to your own repository(docker.repo, peel.repo...) instead of setting it globally for yum. |
Also just to add a bit more, the /etc/profile.d/proxy.sh is executed when the machine startup so all of the users will have those environment variables. But again I’m ok to have yum proxy at /etc/yum.repos.d/ but not at yum.conf level. |
I see 2 way:
What do you think? |
@patsevanton doing something like that might be a bit hassle i think, as you have to do that 4 steps every times your ansible task need to work with yum. As for why only docker.repo and epel.repo is because in our environment we have our server deployment with local repo configured by default so there is no need to talk to internet and only the docker.repo,epel.repo... from kubespray that need the external repo. In fact we can host all the docker packages and it dependencies locally but because there is no option to tell kubespray to do so(correct me if i miss something here) that is why we whitelist the repo and allow our server to connect to internet. |
@patsevanton not sure i get you, so you use /etc/profile.d/proxy.sh and run kubespray playbooks(cluster.yml) and it failed? Or you use yum to install kubespary(eg. yum install -y kubespray) and it failed? |
@puthi Try https://github.com/patsevanton/kubespray - I Refactored add proxy for CentOS |
@patsevanton i will try it out on Monday and let you know the result. |
@patsevanton i tried on my environment but it doesn't work. And the reason is because we have our /etc/yum.repos.d/CentOS-.repo content comment out and if you just add proxy line at the end of each repo ( [base,update,...] ) it will just failed, probably from the wrong format of the .repo file or somehting. So i have to remove the task where you touch all of the CentOS-.repo to make it work for me. But this is very specific to my environment, i'm not sure if there is a better to give general user a more flexible option. How about give user a flag like yum_proxy_enable = true/false in all.yml and let user decide wither they want kubespray to add the yum proxy for them or not? |
@puthi Are you have /etc/yum.repos.d/CentOS-Base.repo?
|
here u go DISABLED BY REPO PKG## CentOS-Base.repo |
but this is very specific to my environment, it probably not work for everyone if u just update the code for my environment |
it is standard CentOS-Base.repo.
|
previous comment is my actually CentOS-Base.repo basically we don't use CentOS-Base.repo at all, that is why it is comment out. |
|
here is the list of all files in /etc/yum.repos.d/ ls -al /etc/yum.repos.d/ total 92 |
run kubespray from https://github.com/patsevanton/kubespray + set proxy and show output error |
here is the error TASK [bootstrap-os : Install packages requirements for bootstrap] *********************************************************************************************************************************************************** |
@puthi please send CentOS-Base.repo before run kubespray and after run kubespray to my email patsev.anton @ gmail.com |
@patsevanton email sent. |
I try install kubespray using proxy
Set
If run kubespray without environment: "{{proxy_env}}" in Install packages requirements for bootstrap - get error
Task Install packages requirements for bootstrap dont work with proxy
This PR added environment: "{{proxy_env}}" to Install packages requirements for bootstrap