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.

105 lines
3.0 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. Using `cri-dockerd` instead of `dockershim`:
  8. ```yaml
  9. cri_dockerd_enabled: false
  10. ```
  11. *Note:* The `cri_dockerd_enabled: true` setting will become the default in a future kubespray release once kubespray 1.24+ is supported and `dockershim` is removed. At that point, changing this option will be deprecated and silently ignored.
  12. Enabling the `overlay2` graph driver:
  13. ```yaml
  14. docker_storage_options: -s overlay2
  15. ```
  16. Enabling `docker_container_storage_setup`, it will configure devicemapper driver on Centos7 or RedHat7.
  17. Deployers must be define a disk path for `docker_container_storage_setup_devs`, otherwise docker-storage-setup will be executed incorrectly.
  18. ```yaml
  19. docker_container_storage_setup: true
  20. docker_container_storage_setup_devs: /dev/vdb
  21. ```
  22. Changing the Docker cgroup driver (native.cgroupdriver); valid options are `systemd` or `cgroupfs`, default is `systemd`:
  23. ```yaml
  24. docker_cgroup_driver: systemd
  25. ```
  26. 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.
  27. ```yaml
  28. docker_dns_servers_strict: false
  29. ```
  30. Set the path used to store Docker data:
  31. ```yaml
  32. docker_daemon_graph: "/var/lib/docker"
  33. ```
  34. Changing the docker daemon iptables support:
  35. ```yaml
  36. docker_iptables_enabled: "false"
  37. ```
  38. Docker log options:
  39. ```yaml
  40. # Rotate container stderr/stdout logs at 50m and keep last 5
  41. docker_log_opts: "--log-opt max-size=50m --log-opt max-file=5"
  42. ```
  43. Changre the docker `bin_dir`, this should not be changed unless you use a custom docker package:
  44. ```yaml
  45. docker_bin_dir: "/usr/bin"
  46. ```
  47. To keep docker packages after installation; speeds up repeated ansible provisioning runs when '1'.
  48. kubespray deletes the docker package on each run, so caching the package makes sense:
  49. ```yaml
  50. docker_rpm_keepcache: 1
  51. ```
  52. Allowing insecure-registry access to self hosted registries. Can be ipaddress and domain_name.
  53. ```yaml
  54. ## example define 172.19.16.11 or mirror.registry.io
  55. docker_insecure_registries:
  56. - mirror.registry.io
  57. - 172.19.16.11
  58. ```
  59. Adding other registry, i.e. China registry mirror:
  60. ```yaml
  61. docker_registry_mirrors:
  62. - https://registry.docker-cn.com
  63. - https://mirror.aliyuncs.com
  64. ```
  65. 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:
  66. ```yaml
  67. docker_mount_flags:
  68. ```
  69. Adding extra options to pass to the docker daemon:
  70. ```yaml
  71. ## This string should be exactly as you wish it to appear.
  72. docker_options: ""
  73. ```