Hi,
I have an existing set of VMs that are running containers and non containerized services, utilizing consul for service registration such that a query returns an IP and port to access the service by name.
I’d like to extend this to Kubernetes and maintain this pattern for non Kubernetes applications, ie. the service that was previously returning an IP and port now returns some useable hostname or IP that reaches the service running in k8s.
I have a working consul installation in my cluster that syncs the k8s services to my pre-existing consul instance.
The two ways I can see of doing this are using a NodePort service, which allows my external service to access the k8s service via port and IP.
Or… I can return a hostname linked to an ingress resource tied to a clusterIP k8s service, but this relies on the hostname being resolvable within my environment and therefore means I need to maintain DNS separately.
My k8s setup is done via helm, and I’m utilizing the sync catalog feature to achieve this (Service Sync for Consul on Kubernetes | Consul | HashiCorp Developer)
Both of the above approaches seem suboptimal, with nodeports I’ll miss out on loadbalancing but with ingress I’ll need to maintain DNS (I can’t do this dynamically in my environment).
Is there an approach I’m missing here, or does anyone have a suggestion for how to improve either of the two other options?