當前位置: 首頁>>代碼示例>>Python>>正文


Python VncKubernetesConfig.cluster_nested_underlay_policy_name方法代碼示例

本文整理匯總了Python中vnc_kubernetes_config.VncKubernetesConfig.cluster_nested_underlay_policy_name方法的典型用法代碼示例。如果您正苦於以下問題:Python VncKubernetesConfig.cluster_nested_underlay_policy_name方法的具體用法?Python VncKubernetesConfig.cluster_nested_underlay_policy_name怎麽用?Python VncKubernetesConfig.cluster_nested_underlay_policy_name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在vnc_kubernetes_config.VncKubernetesConfig的用法示例。


在下文中一共展示了VncKubernetesConfig.cluster_nested_underlay_policy_name方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _create_attach_policy

# 需要導入模塊: from vnc_kubernetes_config import VncKubernetesConfig [as 別名]
# 或者: from vnc_kubernetes_config.VncKubernetesConfig import cluster_nested_underlay_policy_name [as 別名]
    def _create_attach_policy(self, proj_obj, ip_fabric_vn_obj,
            pod_vn_obj, service_vn_obj, cluster_vn_obj):
        policy_name = vnc_kube_config.cluster_name() + \
            '-default-ip-fabric-np'
        ip_fabric_policy = \
            self._create_np_vn_policy(policy_name, proj_obj, ip_fabric_vn_obj)
        policy_name = vnc_kube_config.cluster_name() + \
            '-default-service-np'
        cluster_service_network_policy = \
            self._create_np_vn_policy(policy_name, proj_obj, service_vn_obj)
        policy_name = vnc_kube_config.cluster_name() + \
            '-default-pod-service-np'
        cluster_default_policy = self._create_vn_vn_policy(policy_name,
            proj_obj, pod_vn_obj, service_vn_obj)
        self._attach_policy(ip_fabric_vn_obj, ip_fabric_policy)
        self._attach_policy(pod_vn_obj,
            ip_fabric_policy, cluster_default_policy)
        self._attach_policy(service_vn_obj, ip_fabric_policy,
            cluster_service_network_policy, cluster_default_policy)

        # In nested mode, create and attach a network policy to the underlay
        # virtual network.
        if DBBaseKM.is_nested() and cluster_vn_obj:
            policy_name = vnc_kube_config.cluster_nested_underlay_policy_name()
            nested_underlay_policy = self._create_np_vn_policy(policy_name,
                                         proj_obj, cluster_vn_obj)
            self._attach_policy(cluster_vn_obj, nested_underlay_policy)
開發者ID:rombie,項目名稱:contrail-controller,代碼行數:29,代碼來源:vnc_kubernetes.py


注:本文中的vnc_kubernetes_config.VncKubernetesConfig.cluster_nested_underlay_policy_name方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。