OpenShift-nginx pod作为SSL终端和负载平衡器

OpenShift-nginx pod作为SSL终端和负载平衡器,nginx,openshift,reverse-proxy,kubernetes-pod,Nginx,Openshift,Reverse Proxy,Kubernetes Pod,在过去,我在Ubuntu上为nginx使用了以下配置文件。它做了以下工作: SSL终端 负载平衡器 插入自定义标头X-Nginx-header 记录调用 我想用部署为OpenShift集群中的pod的nginx复制相同的功能。我可以看到OpenShift集群目录中列出的nginx。当我尝试启动一个存储库时,它显示了GitHub存储库的一个字段,其中包含一个示例存储库- 如何将此存储库用于上面显示的配置文件?可以找到此映像的nginx 1.14版本的文档 这是一个图像。s2i是一种构建机制,它获取

在过去,我在Ubuntu上为
nginx
使用了以下配置文件。它做了以下工作:

  • SSL终端
  • 负载平衡器
  • 插入自定义标头
    X-Nginx-header
  • 记录调用
  • 我想用部署为OpenShift集群中的pod的
    nginx
    复制相同的功能。我可以看到OpenShift集群目录中列出的
    nginx
    。当我尝试启动一个存储库时,它显示了GitHub存储库的一个字段,其中包含一个示例存储库-


    如何将此存储库用于上面显示的配置文件?

    可以找到此映像的nginx 1.14版本的文档

    这是一个图像。s2i是一种构建机制,它获取源代码(在您的情况下是nginx配置)和基本s2i映像(在您的情况下是sclorg nginx contianer映像),并生成运行时映像(在您的情况下是带有配置的nginx映像)

    基于该nginx s2i映像的上述文档,如果您将s2i构建过程指向VCS存储库(或本地目录),其中包含以下任何文件,nginx s2i builder映像将自动使用这些文件以生成配置的运行时容器映像

    ./nginx.conf-- The main nginx configuration file
    
    ./nginx-cfg/*.conf
    Should contain all nginx configuration we want to include into image
    
    ./nginx-default-cfg/*.conf
    Contains any nginx config snippets to include in the default server block
    
    ./nginx-start/*.sh
    Contains shell scripts that are sourced right before nginx is launched
    
    ./
    Should contain nginx application source code
    

    在您的情况下,这意味着您可以将配置放在
    nginx.conf
    文件中覆盖整个nginx配置,或者放在
    /nginx cfg/*.conf
    文件中,将配置添加到默认的nginx.conf文件中。

    我从
    oc new app开始centos/nginx-112-centos7~https://github.com/user/repo.git
    其中,回购协议的根目录为
    nginx.conf
    。但是,我没有看到它包含在pod中,pod永远处于运行状态,没有日志。s2i构建的日志是什么?脚本应该在构建过程中输出信息,让您知道它是否拾取了您的文件。您还应该能够在正在运行的容器中找到该文件。使用
    newapp
    命令,生成日志(
    oclogs-fbc/repo
    )显示推送成功。部署似乎未完成…运行时映像在启动时出现问题。我要检查的第一个地方是nginx是否在运行时映像中启动,以及配置是否良好。如果您在OpenShift内部部署此功能,pod将在崩溃之前拥有日志。您可以在UI内部或通过
    oc get logs
    ./nginx.conf-- The main nginx configuration file
    
    ./nginx-cfg/*.conf
    Should contain all nginx configuration we want to include into image
    
    ./nginx-default-cfg/*.conf
    Contains any nginx config snippets to include in the default server block
    
    ./nginx-start/*.sh
    Contains shell scripts that are sourced right before nginx is launched
    
    ./
    Should contain nginx application source code