Automatically onboarding services
Supported platforms:
Gremlin can automatically discover and onboard services that you have annotated. Annotations are metadata that you can add to hosts, containers, and Kubernetes resources. When the Gremlin agent detects these annotations, it uses them to create and name services. This makes it easy to onboard a large number of services for testing.
Supported values
Gremlin supports three different types of annotations, all starting with the prefix gremlin.com/:
service-id: the name that you want to give the service when it's onboarded to Gremlin.team-id: the ID of the Gremlin team that owns the service.tags: any additional tags that you want to give the service.
Annotating host-based services
You can register host-based services with Gremlin by adding the gremlin-service-id tag to your agent configuration. Each host that shares the same gremlin-service-id value will be treated as part of the same service.
- Identify the host(s) that you want to annotate.
- Choose a name for the service. This is the name that the service will have in the Gremlin web app and REST API. This can be the hostname, the name of the cluster the host belongs to, or a unique name specific to Gremlin.
- Add the tag to the agent configuration. An example is available below.
- Alternatively, use the
GREMLIN_CLIENT_TAGSenvironment variable, also shown below. - (Optional) If you want to include multiple hosts in same service, use the same service name in the other hosts' agent configurations.
- Alternatively, use the
- Save the updated configuration(s) and restart the agent(s). Gremlin will detect the tag and add the new service(s).
Alternatively, you can use the GREMLIN_CLIENT_TAGS environment variable:
Annotating Kubernetes-based services
You can register Kubernetes objects with Gremlin by adding the gremlin.com/service-id annotation. Each object with the same service-id value will be treated as part of the same service.
- Identify the Kubernetes resource(s) that you want to annotate. Gremlin supports annotations on Deployments, DeploymentConfigs, DaemonSets, StatefulSets, and Argo Rollouts.
- Choose a name for the service. This is the name that the service will have in the Gremlin web app and REST API. This can be the same name as the Kubernetes object, or a unique name specific to Gremlin.
- Add the annotation to the object definition. An example is available below.
- (Optional) If you want multiple objects to be part of the same service (e.g. two or more Deployments), use the same service name for both.
- (Optional) If you want to create this service for another team in your company, add the
gremlin.com/team-idannotation. The value of this annotation should be the ID of the team within your company that you want to create the service for. Remember to share access to the namespace with that team before doing so, otherwise the service will not be automatically generated. - (Optional) You can add additional tags to this service by adding a
gremlin.com/tagsannotation containing a comma-separated list of key-value pairs. For example:gremlin.com/tags: environment:staging,app:nginx. This is useful for organizing and searching services in the Gremlin web app.
- Deploy the updated manifest. The Gremlin agent will detect the annotation and add the new service.
Bulk annotating services
If you have a large number of deployments to annotate, you can use a script similar to the one below. This script iterates over each deployment in the given namespace, annotates the deployment using the deployment name as the service ID, and adds any additional tags that you want to give the service (deployment environment, region, etc.). If you don’t want to add tags, remove the GREMLIN_TAGS="..." and gremlin.com/tags="..." lines.

