community.docker icon indicating copy to clipboard operation
community.docker copied to clipboard

docker_swarm_service: add support for sysctl parameter

Open lem8r opened this issue 3 years ago • 6 comments

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

lem8r avatar Aug 15 '21 12:08 lem8r

I think it is a good feature proposal. Will implement it in September.

WojciechowskiPiotr avatar Aug 28 '21 20:08 WojciechowskiPiotr

September is over :-) Is there any news on this feature request?

Ranger-X avatar Oct 15 '21 06:10 Ranger-X

Year of September was not specified 🤷‍♂️

lem8r avatar Oct 15 '21 13:10 lem8r

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.

WojciechowskiPiotr avatar Oct 20 '21 21:10 WojciechowskiPiotr

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

WojciechowskiPiotr avatar Nov 06 '21 22:11 WojciechowskiPiotr

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

NairolfL avatar Mar 21 '24 15:03 NairolfL

#836 was merged, I think this can be closed :)

NairolfL avatar May 02 '24 10:05 NairolfL

@NairolfL Thank you!

lem8r avatar May 02 '24 10:05 lem8r