flannel 3种后端设置方法

[复制链接]
发表于 4 天前 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
1.udp
  1. apiVersion: v1
  2. data:
  3.   cni-conf.json: |
  4.     {
  5.       "name": "cbr0",
  6.       "cniVersion": "0.3.1",
  7.       "plugins": [
  8.         {
  9.           "type": "flannel",
  10.           "delegate": {
  11.             "hairpinMode": true,
  12.             "isDefaultGateway": true
  13.           }
  14.         },
  15.         {
  16.           "type": "portmap",
  17.           "capabilities": {
  18.             "portMappings": true
  19.           }
  20.         }
  21.       ]
  22.     }
  23.   net-conf.json: |
  24.     {
  25.       "Network": "10.244.0.0/16",
  26.       "SubnetLen": 24,
  27.       "Backend": {
  28.         "Type": "udp",
  29.         "Port": 8285
  30.       }
  31.     }
  32. kind: ConfigMap
  33. metadata:
  34.   labels:
  35.     app: flannel
  36.     k8s-app: flannel
  37.     tier: node
  38.   name: kube-flannel-cfg
  39.   namespace: kube-flannel
复制代码
2.vxlan
  1. apiVersion: v1
  2. data:
  3.   cni-conf.json: |
  4.     {
  5.       "name": "cbr0",
  6.       "cniVersion": "0.3.1",
  7.       "plugins": [
  8.         {
  9.           "type": "flannel",
  10.           "delegate": {
  11.             "hairpinMode": true,
  12.             "isDefaultGateway": true
  13.           }
  14.         },
  15.         {
  16.           "type": "portmap",
  17.           "capabilities": {
  18.             "portMappings": true
  19.           }
  20.         }
  21.       ]
  22.     }
  23.   net-conf.json: |
  24.     {
  25.       "Network": "10.244.0.0/16",
  26.       "EnableNFTables": false,
  27.       "Backend": {
  28.         "Type": "vxlan"
  29.       }
  30.     }
  31. kind: ConfigMap
  32. metadata:
  33.   labels:
  34.     app: flannel
  35.     k8s-app: flannel
  36.     tier: node
  37.   name: kube-flannel-cfg
  38.   namespace: kube-flannel
复制代码
3.host-gw
  1. apiVersion: v1
  2. data:
  3.   cni-conf.json: |
  4.     {
  5.       "name": "cbr0",
  6.       "cniVersion": "0.3.1",
  7.       "plugins": [
  8.         {
  9.           "type": "flannel",
  10.           "delegate": {
  11.             "hairpinMode": true,
  12.             "isDefaultGateway": true
  13.           }
  14.         },
  15.         {
  16.           "type": "portmap",
  17.           "capabilities": {
  18.             "portMappings": true
  19.           }
  20.         }
  21.       ]
  22.     }
  23.   net-conf.json: |
  24.     {
  25.       "Network": "10.244.0.0/16",
  26.       "EnableNFTables": false,
  27.       "Backend": {
  28.         "Type": "host-gw"
  29.       }
  30.     }
  31. kind: ConfigMap
  32. metadata:
  33.   labels:
  34.     app: flannel
  35.     k8s-app: flannel
  36.     tier: node
  37.   name: kube-flannel-cfg
  38.   namespace: kube-flannel
复制代码
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
继续阅读请点击广告
回复

使用道具 举报

© 2001-2025 Discuz! Team. Powered by Discuz! X3.5

GMT+8, 2025-7-25 08:16 , Processed in 0.076181 second(s), 28 queries 手机版|qidao123.com技术社区-IT企服评测▪应用市场 ( 浙ICP备20004199 )|网站地图

快速回复 返回顶部 返回列表