azure - 在 Azure 但在非 AKS Kubernetes 环境/Kubernetes Baremetal 安装中需要 Azure CNI 的问题或帮助
问题描述
我找到了这个 cni 和插件,我目前正在使用 docker 在 azure 上的 kubernetes v1.20.5 裸机安装中对其进行测试。我们不使用 aks azure 服务,因为我们想在我们的一个客户的 prem vmware 环境中学习和部署以后的 kubernetes,但是我们会在那里使用不同的 cni,比如 flannel 或 weave。flannel 和 weave 在 azure 上不起作用,这就是我使用 azure cni 插件的原因。
我的测试环境:
- 我们有 6 个带有 rhel7.9 的虚拟机... 3 个 kubernets master 和 3 个 kubenetes worker。
- 我们有一个带有两个子网的 vnet(192.168.xx 用于节点 && 10.1.xx 用于 pod)
- 每个虚拟机都有两个网卡... eth0 节点子网 192.x和eth1 是 pod 子网 10.x
- 在所有 6 台虚拟机上,我使用 (# ./install-cni-plugin.sh v1.2.9 v0.9.1) 安装了 azure CNI
- 在所有 6 台虚拟机上,我安装了 azure CLI 并使用我的帐户登录
- 我们在您的文档 net.ipv4.ip_forward=1 iptables -t nat -A POSTROUTING -m addrtype 中启用了端口转发和 iptables 规则,如 describend!--dst-type 本地!-d 10.1.0.0/16 -j 伪装
我下面的 ipam 配置无法正常工作。我需要添加第二个网卡
{
"cniVersion":"0.3.0",
"name":"azure",
"plugins":[
{
"type":"azure-vnet",
"mode":"transparent",
"ipsToRouteViaHost":["169.254.20.10"],
"ipam": {
"type": "host-local",
"subnet": "10.1.0.0/16",
"gateway": "10.1.0.1"
},
"dns": {
"nameservers": [ "10.1.0.1" ]
}
},
{
"type":"portmap",
"capabilities":{
"portMappings":true
},
"snat":true
}
]
}
尾 -f /var/log/azure-vnet.log
2021/03/30 12:23:11 [41456] [cni] reboot time 2021-03-29 23:16:00 +0000 UTC
2021/03/30 12:23:11 [41456] Connected to telemetry service
2021/03/30 12:23:11 [41456] [cni-net] Plugin azure-vnet version v1.2.8.
2021/03/30 12:23:11 [41456] [cni-net] Running on Linux version 4.18.0-147.43.1.el8_1.x86_64 (mockbuild@x86-vm-08.build.eng.bos.redhat.com) (gcc version 8.3.1 20190507 (Red Hat 8.3.1-4) (GCC)) #1 SMP Thu Feb 18 08:33:46 EST 2021
2021/03/30 12:23:11 [41456] [Azure-Utils] iptables --version
2021/03/30 12:23:11 [41456] [cni-net] iptable version:iptables v1.8.2 (nf_tables), err:<nil>
2021/03/30 12:23:11 [41456] [Azure-Utils] ebtables --version
2021/03/30 12:23:11 [41456] [cni-net] ebtable version ebtables 1.8.2 (nf_tables), err:<nil>
2021/03/30 12:23:11 [41456] [net] Network interface: {Index:1 MTU:65536 Name:lo HardwareAddr: Flags:up|loopback} with IP: [127.0.0.1/8]
2021/03/30 12:23:11 [41456] [net] Network interface: {Index:2 MTU:1500 Name:eth0 HardwareAddr:00:0d:3a:6c:c0:0c Flags:up|broadcast|I would be very grateful if someone would help me, as I'm slowly going insanemulticast} with IP: [192.168.0.7/24]
2021/03/30 12:23:11 [41456] [net] Network interface: {Index:3 MTU:1500 Name:eth1 HardwareAddr:00:0d:3a:f5:cb:22 Flags:up|broadcast|multicast} with IP: [10.1.1.10/16]
2021/03/30 12:23:11 [41456] [net] Network interface: {Index:4 MTU:1500 Name:docker0 HardwareAddr:02:42:0f:16:a8:5e Flags:up|broadcast|multicast} with IP: [172.17.0.1/16]
2021/03/30 12:23:11 [41456] [net] network store key not found
2021/03/30 12:23:11 [41456] [cni-net] Plugin started.
2021/03/30 12:23:11 [41456] CNI_COMMAND environment variable set to VERSION
2021/03/30 12:23:11 [41456] [cni-net] Plugin stopped
尾 -f /var/log/azure-vnet-ipam.log
2021/03/29 22:37:18 [10282] [Utils] Initializing HTTP client with connection timeout: 10, response header timeout: 10
2021/03/29 22:37:18 [10282] [ipam] Wireserver call http://168.63.129.16/machine/plugins?comp=nmagent&type=getinterfaceinfov1 to retrieve IP List
2021/03/29 22:37:18 [10282] [ipam] got 0 addresses from interface eth0, subnet 192.168.0.0/24
2021/03/29 22:37:18 [10282] [ipam] got 0 addresses from interface eth1, subnet 10.1.0.0/16
2021/03/29 22:37:18 [10282] [ipam] merging address space
2021/03/29 22:37:18 [10282] [ipam] saving ipam state.
2021/03/29 22:37:18 [10282] [ipam] Save succeeded.
2021/03/29 22:37:18 [10282] [azure-vnet-ipam] Failed to release address: Pool id not found :Invalid address pool.
2021/03/29 22:37:18 [10282] [cni-ipam] DEL command completed with err:Failed to release address: Pool id not found :Invalid address pool.
2021/03/29 22:37:18 [10282] [cni-ipam] Plugin stopped.
以下是我的问题:
- 我的配置在顶部吗?还是我理解错了?
- 这仅在我将 azure 上的多个 ip 地址添加到第二个 nic(eth1,子网 10.1.0.0/16)时才有效,但我希望有所不同。但我不想那样做!!!:-(
- 如果我对您的文档的理解正确,我希望该插件会在第二个 nic 上创建、添加和删除 ipadresses?
如果有人能帮助我,我将非常感激,因为我正在慢慢发疯^^
提前谢谢
解决方案
推荐阅读
- javascript - 一个组件具有相同服务的两个实例
- amazon-web-services - 使用 AWS API:给定 IAM 用户,获取当前有效的 IAM 政策文档
- eloquent - 每次刷新页面时结果都会重复
- java - Netbeans Autocomplete 只是随机停止工作?
- docker - 推送多个 docker 镜像以显示不带标签
- python - 如何设置创建密码生成器并询问密码应该多长?
- flutter - 如何为 linux arm 构建 frontend_server.dart.snapshot?
- javascript - Impetus.js 库:TypeError:impetus_1.Impetus 不是构造函数
- python - 无法在 Django 模型中上传图像
- javascript - Vue使用键值使axios GET并显示数组中的数据?