【问题标题】:Use https with HCL Connections Component Pack 6.5 from IHS to K8S从 IHS 到 K8S 将 https 与 HCL Connections Component Pack 6.5 一起使用
【发布时间】:2020-03-04 13:43:11
【问题描述】:

Component Pack documentation 使用 http 从 IHS 连接到 Kubernetes 后端。这不再是最新的了,所以我想在这些后端连接以及 IHS 中使用 https,如下所示:

User <----- https -----> IHS <----- https -----> K8S Backend

根据 HCL 文档,我们得到了

User <----- https -----> IHS <----- http -----> K8S Backend

Component Packs ingress 没有记录 https 的任何配置选项。

【问题讨论】:

    标签: kubernetes ibm-connections ibmhttpserver hcl-component-pack


    【解决方案1】:

    我打开图表并查看它的默认值values.yml。 IBM/HCL 似乎没有遵循 Helm 模板,该模板允许使用 ingress.tls 在几乎任何图表中配置 https。

    唯一可能的方法似乎是像这样手动修改我们的入口资源:

    1. kubectl edit ing cnx-ingress-orient-me
    2. 用子域替换*(例如ing):- host: ing.k8s.internal
    3. spec 中添加tls 部分:
     tls:
      - hosts:
        - ing.k8s.internal
    
    1. 保存更改并使用 https 验证您的入口是否可用,例如使用 comp

      curl "https://ing.k8s.internal/social/views/login.html" --head 应该返回 HTTP/2 200

    我们需要为所有部署的入口资源重新发送此信息。部署所有功能后,有 4 个:

    $ kging | grep -v NAME | awk '{print $1}'
    cnx-ingress-appreg
    cnx-ingress-orient-me
    cnx-ingress-sanity
    external-service
    

    自动化

    还可以通过将入口导出到文件来自动执行这些更改:

    kubectl get ing cnx-ingress-orient-me -o yaml > /tmp/ing.yml
    

    不,我们可以使用 sed 搜索/替换

    # Replaces the general HTTP listen hostname
    sed -i "s/host: '\*\./ing./g" /tmp/ing.yml
    # Adds tls-tree with corresponding indention
    sed "s/\(\s*\)\(rules:\)/tls:\n\1- hosts:\n\1\1- ing.k8s.internal\n\1\2/g" /tmp/ing.yml
    

    应用我们的更改:

    kubectl replace -f /tmp/ing.yml
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多