How to extend resource capacity in Kubernetes Quota?
If we capacity has been exhausted and we need to extend it. We
can do in two way.
Vertical and Horizontal upgrade.
By horizontal upgrade, you can go ahead and add one more
replica to running deployment.
# kubectl get pods
NAME READY STATUS RESTARTS AGE
varelite6-6545486c46-mj62w 1/1 Running 0 16m
varelite6-6545486c46-zs9xb 1/1 Running 0 16m
# kubectl scale --replicas=3 deploy varelite6
deployment.apps/varelite6 scaled
# kubectl get pods
NAME READY STATUS RESTARTS AGE
varelite6-6545486c46-mj62w 1/1 Running 0 5h4m
varelite6-6545486c46-rnc6f 0/1 ContainerCreating 0 3s
varelite6-6545486c46-zs9xb 1/1 Running 0 5h4m
Here one more pod will be added to your deployment. This is the
horizontal scaling.
Now in case of vertical you can go ahead and edit the
deployment yaml and can upgrade the memory and apply. It will
use Rolling out strategy and will upgrade with its policy. It
will create new one and terminate one as per policy of rolling
strategy.
# kubectl edit deploy varelite6
deployment.apps/varelite6 edited
# kubectl get pods
NAME READY STATUS RESTARTS AGE
varelite6-6545486c46-mj62w 1/1 Running 0 5h7m
varelite6-6545486c46-zs9xb 1/1 Running 0 5h7m
varelite6-6c779cfdff-c76q2 1/1 Running 0 6s
varelite6-6c779cfdff-vmtfk 0/1 ContainerCreating 0 1s
# kubectl get pods
NAME READY STATUS RESTARTS AGE
varelite6-6545486c46-mj62w 0/1 Terminating 0 5h7m
varelite6-6545486c46-zs9xb 1/1 Running 0 5h7m
varelite6-6c779cfdff-76t5x 0/1 ContainerCreating 0 1s
varelite6-6c779cfdff-c76q2 1/1 Running 0 9s
varelite6-6c779cfdff-vmtfk 1/1 Running 0 4s
# kubectl get pods
NAME READY STATUS RESTARTS AGE
varelite6-6c779cfdff-76t5x 1/1 Running 0 9s
varelite6-6c779cfdff-c76q2 1/1 Running 0 17s
varelite6-6c779cfdff-vmtfk 1/1 Running 0 12s