如果你想使用 Calico,你必须为你的家庭 LAN 使用不同的 IP 范围,因为 Calico 使用192.168.0.0/16
网络。您可以将您的家庭网络更改为10.0.0.0/8
或更小或更改为172.16.0.0/16
. 作为替代方案,您可以为集群选择另一个 CNI。在 YAML 中更改 CALICO_IPV4POOL_CIDR 是不够的。IP范围192.168.0.0/16
在许多地方都使用。
更新
如果您使用默认值,则不需要预先配置它,只需检查它是否是正确的端点。从kubernetes 文档提供的文件中:
# Calico Version v3.1.3
# https://docs.projectcalico.org/v3.1/releases#v3.1.3
# This manifest includes the following component versions:
# calico/node:v3.1.3
# calico/cni:v3.1.3
# This ConfigMap is used to configure a self-hosted Calico installation.
kind: ConfigMap
apiVersion: v1
metadata:
name: calico-config
namespace: kube-system
data:
# To enable Typha, set this to "calico-typha" *and* set a non-zero value for Typha replicas
# below. We recommend using Typha if you have more than 50 nodes. Above 100 nodes it is
# essential.
typha_service_name: "none"
# The CNI network configuration to install on each node.
cni_network_config: |-
不需要,etcd_endpoints
因为它用作 Kubernetes 集群 etcd。
在官方Calico doc新版本的 Calico 中。
配置
# Calico Version v3.2.3
# https://docs.projectcalico.org/v3.2/releases#v3.2.3
# This manifest includes the following component versions:
# calico/node:v3.2.3
# calico/cni:v3.2.3
# calico/kube-controllers:v3.2.3
# This ConfigMap is used to configure a self-hosted Calico installation.
kind: ConfigMap
apiVersion: v1
metadata:
name: calico-config
namespace: kube-system
data:
# Configure this with the location of your etcd cluster.
etcd_endpoints: "http://10.96.232.136:6666"
# If you're using TLS enabled etcd uncomment the following.
# You must also populate the Secret below with these files.
etcd_ca: "" # "/calico-secrets/etcd-ca"
etcd_cert: "" # "/calico-secrets/etcd-cert"
etcd_key: "" # "/calico-secrets/etcd-key"
# Configure the Calico backend to use.
calico_backend: "bird"
在最新版本的 Calico 中,您需要etcd_endpoints
从服务 IP 池中手动向任何免费 IP 提供,或者如果您使用默认设置,您可以保持原样。这将是一个新的 etcd,将为 Calico 的需求启动。并且您可以将您的 pod CIDR 更改为任何池。它现在有效,我刚刚检查过。