0

Appreciate an expert advise. We have a Docker EE setup on RH Linux platform.

Given that we have setup Docker EE as:

  • 2 manager nodes (linux)
  • 2 worker nodes (linux)
  • 2 worker node (windows server)
  • UCP
  • Docker Swarm

When I build a windows container to run a .NET console service built on .NET 4.6.2. How this container gets allocated in the swarm?

Questions: How will this be able to join the swarm?

Will my container be able to run on the worker nodes running Linux host OS? How docker swarm manage the fail-over of the nodes? Will the replica only gets distributed on the windows worker nodes? Is this setup of ours make sense?

I had some readings that windows containers only runs on Windows host but Linux containers can run both Linux and Windows host nodes. Will be testing this this week but would be great to hear your experiences. //TIA

rdagumampan
  • 459
  • 4
  • 16

2 Answers2

1

You join your windows container hosts to swarm the same way you join UNIX ones (docker swarm join). You assign label to those nodes to identify that those are windows nodes and when you deploy service specify constraint for windows containers. It will work as you would expect with UNIX services. Current limitation is that you can only deploy in global mode, that is you have to have windows nodes running on each node since swarm mesh is not fully supported yet.

https://learn.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/swarm-mode

Gregory Suvalian
  • 3,566
  • 7
  • 37
  • 66
0

You no longer need to create OS labels for each node. Docker Swarm recognizes worker node OS automatically. Just specify the desired OS for each service in your compose file:

version: '3'  
services:  
    service_1:  
        restart: on-failure  
        image: 'service_1'  
        deploy:  
            placement:  
                constraints:  
                    - node.platform.os == windows  
    junittestsuite:  
        restart: on-failure  
        image: 'junit_test_suite:1.0'  
        command: ant test ...  
        deploy:  
            placement:  
                constraints:  
                    - node.platform.os == linux  
jrbe228
  • 356
  • 3
  • 11