def _deploy(pyk_client, namespace, here, dir_name, alist, resource_name, verbose):
    """
    Deploys resources based on manifest files. Currently the following resources are supported:
    replication controllers, services.
    """
    for litem in alist:
        file_name = os.path.join(os.path.join(here, dir_name), litem)
        if verbose: logging.info("Deploying %s %s" %(resource_name, file_name))
        if resource_name == "service":
            _, res_path = pyk_client.create_svc(manifest_filename=file_name, namespace=namespace)
        elif resource_name == "RC":
            _, res_path = pyk_client.create_rc(manifest_filename=file_name, namespace=namespace)
        if verbose: logging.info("Now trying to own %s" %(res_path))
        _own_resource(pyk_client, res_path, verbose)
        res = pyk_client.describe_resource(res_path)
        logging.debug(res.json())
        # now make sure that a RC's pods are also owned:
        if resource_name == "RC":
            _own_pods_of_rc(pyk_client, res, namespace, res_path, verbose)
dataset/ETHPy150Open kubernauts/kploy/kploycommon.py/_deploy/original