Kubernetes Cluster Federation
Kubernetes Cluster Federation (KubeFed for short) allows you to coordinate the configuration of multiple Kubernetes clusters from a single set of APIs in a hosting cluster. KubeFed aims to provide mechanisms for expressing which clusters should have their configuration managed and what that configuration should be. The mechanisms that KubeFed provides are intentionally low-level, and intended to be foundational for more complex multicluster use cases such as deploying multi-geo applications and disaster recovery.
KubeFed is currently alpha and moving rapidly toward its initial beta release.
KubeFed is configured with two types of information:
Propagation refers to the mechanism that distributes resources to federated clusters.
Type configuration has three fundamental concepts:
These three abstractions provide a concise representation of a resource intended to appear in multiple clusters. They encode the minimum information required for propagation and are well-suited to serve as the glue between any given propagation mechanism and higher-order behaviors like policy-based placement and dynamic scheduling.
These fundamental concepts provide building blocks that can be used by higher-level APIs:
| Feature | Maturity | Feature Gate | Default | |---------|----------|--------------|---------| | Push propagation of arbitrary types to remote clusters | Alpha | PushReconciler | true | | CLI utility () | Alpha | | | | Generate KubeFed APIs without writing code | Alpha | | | | Replica Scheduling Preferences | Alpha | SchedulerPreferences | true |
git clone https://github.com/kubernetes-sigs/kubefed.git
kind create cluster
You now have a Kubernetes cluster with kubefed up and running. The cluster has been joined to itself and you can test federation of resources like this:
KubeFedClusterexists and is ready:
kubectl -n kube-federation-system get kubefedclusterIf you're on macOS the cluster will not immediately show as ready. You need to change the API endpoint's URL first:
kubectl create ns federate-me
./bin/kubefedctl federate ns federate-me
ConfigMapto be federated:
kubectl -n federate-me create cm my-cm
./bin/kubefedctl -n federate-me federate configmap my-cm
FederatedConfigMaphas been created and propagates properly:
kubectl -n federate-me describe federatedconfigmap my-cm
Take a look at our user guide if you are interested in using KubeFed.
Take a look at our development guide if you are interested in contributing.
Refer to the contributing guidelines if you would like to contribute to KubeFed.
KubeFed is sponsored by SIG Multicluster and it uses the same communication channels as SIG multicluster.
Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.