baiducloud-cce-cni-driver

module
v1.9.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2024 License: Apache-2.0

README

Baidu Cloud CNI Plugin

English | 简体中文

Introduction

Baidu Cloud CNI plugin implement an interface between CNI enabled Container Orchestrator and Baidu Cloud Network Infrastructure.

Getting Started

These instructions will get you a copy of the project up and running on your environment for development and testing purposes. See installing for notes on how to deploy the project on a Baidu Cloud CCE cluster.

Prerequisites

A healthy CCE kubernetes cluster. See documents for creating a CCE cluster.

Features

From the perspective of Pod connectivity in one node, Baidu Cloud CNI Plugin supports 2 modes:

  • veth (compatible with all OS Image)
  • ipvlan (need kernel version >= 4.9, e.g., ubuntu16/18 and centos8+)

From the perspective of Pod connectivity across nodes, Baidu Cloud CNI Plugin supports 3 modes:

  • VPC Route Mode
  • ENI Secondary IP Mode (only for BCC)
  • BBC Secondary IP Mode
Components

There are 3 components:

  • CNI Plugin, which will wire up host's and pod's network stack when called.
  • Node Agent, which is a long-running daemon on each node responsible for:
    • create cni configuration file in /etc/cni/net.d/
    • install cni plugin binaries in /opt/cni/bin/
    • setup attached ENIs
    • create VPC route
  • ENI IPAM, which is a long-running central process, supports:
    • create and attach ENIs to node
    • assign a Private IP address to a Pod
Installing

Fill proper information about CCE cluster in build/yamls/cce-cni-driver/values.yaml , then run

make charts VALUES=build/yamls/cce-cni-driver/values.yaml | kubectl apply -f -

Assume we have a CCE cluster with ID cce-xxxxx at bj region. Cluster cce-xxxxx is in VPC vpc-yyyyy.

Example values.yaml are shown below:

VPC Route Mode
CNIMode: vpc-route-auto-detect
Region: bj
ClusterID: cce-xxxxx
VPCID: vpc-yyyyy
ContainerNetworkCIDRIPv4: # cluster container cidr
CCEGatewayEndpoint: cce-gateway.bj.baidubce.com
BCCEndpoint: bcc.bj.baidubce.com
BBCEndpoint: bbc.bj.baidubce.com
ServiceCIDR: # cluster service cidr
CCECNIImage: registry.baidubce.com/cce-plugin-pro/cce-cni:v1.3.4

# Route Controller
EnableVPCRoute: true
EnableStaticRoute: false
ENI Secondary IP Mode
CNIMode: vpc-secondary-ip-auto-detect
Region: bj
ClusterID: cce-xxxxx
VPCID: vpc-yyyyy
ENISubnetList:
  - sbn-a
  - sbn-b
SecurityGroupList:
  - g-bwswsr8fbjb4
CCEGatewayEndpoint: cce-gateway.bj.baidubce.com
BCCEndpoint: bcc.bj.baidubce.com
BBCEndpoint: bbc.bj.baidubce.com
ServiceCIDR: # cluster service cidr
CCECNIImage: registry.baidubce.com/cce-plugin-pro/cce-cni:v1.3.4
BBC Secondary IP Mode
CNIMode: bbc-vpc-secondary-ip-auto-detect
Region: bj
ClusterID: cce-xxxxx
VPCID: vpc-yyyyy
CCEGatewayEndpoint: cce-gateway.bj.baidubce.com
BCCEndpoint: bcc.bj.baidubce.com
BBCEndpoint: bbc.bj.baidubce.com
ServiceCIDR: # cluster service cidr
CCECNIImage: registry.baidubce.com/cce-plugin-pro/cce-cni:v1.3.4

For more details, check values.yaml.

Running the tests

Unit Test
make test

Contributing

Please go through CNI Spec to get some basic understanding of CNI driver before you start.

Requirements
  • Golang 1.13.+
  • Docker 17.05+ for releasing
Dependency

Dependencies are managed through go module.

Build

To build the project, first turn on go mod using export GO111MODULE=on.

To build all the binary, run make build, then build the docker image using: make cni-image.

Issues
  • Please create an issue in issue list.
  • Contact Committers/Owners for further discussion if needed.

Authors

Discussion

  • Issue list.
  • Ruliu Group ID: 1586317

Directories

Path Synopsis
cmd
cni
eri
ptp
pkg
apis/networking/v1alpha1
v1alpha1 版本的api包
v1alpha1 版本的api包
apis/networking/v2
v2 版本的api包
v2 版本的api包
bce/cloud/testing
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.
bce/metadata/testing
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.
cni
controller/subnet/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
eniipam/ipam/rdma/client/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
eniipam/ipam/testing
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.
generated/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
generated/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
generated/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
generated/clientset/versioned/typed/networking/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
generated/clientset/versioned/typed/networking/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
generated/clientset/versioned/typed/networking/v2
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
generated/clientset/versioned/typed/networking/v2/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
nodeagent/util/roce/testing
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.
rpc
rpc/testing
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.
util/fs/testing
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.
util/kernel/testing
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.
util/network/testing
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.
util/slice
Package slice provides utility methods for common operations on slices.
Package slice provides utility methods for common operations on slices.
wrapper/cnitypes/testing
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.
wrapper/grpc/testing
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.
wrapper/ip/testing
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.
wrapper/ipam/testing
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.
wrapper/netlink/testing
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.
wrapper/netns/testing
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.
wrapper/ns/testing
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.
wrapper/rpc/testing
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.
wrapper/sysctl/testing
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.
test

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL