tacker.vnfm.infra_drivers.kubernetes.kubernetes_driver module

class tacker.vnfm.infra_drivers.kubernetes.kubernetes_driver.Kubernetes

Bases: VnfAbstractDriver, VnfScaleAbstractDriver

Kubernetes infra driver for hosting containerized vnfs

change_ext_conn_vnf(context, vnf_instance, vnf_dict, vim_connection_info, change_ext_conn_req)

Change external VNF connectivity

Parameters:
  • context – A RequestContext

  • vnf_instance – tacker.objects.VnfInstance to be changed

  • vnf_dict

  • vim_connection_info – Credentials to initialize Vim connection

  • change_ext_conn_req – tacker.objects.ChangeExtconnRequest object containing parameters passed in the change_ext_conn request

change_ext_conn_vnf_wait(context, vnf_instance, vim_connection_info)

Check vnf external connnectivity is changed successfully

clean_authenticate_vim(vim_auth, file_descriptor)
create(plugin, context, vnf)

Create vnf and return its id.

create_wait(plugin, context, vnf_dict, vnf_id, auth_attr)

wait for vnf creation to complete.

create_wait_k8s(k8s_objs, k8s_client_dict, vnf_instance)
delete(**kwargs)
delete_vnf_instance_resource(context, vnf_instance, vim_connection_info, vnf_resource)
delete_wait(**kwargs)
get_auth_creds(auth_cred)
get_cinder_list(vnf_info)
get_description()
get_grant_resource(plugin, vnf_instance, vnf_info, scale_vnf_request, placement_obj_list, vim_connection_info, del_list)
get_name()

Return a symbolic name for the service VM plugin.

get_pod_status(pods_information)
get_resource_info(**kwargs)

Fetches optional details of a VNF

get_rollback_ids(plugin, context, vnf_dict, aspect_id, auth_attr, region_name)
get_scale_ids(plugin, context, vnf_dict, auth_attr, region_name)
get_scale_in_ids(plugin, context, vnf_dict, is_reverse, auth_attr, region_name, number_of_steps)
get_type()

Return one of predefined type of the hosting vnf drivers.

heal_vnf(context, vnf_instance, vim_connection_info, heal_vnf_request)

Heal function

This function heals vnfc instances (mapped as Pod), and update vnfcResourceInfo which are not the target of healing before healing operation.

heal_vnf_wait(context, vnf_instance, vim_connection_info, heal_vnf_request)

heal wait function

Wait until all status from Pod objects is RUNNING.

instantiate_vnf(context, vnf_instance, vnfd_dict, vim_connection_info, instantiate_vnf_req, grant_response, vnf_package_path, plugin=None)
is_match_pod_naming_rule(rsc_kind, rsc_name, pod_name)
post_change_ext_conn_vnf(context, vnf_instance, vim_connection_info)

Update resource information for each external VL/LINKPORT resources

Parameters:
  • context – A RequestContext

  • vnf_instance – tacker.objects.VnfInstance to be changed

  • vim_connection_info – Credentials to initialize Vim connection

post_heal_vnf(context, vnf_instance, vim_connection_info, heal_vnf_request)

Update VnfcResourceInfo after healing

post_vnf_instantiation(context, vnf_instance, vim_connection_info, instantiate_vnf_req)

Initially store VnfcResourceInfo after instantiation

After instantiation, this function gets pods information from Kubernetes VIM and store information such as pod name and resource kind and metadata, and vdu id.

pre_instantiation_vnf(context, vnf_instance, vim_connection_info, vnf_software_images, instantiate_vnf_req, vnf_package_path)

Create resources required for instantiating Vnf.

Parameters:
  • context – A RequestContext

  • vnf_instance – Object tacker.objects.VnfInstance

Vim_info:

Credentials to initialize Vim connection

Vnf_software_images:

Dict of key:value pair, <VDU/Storage node name>:tacker.objects.VnfSoftwareImage.

scale(**kwargs)
scale_in_reverse(context, plugin, auth_attr, vnf_info, scale_vnf_request, region_name, scale_name_list, grp_id, vnf_instance)
scale_out_initial(context, plugin, auth_attr, vnf_info, scale_vnf_request, region_name)
scale_resource_update(context, vnf_instance, scale_vnf_request, vnf_info, vim_connection_info)

Update VnfcResourceInfo after scaling

scale_update_wait(context, plugin, auth_attr, vnf_info, region_name)
scale_wait(context, plugin, auth_attr, policy, region_name, last_event_id)

Scale wait function

Scale wait function will marked VNF is ACTIVE when all status state from Pod objects is RUNNING.

select_k8s_obj_read_api(k8s_client_dict, namespace, name, kind, api_version)

select kubernetes read api and call

sync_db(context, vnf_instance, vim_info)

method for database synchronization

update(**kwargs)
update_wait(**kwargs)
tacker.vnfm.infra_drivers.kubernetes.kubernetes_driver.config_opts()
tacker.vnfm.infra_drivers.kubernetes.kubernetes_driver.get_scaling_policy_name(action, policy_name)