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
相关推荐
别骂我h16 分钟前
部署LVS-DR群集
linux·服务器·lvs
colorful_stars35 分钟前
vscode连接的linux服务器,上传项目至github
linux·vscode·github
hnlucky1 小时前
k8s中kubeSphere的安装使用+阿里云私有镜像仓库配置完整步骤
linux·运维·学习·阿里云·容器·kubernetes·云计算
愚润求学1 小时前
【Linux】线程概念
linux·运维·服务器
焦糖布丁的午夜1 小时前
Shell脚本中的常用命令
linux
努力学习的小廉2 小时前
深入了解linux系统—— 库的链接和加载
linux·运维·服务器
Albert_Lsk2 小时前
技术文档写作大纲
java·linux·服务器·技术文档
MoFe12 小时前
【.net core】SkiaSharp 如何在Linux上实现
linux·服务器·.netcore
风暴智能3 小时前
在ROS2(humble)+Gazebo+rqt下,实时显示仿真无人机的相机图像
linux·无人机
小诸葛的博客3 小时前
Flannel 支持的后端
linux