deploykit
deploykit copied to clipboard
Initial manager missing infrakit tags
Flow:
- Bootstrap VM creates initial manager with
LogicalID
ofmgr1
inos
group mode with shared NFS for terraform files -
mgr1
then commits a group with the 2 (or 4) additional managers - group controller detects that
mgr1
already exists and issues aProvision
for the additional members
The managers
group is successfully created with the following members:
+ infrakit group describe managers
ID LOGICAL TAGS
instance-1499453209 mgr3 infrakit-link-context=swarm::rnn3rirgdngoflx2xlmgilzbj::manager,infrakit-link-created=2017-07-07t18:46:47z,infrakit-link=za1pnvookmnx4ylh,infrakit.config_sha=qhzuig2vfziwccsahjlawpwzrdp44gi3,infrakit.group=managers,logicalid=mgr3,name=instance-1499453209,swarm-id=rnn3rirgdngoflx2xlmgilzbj
instance-1499453211 mgr2 infrakit-link-context=swarm::rnn3rirgdngoflx2xlmgilzbj::manager,infrakit-link-created=2017-07-07t18:46:47z,infrakit-link=ynas3ip2mep6z373,infrakit.config_sha=qhzuig2vfziwccsahjlawpwzrdp44gi3,infrakit.group=managers,logicalid=mgr2,name=instance-1499453211,swarm-id=rnn3rirgdngoflx2xlmgilzbj
instance-1499452504 mgr1 infrakit.config_sha=2wrobluhcc7havbj5hlpxfpv6lmwwdzx,infrakit.group=managers,logicalid=mgr1,name=instance-1499452504
Since mgr1
was not created using the swarm flavor it is missing the infrakit-link-context
, infrakit-link-created
, infrakit-link
, and swarm-id
tags. Also, the infrakit.config_sha
tag is different then the other 2 managers.
The instance
SPI has a Label
function that can be used to update the tags on mgr1
. https://github.com/docker/infrakit/blob/master/pkg/spi/instance/spi.go#L31
@chungers Any ideas on how we can update the tags on mgr1
to make them consistent with the others?
@kaufers - I think if you label the initial manager with a label bootstrap
, the group controller will essentially assimilate it and considers it a member of the group and update its labels:
https://github.com/docker/infrakit/blob/master/pkg/plugin/group/scaled.go#L191
convergence: https://github.com/docker/infrakit/blob/master/pkg/plugin/group/scaler.go#L230
Thanks @chungers; this appeared to update the infrakit.config_sha
label on the initial manager correctly.
+ docker exec d4b-instance-plugin infrakit group describe managers
ID LOGICAL TAGS
instance-1501184046 mgr1 infrakit.config_sha=cldtgspin74nag7ytzjlgcl3ne6xlztf,infrakit.group=managers,logicalid=mgr1
instance-1501184432 mgr3 infrakit-link-context=swarm::wa39pil0zk243rq2y285rl69t::manager,infrakit-link-created=2017-07-27t19:40:30z,infrakit-link=jkykcjdir4u7qj6c,infrakit.config_sha=cldtgspin74nag7ytzjlgcl3ne6xlztf,infrakit.group=managers,logicalid=mgr3,name=instance-1501184432,swarm-id=wa39pil0zk243rq2y285rl69t
instance-1501184435 mgr2 infrakit-link-context=swarm::wa39pil0zk243rq2y285rl69t::manager,infrakit-link-created=2017-07-27t19:40:30z,infrakit-link=pnfel8wcfq7uvser,infrakit.config_sha=cldtgspin74nag7ytzjlgcl3ne6xlztf,infrakit.group=managers,logicalid=mgr2,name=instance-1501184435,swarm-id=wa39pil0zk243rq2y285rl69t
However, the initial manager is still different then the others.
- What about the other tags that are missing on
mgr1
; do they matter? - What about the fact the there the docker engine on the initial manager does not have any
infrakit-*
labels?
The config sha is the most important because that's how infrakit determines if the nodes in the group are of the same configuration. The other flags, in particular, the link-context, is a 'join' key that associates a swarm node to an infrastructure node /host. This ideally should be the label for Docker engine on the initial node, but it most certainly isn't, because we wouldn't know what values to set (those are generated by the swarm flavor plugin).
However, these labels can be pre-assigned and set up as the initial Docker engine labels.. For example, we could set it up so that the first node has the infrakit-link-context
label set to some known value, say, "bootstrap", as any string value would work as long as the Docker engine and host all have the same values (thus the 'join'). The only other label missing is the swarm id, but that is just informational only and doesn't serve any purposes for infrastructure orchestration and monitoring.