English | 中文
Kosmos is an open-source, all-in-one distributed cloud-native solution. The name "kosmos" combines 'k' representing Kubernetes and 'cosmos' which means universe in Greek, symbolizing the limitless expansion of Kubernetes. Currently, Kosmos primarily consists of three major modules: ClusterLink, ClusterTree and Scheduler. Additionally, Kosmos is equipped with a tool called kosmosctl, which allows for quick deployment of Kosmos components, adding clusters, and testing network connectivity.
The target of Kosmos networking is to establish connectivity between multiple Kubernetes clusters. This module can be deployed and used independently. Kosmos networking enables Pods
to access Pods
and Services
across clusters, as if they were in the same cluster. Currently, this module primarily offers the following ability:
- Cross-cluster PodIP and ServiceIP Make communication: Linux vxlan base on tunneling technology, this enables L3 network connectivity across multiple Kubernetes clusters. This allows users to conduct
Pod-to-Pod
andPod-to-Service
communication within the global clusters scope. - Multi-Mode Support: When join clusters, you can choose
P2P
orGateway
mode. When selecting theP2P
mode, it is applicable for underlay network interconnection,offering shorter network paths and superior performance. When selecting theGateway
mode, it demonstrates superior compatibility, which is well-suited for hybrid and multi-cloud scenarios. - Support for Global IP Allocation: Kosmos networking allows for the presence of two or more clusters within the global clusters to use the same
Pod/Service
network segments, making it convenient for users to manage subnet. Kosmos supports configuring the mapping relationship betweenPodCIDR/ServiceCIDR
andGlobalCIDR
.GlobalIP
is globally unique, enabling cross-cluster communication for services with conflicting network segments throughGlobalIP
. - IPv6/IPv4 Dual-Stack Support
The Kosmos ClusterLink module currently includes the following key components:
Controller-Manager
:Collectes network information of the current cluster and monitors changes in network settings.Network-manager
:Calculates the network configurations required for each node.Agent
:A DaemonSet used for configuring the host network, including tasks such as tunnel creation, routing, NAT, and so on.Multi-Cluster-Coredns
:Implements multi-cluster service discovery.Elector
:Elects the gateway node.
The Kosmos clustertree module realizes the tree-like scaling of Kubernetes and achieves cross-cluster orchestration of applications.
Currently, it primarily supports the following ability:
- Full Compatibility with k8s API: Users can interact with the host cluster's
kube-apiserver
using tools likekubectl
,client-go
, and others just like they normally would. However, thePods
are actually distributed across the entire multi-cloud, multi-cluster environment. - Support for Stateful and k8s-native Applications: In addition to stateless applications, Kosmos also facilitates the orchestration of stateful applications and k8s-native applications (interacting with
kube-apiserver
). Kosmos will automatically detect the storage and permission resources thatPods
depend on, such as pv/pvc, sa, etc., and perform automatic bothway synchronization. - Diverse Pod Topology Constraints: Users can easily control the distribution of Pods within the global clusters, such as by region, availability zone, cluster, or node. This helps achieve high availability and improve resource utilization.
The Kosmos scheduling module is an extension developed on top of the Kubernetes scheduling framework, aiming to meet the container management needs in mixed-node and sub-cluster environments. It provides the following core features to enhance the flexibility and efficiency of container management:
-
Flexible Node and Cluster Hybrid Scheduling: The Kosmos scheduling module allows users to intelligently schedule workloads between real nodes and sub-clusters based on custom configurations. This enables users to make optimal use of resources across different nodes, ensuring the best performance and availability of workloads. Based on this capability, Kosmos enables workloads to achieve flexible cross-cloud and cross-cluster deployments.
-
Fine-grained Container Distribution Strategy: By introducing Custom Resource Definitions (CRD), users can exert precise control over the distribution of workloads. The configuration of CRD allows users to explicitly specify the number of pods for the workload in different clusters and adjust the distribution ratio as needed.
-
Fine-grained Fragmented Resource Handling: The Kosmos scheduling module intelligently detects fragmented resources within sub-clusters, effectively avoiding situations where pod deployment encounters insufficient resources in the sub-cluster. This helps ensure a more balanced allocation of resources across different nodes, enhancing system stability and performance. Whether building a hybrid cloud environment or requiring flexible deployment of workloads across different clusters, the Kosmos scheduling module serves as a reliable solution, assisting users in managing containerized applications more efficiently.
The following command allows you to quickly run an experimental environment with three clusters. Install the control plane in the host cluster.
kosmosctl install --cni calico --default-nic eth0 (We build a network tunnel based the network interface value passed by the arg default-nic)
Join the two member clusters.
kosmosctl join cluster --name cluster1 --kubeconfig ~/kubeconfig/cluster1-kubeconfig --cni calico --default-nic eth0 --enable-all
kosmosctl join cluster --name cluster2 --kubeconfig ~/kubeconfig/cluster2-kubeconfig --cni calico --default-nic eth0 --enable-all
And then we can Use the Kosmos clusters like single cluster.
If you have questions, feel free to reach out to us in the following ways:
Made with contrib.rocks.
Copyright 2023 the KOSMOS Authors. All rights reserved.
Licensed under the Apache License, Version 2.0.