Annotations and Labels

Overview

Consul on Kubernetes provides a few options for customizing how connect-inject behavior should be configured. This allows the user to configure natively configure Consul on select Kubernetes resources (i.e. pods, services).

Annotations

Resource annotations could be used on the Kubernetes pod to control connnect-inject behavior.

Labels

Resource labels could be used on a Kubernetes service to control connect-inject behavior.

  • consul.hashicorp.com/service-ignore - This label can be set on a Kubernetes Service. If set to “true”, the service will not be used to register a Consul endpoint. This can be useful in cases where 2 or more services point to the same deployment. Consul cannot register multiple endpoints to the same deployment. This label can be used to tell the endpoint registration to ignore all services except for the one which should be used for routing requests using Consul.