6.3. 为 Hot Rod 创建外部路由
在 OpenShift 访问数据网格 pod 的外部热 Rod 客户端通过带有 passthrough 终止的路由。
先决条件
- 配置 Data Grid Server 以加密客户端连接。
流程
创建具有
passthrough终止的路由。oc create route passthrough ${ROUTE_NAME} \ --port=hotrod \ --service ${APPLICATION_NAME}$ oc create route passthrough ${ROUTE_NAME} \ --port=hotrod \ --service ${APPLICATION_NAME}Copy to Clipboard Copied! Toggle word wrap Toggle overflow 例如:
oc create route passthrough cache-service-hotrod-route \ --port=hotrod \ --service cache-service
$ oc create route passthrough cache-service-hotrod-route \ --port=hotrod \ --service cache-serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow 从
.spec.host获取 Hot Rod 路由主机名。oc get route cache-service-hotrod-route -o jsonpath="{.spec.host}" cache-service-hotrod-route-rhdg-helloworld.192.0.2.0.nip.io$ oc get route cache-service-hotrod-route -o jsonpath="{.spec.host}" cache-service-hotrod-route-rhdg-helloworld.192.0.2.0.nip.ioCopy to Clipboard Copied! Toggle word wrap Toggle overflow