flannel 3种后端设置方法

1.udp

复制代码
apiVersion: v1
data:
  cni-conf.json: |
    {
      "name": "cbr0",
      "cniVersion": "0.3.1",
      "plugins": [
        {
          "type": "flannel",
          "delegate": {
            "hairpinMode": true,
            "isDefaultGateway": true
          }
        },
        {
          "type": "portmap",
          "capabilities": {
            "portMappings": true
          }
        }
      ]
    }
  net-conf.json: |
    {
      "Network": "10.244.0.0/16",
      "SubnetLen": 24,
      "Backend": {
        "Type": "udp",
        "Port": 8285
      }
    }
kind: ConfigMap
metadata:
  labels:
    app: flannel
    k8s-app: flannel
    tier: node
  name: kube-flannel-cfg
  namespace: kube-flannel

2.vxlan

复制代码
apiVersion: v1
data:
  cni-conf.json: |
    {
      "name": "cbr0",
      "cniVersion": "0.3.1",
      "plugins": [
        {
          "type": "flannel",
          "delegate": {
            "hairpinMode": true,
            "isDefaultGateway": true
          }
        },
        {
          "type": "portmap",
          "capabilities": {
            "portMappings": true
          }
        }
      ]
    }
  net-conf.json: |
    {
      "Network": "10.244.0.0/16",
      "EnableNFTables": false,
      "Backend": {
        "Type": "vxlan"
      }
    }
kind: ConfigMap
metadata:
  labels:
    app: flannel
    k8s-app: flannel
    tier: node
  name: kube-flannel-cfg
  namespace: kube-flannel

3.host-gw

复制代码
apiVersion: v1
data:
  cni-conf.json: |
    {
      "name": "cbr0",
      "cniVersion": "0.3.1",
      "plugins": [
        {
          "type": "flannel",
          "delegate": {
            "hairpinMode": true,
            "isDefaultGateway": true
          }
        },
        {
          "type": "portmap",
          "capabilities": {
            "portMappings": true
          }
        }
      ]
    }
  net-conf.json: |
    {
      "Network": "10.244.0.0/16",
      "EnableNFTables": false,
      "Backend": {
        "Type": "host-gw"
      }
    }
kind: ConfigMap
metadata:
  labels:
    app: flannel
    k8s-app: flannel
    tier: node
  name: kube-flannel-cfg
  namespace: kube-flannel
相关推荐
帕里亚9 分钟前
ubuntu18.04 APT升级 glibc2.28 (Jetson)
linux·运维·windows
好运的阿财19 分钟前
“锟斤拷”问题——程序中用powershell执行命令出现中文乱码的解决办法
linux·前端·人工智能·机器学习·架构·编辑器·vim
cyber_两只龙宝20 分钟前
【Nginx】Nginx实现FastCGI详解
linux·运维·nginx·云原生·php·memcached·fastcgi
砖头拍死你21 分钟前
Powershell使用vim修改文件保存后文件名自动全变小写
linux·编辑器·vim
wang090728 分钟前
linux的中断分析(硬中断和软中断)
linux·运维·服务器
赵优秀一一40 分钟前
Python 工程化基础1:环境(conda)、pip、requirements.txt
linux·开发语言·python
风酥糖1 小时前
chroot的Linux服务配置-当云服务器真正用起来
linux·运维·服务器
木鱼布1 小时前
安装arm虚机启动失败
linux·运维·arm开发
Deitymoon1 小时前
linux——网络基础
linux·网络
CDN3601 小时前
DDoS/CC 攻击下高防不顶用?防护模式与阈值调优教程
tcp/ip·ddos·高防ip