def __create_multus_cni(k8s_conf): multus_enabled = config_utils.is_multus_cni_enabled(k8s_conf) if multus_enabled: multus_elems = config_utils.get_multus_net_elems(k8s_conf) if consts.DHCP_TYPE in multus_elems: __dhcp_installation(k8s_conf) if consts.SRIOV_TYPE in multus_elems: aconf.launch_sriov_cni_configuration(k8s_conf) aconf.launch_sriov_network_creation(k8s_conf) if consts.FLANNEL_TYPE in multus_elems: aconf.create_flannel_interface(k8s_conf) if consts.WEAVE_TYPE in multus_elems: __launch_weave_interface(k8s_conf) if consts.MACVLAN_TYPE in multus_elems: __macvlan_installation(k8s_conf) ips = config_utils.get_minion_node_ips(k8s_conf) networking_plugin = config_utils.get_networking_plugin(k8s_conf) ansible_utils.apply_playbook( consts.K8_CONF_FILES_DELETION_AFTER_MULTUS, ips, config_utils.get_node_user(k8s_conf), variables={ 'networking_plugin': networking_plugin, 'KUBERNETES_PATH': consts.NODE_K8S_PATH, 'PROJ_ARTIFACT_DIR': config_utils.get_project_artifact_dir( k8s_conf), }) else: logger.info('MULTUS CNI IS DISABLED')
def __create_crd_net(k8s_conf): logger.info("Additional N/W plugins multus_cni installation") multus_enabled = config_utils.is_multus_cni_enabled(k8s_conf) if multus_enabled: aconf.launch_crd_network(k8s_conf) aconf.launch_multus_cni(k8s_conf) __create_default_network_multus(k8s_conf)
def test_is_multus_cni_enabled(self): """ Ensures Multus CNI status is properly parsed """ multus_cni = config_utils.is_multus_cni_enabled(self.config) expected_multus_cni = False cni_list = self.network_list[1][consts.MULTUS_NET_KEY][0][ consts.MULTUS_CNI_KEY] if (consts.SRIOV_TYPE or consts.FLANNEL_TYPE or consts.WEAVE_TYPE or consts.MACVLAN_TYPE) in cni_list: expected_multus_cni = True self.assertEqual(expected_multus_cni, multus_cni)