Kubernetes is a well-established container management software used to manage containers, such as Docker. The Kubernetes Hazelcast Discovery extension provides automatic Cluster node discovery in a Kubernetes environment.
The KubernetesHazelcastDiscovery extension is useful when installing Appway and configuring Hazelcast for use in a multi-node environment. See the System Installation guide of your Appway version (e.g. System Installation (Appway 11).
Configure the Kubernetes auto-discovery mechanism before starting the extension, using the configuration properties of the extension. There are two discovery modes that can be used, configure the mode you want to employ:
Note: See
documentation for more details about the available discovery modes.
The following property applies to both discovery modes and allows you to configure a different port than the standard 5713 if necessary:
com.nm.extensions.kuberneteshazelcastdiscovery.servicePort – Defines the endpoint port of the service.
To use the Kubernetes API discovery mode, configure the following properties:
com.nm.extensions.kuberneteshazelcastdiscovery.namespace – Specifies the Kubernetes namespace where Hazelcast is running. If not specified, the value is taken from the environment variables KUBERNETES_NAMESPACE or OPENSHIFT_BUILD_NAMESPACE.com.nm.extensions.kuberneteshazelcastdiscovery.serviceName – Specifies a service name which restricts the scan to the PODs connected to the specified service. If not specified, all PODs in the namespace are checked. Alternatively, you can use:
com.nm.extensions.kuberneteshazelcastdiscovery.serviceLabelName – Specifies the name of the label used to tag services that should be part of the Hazelcast cluster.com.nm.extensions.kuberneteshazelcastdiscovery.serviceLabelValue – Specifies the value of the label used to tag services that should be part of the Hazelcast cluster.
To use the DNS Lookup discovery mode, configure the following properties:
com.nm.extensions.kuberneteshazelcastdiscovery.serviceDns (mandatory) – Specifies the service DNS, usually in the form SERVICE-NAME.NAMESPACE.svc.cluster.local.com.nm.extensions.kuberneteshazelcastdiscovery.serviceDnsTime (optional) – Defines the length of the DNS Lookup check in seconds.
Default value: 5 seconds
After completing the configuration, start the KubernetesHazelcastDiscovery extension to activate this auto-discovery mechanism. No further steps are needed.