How do you use tags?

Node tags are one of those things I’ve never really had an opportunity to
use. I’ve always used roles for the sort of use cases that tags seem to be
made for. They were brought up in a conversation I had recently, however,
which got me wondering… what real world uses have people found for node
tags?

We have been refactoring our cookbooks to locate other nodes/services using Tags instead of searching for a Role or Recipe in the run_list. This gives us some useful capabilities… Instead of your load balancer searching by Role/Recipe and immediately discovering in your new node, you can validate the node before adding the Tag to it and bringing it in to production. Or vice-versa, you could pull a node from the LB pool without modifying its run_list by simply removing the Tag. The same could be achieved by using a custom Attribute, but Tags are convenient.

Eric Reeves
eric@alluvium.com

On May 14, 2013, at 4:42 AM, Larry Wright wrote:

Node tags are one of those things I've never really had an opportunity to use. I've always used roles for the sort of use cases that tags seem to be made for. They were brought up in a conversation I had recently, however, which got me wondering... what real world uses have people found for node tags?

I've considered tagging for this. My biggest fear is that someone who
doesn't understand their purpose will monkey with or delete them without
realizing that code logic is tied to them. This fear has kept me from
using them so far.

Eric Reeves wrote:

We have been refactoring our cookbooks to locate other nodes/services
using Tags instead of searching for a Role or Recipe in the run_list.
This gives us some useful capabilities… Instead of your load
balancer searching by Role/Recipe and immediately discovering in your
new node, you can validate the node before adding the Tag to it and
bringing it in to production. Or vice-versa, you could pull a node
from the LB pool without modifying its run_list by simply removing the
Tag. The same could be achieved by using a custom Attribute, but Tags
are convenient.

Eric Reeves
eric@alluvium.com mailto:eric@alluvium.com

On May 14, 2013, at 4:42 AM, Larry Wright wrote:

Node tags are one of those things I've never really had an
opportunity to use. I've always used roles for the sort of use cases
that tags seem to be made for. They were brought up in a conversation
I had recently, however, which got me wondering... what real world
uses have people found for node tags?

We've used them in the past to control crons in a simple. Have 10
webservers, but only one is supposed to run a cron, tag it and that is the
cron. We added additional logic so that the nodes would do "tag election"
and one of the nodes would always have a tag - so there was no real human
intervention.

On Tue, May 14, 2013 at 9:06 AM, Sascha Bates sascha.bates@gmail.comwrote:

I've considered tagging for this. My biggest fear is that someone who
doesn't understand their purpose will monkey with or delete them without
realizing that code logic is tied to them. This fear has kept me from using
them so far.

Eric Reeves wrote:

We have been refactoring our cookbooks to locate other nodes/services
using Tags instead of searching for a Role or Recipe in the run_list. This
gives us some useful capabilities… Instead of your load balancer searching
by Role/Recipe and immediately discovering in your new node, you can
validate the node before adding the Tag to it and bringing it in to
production. Or vice-versa, you could pull a node from the LB pool without
modifying its run_list by simply removing the Tag. The same could be
achieved by using a custom Attribute, but Tags are convenient.

Eric Reeves
eric@alluvium.com

On May 14, 2013, at 4:42 AM, Larry Wright wrote:

Node tags are one of those things I've never really had an opportunity to
use. I've always used roles for the sort of use cases that tags seem to be
made for. They were brought up in a conversation I had recently, however,
which got me wondering... what real world uses have people found for node
tags?

Hello,

Be careful tags have no version info, name space and are global.

If someone touched your tags, it may break your system.

So make sure you define rules for naming tags and access control for modify tags.

Regards.

Tetsu

On May 14, 2013, at 10:03 PM, Eric Reeves eric@alluvium.com wrote:

We have been refactoring our cookbooks to locate other nodes/services using Tags instead of searching for a Role or Recipe in the run_list. This gives us some useful capabilities… Instead of your load balancer searching by Role/Recipe and immediately discovering in your new node, you can validate the node before adding the Tag to it and bringing it in to production. Or vice-versa, you could pull a node from the LB pool without modifying its run_list by simply removing the Tag. The same could be achieved by using a custom Attribute, but Tags are convenient.

Eric Reeves
eric@alluvium.com

On May 14, 2013, at 4:42 AM, Larry Wright wrote:

Node tags are one of those things I've never really had an opportunity to use. I've always used roles for the sort of use cases that tags seem to be made for. They were brought up in a conversation I had recently, however, which got me wondering... what real world uses have people found for node tags?

I started to use tags with Spiceweasel for labeling “clusters” of machines. Turns out the tag option isn’t supported by knife openstack/rackspace/hp so I shelved that in favor of using Environments for now. But I did open this ticket, which I’ll fix soonish that will allow tag creation with all knife cloud plugins.
http://tickets.opscode.com/browse/KNIFE-264

Thanks,
Matt Ray
Senior Technical Evangelist :: Opscodehttp://opscode.com
512.731.2218 :: matt@opscode.com
mattray :: GitHubhttp://github.com/mattray/ :: IRC :: Twitterhttp://twitter.com/mattray


From: Sascha Bates
Sent: Tuesday, May 14, 2013 8:06 AM
To: chef@lists.opscode.com
Subject: [chef] Re: Re: How do you use tags?

I’ve considered tagging for this. My biggest fear is that someone who doesn’t understand their purpose will monkey with or delete them without realizing that code logic is tied to them. This fear has kept me from using them so far.

Eric Reeves wrote:
We have been refactoring our cookbooks to locate other nodes/services using Tags instead of searching for a Role or Recipe in the run_list. This gives us some useful capabilities… Instead of your load balancer searching by Role/Recipe and immediately discovering in your new node, you can validate the node before adding the Tag to it and bringing it in to production. Or vice-versa, you could pull a node from the LB pool without modifying its run_list by simply removing the Tag. The same could be achieved by using a custom Attribute, but Tags are convenient.

Eric Reeves
eric@alluvium.commailto:eric@alluvium.com

On May 14, 2013, at 4:42 AM, Larry Wright wrote:

Node tags are one of those things I’ve never really had an opportunity to use. I’ve always used roles for the sort of use cases that tags seem to be made for. They were brought up in a conversation I had recently, however, which got me wondering… what real world uses have people found for node tags?

I’m super late to the party. I’ve been using Chef for around 4 years now, but only recently became aware of tags in the normal node attributes. We had a use case where we wanted to exclude a node from a cluster (HA Proxy/Varnish, that sort of thing). Adding a “hidden” tag was much preferable than naming hosts in our discovery libraries. Sine we only use this method temporarily, it’s not likely that they will present a problem if messed with.