<p>I am trying to run a hyperledger fabric blockchain network on kubernetes using <a href="https://github.com/IBM/blockchain-network-on-kubernetes" rel="nofollow noreferrer">https://github.com/IBM/blockchain-network-on-kubernetes</a> as the reference. In one of the steps, the atrifacts (chaincode, configtx.yaml ) are copied into the volume using the below yaml file</p>

<p><a href="https://github.com/IBM/blockchain-network-on-kubernetes/blob/master/configFiles/copyArtifactsJob.yaml" rel="nofollow noreferrer">https://github.com/IBM/blockchain-network-on-kubernetes/blob/master/configFiles/copyArtifactsJob.yaml</a></p>

<p>I am unable to understand how the files are copied into the shared persistent volume. Does the entry point command on line 24 copy the artifaces to the persistent volume? I do not see cp here. So how does the copy happen? </p>

<pre><code> command: ["sh", "-c", "ls -l /shared; rm -rf /shared/*; ls -l /shared; while [ ! -d /shared/artifacts ]; do echo Waiting for artifacts to be copied; sleep 2; done; sleep 10; ls -l /shared/artifacts; "]
</code></pre>

ilegolas
<p>Actually this job does not copy anything. It is just used to wait until copy complete.</p>

<p>Look at <a href="https://github.com/IBM/blockchain-network-on-kubernetes/blob/ee9091f7f70bb1a06bc1081d5769734a1b384f9b/setup_blockchainNetwork.sh#L81" rel="nofollow noreferrer">setup_blockchainNetwork.sh</a> script. Actual copy is happening at line 82.</p>

<pre><code>kubectl cp ./artifacts $pod:/shared/
</code></pre>

<p>This line copy content of <code>./artifact</code> into the <code>/shared</code> directory of <code>shared-pvc</code> volume.</p>

<p>The job just make sure that copy is completed before processing further task. When copy is done, the job will find the files in <code>/shared/artifacts</code> directory and will go to completion.  When the job is completed, the script proceed to further task. Look at the condition <a href="https://github.com/IBM/blockchain-network-on-kubernetes/blob/ee9091f7f70bb1a06bc1081d5769734a1b384f9b/setup_blockchainNetwork.sh#L86" rel="nofollow noreferrer">here</a>.</p>
