moby / moby

The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
https://mobyproject.org/
Apache License 2.0
68.82k stars 18.67k forks source link

Docker engine missing default labels in swarm mode #26529

Open marcosnils opened 8 years ago

marcosnils commented 8 years ago

Description

IIRC Previous swarm and swarm mode RC's provided some default engine labels like Operating System / Arch / ExecutionDriver / StorageDriver / etc. Seems like that is not present anymore, swarm mode doesn't get any engine labels when initializing or joining a swarm

Steps to reproduce the issue:

  1. docker swarm init
  2. swarmctl node inspect <node_id>

Describe the results you received:

I don't see any engine label at all

Describe the results you expected:

Default labels to be there as before

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker info:

Containers: 5
 Running: 0
 Paused: 0
 Stopped: 5
Images: 75
Server Version: 1.12.1
Storage Driver: aufs
 Root Dir: /home/marcos/docker/aufs
 Backing Filesystem: extfs
 Dirs: 297
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge null overlay host
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: apparmor seccomp
Kernel Version: 3.19.0-68-generic
Operating System: Ubuntu 15.04
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.704 GiB
Name: XPS
ID: LHF6:NIMP:TNYU:QXAA:KXZP:RRV5:MJUB:GIZG:GZGQ:MFE3:H3WN:WPN7
Docker Root Dir: /home/marcos/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 19
 Goroutines: 40
 System Time: 2016-09-13T10:18:46.800194024-03:00
 EventsListeners: 0
Username: marcosnils
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8
cpuguy83 commented 8 years ago

I think engine labels were set by docker-machine only? Swarm doesn't set labels on the engine, these must be set as daemon options.

Node labels in docker engine swarm are different than engine labels. Node labels can only be set once the swarm is initialized and only from manager nodes.

marcosnils commented 8 years ago

@cpuguy83 thx for the quick response. Previous swarm included some useful default tags: https://docs.docker.com/swarm/scheduler/filter/#/use-a-constraint-filter

I might be confused but I believe the first releases of swarm mode also provided some default labels as engine labels that you can use as constraints to create your services. If this is not the case, I still believe this is super useful as many users end up tagging the engines with the OS / Arch (at least) which seems redundant as the engine is already aware of all that.