0.24 通过代理安装k8s,报错

  • Choerodon平台版本: 0.24

  • 遇到问题的执行步骤:
    我们服务器在内网,不能连接互联网。
    所以设置了代理。
    export https_proxy=‘http://10.0.1.1:4321
    上面这行,加入了/etc/profile , /etc/bashrc
    并且加入了 ansible env:
    cat /etc/environment
    https_proxy=。。。
    通过ssh时,域名解析、yum安装等都没有问题。
    但通过ansible-playbook安装时报错:

  • 报错日志:
    fatal: [10.0.81.83]: FAILED! => {“changed”: false, “msg”: “Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was\n14: curl#7 - “Failed to connect to 2604:1580:fe02:2::10: Network is unreachable”\n\n\n One of the configured repositories failed (Unknown),\n and yum doesn’t have enough cached data to continue. At this point the only\n safe thing yum can do is fail. There are a few ways to work “fix” this:\n\n 1. Contact the upstream for the repository and get them to fix the problem.\n\n 2. Reconfigure the baseurl/etc. for the repository, to point to a working\n upstream. This is most often useful if you are using a newer\n distribution release than is supported by the repository (and the\n packages for the previous distribution release still work).\n\n 3. Run the command with the repository temporarily disabled\n yum --disablerepo= …\n\n 4. Disable the repository permanently, so yum won’t use it by default. Yum\n will then just ignore the repository until you permanently enable it\n again or use --enablerepo for temporary usage:\n\n yum-config-manager --disable \n or\n subscription-manager repos --disable=\n\n 5. Configure the failing repository to be skipped, if it is unavailable.\n Note that yum will try to contact the repo. when it runs most commands,\n so will have to try and fail each time (and thus. yum will be be much\n slower). If it is a very temporary problem though, this is often a nice\n compromise:\n\n yum-config-manager --save --setopt=.skip_if_unavailable=true\n\nCannot find a valid baseurl for repo: base/7/x86_64\n”, “rc”: 1, “results”: []}

请问安装k8s设置代理的正确步骤是什么?

我安装用的命令是:
ansible-playbook -i inventory.ini 90-init-cluster.yml -vv

我尝试修改了90.yaml,增加了porxy的设置,然后这个问题暂时解决了。

但这应该不是官方的做法。标准的做法应该是什么?

https://github.com/open-hand/kubeadm-ha/blob/master/docs/01-集群安装.md#部署集群

恩。管用!
谢谢!