<p>I have been working in Kubernetes for a while and I have a docker image of wildfly application. In the stanalone.xml of the wildfly, the connection to datasources are defined as follows:</p>
<pre><code>&lt;datasource jta=&quot;true&quot; jndi-name=&quot;java:/DB&quot; pool-name=&quot;DB&quot; enabled=&quot;true&quot; use-ccm=&quot;true&quot;&gt;
                    &lt;connection-url&gt;jdbc:mysql://IP:3306/DB_NAME?zeroDateTimeBehavior=convertToNull&amp;amp;autoReconnect=true&lt;/connection-url&gt;
                    &lt;driver-class&gt;com.mysql.cj.jdbc.Driver&lt;/driver-class&gt;
                    &lt;driver&gt;mysql&lt;/driver&gt;
                    &lt;security&gt;
                        &lt;user-name&gt;root&lt;/user-name&gt;
                        &lt;password&gt;root&lt;/password&gt;
                    &lt;/security&gt;
                &lt;/datasource&gt;
</code></pre>
<p>I have one worker node and 2 replicas of the same pod are running in it. But currently i observed that internet is not able to reach my pods. I am trying with</p>
<blockquote>
<p>ping google.com</p>
</blockquote>
<p>It is not giving response as expected. Already I am using <strong>LoadBalancer</strong> services to expose the ports.</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: re-demo
  namespace: default
spec:
  type: LoadBalancer 
  selector: 
    app: re-demo
  ports:
  - port: 9575 
    targetPort: 9575
    nodePort: 32756
  externalTrafficPolicy: Cluster 
</code></pre>
<p>How can I solve this ??</p>

Bruce wayne - The Geek Killer
<p>There was mistake when I set up the cluster.</p>
<pre><code>kubeadm init --apiserver-advertise-address 10.128.0.12 --pod-network-cidr=10.244.0.0/16
</code></pre>
<p>cidr address we should give just like what we have in our <strong>kube_flannel.yaml</strong> file. If you want to change the ip adress in the cidr, then first make changes in the <code>kube_flannel.yaml</code> file.</p>
<p>Otherwise, it will result in the no internet availability of the pods. And we need to use the <code>hostNetwork =true</code> property for internet connection, but which turn prevents us some running more than one replica of same pod in the same node.</p>
