minifabric icon indicating copy to clipboard operation
minifabric copied to clipboard

Move tool container from local to k8s when using k8s

Open litong01 opened this issue 3 years ago • 5 comments

Currently the tool container (cli) is deployed on the local machine when deploy Fabric onto k8s. which in later deployment may hard to keep track where the tool container is. If that container gets deployed onto k8s running with peer or orderer nodes, the system will be easier to work with.

litong01 avatar May 17 '21 19:05 litong01

@itaru2622, you wanna to take a look at this one?

litong01 avatar May 17 '21 19:05 litong01

@litong01 hmm. actually, I thought almost the same matter, but unfortunately it is hard for me to work this issue in my current situation.

itaru2622 avatar May 19 '21 23:05 itaru2622

@litong01 I investigated this issue, related to #240 and found some...

in current minifabric architecture, two conatainers (minifab and fabric-tools) sync files via docker volume mount. to solve this matter, followings are needed:

A) boot fabric-tools container on k8s
B) send(sync)  vars/run/* script  from minifab before executing it on fabric-tools container
   I'm not sure if it needs to send back execution output file from fabric-tools to minifab container.
C) the name of fabric-tools container may not have fixed name, and needs resolving. 

A is not difficult, but B is quite hard since there is no auto sync mechanism between local and k8s containers. I was looking for things to achieve B and found 'kubectl cp' functionality may help to achieve B. fortunately, latest kubernetes.core got k8s_cp feature few days ago (in main branch. it is not released yet).

itaru2622 avatar Jul 28 '21 03:07 itaru2622

This feature is probably needed to setup multiple fabrics (on kubernetes) from one operation machine.

itaru2622 avatar Aug 03 '21 03:08 itaru2622

ansible kubernetes.core 2.2.0 released which has k8s_cp and k8s_exec. it is ready to work for this issue.

itaru2622 avatar Sep 20 '21 05:09 itaru2622