Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

Port Forward: Forwards to containers from the zos host itself does not work #10

Open
rkhamis opened this issue Aug 1, 2018 · 3 comments
Assignees
Milestone

Comments

@rkhamis
Copy link

rkhamis commented Aug 1, 2018

Issue migrated from https://api.github.com/repos/zero-os/0-core/issues/682, opened by @muhamadazmy

Port forwards works for external connections, while connections from zos itself does not work

@siddiquagig
Copy link

siddiquagig commented Sep 25, 2018

Issue still exists, port forwards works for external connections, while connections from zos itself does not work.

In [59]: node_client.client.container.list()
Out[59]: 
{'1': {'container': {'arguments': {'cgroups': [['devices', 'corex']],
    'config': None,
    'env': {'HOME': '/root', 'LANG': 'C.UTF-8', 'LC_ALL': 'C.UTF-8'},
    'host_network': False,
    'hostname': '',
    'identity': '',
    'mount': {'/var/cache/zrobot/config': '/opt/code/local/stdorg/config',
     '/var/cache/zrobot/data': '/opt/var/data/zrobot/zrobot_data',
     '/var/cache/zrobot/jsconfig': '/root/jumpscale/cfg',
     '/var/cache/zrobot/ssh': '/root/.ssh',
     '/var/run/redis.sock': '/tmp/redis.sock'},
    'name': 'zrobot',
    'nics': [{'config': {'cidr': '',
       'dhcp': False,
       'dns': None,
       'gateway': ''},
      'hwaddr': '',
      'id': '',
      'monitor': False,
      'state': 'configured',
      'type': 'default'}],
    'port': {'zt*:6600': 6600},
    'privileged': False,
    'root': 'https://hub.grid.tf/tf-autobuilder/threefoldtech-0-robot-autostart-development.flist',
    'storage': 'zdb://hub.grid.tf:9900',
    'tags': ['zrobot']},
   'pid': 557,
   'root': '/mnt/containers/1'},
  'cpu': 0.21623104251268657,
  'rss': 8966144,
  'swap': 0,
  'vms': 732110848},
 '11': {'container': {'arguments': {'cgroups': [['devices', 'corex']],
    'config': {},
    'env': {},
    'host_network': False,
    'hostname': '',
    'identity': '1c5f2abed7:0:26b18a2bb9c97b554d5f36b46f8f08195e4da7fc7dd3ba0315bf400a44cd7f5f4c74ca5955aea9553b56fc0c22e7c6d0873ad4fa06abf58b88d87eea6cbfe1d0:bd65e9c4733ba5698c6d8eee57426a70955b92b48760e8956271f00606c7d0ccafb8286d6265e41542efa7e4c13922215e44655ef91596716ec3c6481a1b5635',
    'mount': {'/mnt/zdbs/sdc': '/zerodb'},
    'name': 'tfzdb',
    'nics': [{'config': {'cidr': '',
       'dhcp': False,
       'dns': None,
       'gateway': ''},
      'hwaddr': '',
      'id': 'None',
      'monitor': False,
      'name': 'nat0',
      'state': 'configured',
      'type': 'default'}],
    'port': {'1024': 9900},
    'privileged': False,
    'root': 'https://hub.grid.tf/tf-autobuilder/threefoldtech-0-db-release-development.flist',
    'storage': 'zdb://hub.grid.tf:9900',
    'tags': ['tfzdb']},
   'pid': 25120,
   'root': '/mnt/containers/11'},
  'cpu': 0.21622965794000554,
  'rss': 9605120,
  'swap': 0,
  'vms': 1150201856}}


In [61]: node_client.client.container.add_portforward(11,8080,9900)


In [62]: node_client.client.container.list()
Out[62]: 
{'1': {'container': {'arguments': {'cgroups': [['devices', 'corex']],
    'config': None,
    'env': {'HOME': '/root', 'LANG': 'C.UTF-8', 'LC_ALL': 'C.UTF-8'},
    'host_network': False,
    'hostname': '',
    'identity': '',
    'mount': {'/var/cache/zrobot/config': '/opt/code/local/stdorg/config',
     '/var/cache/zrobot/data': '/opt/var/data/zrobot/zrobot_data',
     '/var/cache/zrobot/jsconfig': '/root/jumpscale/cfg',
     '/var/cache/zrobot/ssh': '/root/.ssh',
     '/var/run/redis.sock': '/tmp/redis.sock'},
    'name': 'zrobot',
    'nics': [{'config': {'cidr': '',
       'dhcp': False,
       'dns': None,
       'gateway': ''},
      'hwaddr': '',
      'id': '',
      'monitor': False,
      'state': 'configured',
      'type': 'default'}],
    'port': {'zt*:6600': 6600},
    'privileged': False,
    'root': 'https://hub.grid.tf/tf-autobuilder/threefoldtech-0-robot-autostart-development.flist',
    'storage': 'zdb://hub.grid.tf:9900',
    'tags': ['zrobot']},
   'pid': 557,
   'root': '/mnt/containers/1'},
  'cpu': 0,
  'rss': 8966144,
  'swap': 0,
  'vms': 732110848},
 '11': {'container': {'arguments': {'cgroups': [['devices', 'corex']],
    'config': {},
    'env': {},
    'host_network': False,
    'hostname': '',
    'identity': '1c5f2abed7:0:26b18a2bb9c97b554d5f36b46f8f08195e4da7fc7dd3ba0315bf400a44cd7f5f4c74ca5955aea9553b56fc0c22e7c6d0873ad4fa06abf58b88d87eea6cbfe1d0:bd65e9c4733ba5698c6d8eee57426a70955b92b48760e8956271f00606c7d0ccafb8286d6265e41542efa7e4c13922215e44655ef91596716ec3c6481a1b5635',
    'mount': {'/mnt/zdbs/sdc': '/zerodb'},
    'name': 'tfzdb',
    'nics': [{'config': {'cidr': '',
       'dhcp': False,
       'dns': None,
       'gateway': ''},
      'hwaddr': '',
      'id': 'None',
      'monitor': False,
      'name': 'nat0',
      'state': 'configured',
      'type': 'default'}],
    'port': {'1024': 9900, '8080': 9900},
    'privileged': False,
    'root': 'https://hub.grid.tf/tf-autobuilder/threefoldtech-0-db-release-development.flist',
    'storage': 'zdb://hub.grid.tf:9900',
    'tags': ['tfzdb']},
   'pid': 25120,
   'root': '/mnt/containers/11'},
  'cpu': 0,
  'rss': 9605120,
  'swap': 0,
  'vms': 1150201856}}



root@tf-laptop:~$ telnet 10.102.53.47 8080
Trying 10.102.53.47...
Connected to 10.102.53.47.
Escape character is '^]'.

As per @muhamadazmy , this was supposed to be state_inprogress.

lib: commit 09360858e8149edf92f065eb370005424e4784e4
core: commit 28515efa893162cfc08cc4e259bc268a4c48ef4d
0-robot: commit a15195e2d096d894ca09721a1b5cc37ada787700

@zaibon
Copy link

zaibon commented Sep 26, 2018

@siddiquagig You state the issue is still there, but in the logs you post there is not proof that this is still the case.

@siddiquagig
Copy link

@zaibon , missed this part

In [208]: node_client.client.bash('telnet 10.102.53.47 8080').get()
Out[208]: 
STATE: 1001 ERROR
STDOUT:

STDERR:
telnet: can't connect to remote host (10.102.53.47): Connection refused

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants