General approach to how Docker is configured when deploying a Kubernetes cluster on any operating system is described here.
When deploying a Kubernetes cluster via Kublr on Red Hat Enterprise Linux (RHEL) using Docker as container runtime environment, Kublr transfers the following Docker parameters/values to the kublr-daemon.json
file (usually located at the /etc/docker
folder):
{
"exec-opts": [
"native.cgroupdriver=systemd"
],
"ip-masq": false,
"iptables": false,
"log-driver": "json-file",
"log-opts": {
"max-file": "3",
"max-size": "10M"
},
"selinux-enabled": true,
"storage-driver": "overlay2",
"storage-opts": [
"overlay2.override_kernel_check=true" I
]
}
These parameters/values are taken from the internal Kublr template file during cluster creation.
Notes:
selinux-enabled
set to true
has to be set at the moment for Kubernetes to work on RHEL.log-opts
: max-file
and max-size
configure Docker log rotation.daemon.json
file for Docker is kept as backup when kublr-daemon.json
is created. It allows to quickly rollback the configuration if something goes wrong.To override the parameters, access cluster specification and set you values for these parameters in the KublrAgentConfig
section (globally or for the specific instance group), for example:
master:
kublrAgentConfig:
docker:
config:
ip-masq: false
iptable: false
log-driver: json-file
log-opts:
max-file: 3
max-size: 10M
Notes:
Kublr edits systemd unit file to add all these keys to Docker.
kublr-daemon.json
file is enabled in the /etc/default/kublr-docker
:
KUBLR_DOCKER_OPTIONS=–config-file=/etc/docker/kublr-daemon.json