【问题标题】:Proxy configuration for OpenShift OriginOpenShift Origin 的代理配置
【发布时间】:2016-02-22 15:32:54
【问题描述】:

我正在设置一个 OpenShift 源服务器。我所做的配置很大程度上依赖于演练描述:

https://github.com/openshift/origin/blob/master/examples/sample-app/README.md

创建项目后,我添加了一个这样的新应用(成功):

oc new-app centos/ruby-22-centos7~https://github.com/openshift/ruby-hello-world.git

OpenShift 尝试立即构建,但失败如下:

F0222 15:24:58.504626 1 builder.go:204] 错误:构建错误:致命:无法访问“https://github.com/openshift/ruby-hello-world.git/”:无法连接到 github.com:443;连接被拒绝

我查阅了有关代理配置的文档:

https://docs.openshift.com/enterprise/3.0/admin_guide/http_proxies.html#git-repository-access

得出的结论是,我可以简单地编辑此特定应用程序的 YAML 描述符以包含我的公司代理。

...
source:
  type: Git
  git:
    uri: "git://github.com/openshift/ruby-hello-world.git"
    httpProxy: http://proxy.example.com
    httpsProxy: https://proxy.example.com
...

随着该更改,构建继续进行。

可以在系统范围内配置 HTTP 代理吗?

注意:同样,我只是下载了二进制文件(客户端、服务器),并没有通过 ansible 安装。而且我没有在我的服务器二进制文件夹中找到相关的属性 openshift.local.config 文件夹。

【问题讨论】:

    标签: rhel openshift-origin


    【解决方案1】:

    一段时间后,我现在知道的足以回答我自己的问题了。 有两个地方需要处理公司代理设置。

    Docker 本帖会详细告诉你该怎么做:

    Cannot download Docker images behind a proxy

    在 RHEL 7.2 上,我需要编辑此文件:/etc/sysconfig/docker 我必须添加以下条目:

    HTTP_PROXY="http://proxy.company.com:4128"
    HTTPS_PROXY="http://proxy.company.com:4128"
    

    然后需要重启 docker 服务。

    源代理 我最初错过的是配置我们公司代理设置的地方。目前我通过 ansible 安装了一个集群(1 个主节点,1 个节点)。

    这些是要在服务器上编辑的相关文件: * /etc/sysconfig/origin-master * /etc/sysconfig/origin-node

    此文件中已有占位符:

    #NO_PROXY=master.example.com
    #HTTP_PROXY=http://USER:PASSWORD@IPADDR:PORT
    #HTTPS_PROXY=https://USER:PASSWORD@IPADDR:PORT
    

    文档:

    https://docs.openshift.org/latest/install_config/http_proxies.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-02-11
      • 1970-01-01
      • 1970-01-01
      • 2018-09-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多