0

Is there a setting that we can use as an equivalent to max-buffer-size (https://docs.docker.com/config/containers/logging/configure/) to configure ring buffer for Kubernetes Pods Containers?

2 Answers2

1

The default value for the max-buffer-size is 1 MB and if you have more RAM available you can increase the buffer size and it can increase the reliability of your computer’s logging. Blocking mode is dockers default for new containers and you can set it into non-blocking mode by adding daemon.json # /etc/docker/daemon.json

{
        "log-driver": "json-file",
        "log-opts": {
                "mode": "non-blocking"
        }
}

You can also set non-blocking mode on an individual container by using log-opt option.

docker run --log-opt mode=non-blocking alpine echo hello world

Another option is stdin. If the container is not allocated to a buffer for stdin in the container runtime it will always result in EOF. Use this reference for best practices.

1

May be this is not correct answer you are looking for but it will give you direction where to look into it.

As your environment is on EKS and EKS doesn't give you control over container runtime I think you can't do anything related to docker/podman etc.

Your changes specific to container runtime only, so probably you can't do much via EKS or k8s you have to change runtime config to achieve this.

Please feel free to update your question of comment to correct/improve me.

asktyagi
  • 2,401
  • 1
  • 5
  • 19