Simulate a Deployment rolling update from replicas old pods to replicas new pods with integer
max_surge and max_unavailable. Each step:
old + new_ready ≥ replicas − max_unavailable.old + new_ready + new_starting ≤ replicas + max_surge and the new total stays ≤ replicas.Record [old, new_ready, new_starting] after each step and stop when new_ready == replicas and
old == 0. If both max_surge and max_unavailable are 0, return None (Kubernetes rejects it).
Return {"steps": [...], "count": n}.
Implement rollout. Input: replicas: int, max_surge: int, max_unavailable: int. Returns: dict | None.
def rollout(replicas: int, max_surge: int, max_unavailable: int):
return {"steps": [[0, replicas, 0]], "count": 1}
Run executes the public tests. Submit grades against public and hidden tests.
Simulate a Deployment rolling update from replicas old pods to replicas new pods with integer
max_surge and max_unavailable. Each step:
old + new_ready ≥ replicas − max_unavailable.old + new_ready + new_starting ≤ replicas + max_surge and the new total stays ≤ replicas.Record [old, new_ready, new_starting] after each step and stop when new_ready == replicas and
old == 0. If both max_surge and max_unavailable are 0, return None (Kubernetes rejects it).
Return {"steps": [...], "count": n}.
Implement rollout. Input: replicas: int, max_surge: int, max_unavailable: int. Returns: dict | None.
def rollout(replicas: int, max_surge: int, max_unavailable: int):
return {"steps": [[0, replicas, 0]], "count": 1}
Run executes the public tests. Submit grades against public and hidden tests.