How to manage a Docker Swarm with Portainer


Jack Wallen shows you how easy it is to manage a Docker Swarm deployment with the Portainer web-based GUI.

Programmer smiling at desk.
Image: BalanceFormCreative/Adobe Stock

I’ve said this many times before, and I’ll say it many times in the future: Portainer is my go-to container management platform. With Portainer, I can do any task required to manage and monitor container deployments. I can use Portainer on an isolated docker development machine or a multi-node Swarm Cluster.

Wait. Did I just say multi-node Swarm Cluster? I did.

If your Docker deployments are of a large-scale nature, chances are pretty good you’re dealing with a Docker Swarm. For those who don’t know, Swarm mode is built into the Docker Engine and allows you to manage a cluster of Docker nodes for more scalability, decentralized deployments, desired state reconciliations, multi-host networking, load balancing and rolling updates.

In other words, if your container deployments need to meet higher demands, you’re probably using Docker Swarm. And the good news is you can manage your Swarm right from Portainer.

SEE: Hiring kit: Back-end Developer (TechRepublic Premium)

Now, if you haven’t already deployed Portainer, make sure to check out How to deploy the Portainer container management tool with persistent storage before continuing on. You’ll want to make sure to deploy Portainer on your controlling node and make sure to use the Agent option when creating a new Docker Environment (Figure A).

Figure A

Creating a new Swarm Environment in Portainer.

Once you’ve created your new Environment, it should show up in your Environments listing (Figure B).

Figure B

My Docker Swarm Environment is found in Portainer.

How to manage your Docker Swarm from Portainer

With your Docker Swarm Environment up and running, select it and you should see the Swarm entry in the left sidebar (Figure C).

Figure C

The Swarm entry in Portainer’s left navigation.

Click that entry and you’ll see two sections: Cluster Status and Nodes (Figure D).

Figure D

My Swarm Cluster overview as seen in Portainer.

Let’s take a look at our dockercontroller node. Click that entry to reveal the details (Figure E).

Figure E

The details for my Docker Swarm controller node.

As you can see, there isn’t a great deal of items you can control. What you can do is set the availability of the node (from Active, Pause, Drain) and add labels, which are metadata that describes the node.

As to the availability, here are the descriptions:

  • Active: A node is active and is available for the scheduler to assign tasks.
  • Pause: A node is up but the scheduler cannot assign new tasks to this node although existing tasks will remain running.
  • Drain: A node is up but the scheduler cannot assign new tasks and will shut down all existing tasks, assigning them to other nodes.

The Availability option is a very handy way to manage individual nodes. You might need to replace a node. Instead of just stopping it, you should drain it so all tasks are reassigned. You can then deploy the new node and set it as active.

Use labels as a handy method of organizing your swarm. For example, say node 1 is a Ubuntu server, and node 2 is an AlmaLinux server. Head over to the first node (which, for our example, is hosted on Ubuntu Server) and click + Label. In the resulting window, type os for name and Ubuntu Server for value (Figure F).

Figure F

Adding our first label to a Swarm node in Portainer.

You can add as many labels as you like.

Resolving a confusing error

When I first started working with Docker Swarm and Portainer, I discovered a confusing error that took me some time to resolve. When I’d attempt to make any change to a Swarm Node, I’d receive the error:

rpc error: code = Unknown desc

Even after restarting every node in the Swarm, I wound up with the same error. On a whim, I checked the time on each server, only to discover that node1 and node2 were configured for different time zones. Because of that, the Swarm nodes had trouble communicating with one another. To fix that problem, I logged into the nodes and ran the command:

sudo timedatectl set-timezone ZONE

Where ZONE is the correct timezone for my area which can be found with the command:

cat /etc/timezone

Once you’ve made sure the time zones are correct for each node, that error should go away and you can label your nodes as needed and set their Availability.

Of course, you can also scale your deployments within your Swarm with Portainer. To find out how this is done, check out my tutorial How to scale service deployments with Portainer.

