<p>We have need to test a pod on our production kubernetes cluster after a data migration before we expose it to our users. What we'd like to do is route traffic from our internal ip addresses to the correct pods, and all other traffic to a maintenance pod. Is there a way we can achieve this, or do we need to briefly expose an ip address on the cluster so we can access the pods directly?</p>

Jake Conkerton-Darby
<p>What ingress controller are you using?<br />
Generally ingress-controllers tend to support header-based routing, rather that source ip based one.</p>
<p>Say, <code>ingress-nginx</code> supports header-based canary deployments out of box.
<a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#canary" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#canary</a>.</p>
<p>Good example here.<br />
<a href="https://medium.com/@domi.stoehr/canary-deployments-on-kubernetes-without-service-mesh-425b7e4cc862" rel="nofollow noreferrer">https://medium.com/@domi.stoehr/canary-deployments-on-kubernetes-without-service-mesh-425b7e4cc862</a><br />
Note, that ingress-nginx canary implementation actually requires your services to be in different namespaces.</p>
<p>You could try to configure your ingress-nginx with <code>use-forwarded-headers</code> and try to employ <code>X-Forwarded-For</code> header for routing.<br />
<a href="https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#use-forwarded-headers" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#use-forwarded-headers</a></p>
