You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
2.6 KiB

  1. # Docker support
  2. The docker runtime is supported by kubespray and while the `dockershim` is deprecated to be removed in kubernetes 1.24+ there are alternative ways to use docker such as through the [cri-dockerd](https://github.com/Mirantis/cri-dockerd) project supported by Mirantis.
  3. Using the docker container manager:
  4. ```yaml
  5. container_manager: docker
  6. ```
  7. *Note:* `cri-dockerd` has replaced `dockershim` across supported kubernetes version in kubespray 2.20.
  8. Enabling the `overlay2` graph driver:
  9. ```yaml
  10. docker_storage_options: -s overlay2
  11. ```
  12. Changing the Docker cgroup driver (native.cgroupdriver); valid options are `systemd` or `cgroupfs`, default is `systemd`:
  13. ```yaml
  14. docker_cgroup_driver: systemd
  15. ```
  16. If you have more than 3 nameservers kubespray will only use the first 3 else it will fail. Set the `docker_dns_servers_strict` to `false` to prevent deployment failure.
  17. ```yaml
  18. docker_dns_servers_strict: false
  19. ```
  20. Set the path used to store Docker data:
  21. ```yaml
  22. docker_daemon_graph: "/var/lib/docker"
  23. ```
  24. Changing the docker daemon iptables support:
  25. ```yaml
  26. docker_iptables_enabled: "false"
  27. ```
  28. Docker log options:
  29. ```yaml
  30. # Rotate container stderr/stdout logs at 50m and keep last 5
  31. docker_log_opts: "--log-opt max-size=50m --log-opt max-file=5"
  32. ```
  33. Change the docker `bin_dir`, this should not be changed unless you use a custom docker package:
  34. ```yaml
  35. docker_bin_dir: "/usr/bin"
  36. ```
  37. To keep docker packages after installation; speeds up repeated ansible provisioning runs when '1'.
  38. kubespray deletes the docker package on each run, so caching the package makes sense:
  39. ```yaml
  40. docker_rpm_keepcache: 1
  41. ```
  42. Allowing insecure-registry access to self hosted registries. Can be ipaddress and domain_name.
  43. ```yaml
  44. ## example define 172.19.16.11 or mirror.registry.io
  45. docker_insecure_registries:
  46. - mirror.registry.io
  47. - 172.19.16.11
  48. ```
  49. Adding other registry, i.e. China registry mirror:
  50. ```yaml
  51. docker_registry_mirrors:
  52. - https://registry.docker-cn.com
  53. - https://mirror.aliyuncs.com
  54. ```
  55. Overriding default system MountFlags value. This option takes a mount propagation flag: `shared`, `slave` or `private`, which control whether mounts in the file system namespace set up for docker will receive or propagate mounts and unmounts. Leave empty for system default:
  56. ```yaml
  57. docker_mount_flags:
  58. ```
  59. Adding extra options to pass to the docker daemon:
  60. ```yaml
  61. ## This string should be exactly as you wish it to appear.
  62. docker_options: ""
  63. ```
  64. For Debian based distributions, set the path to store the GPG key to avoid using the default one used in `apt_key` module (e.g. /etc/apt/trusted.gpg)
  65. ```yaml
  66. docker_repo_key_keyring: /etc/apt/trusted.gpg.d/docker.gpg
  67. ```