MCPcopy Index your code
hub / github.com/AliyunContainerService/terway

github.com/AliyunContainerService/terway @v1.17.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.17.2 ↗ · + Follow
5,152 symbols 23,741 edges 446 files 1,868 documented · 36%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Terway 网络插件

CNI plugin for alibaba cloud VPC/ENI

Go Report Card codecov Linter

English | 简体中文

简介

Terway网络插件是ACK自研的容器网络接口(CNI)插件,基于阿里云的弹性网卡(ENI)构建网络,可以充分利用云上资源。Terway支持eBPF对网络流量进行加速,降低延迟,支持基于Kubernetes标准的网络策略(Network Policy)来定义容器间的访问策略。

在Terway网络插件中,每个Pod都拥有自己的网络栈和IP地址。同一台ECS内的Pod之间通信,直接通过机器内部的转发,跨ECS的Pod通信、报文通过VPC的弹性网卡直接转发。由于不需要使用VxLAN等的隧道技术封装报文,因此Terway模式网络具有较高的通信性能。

特性

  • ENI网络模式:分配 Elastic Network Interfaces (ENIs) 给Pod,优化资源利用率和网络性能。
  • Trunking功能:允许Pod配置独立的ENI,支持灵活安全组、交换机配置。
  • 节点池维度网络模式配置:支持节点池配置为独占ENI。
  • 安全策略:支持NetworkPolicy和传统的安全组,提供多维度的网络安全控制。
  • 高性能:使用eBPF加速协议栈,确保低延迟和高吞吐量。
  • IPv6: 支持IPv4/IPv6双栈。
  • 灵骏: 支持智能计算灵骏。

以下功能已经废弃

  • VPC网络模式:利用VPC路由,实现容器与VPC内其他资源的直接通信。
  • 独占ENI模式:将ENI直通进Pod,最大化网络性能。(替换为通过节点池维度网络模式配置为独占ENI)

版本差异

ACK 提供的版本和开源一致。仅Trunking功能无法在自建集群使用。

贡献

我们非常欢迎社区的贡献!无论是修复bug、新增功能、改进文档,或者仅仅是对现有代码的改进,你的帮助都将被我们珍视。

报告问题 提交Pull Request

安全

如果您发现了代码中的安全漏洞,请联系kubernetes-security@service.aliyun.com。详见 SECURITY.md

社区

钉钉群

通过钉钉群号 "35924643" 加入钉钉群组。

Extension points exported contracts — how you extend this code

ResourceMappingHandler (Interface)
ResourceMappingHandler get resource mapping [7 implementers]
pkg/tracing/tracing.go
Storage (Interface)
Storage persistent storage on disk [4 implementers]
pkg/storage/store.go
ResourceRequest (Interface)
(no doc) [7 implementers]
pkg/eni/types.go
ECSClient (Interface)
(no doc) [8 implementers]
pkg/aliyun/credential/clients.go
NodeCapabilitiesStore (Interface)
NodeCapabilitiesStore defines an interface for node capabilities operations [2 implementers]
pkg/utils/nodecap/node_capabilities.go
Kubernetes (Interface)
Kubernetes operation set [2 implementers]
pkg/k8s/k8s.go
FirewallBackend (Interface)
FirewallBackend defines the interface for firewall rule management [2 implementers]
cmd/terway-cli/symmetric.go
Res (Interface)
Res is the func for res [1 implementers]
types/daemon/types.go

Core symbols most depended-on inside this repo

Equal
called by 1594
pkg/windows/ip/ipnet.go
Error
called by 660
pkg/aliyun/client/errors/errors.go
Get
called by 641
pkg/storage/store.go
Run
called by 509
pkg/eni/manager.go
Client
called by 399
pkg/eni/crdv2.go
Contains
called by 319
pkg/windows/ip/ipnet.go
String
called by 276
pkg/eni/types.go
Error
called by 231
types/errors.go

Shape

Function 2,612
Method 1,915
Struct 451
Interface 90
TypeAlias 63
FuncType 21

Languages

Go100%

Modules by API surface

rpc/rpc.pb.go177 symbols
rpc/tracing.pb.go133 symbols
tests/utils_test.go107 symbols
pkg/apis/network.alibabacloud.com/v1beta1/zz_generated.deepcopy.go104 symbols
pkg/eni/local_test.go88 symbols
pkg/aliyun/client/ecs_api_test.go68 symbols
pkg/eni/eni_local_ipam_test.go65 symbols
tests/node_utils_test.go63 symbols
pkg/controller/multi-ip/node/pool_test_factory_test.go61 symbols
pkg/aliyun/client/interface.go61 symbols
pkg/k8s/k8s.go55 symbols
pkg/k8s/k8s_test.go53 symbols

For agents

$ claude mcp add terway \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page