Docker Swarm: Performing Rolling Upgrade of a Service

Share At:

As per business requirement, we might want to perform rolling updates to our services for configuration changes and new Docker Image versions without any downtime.

In this part of the tutorial, we will deploy a service based on the Redis 3.0.6 container tag. Then we will upgrade the service to use the Redis 3.0.7 container image using rolling updates

Pre-requisites

  1. For our demonstration, we will be using centos-07.
  2. We will be using 3 machines for our lab, 1 machine as a swarm Manager node and 2 swarm worker nodes. These servers have below IP details:

192.168.33.76 managernode.unixlab.com
192.168.33.77 workernode1.unixlab.com
192.168.33.78 workernode2.unixlab.com

3. The memory should be at least 2 GB and there should be at least 2 core CPUs for each node.

4. You have already configured Docker Swarm. Read my previous article to understand how to configure the docker swarm.

Deploy a service based on the Redis 3.0.6 container tag:

  1. Run the command below to deploy a redis service with 3 replicas of it with image — “redis:3.0.6” and given the name of this service as “redis”. Notice that we have also passed a flag called “ — update-delay 20s”.

docker service create — replicas 3 — name redis — update-delay 20s redis:3.0.6

The --update-delay flag configures the time delay between updates to a service task or sets of tasks.

2. The “docker service ls” command will show that 3 replicas of the container is running.

3. Run the below command to know, on which nodes the container is running:

docker service ps redis

4. If you need more information related to the service, run the below command. Note that “Delay” mentioned as 20s.

docker service inspect — pretty redis

Upgrade the service using Rolling Update

Now Let’s upgrade the service to use the Redis 3.0.7 container image using rolling updates.

8. Now we can update the container image for redis. We will be upgrading the containers to redis 3.0.7 image. The swarm manager applies the update to nodes according to the UpdateConfig policy.

Run the below command for the upgrade:

docker service update — image redis:3.0.7 redis

You will observe the delay of 20 seconds before the swarm Manager starts upgrading the next container.

9. The command “docker service ls” shows that the containers have been upgraded to redis:3.0.7 image.

10. The below command will show that how the rolling upgrade was performed. You will notice that all the upgrades were not happened at once.

This concludes our tutorial for Performing Rolling Upgrade of a Service.

Happy Learning !!!


Share At:
0 0 votes
Article Rating
Subscribe
Notify of
guest
48 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Kayıt Ol
20 days ago

Your article made me suddenly realize that I am writing a thesis on gate.io. After reading your article, I have a different way of thinking, thank you. However, I still have some doubts, can you help me? Thanks.

atletico madrid coin grafik

Very nice post. I just stumbled upon your blog and wanted to say that I’ve really enjoyed browsing your blog posts. In any case I’ll be subscribing to your feed and I hope you write again soon!

kastamonu ekonomi sitesi

thank you

Olga
1 year ago

Why viewers still make use of to read news papers when in this technological
world everything is existing on web?

Here is my web blog; Olga

Elvia
1 year ago

Hello I am so grateful I found your blog page, I really found you by error, while I was
researching on Bing for something else, Anyhow I am here now and would just like to
say thank you for a tremendous post and a all round entertaining blog (I also love the theme/design), I don’t have time to go through
it all at the moment but I have saved it and also included your RSS feeds,
so when I have time I will be back to read much more, Please
do keep up the superb work.

gain muscle
1 year ago

Link exchange is nothing else except it is only placing
the other person’s website link on your page at suitable place and other person will also do same in support of you.

my webpage: gain muscle

Amy
Amy
1 year ago

It’s an remarkable piece of writing designed for all the online
visitors; they will obtain benefit from it I am sure.

turn on a woman
1 year ago

It is the best time to make some plans for the future and it is time to be happy.
I’ve read this post and if I could I wish to suggest you some interesting things or advice.
Maybe you could write next articles referring to this article.
I want to read more things about it!

Also visit my webpage :: turn on a woman

seeds starts
1 year ago

You could definitely see your skills in the work you write.
The sector hopes for even more passionate writers like you who aren’t afraid to
say how they believe. All the time follow your heart.

