Dimuthu
Dimuthu

Reputation: 8576

Kubernetes changing rolling update logic

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?

Upvotes: 1

Views: 288

Answers (1)

CJ Cullen
CJ Cullen

Reputation: 5642

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.

If you want to experiment with different logic for a rolling update, you can write a client-side controller using the Kubernetes API client libraries, or create a server-side object by extending the API.

Upvotes: 1

Related Questions