Expose Data Grid clusters so you can access Data Grid Console, the Data Grid command line interface (CLI), REST API, and Hot Rod endpoint.
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: infinispan
-
Check that the internal service is available as follows:
oc get services
Exposing Data Grid through a LoadBalancer service
Use a LoadBalancer
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 LoadBalancer
service.
-
Include
spec.expose
in yourInfinispan
CR. -
Specify
LoadBalancer
as the service type with thespec.expose.type
field. -
Optionally specify the network port where the service is exposed with the
spec.expose.port
field.spec: expose: type: LoadBalancer port: 65535
-
Apply the changes.
-
Verify that the
-external
service is available.oc get services | grep external
Exposing Data Grid through a NodePort service
Use a NodePort
service to expose Data Grid clusters on the network.
-
Include
spec.expose
in yourInfinispan
CR. -
Specify
NodePort
as the service type with thespec.expose.type
field. -
Configure the port where Data Grid is exposed with the
spec.expose.nodePort
field.spec: expose: type: NodePort nodePort: 30000
-
Apply the changes.
-
Verify that the
-external
service is available.oc get services | grep external
Exposing Data Grid through a Route
Use an OpenShift Route
with passthrough encryption to make Data Grid clusters available on the network.
-
Include
spec.expose
in yourInfinispan
CR. -
Specify
Route
as the service type with thespec.expose.type
field. -
Optionally add a hostname with the
spec.expose.host
field.spec: expose: type: Route host: www.example.org
-
Apply the changes.
-
Verify that the route is available.
oc get routes
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. |
Network services
Reference information for network services that Data Grid Operator creates and manages.
Service | Port | Protocol | Description |
---|---|---|---|
|
|
TCP |
Access to Data Grid endpoints within the OpenShift cluster or from an OpenShift |
|
|
TCP |
Cluster discovery for Data Grid pods. |
|
|
TCP |
Access to Data Grid endpoints from a |
|
|
TCP |
JGroups RELAY2 channel for cross-site communication. |