Open, Multi-Cloud, Multi-Cluster Kubernetes Orchestration
Go to file
Hongcai Ren 1186eeb9a4
add script for run e2e tests (#71)
2020-12-14 10:42:01 +08:00
.github enable unit test in workflow (#66) 2020-12-09 10:36:04 +08:00
artifacts support kubeconfig and masterURL parameters (#69) 2020-12-11 18:05:51 +08:00
cluster/images/karmada-controller-manager Add makefile and dockfile 2020-11-11 16:45:49 +08:00
cmd support kubeconfig and masterURL parameters (#69) 2020-12-11 18:05:51 +08:00
docs add policy controller design (#50) 2020-12-11 19:46:13 +08:00
hack add script for run e2e tests (#71) 2020-12-14 10:42:01 +08:00
pkg add script for run e2e tests (#71) 2020-12-14 10:42:01 +08:00
samples/nginx Apply suggestions from code review 2020-11-30 20:05:30 +08:00
test add script for run e2e tests (#71) 2020-12-14 10:42:01 +08:00
vendor Update vendor. 2020-12-03 21:40:37 +08:00
.gitignore update gitignore 2020-11-10 22:54:35 +08:00
.golangci.yml Disable excluding of issues about comments from golint. 2020-11-18 15:09:12 +08:00
LICENSE Add LICENSE 2020-11-10 19:38:42 +08:00
Makefile enable unit test in workflow (#66) 2020-12-09 10:36:04 +08:00
README.md update architecture and concepts 2020-12-04 21:28:24 +08:00
go.mod Update vendor. 2020-12-03 21:40:37 +08:00
go.sum Update vendor. 2020-12-03 21:40:37 +08:00

README.md

Karmada

Karmada (Kubernetes Armada) is a multi-cluster management system speaks Kubernetes native API. Karmada aims to provide turnkey automation for multi-cluster application management in multi-cloud and hybrid cloud scenarios, and intended to realize multi-cloud centralized management, high availability, failure recovery and traffic scheduling.

Its key capabilities include:

  • Cross-cluster applications managements based on K8s native API, allow user migrate apps from single cluser to multi-cluster conveniently and quickly.
  • Support provisioning or attaching Kubernetes clusters for centralized operations and management.
  • Cross-cluster applications auto-scaling ,failover and loadbalancing on multi-cluster.
  • Advanced scheduling strategy: region, available zone, cloud provider, cluster affinity/anti-affinity.

Architecture

Architecture

The Karmada Control Plane consists of the following components:

  • ETCD for storing the karmada API objects
  • Karmada API Server
  • Karmada Controller Manager
  • Karmada Scheduler

ETCD stores the karmada API objects, the API Server is the REST endpoint all other components talk to, and the Karmada Controller Manager perform operations based on the API objects you create through the API server.

The Karmada Controller Manager runs the various controllers, the controllers watch karmada objects and then talk to the underlying clusters API servers to create regular Kubernetes resources.

  1. Cluster Controller: attach kubernetes clusters to Karmada for managing the lifecycle of the clusters by creating membercluster object.

  2. Policy Controller: the controller watches PropagationPolicy objects. When PropagationPolicy object is added, it selects a group of resources matching the resourceSelector and create PropagationBinding with each single resource object.

  3. Binding Controller: the controller watches PropagationBinding object and create PropagationWork object corresponding to each cluster with single resource manifest.

  4. Excution Controller: the controller watches PropagationWork objects.When PropagationWork objects are created, it will distribute the resources to member clusters.

Concepts

Resource template: Karmada uses Kubernetes Native API definition for federated resource template, to make it easy to integrate with existing tools that already adopt on Kubernetes

Propagation Policy: Karmada offers standalone (placement) policy API to define spreading requirements.

  • Support 1:n mapping of Policy: workload, users don't need to indicate scheduling constraints every time creating federated applications.
  • With default policies, users can just interact with K8s API

Override Policy: Karmada provides standalone override API for specializing cluster relevant configuration automation. E.g.:

  • Override image prefix according to member cluster region
  • Override StorageClass according to cloud provider

The following diagram shows how Karmada resources are involved when propagating resources to member clusters.

karmada-resource-relation

Quickstart

Please install kind and kubectl before the following steps.

Install karmada

  1. Clone this repo to get karmada.
git clone https://github.com/huawei-cloudnative/karmada
  1. Move to the karmada package directory.
cd karmada
  1. Install karmada.
export KUBECONFIG=/root/.kube/karmada.config
hack/local-up-karmada.sh
  1. Verify that karmada's component is deployed and running.
kubectl get pods -n karmada-system

Join member cluster

  1. Create member cluster for attaching it to karmada.
hack/create-cluster.sh member-cluster-1 /root/.kube/membercluster1.config
  1. Join member cluster to karmada using karmadactl.
make karmadactl
./karmadactl join member-cluster-1 --member-cluster-kubeconfig=/root/.kube/membercluster1.config
  1. Verify member cluster is Joined to karmada successfully.
kubectl get membercluster -n karmada-cluster

Propagate application

  1. Create nginx deployment in karmada.
export KUBECONFIG=/root/.kube/karmada.config
kubectl create -f samples/nginx/deployment.yaml
  1. Create PropagationPolicy that will propagate nginx to member cluster.
export KUBECONFIG=/root/.kube/karmada.config
kubectl create -f samples/nginx/propagationpolicy.yaml
  1. Verify the nginx is deployed successfully in member-cluster-1.
export KUBECONFIG=/root/.kube/membercluster1.config
kubectl describe deploy nginx