Feel free to surf to my web-site; seeds starts

https://championsleage.review/wiki/Profitable_Stories_You_Didnt_Learn_about_Game_Servers

I do believe that a foreclosed can have a important effect on the applicant’s life.
Foreclosures can have a 6 to few years negative impact oon a applicant’s credit report.
The borrower who have applied for home financing or just abut any loans for instance, kknows
that the actual worse credit rating can be, the
more challenging it is for any decent personal loan. In addition,
it may affect any borrower’s chance to find a decent place to lease or hire, if that gets the alteenative housing solution.
Goood blog post.

dry skin
1 year ago

Hey there! Quick question that’s entirely off
topic. Do you know how to make your site mobile friendly?
My blog looks weird when browsing from my apple iphone.
I’m trying to find a theme or plugin that might be able to fix this
issue. If you have any recommendations, please share.
With thanks!

Visit my blog – dry skin

promote skin health
1 year ago

I don’t usually comment but I gotta tell appreciate it for
the post on this amazing one :D.

Here is my site promote skin health

hemp seed oil capsules

Heya this is kinda of off topic but I was wondering if blogs use WYSIWYG editors
or if you have to manually code with HTML. I’m
starting a blog soon but have no coding experience so I wanted to get guidance
from someone with experience. Any help would be greatly appreciated!

my site: hemp seed oil capsules

holiday diet
1 year ago

I?m impressed, I have to admit. Rarely do I come across a blog that?s both equally educative and entertaining, and without a doubt, you’ve hit the nail on the head.
The issue is something which too few folks are speaking intelligently about.
Now i’m very happy I came across this during my search for something relating to this.

Also visit my website holiday diet

Eric
1 year ago

I do accept as true with all of the ideas you have introduced for your post.

They are really convincing and can definitely work. Nonetheless, the posts are very brief
for starters. Could you please extend them a little from next time?
Thanks for the post.

Christena
1 year ago

I got this website from my friend who told me
on the topic of this web page and now this time I am visiting this
website and reading very informative posts at this place.

Frank
1 year ago

You can definitely see your enthusiasm in the work
you write. The arena hopes for more passionate writers such as you who are not afraid to mention how they believe.
At all times follow your heart.

Barbara
1 year ago

Unquestionably imagine that which you said. Your favorite justification seemed to be on the net the simplest thing to understand of.

I say to you, I certainly get annoyed at the same time as folks
think about issues that they plainly don’t understand about.

You managed to hit the nail upon the top and also defined out the whole thing with no need side
effect , other folks could take a signal. Will likely be back to get more.
Thanks

instagram takipci satin al

I was able to find good advice from your content.

Stefan
1 year ago

We are a bunch of volunteers and starting a new
scheme in our community. Your web site provided us with valuable information to work on. You’ve done an impressive process and our entire
community will likely be grateful to you.

Demi
1 year ago

That is a good tip especially to those fresh to the blogosphere.

Short but very precise info… Thank you for sharing this one.
A must read post!

Monroe
1 year ago

Howdy! I could have sworn I’ve visited this
web site before but after browsing through many of the
articles I realized it’s new to me. Regardless, I’m definitely
pleased I came across it and I’ll be bookmarking it and checking back frequently!

http://www.fotosombra.com.br

Thank you, I’ve just been looking for info approximately this
subject for a while and yours is the greatest I’ve came upon till now.
But, what in regards to the conclusion? Are you
sure about the supply?

Review my blog; http://www.fotosombra.com.br

Meredith
1 year ago

Hello, this weekend is pleasant in support of me, since this point in time i am reading this enormous educational paragraph here at my home.

atolyesi.net
1 year ago

Unquestionably consider that that you said. Your favorite
reason seemed to be at the internet the simplest factor
to consider of. I say to you, I certainly get annoyed at the same time as people consider issues that they just do not know about.
You managed to hit the nail upon the highest as neatly as defined out the whole thing with no need side effect , other folks can take a signal.
Will likely be back to get more. Thanks!

Feel free to visit my website atolyesi.net

treat yeast infection

