首页 文章

关于为Kubernetes安装Calico的问题

提问于
浏览
1

我有两个问题:

Background:

  • 我正在尝试在我的家庭网络上设置Kubernetes,只需要一个Master和Single Minion(加上污点大师以便它可以运行Pods) .

  • 我正在使用kubeadm进行安装 .

  • 我想将Calico用于CNI .

  • 家庭局域网的子网CIDR为192.168.10.0/24 .

  • 我正在使用"etcd datastore"方法安装Calico .

Calico的默认Pod网络CIDR为192.160.0.0/16,而doco表示它不得与物理网络重叠 . 我可以在calico.yaml中更改该设置,但documentation也声明配置etc_endpoints .

Q1 . 为什么我需要配置etcd_endpoint?

Q2 . 我在哪里可以找到 Value ?

1 回答

  • 0

    如果要使用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 在许多地方使用 .

    Update

    如果使用默认值,则无需预先配置它,只检查它是否是正确的 endpoints . 来自kubernetes docs:提供的文件

    # 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中,您需要手动向服务IP池中的任何免费IP提供 etcd_endpoints ,或者如果您使用默认设置,则可以保留原样 . 这将是一个新的etd将开始为Calico需求 . 并且您可以将pod CIDR更改为任何池 . 它现在有效,我刚检查过它 .

相关问题