This repository contains Kubernetes Ping protocol for JGroups. The protocol can also be used in OpenShift v3 environment (which is also based on Kubernetes).
In order to run JGroups discovery on Kubernetes one needs to add necessary dependencies to the project:
<dependency>
<groupId>org.jgroups.kubernetes</groupId>
<artifactId>kubernetes</artifactId>
<version>${version.kubernetes-ping}</version>
</dependency>
It is highly recommended to use JGroups version which is transitively pulled by the Kubernetes discovery protocol (however it is not strictly required).
When deploying on OpenShift v3, the next step requires adding additional privileges using the following command:
oc policy add-role-to-user view system:serviceaccount:$(oc project -q):default -n $(oc project -q)
Thant’s it!
The configuration is mainly done using environmental variables:
Variable name |
Meaning |
Default |
Example |
OPENSHIFT_KUBE_PING_NAMESPACE |
Namespace used for discovery |
<not set> |
Cluster-1 |
OPENSHIFT_KUBE_PING_LABELS |
Labels used for discovery |
default |
my-cluster |
OPENSHIFT_KUBE_PING_SERVER_PORT |
Port used for hosting internal server |
8888 |
my-cluster |