예제 #1
0
 def __init__(self):
     self.host_agents = {
         'docker': DockerHost("docker"),
         'swarm': DockerHost("swarm"),
         'kubernetes': KubernetesHost(),
         'vsphere': VsphereHost()
     }
예제 #2
0
파일: host.py 프로젝트: vijaykonda/cello
 def __init__(self):
     self.col = db["host"]
     self.host_agents = {
         'docker': DockerHost(),
         'swarm': DockerHost(),
         'kubernetes': KubernetesHost()
     }
예제 #3
0
파일: cluster.py 프로젝트: wuming820/cello
    def get_services_urls(self, cid):
        try:
            cluster = ClusterModel.objects.get(id=cid)

            cluster_name = cluster.name
            kube_config = KubernetesHost().get_kubernets_config(
                cluster.host.k8s_param)

            operation = K8sClusterOperation(kube_config)
            services_urls = operation.get_services_urls(cluster_name)
        except Exception as e:
            logger.error(
                "Failed to get Kubernetes services's urls: {}".format(e))
            return None
        return services_urls
예제 #4
0
파일: cluster.py 프로젝트: wuming820/cello
    def _get_cluster_info(self, cid, config):
        cluster = ClusterModel.objects.get(id=cid)

        cluster_name = cluster.name
        kube_config = KubernetesHost().get_kubernets_config(
            cluster.host.k8s_param)

        clusters_exists = ClusterModel.objects(host=cluster.host)
        ports_index = [
            service.port
            for service in ServicePort.objects(cluster__in=clusters_exists)
        ]

        nfsServer_ip = cluster.host.k8s_param.get('nfsServer')
        consensus = config['consensus_plugin']

        return cluster, cluster_name, kube_config, ports_index, \
            nfsServer_ip, consensus