= KUBE_PING
JGroups `Kube_PING` uses a Kubernetes API to discover {brandname} cluster
members in environments such as OKD and Red Hat OpenShift.

.KUBE_PING configuration example
[source,xml,options="nowrap",subs=attributes+]
----
include::config_examples/kubeping.xml[]
----

.KUBE_PING configuration requirements

* Your `KUBE_PING` configuration must bind the JGroups stack to the `eth0`
network interface. Docker containers use `eth0` for communication.
* `KUBE_PING` uses environment variables inside containers for configuration.
The `KUBERNETES_NAMESPACE` environment variable must specify a valid namespace.
You can either hardcode it or populate it via the Kubernetes Downward API.
* `KUBE_PING` requires additional privileges on Red Hat OpenShift. Assuming that `oc project -q` returns the current namespace and `default` is the service account name, you can run:
+
[source,bash]
----
include::oc_examples/oc_policy_add_role_user.adoc[]
----

.Reference

* link:http://www.jgroups.org/manual4/index.html#_kube_ping[JGroups Kube_PING]
* link:https://github.com/kubernetes/kubernetes/tree/release-1.0/docs/user-guide/downward-api[Kubernetes Downward API]
* link:https://docs.docker.com/engine/userguide/networking/dockernetworks/[Docker Networking]
