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.

  kubernetes:
    version: v1.19.8
    imageRepo: kubesphere
    clusterName: cluster.local
    masqueradeAll: false
    maxPods: 110
    nodeCidrMaskSize: 24
    proxyMode: ipvs
  network:
    plugin: calico
    calico:
      ipipMode: Always
      vxlanMode: Never
      vethMTU: 1440
    kubePodsCIDR: 10.233.64.0/18
    kubeServiceCIDR: 10.233.0.0/18
  registry:
    registryMirrors: []
    insecureRegistries: []
    privateRegistry: ""
  addons: []

The below table describes the above parameters in detail.

Parameter Description
kubernetes
version The Kubernetes version to be installed. If you do not specify a Kubernetes version, KubeKey v1.1.0 will install Kubernetes v1.19.8 by default. For more information, see Support Matrix.
imageRepo The Docker Hub repository where images will be downloaded.
clusterName The Kubernetes cluster name.
masqueradeAll* masqueradeAll tells kube-proxy to SNAT everything if using the pure iptables proxy mode. It defaults to false.
maxPods* The maximum number of Pods that can run on this Kubelet. It defaults to 110.
nodeCidrMaskSize* The mask size for node CIDR in your cluster. It defaults to 24.
proxyMode* The proxy mode to use. It defaults to ipvs.
network
plugin The 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.ipipMode* The 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.vxlanMode* The 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.vethMTU* The maximum transmission unit (MTU) setting determines the largest packet size that can be transmitted through your network. It defaults to 1440.
kubePodsCIDR A valid CIDR block for your Kubernetes Pod subnet. It should not overlap with your node subnet and your Kubernetes Services subnet.
kubeServiceCIDR A valid CIDR block for your Kubernetes Services. It should not overlap with your node subnet and your Kubernetes Pod subnet.
registry
registryMirrors Configure a Docker registry mirror to speed up downloads. For more information, see Configure the Docker daemon.
insecureRegistries Set an address of insecure image registry. For more information, see Test an insecure registry.
privateRegistry* Configure 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.

Thanks for the feedback. If you have a specific question about how to use KubeSphere, ask it on Slack. Open an issue in the GitHub repo if you want to report a problem or suggest an improvement.

What’s on this Page