Exemplo n.º 1
0
    def get_agent_pools(self, nodes):
        pools = {}
        for node in nodes:
            pool_name = utils.get_pool_name(node)
            pools.setdefault(pool_name, []).append(node)

        agent_pools = []
        for pool_name in pools:
            agent_pools.append(AgentPool(pool_name, pools[pool_name]))

        return agent_pools
    def get_agent_pools(self, nodes):
        # TODO: add param for regex for pool name
        pools = {}
        for node in nodes:
            # Will need to be modified to pass the regex
            pool_name = utils.get_pool_name(node, self.pool_name_regex)
            pool = pools.setdefault(pool_name, {'size': "", 'nodes': []})
            pool['nodes'].append(node)
            pool['size'] = node.selectors["beta.kubernetes.io/instance-type"]

        agent_pools = []
        scalable_pools = []
        for pool_name in pools:
            pool_info = pools[pool_name]
            # TODO: Create the pool after, and infer size from node count
            pool = AgentPool(pool_name, pool_info['size'], pool_info['nodes'])
            agent_pools.append(pool)
            if not pool_name in self.ignored_pool_names:
                scalable_pools.append(pool)

        return agent_pools, scalable_pools
    def get_agent_pools(self, nodes):
        params = self.arm_parameters
        pools = {}
        for param in params:
            if param.endswith('VMSize') and param != 'masterVMSize':
                pool_name = param[:-6]
                pools.setdefault(
                    pool_name, {'size': params[param]['value'], 'nodes': []})
        for node in nodes:
            pool_name = utils.get_pool_name(node)
            pools[pool_name]['nodes'].append(node)

        agent_pools = []
        scalable_pools = []
        for pool_name in pools:
            pool_info = pools[pool_name]
            pool = AgentPool(pool_name, pool_info['size'], pool_info['nodes'])
            agent_pools.append(pool)
            if not pool_name in self.ignored_pool_names:
                scalable_pools.append(pool)

        return agent_pools, scalable_pools