<p>They should able to communicate and update should visible to each other i mean mainly syncing. </p>

<blockquote>
  <p>DiscoveryStrategyConfig strategyConfig = new DiscoveryStrategyConfig(factory);
  Blockquote</p>
  
  <p>//        strategyConfig.addProperty("service-dns",
  "my-serice-name.my-namespace.svc.cluster.local");
  //        strategyConfig.addProperty("service-dns-timeout", "300");</p>
  
  <p>strategyConfig.addProperty("service-name", "my-service-name");
        strategyConfig.addProperty("service-label-name",
  "my-service-label");
        strategyConfig.addProperty("service-label-value", true);
        strategyConfig.addProperty("namespace", "my-namespace");</p>
</blockquote>

<p>I have followed the <a href="https://github.com/hazelcast/hazelcast-kubernetes.I" rel="nofollow noreferrer">https://github.com/hazelcast/hazelcast-kubernetes.I</a> have used the first approach was able to see the instance(per pod not in one members list) but they were not communicating (if I am doing crud in one hazel instance it's not reflecting in other). I want to use DNS strategy but was not able to create the instance only.</p>

Samrat Roy
<p>Please check the followings:</p>
<h2>1. Discovery Strategy</h2>
<p>For Kubernetes you need to use the <code>HazelcastKubernetesDiscoveryStrategy</code> class. It can be defined in the XML configuration or in the code (as in your case).</p>
<h2>2. Labels</h2>
<p>Check that the service for your Hazelcast cluster has the labels you specified. The same when it comes to the service name and namespace.</p>
<h2>3. Configuration</h2>
<p>There are two ways to configure the discovery: <strong>DNS Lookup</strong> and <strong>REST API</strong>. Each has special requirements. You mentioned DNS Lookup, but the configuration you've sent actually uses REST API.</p>
<h3>DNS Lookup</h3>
<p>Your Hazelcast cluster service must be <strong>headless ClusterIP</strong>.</p>
<pre><code>    spec:
      type: ClusterIP
      clusterIP: None
</code></pre>
<h3>REST API</h3>
<p>You need to grant access for you app to access Kubernetes API. Please check: <a href="https://github.com/hazelcast/hazelcast-code-samples/blob/master/hazelcast-integration/kubernetes/rbac.yaml" rel="nofollow noreferrer">https://github.com/hazelcast/hazelcast-code-samples/blob/master/hazelcast-integration/kubernetes/rbac.yaml</a></p>
<h2>Other helpful resources</h2>
<ul>
<li><a href="https://github.com/hazelcast/hazelcast-code-samples/blob/master/hazelcast-integration/kubernetes/" rel="nofollow noreferrer">Hazelcast Kubernetes Code Sample</a></li>
<li><a href="https://github.com/hazelcast/hazelcast-code-samples/tree/master/hazelcast-integration/openshift/client-apps/ocp-demo-frontend" rel="nofollow noreferrer">Hazelcast OpenShift Client app</a> (should also work in Kubernetes)</li>
</ul>
