在单节点上部署calicov3273后,发现资源占用

 修改calico以下配置是资源消耗降低
1、因为是单节点,没有跨节点pod网段组网需要,禁用overlay方式网络(ipip,vxlan),使用route方式网络
配置calico-node的环境变量
CALICO_IPV4POOL_IPIP: Never
CALICO_IPV4POOL_VXLAN: Never
CALICO_IPV6POOL_VXLAN: Never
FELIX_IPINIPENABLED: false
FELIX_VXLANENABLED: false
参考
Troubleshoot eBPF mode | Calico Documentation (tigera.io)
2、节点使用XDP加速hostendpoint之间通信,但是是单节点,没有必要,而且环境中单节点一直报XDP的错误
failed to wipe the XDP state error=failed to load BPF program (/usr/lib/calico/bpf/filter.o): stat /sys/fs/bpf/calico/xdp/prefilter_v1_calico_tmp_A: no such file or directory
因此,禁用XDP。
FELIX_XDPENABLE: false
FELIX_BPFENABLED: false #禁用bpf,默认为false,可以不用配置
参考
Configuring Felix | Calico Documentation (tigera.io)
Kind XDP disabled for dev environment by jayunit100 · Pull Request #3017 · projectcalico/calico (github.com)
3、设置calico_backend: bird为calico_backend: vxlan(在calico部署文件中configmap中配置),节省资源消耗(没有overlay网络不需要bird)
参考
Customize Calico configuration | Calico Documentation (tigera.io)
Comment out the line - -bird-ready and - -bird-live from the calico/node readiness/liveness check (otherwise disabling BIRD will cause the readiness/liveness check to fail on every node)
至此,部署的calico性能消耗明显降低,如下图所示



















