美文网首页
k8s 网络插件

k8s 网络插件

作者: 陈先生_9e91 | 来源:发表于2018-09-17 12:08 被阅读0次

k8s 网络插件

跨node

为了实现不同node上的Pod通信,必须实现以下两点:

  1. 对k8s集群中所有node上的pod做IP规划,防止IP冲突。因为Pod之间通过Pod IP通信。
  2. 保存规划的Pod IP与node IP映射关系。因为说到底node之间是通过node IP通信。

flannel

实现猜想

数据包从docker0出来,转发给flannel,flannel根据目标Pod IP查询对应node IP,然后发送给对应node上的flannel,对端flannel收到数据包之后再转发docker0。

原理

image

config

通过-etcd-prefix string etcd prefix (default "/coreos.com/network"),存入etcd。

The value of the config is a JSON dictionary with the following keys:

  • Network (string): 重点。IPv4 network in CIDR format to use for the entire flannel network. (This is the only mandatory key.)

  • SubnetLen (integer): The size of the subnet allocated to each host.
    Defaults to 24 (i.e. /24) unless Network was configured to be smaller than a /24 in which case it is one less than the network.

  • SubnetMin (string): The beginning of IP range which the subnet allocation should start with.
    Defaults to the first subnet of Network.

  • SubnetMax (string): The end of the IP range at which the subnet allocation should end with.
    Defaults to the last subnet of Network.

  • Backend (dictionary): 重点。Type of backend to use and specific configurations for that backend.
    The list of available backends and the keys that can be put into the this dictionary are listed below.
    Defaults to udp backend.

backends

VXLAN is the recommended choice. host-gw is recommended for more experienced users who want the performance improvement and whose infrastructure support it (typically it can't be used in cloud environments). UDP is suggested for debugging only or for very old kernels that don't support VXLAN.

VXLAN

Use in-kernel VXLAN to encapsulate the packets.

Type and options:

  • Type (string): vxlan
  • VNI (number): VXLAN Identifier (VNI) to be used. Defaults to 1.
  • Port (number): UDP port to use for sending encapsulated packets. Defaults to kernel default, currently 8472.
  • GBP (Boolean): Enable VXLAN Group Based Policy. Defaults to false.
  • DirectRouting (Boolean): Enable direct routes (like host-gw) when the hosts are on the same subnet. VXLAN will only be used to encapsulate packets to hosts on different subnets. Defaults to false.

host-gw

Use host-gw to create IP routes to subnets via remote machine IPs. Requires direct layer2 connectivity between hosts running flannel.

host-gw provides good performance, with few dependencies, and easy set up.

Type:

  • Type (string): host-gw

UDP

Use UDP only for debugging if your network and kernel prevent you from using VXLAN or host-gw.

Type and options:

  • Type (string): udp
  • Port (number): UDP port to use for sending encapsulated packets. Defaults to 8285.

相关文章

  • k8s 网络插件

    k8s 网络插件 跨node 为了实现不同node上的Pod通信,必须实现以下两点: 对k8s集群中所有node上...

  • k8s的idea配置

    idea安装k8s插件 idea插件官网地址 查找对应自己idea版本的k8s插件信息 help->about->...

  • 浅析 Kubernetes原生NetworkPolicy 网络策

    k8s中的网络策略主要分为原生 NetworkPolicy 和第三方网络插件提供的网络策略。本文将主要分析原生Ne...

  • kubernetes之network policy

    Network policy:设置pod进出网络的策略,k8s本身并不支持,主要靠以下网络插件来支持。 calic...

  • k8s 1.22.15 版本技术文档

    1. 基础环境 2. 部署 k8s 环境 3. 安装网络插件 4. 更换 kube-proxy 网络模式为 ipv...

  • k8s 报错总结

    flannel网络插件,跨主机pod无法通信 故障现象 本机实验 k8s版本1.18.3flannel 在pod中...

  • K8S 网络插件对比

    集群网络架构是 K8s 中比较复杂的,最让用户头痛的方面之一。K8s 拥有众多的 CNI 插件,该如何做好CNI的...

  • Openshift开启Calico BGP 与 OVS性能PK

    Openshift网络方案选择 大家都知道K8S在网络插件选择上有很多种,默认的是Flannel,但是它的性能一般...

  • docker 启动失败:Failed to start Dock

    说明: 在部署k8s中,安装网络插件cilium,初始化无法完成,打印日志pull拉取镜像失败(拒绝连接), 当初...

  • Minikube 基础插件 addons

    minikube 通过插件的方式提供了 k8s 集群的基本服务。 Minikube 插件 查看所有插件 输入如下:...

网友评论

      本文标题:k8s 网络插件

      本文链接:https://www.haomeiwen.com/subject/eloknftx.html