OPTIMIZED POD PROVISIONING IN KUBERNETES AUTO-SCALER ENVIRONMENT
A pod-pinning tool selects a Kubernetes pod to act as an arbiter pod that controls pod allocation for nodes from a plurality of candidate pods. Responsive to determining that a scaling operation is to be performed, the pod-pinning tool instructs the arbiter pod to generate a placeholder node while an assigned node is instantiated. The pod-pinning tool instructs the arbiter pod to bind one or more particular pods to the placeholder node. Responsive to determining that the assigned node is instantiated, the pod-pinning tool instructs the arbiter pod to clear the placeholder node.
1 . A method comprising:
selecting a pod to act as an arbiter pod that controls pod allocation for nodes from a plurality of candidate pods;
responsive to determining that a scaling operation is to be performed, instructing the arbiter pod to generate a placeholder node while an assigned node is instantiated;
instructing the arbiter pod to bind one or more particular pods to the placeholder node; and
responsive to determining that the assigned node is instantiated, instructing the arbiter pod to clear the placeholder node.
2 . The method of claim 1 , wherein instructing the arbiter pod to generate the placeholder node comprises indicating identity metadata for the assigned node to be used by the placeholder while the assigned node is instantiated.
3 . The method of claim 1 , wherein the scaling operation defines resources to be allocated to the assigned node.
4 . The method of claim 3 , wherein the one or more particular pods are selected for binding to the placeholder node based on an optimization of capacity of the one or more particular pods relative to the resources to be allocated to the assigned node.
5 . The method of claim 1 , wherein binding the one or more particular pods to the placeholder nodes while the assigned node is instantiated prevents cleanup of the one or more particular pods by a Kubernetes control plane.
6 . The method of claim 1 , wherein the arbiter pod executes on instructions by making application programming interface (API) calls to a Kubernetes control plane that effect generate, bind, and clear instructions.
7 . The method of claim 6 , wherein the arbiter pod is within the Kubernetes control plane.
8 . The method of claim 7 , wherein the arbiter pod receives instructions from an entity acting outside of the Kubernetes control plane.
9 . The method of claim 1 , wherein the placeholder node is instantiated and the one or more particular pods are bound in a timeframe that is faster than the assigned node being instantiated.
10 . The method of claim 1 , wherein determining that a scaling operation is to be performed comprises automatically detecting that an existing operation has experienced a load demand that requires one or more additional nodes.
11 . The method of claim 1 , wherein the assigned node was previously instantiated, and wherein the method further comprises:
instructing the arbiter pod to drain the one or more particular pods; and
instructing the arbiter pod to monitor for re-creation of the one or more particular pods using a webhook, wherein the arbiter pod, upon detecting re-creation of the one or more particular pods, pins the one or more particular pods to the assigned node upon re-creation.
12 . The method of claim 1 , wherein pod is a Kubernetes pod.
13 . A non-transitory computer-readable medium comprising memory with instructions thereon that, when executed by one or more processors, cause the one or more processors to perform operations, the instructions comprising instructions to:
select a pod to act as an arbiter pod that controls pod allocation for nodes from a plurality of candidate pods;
responsive to determining that a scaling operation is to be performed, instruct the arbiter pod to generate a placeholder node while an assigned node is instantiated;
instruct the arbiter pod to bind one or more particular pods to the placeholder node; and
responsive to determining that the assigned node is instantiated, instruct the arbiter pod to clear the placeholder node.
14 . The non-transitory computer-readable medium of claim 13 , wherein the instructions to instruct the arbiter pod to generate the placeholder node comprise instructions to indicate identity metadata for the assigned node to be used by the placeholder while the assigned node is instantiated.
15 . The non-transitory computer-readable medium of claim 13 , wherein the scaling operation defines resources to be allocated to the assigned node.
16 . The non-transitory computer-readable medium of claim 15 , wherein the one or more particular pods are selected for binding to the placeholder node based on an optimization of capacity of the one or more particular pods relative to the resources to be allocated to the assigned node.
17 . The non-transitory computer-readable medium of claim 13 , wherein binding the one or more particular pods to the placeholder nodes while the assigned node is instantiated prevents cleanup of the one or more particular pods by a Kubernetes control plane.
18 . The non-transitory computer-readable medium of claim 13 , wherein the arbiter pod executes on instructions by making application programming interface (API) calls to a Kubernetes control plane that effect generate, bind, and clear instructions.
19 . The non-transitory computer-readable medium of claim 18 , wherein the arbiter pod is within the Kubernetes control plane.
20 . A system comprising:
a non-transitory computer-readable medium comprising memory with instructions encoded thereon; and
one or more processors that, when executing the instructions, are caused to perform operations comprising:
selecting a pod to act as an arbiter pod that controls pod allocation for nodes from a plurality of candidate pods;
responsive to determining that a scaling operation is to be performed, instructing the arbiter pod to generate a placeholder node while an assigned node is instantiated;
instructing the arbiter pod to bind one or more particular pods to the placeholder node; and
responsive to determining that the assigned node is instantiated, instructing the arbiter pod to clear the placeholder node.