I think this site has got some rattling superb information for everyone :D.

my web page :: treat yeast infection

weight loss results
1 year ago

It’s truly very difficult in this active life to listen news on TV,
so I simply use internet for that purpose, and take the
most recent information.

My web page … weight loss results

Leonore
1 year ago

Hey! I’m at work browsing your blog from my new iphone! Just
wanted to say I love reading your blog and look forward to all your posts!
Keep up the fantastic work!

tips on healthy eating

Good job over again. Thumbs up=)

Also visit my web site tips on healthy eating

Milla
1 year ago

Hi colleagues, how is the whole thing, and what you desire to say regarding this post, in my view its truly awesome in support of me.

Greg
1 year ago

Your style is so unique compared to other folks I have read stuff from.
Thank you for posting when you have the opportunity, Guess I’ll just bookmark this blog.

skin care routine
1 year ago

I was just seeking this info for some time. After 6 hours of continuous Googleing, finally I got it in your web site.

I wonder what is the lack of Google strategy that don’t rank this type of informative websites
in top of the list. Generally the top websites are full of garbage.

Also visit my homepage skin care routine

Katherine
1 year ago

I know this web site offers quality depending content and
other material, is there any other website which provides such data
in quality?

Ross
1 year ago

I am sure this piece of writing has touched all the internet people, its really really
good post on building up new web site.

Dulcie
1 year ago

Thanks for every other informative website. The place else could I am getting that type
of info written in such a perfect approach? I’ve a mission that I am just now operating on, and I have been at the
look out for such info.

Clarence
1 year ago

It’s perfect time to make some plans for the future and
it is time to be happy. I have read this post and if I could I
wish to suggest you few interesting things or advice.

Perhaps you could write next articles referring to this article.
I desire to read more things about it!

accessing medical cannabis

Thanks for all of your labor on this blog. Betty take interest in getting
into internet research and it’s really easy to see why.
We learn all relating to the lively medium you offer very important things through
the website and in addition invigorate response from people on the area
of interest plus our simple princess is without a doubt being
taught a whole lot. Have fun with the rest of the new year.
Your conducting a brilliant job.

Also visit my page – accessing medical cannabis

natural treatment for eczema

Quality content is the key to invite the viewers to pay a visit the
website, that’s what this web page is providing.

Also visit my website; natural treatment for eczema

foroagua.com
1 year ago

Awesome story over again! Thanks a lot:)

Also visit my website: foroagua.com

seeds require
1 year ago

I conceive this internet site has got some very great info
for everyone :D.

Look at my web blog seeds require

Shirley
1 year ago

Howdy! I simply would like to give you a big thumbs up for the excellent info you’ve got here
on this post. I am coming back to your blog for more soon.

healthy nutrition
1 year ago

It’s awesome designed for me to have a web page, which is useful
in support of my experience. thanks admin

my site – healthy nutrition

flat belly diets
1 year ago

This page definitely has all of the information I wanted concerning this subject and didn?t know
who to ask.

My homepage :: flat belly diets

Sue
Sue
1 year ago

Hey just wanted to give you a quick heads up.
The text in your post seem to be running off the screen in Firefox.
I’m not sure if this is a format issue or something
to do with web browser compatibility but I thought I’d post to let you know.

The design and style look great though! Hope you get the problem resolved soon. Kudos

higher testosterone level

My brother recommended I might like this blog.

He was totally right. This post actually made my day.
You can not imagine just how much time I had spent for this information!
Thanks!

Feel free to visit my blog … higher testosterone level

dhea testosterone
1 year ago

Hi there! This article could not be written any better!
Reading through this article reminds me of my previous
roommate! He constantly kept talking about this.

I most certainly will send this information to him. Pretty sure he’s going
to have a good read. Many thanks for sharing!

Here is my webpage: dhea testosterone

Ciara
1 year ago

Very good site you have here but I was curious about
if you knew of any discussion boards that
cover the same topics discussed in this article?
I’d really like to be a part of community where I can get
responses from other experienced individuals that share the
same interest. If you have any recommendations, please let me know.
Appreciate it!

Back To Top

Contact Us