community.docker
community.docker copied to clipboard
docker_swarm_service: add support for sysctl parameter
SUMMARY
Since Docker API 1.40 there is sysctl parameter for swarm services.
ISSUE TYPE
- Feature Idea
COMPONENT NAME
docker_swarm_service
ADDITIONAL INFORMATION
In some cases there is a need to configure service's sysctl parameters. In my case it is net.ipv4.tcp_keepalive_*
for database service. To prevent closing TCP socket on long running requests.
It looks like so when starting from command line
docker service create \
my_service \
--sysctl net.ipv4.tcp_keepalive_time=600 \
--sysctl net.ipv4.tcp_keepalive_intvl=60 \
--sysctl net.ipv4.tcp_keepalive_probes=6 \
image:1.0
I think it is a good feature proposal. Will implement it in September.
September is over :-) Is there any news on this feature request?
Year of September was not specified 🤷♂️
Hey. Sorry guys for the delay. I was overloaded with work lately, but I'm almost back to a normal level of work. Will take a look at it soon.
After further investigation, I found that sysctl
is not implemented in https://github.com/docker/docker-py yet. This needs to be added there first so we can use it in the Ansible module.
I opened a request for this feature https://github.com/docker/docker-py/issues/2907
Hello, It seems that they implemented it a while ago now : https://github.com/docker/docker-py/pull/3029 Would it be possible to add the parameter to docker_swarm_service ?
Thanks
#836 was merged, I think this can be closed :)
@NairolfL Thank you!