Kubernetes 集群配置

本教程介绍使用 KubeKey 安装集群时,如何在 config-example.yaml 文件中配置 Kubernetes 集群参数(多节点安装时需要此文件)。文件中每个参数的说明如下:

  1. ######################### Kubernetes #########################
  2. kubernetes:
  3. version: v1.17.9 # The default k8s version is v1.17.9, you can specify 1.15.2, v1.16.13, v1.18.6 as you want
  4. imageRepo: kubesphere # DockerHub Repo
  5. clusterName: cluster.local # Kubernetes Cluster Name
  6. masqueradeAll: false # masqueradeAll tells kube-proxy to SNAT everything if using the pure iptables proxy mode. [Default: false]
  7. maxPods: 110 # maxPods is the number of pods that can run on this Kubelet. [Default: 110]
  8. nodeCidrMaskSize: 24 # internal network node size allocation. This is the size allocated to each node on your network. [Default: 24]
  9. proxyMode: ipvs # mode specifies which proxy mode to use. [Default: ipvs]
  10. network:
  11. plugin: calico # Calico by default, KubeSphere Network Policy is based on Calico. You can also specify Flannel as you want
  12. calico:
  13. ipipMode: Always # IPIP Mode to use for the IPv4 POOL created at start up. If set to a value other than Never, vxlanMode should be set to "Never". [Always | CrossSubnet | Never] [Default: Always]
  14. vxlanMode: Never # VXLAN Mode to use for the IPv4 POOL created at start up. If set to a value other than Never, ipipMode should be set to "Never". [Always | CrossSubnet | Never] [Default: Never]
  15. vethMTU: 1440 # The maximum transmission unit (MTU) setting determines the largest packet size that can be transmitted through your network. [Default: 1440]
  16. kubePodsCIDR: 10.233.64.0/18 # A valid CIDR range for Kubernetes pod subnet, it should not overlap with node subnet, and it should not overlap with Kubernetes services subnet.
  17. kubeServiceCIDR: 10.233.0.0/18 # A valid CIDR range for Kubernetes services, it should not overlap with node subnet, and it should not overlap with Kubernetes pod subnet
  18. registry:
  19. registryMirrors: [] # For users who need to accelerate image download speed
  20. insecureRegistries: [] # Configure an address of Insecure image Registry, see https://docs.docker.com/registry/insecure/
  21. privateRegistry: "" # Configure a private image registry for air-gapped installation (e.g. docker local registry or Harbor)
  22. addons: [] # You can specify any add-ons with one or more Helm Charts or YAML files in this field, e.g. CSI plugins or cloud provider plugins.