<p>I am doing a setup of fabric using multinode environment with dynamic provision (dynamic pod allocation) over google cloud platform using native kubernetes engine.</p>

<p>I am using helm for the deployment . So let me tell you the entity which are running successfully .</p>

<p>1-> 1 Orderer with pod name <code>ord1-hlf-ord-54bbffd6f7-4qtxd</code></p>

<p>2-> 1 couchdb with pod name <code>cdb-peer1-hlf-couchdb-7cf88678b8-74426</code></p>

<p>3-> 1 peer with pod name <code>peer1-hlf-peer-6c5f6886d4-wrddj</code></p>

<p>Till now everything is fine . Let me paste the results of some useful commands below </p>

<p><code>kubectl get nodes</code></p>

<pre><code>master    Ready    master   138m   v1.14.1
worker1   Ready    &lt;none&gt;   135m   v1.14.1
</code></pre>

<p><code>kubectl get ns</code></p>

<pre><code>default           Active   141m
kube-node-lease   Active   141m
kube-public       Active   141m
kube-system       Active   141m
orderers          Active   122m
peers             Active   122m
</code></pre>

<p><code>kubectl get pods -n peers</code>   </p>

<pre><code>cdb-peer1-hlf-couchdb-7cf88678b8-74426   1/1     Running   0          114m
peer1-hlf-peer-6c5f6886d4-wrddj          1/1     Running   0          33m     
</code></pre>

<p><code>kubectl get pods -n orderers</code>    </p>

<pre><code>NAME                            READY   STATUS    RESTARTS   AGE
ord1-hlf-ord-54bbffd6f7-4qtxd   1/1     Running   0          120m
</code></pre>

<p><code>kubectl get svc -A</code>  </p>

<pre><code>NAMESPACE     NAME                    TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                  AGE
default       kubernetes              ClusterIP   10.96.0.1        &lt;none&gt;        443/TCP                  144m
kube-system   kube-dns                ClusterIP   10.96.0.10       &lt;none&gt;        53/UDP,53/TCP,9153/TCP   144m
kube-system   tiller-deploy           ClusterIP   10.111.43.221    &lt;none&gt;        44134/TCP                138m
orderers      ord1-hlf-ord            ClusterIP   10.105.9.161     &lt;none&gt;        7050/TCP                 121m
peers         cdb-peer1-hlf-couchdb   ClusterIP   10.99.87.182     &lt;none&gt;        5984/TCP                 117m
peers         peer1-hlf-peer          ClusterIP   10.110.219.142   &lt;none&gt;        7051/TCP,7053/TCP        35m
</code></pre>

<p>now as you can see that orderer is running with service name <code>ord1-hlf-ord</code> so I am following the kubernetes pattern to connect this as <code>service-name.namespace.svc.cluster.local</code> so I am trying to connect orderer on <code>ord1-hlf-ord.orderers.svc.cluster.local:7050</code> In the below command :</p>

<pre><code>kubectl exec -n peers $PEER_POD -- su -c "CORE_PEER_MSPCONFIGPATH=/var/hyperledger/admin_msp peer channel create -o ord1-hlf-ord.orderers.svc.cluster.local:7050 -c mychannel -f /hl_config/channel/channel.tx" 
</code></pre>

<p>But I am not able to connect to orderer </p>

<p>One more thing I want to tell you that when I am entering into the peer pod using command <code>kubectl exec -it peer1-hlf-peer-6c5f6886d4-wrddj bash -n peers</code> and trying to run <code>apt-get update</code> , So that by installing ping I can check that peer is able to ping orderer or not then I am getting error </p>

<pre><code>root@peer1-hlf-peer-6c5f6886d4-wrddj:/# apt-get update
Err:1 http://security.ubuntu.com/ubuntu xenial-security InRelease        
  Temporary failure resolving 'security.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu xenial InRelease                  
  Temporary failure resolving 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Reading package lists... Done        
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
</code></pre>

<p>If anyone faced this issue of having knowledge about the cause of issue then please let me know.</p>

<p>Thanks in advance</p>

Pankaj Cheema
<p>If it is working while applying the <code>orderer</code> IP address. Then probably try entering an entry for it in your <code>/etc/hosts</code> file. The entry will look like </p>

<pre><code>    10.105.9.161 ord1-hlf-ord.orderers.svc.cluster.local
</code></pre>

<p>This should allow you to resolve DNS, you can check this by pinging <code>ord1-hlf-ord.orderers.svc.cluster.local</code>  </p>
