<p>I have a set of http server instances. We can assume a simple apache or nginx instances. However, the set of instances comprises of two sub-sets, (1) instances that runs in an infrastructure that fed by green energy (2) infra. that runs on regular grid energy. 
The two runs the SAME software stack, say kubernetes. Also, it can run in the same WAN if not LAN, i.e., same datacenter. </p>

<p>I want to load-balance traffic to the first resource set, the green set, when I have green energy available. Lets assume I have an optimized mechanism that knows when I have enough green-energy to run a workload. How can I use clusterDNS to allow traffic to the set of pods that are fed by green-energy. In other words I want to have the clusterDNS to biased toward a specific resource set. Also, I want to know how can populate instances (and exclude) dynamically to the green-energy pods sets?</p>

<p>I tired to look at <a href="https://github.com/kubernetes/kubernetes/tree/release-1.2/examples/cluster-dns/README.html" rel="nofollow">https://github.com/kubernetes/kubernetes/tree/release-1.2/examples/cluster-dns/README.html</a> but it is not available and I wonder if you can share some ideas on how to tackle this using kubernetes.</p>

<p>You need a rediness probe on your Green pods. Cluster DNS will only work within a single cluster, so you will have to put both your nginx pods (green and grid) behind a single service, and use the DNS name of that service to talk to it. Then if one of the pods fails a readiness probe, all traffic directed to the cluster DNS name will get sent to the others. </p>

<p>Example nginx pod with readiness probe: <a href="https://github.com/kubernetes/kubernetes/blob/master/test/e2e/testing-manifests/kubectl/pod-with-readiness-probe.yaml" rel="nofollow">https://github.com/kubernetes/kubernetes/blob/master/test/e2e/testing-manifests/kubectl/pod-with-readiness-probe.yaml</a></p>
