Convert Figma logo to code with AI

kubernetes-retired logokubefed

Kubernetes Cluster Federation

2,496
531
2,496
0

Top Related Projects

2,496

Kubernetes Cluster Federation

1,500

Deploy workloads from Git to large fleets of Kubernetes clusters

4,375

Open, Multi-Cloud, Multi-Cluster Kubernetes Orchestration

1,088

Enable dynamic and seamless Kubernetes multi-cluster topologies

Quick Overview

Kubernetes Federation (KubeFed) is an open-source project that enables the management of multiple Kubernetes clusters from a single control plane. It allows users to coordinate the configuration of multiple Kubernetes clusters and deploy workloads across them, providing a unified view of resources across clusters.

Pros

  • Simplifies multi-cluster management and resource distribution
  • Enables high availability and disaster recovery across multiple clusters
  • Supports workload migration and load balancing between clusters
  • Provides a unified API for managing resources across clusters

Cons

  • Increased complexity in setup and maintenance
  • Performance overhead due to additional abstraction layer
  • Limited support for certain Kubernetes features across federated clusters
  • Project is now retired, which may lead to reduced community support and updates

Code Examples

# Example of a FederatedDeployment resource
apiVersion: types.kubefed.io/v1beta1
kind: FederatedDeployment
metadata:
  name: test-deployment
  namespace: test-namespace
spec:
  template:
    metadata:
      labels:
        app: nginx
    spec:
      replicas: 3
      selector:
        matchLabels:
          app: nginx
      template:
        metadata:
          labels:
            app: nginx
        spec:
          containers:
          - image: nginx:1.17
            name: nginx
  placement:
    clusters:
    - name: cluster1
    - name: cluster2
# Example of a FederatedService resource
apiVersion: types.kubefed.io/v1beta1
kind: FederatedService
metadata:
  name: test-service
  namespace: test-namespace
spec:
  template:
    metadata:
      labels:
        app: nginx
    spec:
      ports:
      - port: 80
        targetPort: 80
      selector:
        app: nginx
  placement:
    clusters:
    - name: cluster1
    - name: cluster2
# Example of a FederatedNamespace resource
apiVersion: types.kubefed.io/v1beta1
kind: FederatedNamespace
metadata:
  name: test-namespace
spec:
  placement:
    clusters:
    - name: cluster1
    - name: cluster2

Getting Started

To get started with KubeFed:

  1. Install the kubefedctl tool:

    curl -LO https://github.com/kubernetes-sigs/kubefed/releases/download/v0.8.1/kubefedctl-0.8.1-linux-amd64.tgz
    tar -zxvf kubefedctl-*.tgz
    chmod u+x kubefedctl
    sudo mv kubefedctl /usr/local/bin/
    
  2. Deploy KubeFed control plane:

    kubefedctl enable
    
  3. Join clusters to the federation:

    kubefedctl join cluster1 --cluster-context cluster1 --host-cluster-context host-cluster
    kubefedctl join cluster2 --cluster-context cluster2 --host-cluster-context host-cluster
    
  4. Create federated resources using the examples provided above.

Competitor Comparisons

2,496

Kubernetes Cluster Federation

Pros of kubefed

  • More active development and community support
  • Better documentation and examples
  • Improved stability and performance

Cons of kubefed

  • Slightly more complex setup process
  • May require additional resources for management

Code Comparison

kubefed:

apiVersion: types.kubefed.io/v1beta1
kind: FederatedDeployment
metadata:
  name: test-deployment
  namespace: test-namespace
spec:
  template:
    # Deployment spec

kubefed>:

apiVersion: core.kubefed.io/v1beta1
kind: FederatedDeployment
metadata:
  name: test-deployment
  namespace: test-namespace
spec:
  template:
    # Deployment spec

The main difference in the code is the API version used. kubefed uses types.kubefed.io/v1beta1, while kubefed> uses core.kubefed.io/v1beta1. This reflects the evolution of the API structure between the two projects.

