Chapter 8. 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.
8.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
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
$ oc get services NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) example-infinispan ClusterIP 192.0.2.0 <none> 11222/TCPCopy to Clipboard Copied! Toggle word wrap Toggle overflow
8.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 with thespec.expose.typefield. Optionally specify the network port where the service is exposed with the
spec.expose.portfield. The default port is7900.spec: expose: type: LoadBalancer port: 65535spec: expose: type: LoadBalancer port: 65535Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 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
$ oc get services | grep external NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) example-infinispan-external LoadBalancer 192.0.2.24 hostname.com 11222/TCPCopy to Clipboard Copied! Toggle word wrap Toggle overflow
8.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 with thespec.expose.typefield. Configure the port where Data Grid is exposed with the
spec.expose.nodePortfield.spec: expose: type: NodePort nodePort: 30000spec: expose: type: NodePort nodePort: 30000Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 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
$ oc get services | grep external NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) example-infinispan-external NodePort 192.0.2.24 <none> 11222:30000/TCPCopy to Clipboard Copied! Toggle word wrap Toggle overflow
8.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 with thespec.expose.typefield. Optionally add a hostname with the
spec.expose.hostfield.spec: expose: type: Route host: www.example.orgspec: expose: type: Route host: www.example.orgCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Apply the changes.
Verify that the route is available.
oc get routes NAME CLASS HOSTS ADDRESS PORTS AGE example-infinispan <none> * 443 73s
$ oc get routes NAME CLASS HOSTS ADDRESS PORTS AGE example-infinispan <none> * 443 73sCopy to Clipboard Copied! Toggle word wrap Toggle overflow
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. |
8.5. Network services Copy linkLink copied to clipboard!
Reference information for network services that Data Grid Operator creates and manages.
8.5.1. Internal service Copy linkLink copied to clipboard!
- Allow Data Grid pods to discover each other and form clusters.
- Provide access to Data Grid endpoints from clients in the same OpenShift namespace.
| Service | Port | Protocol | Description |
|---|---|---|---|
|
|
| TCP | Internal access to Data Grid endpoints |
|
|
| TCP | Cluster discovery |
8.5.2. External service Copy linkLink copied to clipboard!
Provides access to Data Grid endpoints from clients outside OpenShift or in different namespaces.
You must create the external service with Data Grid Operator. It is not available by default.
| Service | Port | Protocol | Description |
|---|---|---|---|
|
|
| TCP | External access to Data Grid endpoints. |
8.5.3. Cross-site service Copy linkLink copied to clipboard!
Allows Data Grid to back up data between clusters in different locations.
| Service | Port | Protocol | Description |
|---|---|---|---|
|
|
| TCP | JGroups RELAY2 channel for cross-site communication. |