12.2. 通过 LoadBalancer 服务公开 Data Grid

使用 LoadBalancer 服务使 Data Grid 集群可供 OpenShift 外部运行的客户端使用。

注意

要使用未加密的 Hot Rod 客户端连接访问数据网格,您必须使用 LoadBalancer 服务。

流程

  1. Infinispan CR 中包含 spec.expose
  2. 使用 spec.expose.type 字段将 LoadBalancer 指定为服务类型。
  3. (可选)指定服务通过 spec.expose.port 字段公开的网络端口。

    spec:
      expose:
        type: LoadBalancer
        port: 65535
  4. 应用更改。
  5. 验证 -external 服务是否可用。

    oc get services | grep external