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
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
Additional resources
6.2. Exposing Data Grid Through Load Balancers
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.expose
in yourInfinispan
CR. Specify
LoadBalancer
as the service type withspec.expose.type
.spec: ... expose: type: LoadBalancer 1 nodePort: 30000 2
- Apply the changes.
Verify that the
-external
service 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
Use a node port service to expose Data Grid clusters on the network.
Procedure
-
Include
spec.expose
in yourInfinispan
CR. Specify
NodePort
as the service type withspec.expose.type
.spec: ... expose: type: NodePort 1 nodePort: 30000 2
- Apply the changes.
Verify that the
-external
service 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
Use an OpenShift Route with passthrough encryption to make Data Grid clusters available on the network.
Procedure
-
Include
spec.expose
in yourInfinispan
CR. -
Specify
Route
as the service type withspec.expose.type
. Optionally add a hostname with
spec.expose.host
.spec: ... expose: type: Route 1 host: www.example.org 2
- 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. |