Skip to content

Managing pods using the flat-networks (Macvlan/IPvlan) in Rancher.

License

Notifications You must be signed in to change notification settings

cnrancher/rancher-flat-network

Repository files navigation

rancher-flat-network

CI Go Report Card GitHub release GitHub pre-release License

Rancher Flat-Network Operator (based on Wrangler V2) & CNI plugin for managing pods using the flat-networks (Macvlan/IPvlan).

Current Progress

Operator

  • FlatNetwork subnet IPAM supports for both Macvlan & IPvlan.
  • Support for both IPv4 and IPv6 addresses.
  • IPAM supports custom specified IP address or allocate IP address automatically.
  • Custom IP Range to allocate IP address.
  • Auto create FlatNetwork headless ClusterIP service.
  • Leader election support to run operator & webhook server in multi-replicas (HA).
  • Update FlatNetwork Service Endpoints IP address.
  • Admission webhook server.

CNI

  • Macvlan & IPvlan support.
  • CNI Spec 1.0.0 support.

Migrator

  • Upgrade resource migrator from macvlan.cluster.cattle.io to flatnetwork.pandaria.io.

Usage

Operator

To build and run this flat-network operator manually:

  1. Prepare a clean Kubernetes cluster for testing purpose.

  2. Apply CRDs.

    $ kubectl apply -f ./charts/rancher-flat-network/templates/crd.yaml
  3. Build and run flat-network operator.

    $ go build . && ./rancher-flat-network-operator --webhook-server=false
  4. Example workloads are available in docs directory, run following command to create example subnet & workloads for test.

    $ kubectl apply -f ./docs/macvlan
    $ kubectl apply -f ./docs/ipvlan

Environment variables for operator:

  • CATTLE_DEV_MODE: Enable debug outputs and extend the leader election renew deadline & lease duration to support delve breakpoint debug operations, default false.
  • CATTLE_RESYNC_DEFAULT: period to resync resources in minutes, default 600min (10h).
  • CATTLE_ELECTION_LEASE_DURATION: leader election lease duration, default 45s.
  • CATTLE_ELECTION_RENEW_DEADLINE: leader election renew deadline, default 30s.
  • CATTLE_ELECTION_RETRY_PERIOD: leader election retry period, default 2s.
  • FLAT_NETWORK_CNI_ARP_POLICY: CNI ARP Policy, default arp_notify, available arp_notify, arping.
  • FLAT_NETWORK_CLUSTER_CIDR: Kubernetes config Cluster CIDR, default 10.42.0.0/16.
  • FLAT_NETWORK_SERVICE_CIDR: Kubernetes config Service CIDR, default 10.43.0.0/16.

License

Copyright 2024 SUSE Rancher

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Managing pods using the flat-networks (Macvlan/IPvlan) in Rancher.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages