1 Large deployments of K8s
2 ========================
4 For a large scaled deployments, consider the following configuration changes:
6 * Tune [ansible settings](https://docs.ansible.com/ansible/latest/intro_configuration.html)
7 for `forks` and `timeout` vars to fit large numbers of nodes being deployed.
9 * Override containers' `foo_image_repo` vars to point to intranet registry.
11 * Override the ``download_run_once: true`` and/or ``download_localhost: true``.
12 See download modes for details.
14 * Adjust the `retry_stagger` global var as appropriate. It should provide sane
15 load on a delegate (the first K8s control plane node) then retrying failed
16 push or download operations.
18 * Tune parameters for DNS related applications
19 Those are ``dns_replicas``, ``dns_cpu_limit``,
20 ``dns_cpu_requests``, ``dns_memory_limit``, ``dns_memory_requests``.
21 Please note that limits must always be greater than or equal to requests.
23 * Tune CPU/memory limits and requests. Those are located in roles' defaults
24 and named like ``foo_memory_limit``, ``foo_memory_requests`` and
25 ``foo_cpu_limit``, ``foo_cpu_requests``. Note that 'Mi' memory units for K8s
26 will be submitted as 'M', if applied for ``docker run``, and cpu K8s units
27 will end up with the 'm' skipped for docker as well. This is required as
28 docker does not understand k8s units well.
30 * Tune ``kubelet_status_update_frequency`` to increase reliability of kubelet.
31 ``kube_controller_node_monitor_grace_period``,
32 ``kube_controller_node_monitor_period``,
33 ``kube_apiserver_pod_eviction_not_ready_timeout_seconds`` &
34 ``kube_apiserver_pod_eviction_unreachable_timeout_seconds`` for better Kubernetes reliability.
35 Check out [Kubernetes Reliability](/docs/kubernetes-reliability.md)
37 * Tune network prefix sizes. Those are ``kube_network_node_prefix``,
38 ``kube_service_addresses`` and ``kube_pods_subnet``.
40 * Add calico_rr nodes if you are deploying with Calico or Canal. Nodes recover
41 from host/network interruption much quicker with calico_rr.
44 [Inventory](/docs/getting-started.md#building-your-own-inventory)
45 section of the Getting started guide for tips on creating a large scale
48 * Override the ``etcd_events_cluster_setup: true`` store events in a separate
49 dedicated etcd instance.
51 For example, when deploying 200 nodes, you may want to run ansible with
52 ``--forks=50``, ``--timeout=600`` and define the ``retry_stagger: 60``.