Kubernetes ExternalName service provide a way to access external, non-Kubernetes services using Kubernetes DNS and load balancing capabilities. Using this feature, you can specify the hostname that should be resolved and an external IP address. This makes it possible to easily access non-Kubernetes resources in the same manner as you would access services running in within Kubernetes clusters.
This type of service can be particularly useful when working with external hosted services such as database servers, message brokers, or other APIs. It allows the Kubernetes environment to utilize the external services without having to establish and maintain separate connections for each.
The ExternalName service will monitor and update the DNS records to keep track of changes in the external service’s IP address. This ensures that requests to the external service will always be routed to the correct endpoint.
To set up an ExternalName Service, you’ll need to create a new Kubernetes service. In the spec definition, use .spec.type = “ExternalName” and specify the external service hostname in .spec.externalName. You can then use this service just like any other Kubernetes service: use the Service’s name to construct valid URLs and access the external service from within your Kubernetes environment.
Kubernetes’ external name service provides a simple and effective way to reach out to non-Kubernetes hosted services within your cluster. By setting up the service, you can connect to remote services without requiring additional networking configuration or manual setup.
Pingback: What is LoadBalancer service in Kubernetes? - MtroView