Monday, 8 February 2021

How can I expose Traffic Parrot virtual services outside my Kubernetes cluster?

When hosting Traffic Parrot virtual services in a Kubernetes cluster, sometimes access to the virtual services is required from traffic outside of the Kubernetes cluster. In these cases, it is typical to use Kubernetes Ingress alongside a DNS name server to provide access to the services inside the cluster. Here are two common options used to achieve this.

Option A - Static domain with unique Ingress path mappings

  • DNS server points static domain record to static Ingress controller IP
  • Unique paths are used to identify a unique backend service port
  • Ingress rules use the path prefix to route to a backend service port
  • Example
    • trafficparrot.xyz.com points to Ingress controller IP 1.2.3.4 using static DNS entry
    • trafficparrot.xyz.com/service1/http Ingress path prefix maps to backend service1 port 1234
    • trafficparrot.xyz.com/service1/https Ingress path prefix maps to backend service1 port 4567
    • trafficparrot.xyz.com/service2/http Ingress path prefix maps to backend service2 port 1234
    • https://kubernetes.io/docs/concepts/services-networking/ingress/#simple-fanout

Option B - Wildcard domain with unique Ingress host mappings

  • DNS server points wildcard domain record to static Ingress controller IP
  • Unique domain names are used to identify a unique backend service port
  • Ingress rules use the host field to route to a backend service port
  • Example

No comments:

Post a comment