Both repositories aim to provide federation capabilities for Kubernetes clusters, allowing users to manage multiple clusters from a single control plane. The differences between them are minimal, as they represent different stages of the same project's development. kubefed is generally considered the more up-to-date and actively maintained version, offering improvements in various areas such as documentation, stability, and community support.

1,500

Deploy workloads from Git to large fleets of Kubernetes clusters

Pros of Fleet

  • Active development and maintenance
  • Supports GitOps-based multi-cluster management
  • Integrates well with Rancher ecosystem

Cons of Fleet

  • Less mature compared to KubeFed
  • Smaller community and ecosystem
  • Limited to Kubernetes-based deployments

Code Comparison

KubeFed example:

apiVersion: types.kubefed.io/v1beta1
kind: FederatedDeployment
metadata:
  name: test-deployment
  namespace: test-namespace
spec:
  template:
    metadata:
      labels:
        app: nginx
    spec:
      replicas: 3
      selector:
        matchLabels:
          app: nginx

Fleet example:

apiVersion: fleet.cattle.io/v1alpha1
kind: GitRepo
metadata:
  name: sample
  namespace: fleet-local
spec:
  repo: https://github.com/rancher/fleet-examples
  paths:
  - simple

Fleet focuses on GitOps-based deployments, while KubeFed provides a more traditional federation approach. Fleet's configuration is simpler but less flexible compared to KubeFed's detailed resource definitions. KubeFed offers more granular control over federated resources, while Fleet emphasizes ease of use and Git-based workflows.

4,375

Open, Multi-Cloud, Multi-Cluster Kubernetes Orchestration

Pros of Karmada

  • More active development and community support
  • Enhanced multi-cluster resource management capabilities
  • Better integration with modern Kubernetes features

Cons of Karmada

  • Steeper learning curve due to more complex architecture
  • Less mature documentation compared to KubeFed

Code Comparison

KubeFed example:

apiVersion: types.kubefed.io/v1beta1
kind: FederatedDeployment
metadata:
  name: test-deployment
  namespace: test-namespace
spec:
  template:
    # Deployment spec here

Karmada example:

apiVersion: apps.karmada.io/v1alpha1
kind: PropagationPolicy
metadata:
  name: example-policy
spec:
  resourceSelectors:
    - apiVersion: apps/v1
      kind: Deployment
      name: nginx
  placement:
    clusterAffinity:
      clusterNames:
        - member1
        - member2

The code examples show different approaches to multi-cluster resource management. KubeFed uses a FederatedDeployment resource, while Karmada employs a PropagationPolicy to define how resources should be distributed across clusters.

Karmada offers more granular control over resource propagation and placement, reflecting its more advanced multi-cluster management capabilities. However, this also contributes to its increased complexity compared to KubeFed.

1,088

Enable dynamic and seamless Kubernetes multi-cluster topologies

Pros of Liqo

  • Active development with frequent updates and releases
  • Supports dynamic resource sharing across clusters
  • Enables seamless multi-cluster application deployment

Cons of Liqo

  • Less mature project compared to KubeFed
  • Smaller community and ecosystem
  • Limited documentation and examples for complex scenarios

Code Comparison

KubeFed:

apiVersion: types.kubefed.io/v1beta1
kind: FederatedDeployment
metadata:
  name: test-deployment
  namespace: test-namespace
spec:
  template:
    # Deployment spec

Liqo:

apiVersion: discovery.liqo.io/v1alpha1
kind: ForeignCluster
metadata:
  name: foreign-cluster
spec:
  foreignAuthUrl: https://foreign-cluster-api-server:6443
  # Additional configuration

Both projects aim to facilitate multi-cluster Kubernetes management, but they approach the problem differently. KubeFed focuses on federated resource management across clusters, while Liqo emphasizes dynamic resource sharing and virtual cluster creation. KubeFed has a longer history and more extensive documentation, but its development has slowed. Liqo, being newer, offers more modern features and active development but lacks the maturity of KubeFed. The choice between the two depends on specific use cases and requirements for multi-cluster management.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Kubernetes Cluster Federation (archived)

This repository has been archived and is no longer active development. Please see the current subprojects of SIG Multicluster to track ongoing work.

See this discussion for context.