Kubernetes Cluster Configurations

When creating a Kubernetes cluster, you can use KubeKey to define a configuration file (config-sample.yaml) which contains basic information of your cluster. Refer to the following example for Kubernetes-related parameters in the configuration file.

  1. kubernetes:
  2. version: v1.22.12
  3. imageRepo: kubesphere
  4. clusterName: cluster.local
  5. masqueradeAll: false
  6. maxPods: 110
  7. nodeCidrMaskSize: 24
  8. proxyMode: ipvs
  9. network:
  10. plugin: calico
  11. calico:
  12. ipipMode: Always
  13. vxlanMode: Never
  14. vethMTU: 1440
  15. kubePodsCIDR: 10.233.64.0/18
  16. kubeServiceCIDR: 10.233.0.0/18
  17. registry:
  18. registryMirrors: []
  19. insecureRegistries: []
  20. privateRegistry: ""
  21. addons: []

The below table describes the above parameters in detail.

ParameterDescription
kubernetes
versionThe Kubernetes version to be installed. If you do not specify a Kubernetes version, KubeKey v3.0.7 will install Kubernetes v1.23.10 by default. For more information, see Support Matrix.
imageRepoThe Docker Hub repository where images will be downloaded.
clusterNameThe Kubernetes cluster name.
masqueradeAllmasqueradeAll tells kube-proxy to SNAT everything if using the pure iptables proxy mode. It defaults to false.
maxPodsThe maximum number of Pods that can run on this Kubelet. It defaults to 110.
nodeCidrMaskSizeThe mask size for node CIDR in your cluster. It defaults to 24.
proxyModeThe proxy mode to use. It defaults to ipvs.
network
pluginThe CNI plugin to use. KubeKey installs Calico by default while you can also specify Flannel. Note that some features can only be used when Calico is adopted as the CNI plugin, such as Pod IP Pools.
calico.ipipModeThe IPIP Mode to use for the IPv4 POOL created at startup. If it is set to a value other than Never, vxlanMode should be set to Never. Allowed values are Always, CrossSubnet and Never. It defaults to Always.
calico.vxlanModeThe VXLAN Mode to use for the IPv4 POOL created at startup. If it is set to a value other than Never, ipipMode should be set to Never. Allowed values are Always, CrossSubnet and Never. It defaults to Never.
calico.vethMTUThe maximum transmission unit (MTU) setting determines the largest packet size that can be transmitted through your network. It defaults to 1440.
kubePodsCIDRA valid CIDR block for your Kubernetes Pod subnet. It should not overlap with your node subnet and your Kubernetes Services subnet.
kubeServiceCIDRA valid CIDR block for your Kubernetes Services. It should not overlap with your node subnet and your Kubernetes Pod subnet.
registry
registryMirrorsConfigure a Docker registry mirror to speed up downloads. For more information, see Configure the Docker daemon.
insecureRegistriesSet an address of insecure image registry. For more information, see Test an insecure registry.
privateRegistryConfigure a private image registry for air-gapped installation (for example, a Docker local registry or Harbor). For more information, see Air-gapped Installation on Linux.

Note

  • * By default, KubeKey does not define these parameters in the configuration file while you can manually add them and customize their values.
  • addons is used to install cloud-native add-ons (YAML or Chart). For more information, see this file.
  • This page only lists part of the parameters in the configuration file created by KubeKey. For more information about other parameters, see this example file.

Feedback

Was this page Helpful?

Yes No