<p>Currently kubernetes rolling update creates a new pod to a terminated pod and add it to the service. At the moment of rolling update there could be two types of pods registered (old ones and new ones) for a service. However I need to enforce the consistency. For example when a rolling update request comes to Kubernetes, first it creates a new rc but pods created under that rc is not added to the service. Once all replications of that rc becomes available, all the traffic came to the service is routed to that rc. Finally the old rc is deleted. Can we currently do this using Kubernetes? If not is there a way I can write an extension to Kubernetes to implement this functionality? </p>

<p>If the new pods have labels matching the service's label selector, they should be added to the service as soon as they come up.</p>

<p>If you want to experiment with different logic for a rolling update, you can write a client-side controller using the <a href="https://github.com/kubernetes/kubernetes/blob/master/docs/devel/client-libraries.md" rel="nofollow">Kubernetes API client libraries</a>, or create a server-side object by <a href="https://github.com/kubernetes/kubernetes/blob/master/docs/design/extending-api.md" rel="nofollow">extending the API</a>.</p>
