Techiio-author
Started by Peter DanielsSep 24, 2021

Open
Ansible playbook to update daemon.json and restart docker on a running Kubernetes cluster

1 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 1 VIEWES SHARE

I have 5 kubernetes clusters that I need to change part of the /etc/docker/daemon.json and then restart docker. I am planning on doing this via ansible, and those 2 steps are pretty straight forward. The question I have is how can I accomplish this while not taking down the whole cluster with the docker restart? I assume I would want to do this one node at a time, drain the node, then update/restart docker, wait for the node to come back online, then move onto the next node? Not sure exactly how to accomplish that.

1 Replies

Techiio-commentatorNeel Dey replied 4 months ago0 likes0 dislikes

You're on the right track. Drain the nodes and update them one by one, uncordoning the nodes as they complete.

As daniel mentioned in their comment you'll likely want to limit the batch size Ansible uses to one using serial. This means Ansible will only work on one host at a time.

You'll also want to structure your playbook in a way that it doesn't move onto the next host until all tasks are complete for the one it's working on. Maybe using blocks.

You must be Logged in to reply
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance