<p>I am trying to run the Fabric 2.0 test-network in Kubernetes (locally, in minikube) and am facing an issue with the installing or running of the chaincode by the peers (in a docker container, it seems).</p>

<p>I created kubernetes files based on the docker-compose-test-net.yaml and successfully deployed the network, generated the crypto material, created and joined the channel, installed the chaincode on the peers, commited its definition. But when I try to invoke it, I have the following error:</p>

<pre><code>Error: endorsement failure during invoke. response: status:500 message:"error in simulation:
failed to execute transaction 68e996b0d17c210af9837a78c0480bc7ba0c7c0f84eec7da359a47cd1f5c704a:
could not launch chaincode fabcar_01:bb76beb676a23a9be9eb377a452baa4b756cb1dc3a27acf02ecb265e1a7fd3df:
chaincode registration failed: container exited with 0"
</code></pre>

<p>I included in that pastebin the logs of the peer. We can see in there that it starts the container, but then I don't understand what happens with it: <a href="https://pastebin.com/yrMwG8Nd" rel="nofollow noreferrer">https://pastebin.com/yrMwG8Nd</a></p>

<hr>

<p>I then tried as explained here: <a href="https://github.com/IBM/blockchain-network-on-kubernetes/issues/27" rel="nofollow noreferrer">https://github.com/IBM/blockchain-network-on-kubernetes/issues/27</a>. Where they say that</p>

<blockquote>
  <p>IKS v1.11 and onwards now use containerd as its container runtime
  instead of the docker engine therefore using docker.sock is no longer
  possible.</p>
</blockquote>

<p>And they propose to deploy a docker pod (dind) with <a href="https://github.com/IBM/blockchain-network-on-kubernetes/blob/master/configFiles/docker.yaml" rel="nofollow noreferrer">that file</a> and <a href="https://github.com/IBM/blockchain-network-on-kubernetes/blob/master/configFiles/docker-volume.yaml" rel="nofollow noreferrer">that file</a> and change the occurences of unix:///host/var/run/docker.sock to tcp://docker:2375.</p>

<p>But then I have the following error when I try to install the chaincode:</p>

<pre><code>Error: chaincode install failed with status:
500 - failed to invoke backing implementation of 'InstallChaincode':
could not build chaincode:
docker build failed:
docker image inspection failed:
cannot connect to Docker endpoint
</code></pre>

<p>So it seems it cannot connect to the Docker endpoint. But I cannot find how to fix this.</p>

<p>If you have an idea, it would help a lot!</p>

<p>I found my issue:</p>

<p>For the peers, I was setting:</p>

<pre><code>- name: CORE_PEER_CHAINCODEADDRESS
  value: peer0-org1-example-com:7052
- name: CORE_PEER_CHAINCODELISTENADDRESS
  value: 0.0.0.0:7052
</code></pre>

<p>like they do for the test-network with docker-compose.</p>

<p>Removing those made it work. I guess there were important for the docker-compose setup, but not adequate for kubernetes.</p>