And that’s all there is to managing your Docker Swarm with Portainer. This platform is a remarkable solution for anyone looking to make managing Docker container deployments a much easier and more efficient process.

Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.



Source link

istanbul escort aksaray escort arnavutköy escort ataköy escort avcılar escort avcılar türbanlı escort avrupa yakası escort bağcılar escort bahçelievler escort bahçeşehir escort bakırköy escort başakşehir escort bayrampaşa escort beşiktaş escort beykent escort beylikdüzü escort beylikdüzü türbanlı escort beyoğlu escort büyükçekmece escort cevizlibağ escort çapa escort çatalca escort esenler escort esenyurt escort esenyurt türbanlı escort etiler escort eyüp escort fatih escort fındıkzade escort florya escort gaziosmanpaşa escort güneşli escort güngören escort halkalı escort ikitelli escort istanbul escort kağıthane escort kayaşehir escort küçükçekmece escort mecidiyeköy escort merter escort nişantaşı escort sarıyer escort sefaköy escort silivri escort sultangazi escort suriyeli escort şirinevler escort şişli escort taksim escort topkapı escort yenibosna escort zeytinburnu escort porno 1080p porno izle 4k porno izle 720p porno izle abella danger alman alman porno alman porno izle aloha tube porno amatör amatör porno amatör porno izle anal anal porno anal porno izle arap porno asa akira porno asyalı porno bangbros porno bangbros porno izle banyoda sikis başörtülü porno beeg porno izle beyaz tenli porno izle biseksuel porno izle bisexsuel porno brandi love porno brazzers brazzers porno izle canli porno canli porno izle çinli porno çinli porno izle ensest porno ensest porno izle ensest seks erotik porno erotik porno izle esmer porno esmer porno izle etek altı fake agent fake taxi fake taxi porno fantazi pornoları fantezi porno izle fetiş porno fetiş porno izle fetish fransız porno fransız porno izle full hd hg porno izle gangbang porno genç kız porno izle genç kız sikişi genç teen porno izle gizli çekim porno gizli çekim pornosu grup pornosu grup porno grup porno izle hd pornolar hd porno hd porno izle hemşire porno hemşire pornosu hizmetçi porno hizmetçi porno izle ingiliz porno japon pornoları japon porno kızlık bozma kızlık bozma porno izle konulu porno konulu porno izle koreli porno köylü pornoları kumral porno kumral porno izle latin pornoları latin porno latin porno izle lezbiyen pornoları lezbiyen porno lezbiyen porno izle lisa ann porno liseli pornoları liseli porno liseli porno izle manken porno manken porno izle masaj porno izle masturbasyon porno izle masturbasyon pornoları mature porno mia khalifa porno mia malkova porno milf porno izle mobil porno mobil porno izle öğrenci porno izle öğretmen porno izle okul porno izle olgun kadın pornosu olgun porno oral porno oral porno izle oral seks porna izle pornhub pornhub porno izle porno film izle porno indir porno izle porno resimler porno star porntube porno izle redtube redtube pornoları riley reid porno rokettube rus pornoları rus porno rus porno izle sakso blowjob porno izle sarışın pornoları sarışın porno sarışın porno izle sarışın pornoları sekreter porno shemale sikiş sikiş sikiş izle şişman porno siyahi pornoları suriyeli pornoları swinger porno tecavüz porno teen porn türbanlı pornoları türbanlı porno türk pornoları türk porno türk porno izle türkçe altyazılı porno türkçe altyazılı porno izle xhamster pornoları xhamster porno xhamster porno izle xnxx xnxx porno xnxx porno izle xvideos xvideos porno izle yaşlı porno yeşilçam porno izle youjizz youporn youporn porno izle zenci porno güvenilir bahis siteleri bahis siteleri casino deneme bonusu casino siteleri deneme bonusu para yatırma bonusu bahis siteleri casino siteleribahis sitesi para yatırma