def nodes_flow_kube_api(cluster_name, machine_net, cluster_deployment, agent_cluster_install): tf_folder = utils.get_tf_folder(cluster_name, args.namespace) baremetal_template = os.path.join(tf_folder, consts.Platforms.BARE_METAL) nodes_details = utils.get_tfvars(baremetal_template) tf = terraform_utils.TerraformUtils(working_dir=baremetal_template) is_ipv4 = machine_net.has_ip_v4 or not machine_net.has_ip_v6 nodes_number = args.master_count + args.number_of_workers create_nodes_and_wait_till_registered( inventory_client=None, cluster=None, nodes_details=nodes_details, tf=tf, is_ipv4=is_ipv4, nodes_number=nodes_number, cluster_deployment=cluster_deployment, ) if args.master_count == 1: set_single_node_ip( client=None, cluster_id=None, main_cidr=args.vm_network_cidr if is_ipv4 else args.vm_network_cidr6, is_ipv4=is_ipv4, cluster_deployment=cluster_deployment, tf=tf, ) else: log.info("VIPs already configured") kubeapi_utils.set_agents_hostnames( cluster_deployment=cluster_deployment, is_ipv4=is_ipv4, static_network_mode=args.with_static_network_config, tf=tf, nodes_number=nodes_number, ) if args.install_cluster: install_cluster.run_installation_flow_kube_api( cluster_deployment=cluster_deployment, agent_cluster_install=agent_cluster_install, nodes_number=nodes_number, kubeconfig_path=utils.get_kubeconfig_path(cluster_name))
def nodes_flow_kube_api(cluster_name, machine_net, cluster_deployment): tf_folder = utils.get_tf_folder(cluster_name, args.namespace) nodes_details = utils.get_tfvars(tf_folder) tf = terraform_utils.TerraformUtils(working_dir=tf_folder) is_ipv4 = machine_net.has_ip_v4 or not machine_net.has_ip_v6 nodes_number = args.master_count + args.number_of_workers create_nodes_and_wait_till_registered( inventory_client=None, cluster=None, nodes_details=nodes_details, tf=tf, is_ipv4=is_ipv4, nodes_number=nodes_number, cluster_deployment=cluster_deployment, ) if cluster_deployment: if args.master_count == 1: set_single_node_ip( client=None, cluster_id=None, main_cidr=args.vm_network_cidr if is_ipv4 else args.vm_network_cidr6, is_ipv4=is_ipv4, cluster_deployment=cluster_deployment, tf=tf, ) else: log.info("VIPs already configured") kubeapi_utils.set_agents_hostnames( cluster_deployment=cluster_deployment, is_ipv4=is_ipv4, static_network_mode=args.with_static_network_config, tf=tf, nodes_number=nodes_number, ) if args.install_cluster: install_cluster.run_installation_flow_kube_api( cluster_deployment=cluster_deployment, nodes_number=nodes_number, kubeconfig_path=consts.DEFAULT_CLUSTER_KUBECONFIG_PATH, )