本文整理汇总了Python中vnc_kubernetes_config.VncKubernetesConfig.is_cluster_network_configured方法的典型用法代码示例。如果您正苦于以下问题:Python VncKubernetesConfig.is_cluster_network_configured方法的具体用法?Python VncKubernetesConfig.is_cluster_network_configured怎么用?Python VncKubernetesConfig.is_cluster_network_configured使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vnc_kubernetes_config.VncKubernetesConfig
的用法示例。
在下文中一共展示了VncKubernetesConfig.is_cluster_network_configured方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from vnc_kubernetes_config import VncKubernetesConfig [as 别名]
# 或者: from vnc_kubernetes_config.VncKubernetesConfig import is_cluster_network_configured [as 别名]
def __init__(self, ingress_mgr):
self._k8s_event_type = 'Service'
super(VncService,self).__init__(self._k8s_event_type)
self._name = type(self).__name__
self._ingress_mgr = ingress_mgr
self._vnc_lib = vnc_kube_config.vnc_lib()
self._label_cache = vnc_kube_config.label_cache()
self._labels = XLabelCache(self._k8s_event_type)
self._labels.reset_resource()
self._args = vnc_kube_config.args()
self.logger = vnc_kube_config.logger()
self._queue = vnc_kube_config.queue()
self.kube = vnc_kube_config.kube()
self._fip_pool_obj = None
# Cache kubernetes API server params.
self._kubernetes_api_server = self._args.kubernetes_api_server
self._kubernetes_api_secure_port =\
int(self._args.kubernetes_api_secure_port)
# Cache kuberneter service name.
self._kubernetes_service_name = self._args.kubernetes_service_name
# Config knob to control enable/disable of link local service.
if self._args.api_service_link_local == 'True':
api_service_ll_enable = True
else:
api_service_ll_enable = False
# If Kubernetes API server info is incomplete, disable link-local create,
# as create is not possible.
if not self._kubernetes_api_server:
self._create_linklocal = False
elif vnc_kube_config.is_cluster_network_configured() and\
DBBaseKM.is_nested():
# In nested mode, if cluster network is configured, then the k8s api
# server is in the same network as the k8s cluster. So there is no
# need for link local.
self._create_linklocal = False
else:
self._create_linklocal = api_service_ll_enable
self.service_lb_mgr = importutils.import_object(
'kube_manager.vnc.loadbalancer.ServiceLbManager')
self.service_ll_mgr = importutils.import_object(
'kube_manager.vnc.loadbalancer.ServiceLbListenerManager')
self.service_lb_pool_mgr = importutils.import_object(
'kube_manager.vnc.loadbalancer.ServiceLbPoolManager')
self.service_lb_member_mgr = importutils.import_object(
'kube_manager.vnc.loadbalancer.ServiceLbMemberManager')