Cloud Agnostic Tagging with Spinnaker
Originally published in The Spinnaker Community Blog on Medium.
A fairly common ask of Spinnaker over the last couple of years has boiled down to having an ability to attach arbitrary tags to any cloud resource.
Of course these tags must also be searchable:
- Fetch all tags on a given resource (ie. give me all tags for servergroup-v001)
- Fetch all resources with a given tag (ie. find me all resources that have tag application_tier: critical)
This post offers a detailed look into how we built this in Spinnaker, why we built it vs. just using native cloud provider tags and what it might lead to in the future.
If you have not already, please familiarize yourself with Spinnaker basics.
What is a “Cloud Resource”
A cloud resource is any component of a cloud provider that is either managed or used by Spinnaker, including but not limited to:
- Server Groups — autoscaling groups, etc.
- Load Balancers — elastic load balancers, application load balancers, etc.
- Images — amazon machine images, docker containers, etc.
- Security Groups
- IAM Roles
Cloud Resources also include core Spinnaker concepts such as Clusters and Applications that are derived by naming convention and not physically represented within a cloud provider like Amazon Web Services (AWS) or Google Cloud Platform (GCP).
Why aren’t AWS* tags sufficient?
The biggest issues with the native tagging capabilities provided by AWS are twofold:
- Not all resources support tagging (notably IAM Roles do not). Those that do only allow 50 tags, a relatively recent and modest increase from 10. The official documentation for Autoscaling Groups still references a limit of 10 despite the AWS Console allowing for more.
- Can store at most 255 characters in a tag value.
In the past we have observed situations where resources are returned from AWS APIs without tags … despite them existing. This led to workarounds that included more aggressive/complicated caching of resource tags in Edda (if we see an empty tag response come back, do not use).
We would also like to tag Spinnaker concepts like Clusters that are not themselves represented by a native cloud provider.
* Feel free to substitute AWS with your favorite cloud provider.
Potential Use Cases
The following are a few use cases we feel are solvable by tagging:
- Provenance metadata on server groups indicating what pipeline or orchestration was responsible for creation (already implemented — see below).
- Alerts and notices on clusters, server groups, load balancers and security groups (already implemented — see below).
- Identifying clusters that can be immediately terminated when facing a capacity shortage.
- Identifying server groups that are pending Janitor Monkey cleanup.
- Associating ownership metadata with clusters. This sort of information is particularly useful for capacity planning and billing organizations. If a centralized team at Netflix manages Elasticsearch on behalf of a product team, it is important that the physical resources consumed come out of the product team’s allocation.
- Associating IAM Roles with the applications and groups that can launch with them (implemented as a Netflix-specific extension).
- Linking Elastic IPs with the clusters that can use them (we have an existing system that utilizes DynamoDB for this … plus an on-instance boot script that handles the actual association of an elastic ip using AWS APIs).
Introducing Entity Tags
This ability to associate and query arbitrary metadata is supported in Spinnaker by an optional feature we have been calling Entity Tags.
Entity Tags allows you to store an unlimited number of tags of practically unlimited size on any resource, whether it is native to the underlying cloud provider or not.
Netflix has been running in production for a couple of months with ~100k+ individual tags against ~40–50k resources (mostly server groups right now).
Getting started documentation can be found over on spinnaker.io.
TL;DR — We store tags in Front50 (backed by S3/GCS … a single document for each resource containing all tags) and index via Elasticsearch. Front50 provides durability and Elasticsearch provides query flexibility.
It is our goal for Elasticsearch and Front50 (backed by S3/GCS) to scale well enough that restrictions are not necessary.
Anatomy of an Entity Tag

Entity Tags as a Building Block
The following features have been built on top of Entity Tags.

Server Group Provenance
Spinnaker automatically tags all created server groups with provenance metadata.
This metadata includes:
- Pipeline / Task ID
- Application Name
- User (requires authentication)
- Description (if provided)

Notices and Alerts
A user can add multiple notices or alerts to any Server Group, Cluster (single region or all regions), Load Balancer or Security Group.
These descriptive messages are contextually displayed (see below for an example) throughout the UI.

Deprecation Warnings
At Netflix we have a service called Astrid that identifies server groups using a deprecated library or configuration.
Historically email campaigns have been used to notify and encourage application owners to make necessary updates.
With Entity Tags, Astrid is also able to supplement these email campaigns with contextualized alerts in Spinnaker.
Gotchas
Elasticsearch Dependency
For smaller cloud footprints, it is possible that all necessary operations could be done in-memory within Front50. This is not something we have investigated but I suspect with a bit of development effort it would work.
This would alleviate the need for Elasticsearch.
Tag Lifecycles
We have lifecycle support (ie. ensuring the tag is removed when it’s associated resource is destroyed) for entity tags attached to server groups.
Given that tags can be attached to anything, we will eventually need a more comprehensive strategy.
Native Tags vs. Entity Tags
Entity Tags are completely independent from any tags stored by the underlying cloud provider.
At some point in the future we may support a write-through model in which sets of tags could also be written to an underlying cloud provider (ie. an Entity Tag attached to a Server Group could be stored on the underlying AWS Autoscaling Group).
Doing so would allow a user to take advantage of a cloud providers ability to propagate tags (ie. from an AWS Autoscaling Group to launched instances) while still using the common Entity Tags API for management.
UI
Support for Entity Tags in the UI is available as part of the Notices and Alerts and Server Group Provenance features described above.
We have API support for filtering and querying by Entity Tags but have not yet exposed this in the UI.
Getting Involved
We are actively evolving and extending Entity Tags as feature requests and feedback comes in from stakeholders at Netflix.
At this point, we would love for members of the broader Spinnaker community to give it a whirl.
If you already have Spinnaker deployed and are interested in enabling Entity Tags, see the documentation.
Are you a developer with ideas on possible use cases, feel free to reach out to us on Slack or Twitter.