We are using docker-swarm-plugin as provider for slave. Unfortunately we are facing connectivity problems in swarm and it happens that there remains running containers or dead services (without replicas) when jenkins job is killed or connection is reset. Because of that we would like to be able to define label (e.g. marker how long service shoul live, TTL=24H, TTL=48H etc) in a docker agent template configuration. Based on that labels we will be able to clean up running services without affecting correctly startup services.
We are using docker-swarm-plugin as provider for slave. Unfortunately we are facing connectivity problems in swarm and it happens that there remains running containers or dead services (without replicas) when jenkins job is killed or connection is reset. Because of that we would like to be able to define label (e.g. marker how long service shoul live, TTL=24H, TTL=48H etc) in a docker agent template configuration. Based on that labels we will be able to clean up running services without affecting correctly startup services.
Configuration:
Result service:
[ { "ID": "sm1eitmz1ypuorjo43c8hesz0", "Version": { "Index": 67228061 }, "CreatedAt": "2021-09-27T16:46:22.040470091Z", "UpdatedAt": "2021-09-27T16:46:22.096417534Z", "Spec": { "Name": "agt-test_drimalm-4", "Labels": { "ROLE": "jenkins-agent", "TTL": "48H", "TEAM": "TeamA" },