当前位置: 首页>>代码示例>>Python>>正文


Python VncKubernetesConfig.cluster_default_network_fq_name方法代码示例

本文整理汇总了Python中vnc_kubernetes_config.VncKubernetesConfig.cluster_default_network_fq_name方法的典型用法代码示例。如果您正苦于以下问题:Python VncKubernetesConfig.cluster_default_network_fq_name方法的具体用法?Python VncKubernetesConfig.cluster_default_network_fq_name怎么用?Python VncKubernetesConfig.cluster_default_network_fq_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vnc_kubernetes_config.VncKubernetesConfig的用法示例。


在下文中一共展示了VncKubernetesConfig.cluster_default_network_fq_name方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _get_cluster_network

# 需要导入模块: from vnc_kubernetes_config import VncKubernetesConfig [as 别名]
# 或者: from vnc_kubernetes_config.VncKubernetesConfig import cluster_default_network_fq_name [as 别名]
 def _get_cluster_network(self):
     vn_fq_name = vnc_kube_config.cluster_default_network_fq_name()
     try:
         vn_obj = self._vnc_lib.virtual_network_read(fq_name=vn_fq_name)
     except NoIdError:
         return None
     return vn_obj
开发者ID:nischalsheth,项目名称:contrail-controller,代码行数:9,代码来源:vnc_service.py

示例2: _provision_cluster

# 需要导入模块: from vnc_kubernetes_config import VncKubernetesConfig [as 别名]
# 或者: from vnc_kubernetes_config.VncKubernetesConfig import cluster_default_network_fq_name [as 别名]
    def _provision_cluster(self):
        # Pre creating default project before namespace add event.
        proj_obj = self._create_project('default')

        # Create application policy set for the cluster project.
        VncSecurityPolicy.create_application_policy_set(
            vnc_kube_config.application_policy_set_name())

        # Allocate fabric snat port translation pools.
        self._allocate_fabric_snat_port_translation_pools()

        ip_fabric_fq_name = vnc_kube_config.cluster_ip_fabric_network_fq_name()
        ip_fabric_vn_obj = self.vnc_lib. \
            virtual_network_read(fq_name=ip_fabric_fq_name)

        cluster_vn_obj = None
        if DBBaseKM.is_nested():
            try:
                cluster_vn_obj = self.vnc_lib.virtual_network_read(
                    fq_name=vnc_kube_config.cluster_default_network_fq_name())
            except NoIdError:
                pass

        # Pre creating kube-system project before namespace add event.
        self._create_project('kube-system')
        # Create ip-fabric IPAM.
        ipam_name = vnc_kube_config.cluster_name() + '-ip-fabric-ipam'
        ip_fabric_ipam_update, ip_fabric_ipam_obj, ip_fabric_ipam_subnets = \
            self._create_ipam(ipam_name, self.args.ip_fabric_subnets, proj_obj)
        self._cluster_ip_fabric_ipam_fq_name = ip_fabric_ipam_obj.get_fq_name()
        # Create Pod IPAM.
        ipam_name = vnc_kube_config.cluster_name() + '-pod-ipam'
        pod_ipam_update, pod_ipam_obj, pod_ipam_subnets = \
            self._create_ipam(ipam_name, self.args.pod_subnets, proj_obj)
        # Cache cluster pod ipam name.
        # This will be referenced by ALL pods that are spawned in the cluster.
        self._cluster_pod_ipam_fq_name = pod_ipam_obj.get_fq_name()
        # Create a cluster-pod-network.
        if self.args.ip_fabric_forwarding:
            cluster_pod_vn_obj = self._create_network(
                vnc_kube_config.cluster_default_pod_network_name(),
                'pod-network', proj_obj,
                ip_fabric_ipam_obj, ip_fabric_ipam_update, ip_fabric_vn_obj)
        else:
            cluster_pod_vn_obj = self._create_network(
                vnc_kube_config.cluster_default_pod_network_name(),
                'pod-network', proj_obj,
                pod_ipam_obj, pod_ipam_update, ip_fabric_vn_obj)
        # Create Service IPAM.
        ipam_name = vnc_kube_config.cluster_name() + '-service-ipam'
        service_ipam_update, service_ipam_obj, service_ipam_subnets = \
            self._create_ipam(ipam_name, self.args.service_subnets, proj_obj)
        self._cluster_service_ipam_fq_name = service_ipam_obj.get_fq_name()
        # Create a cluster-service-network.
        cluster_service_vn_obj = self._create_network(
            vnc_kube_config.cluster_default_service_network_name(),
            'service-network', proj_obj, service_ipam_obj, service_ipam_update)
        self._create_attach_policy(proj_obj, ip_fabric_vn_obj,
            cluster_pod_vn_obj, cluster_service_vn_obj, cluster_vn_obj)
开发者ID:rombie,项目名称:contrail-controller,代码行数:61,代码来源:vnc_kubernetes.py

示例3: _get_host_vm

# 需要导入模块: from vnc_kubernetes_config import VncKubernetesConfig [as 别名]
# 或者: from vnc_kubernetes_config.VncKubernetesConfig import cluster_default_network_fq_name [as 别名]
    def _get_host_vm(self, host_ip):
        iip = InstanceIpKM.get_object(host_ip,
            vnc_kube_config.cluster_default_network_fq_name())
        if iip:
            for vmi_id in iip.virtual_machine_interfaces:
                vm_vmi = VirtualMachineInterfaceKM.get(vmi_id)
                if vm_vmi and vm_vmi.virtual_machine:
                    return vm_vmi.virtual_machine

        return None
开发者ID:cijohnson,项目名称:contrail-controller,代码行数:12,代码来源:vnc_endpoints.py

示例4: _get_network

# 需要导入模块: from vnc_kubernetes_config import VncKubernetesConfig [as 别名]
# 或者: from vnc_kubernetes_config.VncKubernetesConfig import cluster_default_network_fq_name [as 别名]
 def _get_network(self, ns_name):
     ns = self._get_namespace(ns_name)
     if ns.is_isolated():
         vn_fq_name = ns.get_isolated_network_fq_name()
     else:
         if self._default_vn_obj:
             return self._default_vn_obj
         vn_fq_name = vnc_kube_config.cluster_default_network_fq_name()
     try:
         vn_obj = self._vnc_lib.virtual_network_read(fq_name=vn_fq_name)
     except NoIdError:
         self._logger.error("%s - %s Not Found" %(self._name, vn_fq_name))
         return None
     if not ns.is_isolated():
         self._default_vn_obj = vn_obj
     return vn_obj
开发者ID:cijohnson,项目名称:contrail-controller,代码行数:18,代码来源:vnc_ingress.py


注:本文中的vnc_kubernetes_config.VncKubernetesConfig.cluster_default_network_fq_name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。