Pages

Pages

15 กรกฎาคม 2567

kubectl command update min-replicas and max-replicas of hpa

To update min-replicas or max-replicas of hpa using kubectl command, just run

kubectl -n YOUR_NAME_SPACE patch hpa YOUR_DEPLOYMENT --patch '{"spec":{"minReplicas":2,"maxReplicas":10}}'

The command above will set min-replicas to 2, and set max-replicas to 10

To review hpa result, run this command

kubectl -n YOUR_NAME_SPACE get hpa -o=custom-columns=NAME:.metadata.name,MIN:.spec.minReplicas,MAX:.spec.maxReplicas

ไม่มีความคิดเห็น:

แสดงความคิดเห็น