Amazon ECS Service Discovery Concepts: Difference between revisions
(3 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
=Overview= | =Overview= | ||
Service discovery uses Amazon Route 53 to create a namespace for an ECS service, which allows it to be discoverable via DNS. | Service discovery uses Amazon Route 53 to create a namespace for an ECS service, which allows it to be discoverable via DNS. Service discovery is supported for tasks that use the Fargate launch type. Amazon ECS does not support registering services into public DNS namespaces. Service discovery requires that tasks specify awsvpc, bridge or host network modes. | ||
=Namespace= | =Namespace= | ||
The service discovery namespace is a logical group of service discovery services that share the same domain name. A [[Amazon_Route53_Concepts#Hosted_Zone|hosted zone]] in Route 53 is created for each private namespace. If a hosted zone with the same name already exists, it is used. | The service discovery namespace is a logical group of service discovery services that share the same domain name. A [[Amazon_Route53_Concepts#Hosted_Zone|hosted zone]] in Route 53 is created for each private namespace. If a hosted zone with the same name already exists, it is used. | ||
=Service Discovery Service= | |||
A service discovery service exists within the [[#Namespace|service discovery namespace]] and consists of the service name and DNS configuration for the namespace. It provides a "[[#Service_Registry|service registry]]" core component. | |||
=Service Registry= | |||
Allows to look up a service via DNS or AWS Cloud Map API actions and get back one or more available endpoints that can be used to connect to the service. | |||
=Service Discovery Instance= | |||
Exists within the [[#Service_Discovery_Service|service discovery service]] and consists of the attributes associated with each [[Amazon_ECS_Concepts#Service|Amazon ECS service]] in the service directory. The instance attributes are metadata that is added as custom attributes for each [[Amazon_ECS_Concepts#Service|Amazon ECS service]] that is configured to use service discovery: | |||
====AWS_INSTANCE_IPV4==== | |||
For an A record, the IPv4 address that Route53 returns in response to DNS queries and AWS Cloud Map returns when discovering instance details. | |||
====AWS_INSTANCE_PORT==== | |||
The port value associated with the service discovery service. | |||
====AVAILABILITY_ZONE==== | |||
The availability zone into which the task was launched. | |||
====REGION==== | |||
====ECS_SERVICE_NAME==== | |||
The name of the Amazon ECS service to which the task belongs. | |||
====ECS_CLUSTER_NAME==== | |||
The name of the Amazon ECS cluster to which the task belongs. | |||
====EC2_INSTANCE_ID==== | |||
====ECS_TASK_DEFINITION_FAMILY==== |
Latest revision as of 19:17, 8 February 2019
External
Internal
Overview
Service discovery uses Amazon Route 53 to create a namespace for an ECS service, which allows it to be discoverable via DNS. Service discovery is supported for tasks that use the Fargate launch type. Amazon ECS does not support registering services into public DNS namespaces. Service discovery requires that tasks specify awsvpc, bridge or host network modes.
Namespace
The service discovery namespace is a logical group of service discovery services that share the same domain name. A hosted zone in Route 53 is created for each private namespace. If a hosted zone with the same name already exists, it is used.
Service Discovery Service
A service discovery service exists within the service discovery namespace and consists of the service name and DNS configuration for the namespace. It provides a "service registry" core component.
Service Registry
Allows to look up a service via DNS or AWS Cloud Map API actions and get back one or more available endpoints that can be used to connect to the service.
Service Discovery Instance
Exists within the service discovery service and consists of the attributes associated with each Amazon ECS service in the service directory. The instance attributes are metadata that is added as custom attributes for each Amazon ECS service that is configured to use service discovery:
AWS_INSTANCE_IPV4
For an A record, the IPv4 address that Route53 returns in response to DNS queries and AWS Cloud Map returns when discovering instance details.
AWS_INSTANCE_PORT
The port value associated with the service discovery service.
AVAILABILITY_ZONE
The availability zone into which the task was launched.
REGION
ECS_SERVICE_NAME
The name of the Amazon ECS service to which the task belongs.
ECS_CLUSTER_NAME
The name of the Amazon ECS cluster to which the task belongs.