Esempio n. 1
0
def main(args_str=None, kube_api_skip=False, event_queue=None):
    args = kube_args.parse_args(args_str)
    kube_nw_mgr = KubeNetworkManager(args,
                                     kube_api_connected=kube_api_skip,
                                     queue=event_queue)
    KubeNetworkManager._kube_network_manager = kube_nw_mgr
    kube_nw_mgr.start_tasks()
def main(args_str=None, mesos_api_skip=False, event_queue=None):
    vnc_cgitb.enable(format='text')
    args = mesos_args.parse_args(args_str)
    mesos_nw_mgr = MesosNetworkManager(args,
                                       mesos_api_connected=mesos_api_skip,
                                       queue=event_queue)
    mesos_nw_mgr.start_tasks()
def main(args_str=None, mesos_api_skip=False, event_queue=None):
    vnc_cgitb.enable(format='text')
    args = mesos_args.parse_args(args_str)
    mesos_nw_mgr = MesosNetworkManager(args, mesos_api_connected=mesos_api_skip,
                                       queue=event_queue)
    MesosNetworkManager._mesos_network_manager = mesos_nw_mgr
    mesos_nw_mgr.start_tasks()
Esempio n. 4
0
def main(args_str=None,
         kube_api_skip=False,
         event_queue=None,
         vnc_kubernetes_config_dict=None):
    _zookeeper_client = None

    args = kube_args.parse_args(args_str)
    if 'kube_timer_interval' not in args:
        args.kube_timer_interval = '60'

    if args.cluster_id:
        client_pfx = args.cluster_id + '-'
        zk_path_pfx = args.cluster_id + '/'
    else:
        client_pfx = ''
        zk_path_pfx = ''

    # randomize collector list
    args.random_collectors = args.collectors
    if args.collectors:
        args.random_collectors = random.sample(args.collectors,
                                               len(args.collectors))

    km_logger = common_logger.KubeManagerLogger(args, http_server_port=-1)

    if args.nested_mode == '0':
        # Initialize AMQP handler then close it to be sure remain queue of a
        # precedent run is cleaned
        rabbitmq_cfg = kube_args.rabbitmq_args(args)
        try:
            vnc_amqp = VncAmqpHandle(km_logger._sandesh, km_logger, DBBaseKM,
                                     REACTION_MAP, 'kube_manager',
                                     rabbitmq_cfg)
            vnc_amqp.establish()
            vnc_amqp.close()
        except Exception:  # FIXME: Except clause is too broad
            pass
        finally:
            km_logger.debug("Removed remained AMQP queue")

        # Ensure zookeeper is up and running before starting kube-manager
        _zookeeper_client = ZookeeperClient(client_pfx + "kube-manager",
                                            args.zk_server_ip)

        km_logger.notice("Waiting to be elected as master...")
        _zookeeper_client.master_election(zk_path_pfx + "/kube-manager",
                                          os.getpid(), run_kube_manager,
                                          km_logger, args, kube_api_skip,
                                          event_queue,
                                          vnc_kubernetes_config_dict)

    else:  # nested mode, skip zookeeper mastership check
        run_kube_manager(km_logger, args, kube_api_skip, event_queue,
                         vnc_kubernetes_config_dict)
def main(args_str=None, kube_api_skip=False, event_queue=None,
         vnc_kubernetes_config_dict=None):
    _zookeeper_client = None

    args = kube_args.parse_args(args_str)
    if 'kube_timer_interval' not in args:
        args.kube_timer_interval = '60'

    if args.cluster_id:
        client_pfx = args.cluster_id + '-'
        zk_path_pfx = args.cluster_id + '/'
    else:
        client_pfx = ''
        zk_path_pfx = ''

    # randomize collector list
    args.random_collectors = args.collectors
    if args.collectors:
        args.random_collectors = random.sample(args.collectors,
                                           len(args.collectors))

    km_logger = logger.KubeManagerLogger(args, http_server_port=-1)

    if args.nested_mode == '0':
        # Initialize AMQP handler then close it to be sure remain queue of a
        # precedent run is cleaned
        rabbitmq_cfg = kube_args.rabbitmq_args(args)
        try:
            vnc_amqp = VncAmqpHandle(km_logger._sandesh, km_logger, DBBaseKM,
                                     REACTION_MAP, 'kube_manager',
                                     rabbitmq_cfg)
            vnc_amqp.establish()
            vnc_amqp.close()
        except Exception:
            pass
        finally:
            km_logger.debug("Removed remained AMQP queue")
 
        # Ensure zookeeper is up and running before starting kube-manager
        _zookeeper_client = ZookeeperClient(client_pfx+"kube-manager",
                                            args.zk_server_ip)

        km_logger.notice("Waiting to be elected as master...")
        _zookeeper_client.master_election(zk_path_pfx+"/kube-manager",
                                          os.getpid(), run_kube_manager,
                                          km_logger, args, kube_api_skip,
                                          event_queue, vnc_kubernetes_config_dict)

    else: #nested mode, skip zookeeper mastership check
        run_kube_manager(km_logger, args, kube_api_skip, event_queue,
                         vnc_kubernetes_config_dict)
def main():
    vnc_cgitb.enable(format='text')
    args = mesos_args.parse_args()
    mesos_nw_mgr = MesosNetworkManager(args)
    mesos_nw_mgr.start_tasks()
Esempio n. 7
0
def main():
    vnc_cgitb.enable(format='text')
    args = mesos_args.parse_args()
    mesos_nw_mgr = MesosNetworkManager(args)
    mesos_nw_mgr.start_tasks()
def main():
    args = kube_args.parse_args()
    kube_nw_mgr = KubeNetworkManager(args)
    kube_nw_mgr.start_tasks()
Esempio n. 9
0
def main():
    args = kube_args.parse_args()
    kube_nw_mgr = KubeNetworkManager(args)
    kube_nw_mgr.start_tasks()
def main():
    args = mesos_args.parse_args()
    mesos_nw_mgr = MesosNetworkManager(args)
    mesos_nw_mgr.start_tasks()