【问题标题】:How to configure ssl for ldap/opendj while using ISTIO service mesh如何在使用 ISTIO 服务网格时为 ldap/opendj 配置 ssl
【发布时间】:2020-10-07 09:43:33
【问题描述】:

我有几个微服务,我们的后端是 opendj/ldap。它已配置为使用 SSL。现在我们正在尝试使用 ISTIO 作为我们的 k8s 服务网格。其他所有服务都可以正常工作,但 ldap 服务器 - opendj - 不是。我的猜测是因为 ssl 配置。这意味着使用自签名证书。

我有一个在 istio 命名空间中创建自签名证书的脚本,我尝试在 gateway.yaml 上像这样使用它

  - port:
      number: 4444
      name: tcp-admin
      protocol: TCP
    hosts:
    - "*"
    tls:
      mode: SIMPLE # enable https on this port
      credentialName: tls-certificate # fetch cert from k8s secret

我也试过用

apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: opendj-istio-mtls
spec:
  host: opendj.{{.Release.Namespace }}.svc.cluster.local
  trafficPolicy:
    tls:
      mode: ISTIO_MUTUAL
      credentialName: tls-certificate

---

apiVersion: authentication.istio.io/v1alpha1
kind: Policy
metadata:
  name: opendj-receive-tls
spec:
  targets:
  - name: opendj
  peers:
  - mtls: {}

对于 ldap 服务器,但它没有连接。尝试在 gateway.yaml 中使用 tls 规范时出现此错误

Error: admission webhook "pilot.validation.istio.io" denied the request: configuration is invalid: server cannot have TLS settings for non HTTPS/TLS ports

还有来自 opendj 服务器的日志


INFO - entrypoint - 2020-06-17 12:49:44,768 - Configuring OpenDJ.
WARNING - entrypoint - 2020-06-17 12:49:48,987 - 
Unable to connect to the server at
"oj-opendj-0.opendj.default.svc.cluster.local" on port 4444


WARNING - entrypoint - 2020-06-17 12:49:53,293 - 
Unable to connect to the server at
"oj-opendj-0.opendj.default.svc.cluster.local" on port 4444

有人可以帮我解决这个问题。

【问题讨论】:

    标签: ssl kubernetes ldap istio opendj


    【解决方案1】:

    要通过 TLS 连接启用非 https 流量,您必须使用协议 TLS。 TLS 意味着连接将基于 SNI 标头 路由到目的地,而不会终止 TLS 连接。您可以查看this

      - port:
          number: 4444
          name: tls
          protocol: TLS
        hosts:
        - "*"
        tls:
          mode: SIMPLE # enable https on this port
          credentialName: tls-certificate # fetch cert from k8s secret
    

    也请检查这个 istio documentation

    【讨论】:

    • 我将对此进行测试。谢谢
    猜你喜欢
    • 2021-11-14
    • 2020-01-12
    • 2020-04-09
    • 1970-01-01
    • 2015-05-05
    • 2012-05-10
    • 1970-01-01
    • 1970-01-01
    • 2020-01-09
    相关资源
    最近更新 更多