Chapter 6. Configuring Network Access to Data Grid
Expose Data Grid clusters so you can access Data Grid Console, the Data Grid command line interface (CLI), REST API, and Hot Rod endpoint.
6.1. Getting the Service for Internal Connections Copy linkLink copied to clipboard!
By default, Data Grid Operator creates a service that provides access to Data Grid clusters from clients running on OpenShift.
This internal service has the same name as your Data Grid cluster, for example:
metadata:
name: example-infinispan
Procedure
Check that the internal service is available as follows:
$ oc get services NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) example-infinispan ClusterIP 192.0.2.0 <none> 11222/TCP
6.2. Exposing Data Grid Through Load Balancers Copy linkLink copied to clipboard!
Use a load balancer service to make Data Grid clusters available to clients running outside OpenShift.
To access Data Grid with unencrypted Hot Rod client connections you must use a load balancer service.
Procedure
-
Include
spec.exposein yourInfinispanCR. Specify
LoadBalanceras the service type withspec.expose.type.spec: ... expose: type: LoadBalancer1 nodePort: 300002 - Apply the changes.
Verify that the
-externalservice is available.$ oc get services | grep external NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) example-infinispan-external LoadBalancer 192.0.2.24 hostname.com 11222/TCP
6.3. Exposing Data Grid Through Node Ports Copy linkLink copied to clipboard!
Use a node port service to expose Data Grid clusters on the network.
Procedure
-
Include
spec.exposein yourInfinispanCR. Specify
NodePortas the service type withspec.expose.type.spec: ... expose: type: NodePort1 nodePort: 300002 - Apply the changes.
Verify that the
-externalservice is available.$ oc get services | grep external NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) example-infinispan-external NodePort 192.0.2.24 <none> 11222:30000/TCP
6.4. Exposing Data Grid Through Routes Copy linkLink copied to clipboard!
Use an OpenShift Route with passthrough encryption to make Data Grid clusters available on the network.
Procedure
-
Include
spec.exposein yourInfinispanCR. -
Specify
Routeas the service type withspec.expose.type. Optionally add a hostname with
spec.expose.host.spec: ... expose: type: Route1 host: www.example.org2 - Apply the changes.
Verify that the route is available.
$ oc get routes NAME CLASS HOSTS ADDRESS PORTS AGE example-infinispan <none> * 443 73s
Route ports
When you create a route, it exposes a port on the network that accepts client connections and redirects traffic to Data Grid services that listen on port 11222.
The port where the route is available depends on whether you use encryption or not.
| Port | Description |
|---|---|
|
| Encryption is disabled. |
|
| Encryption is enabled. |