kuberneteskubectlpolicyquota

Can we update K8 quota policy using command line


I have set a quota policy on my Kubernetes namespaces. I want to update the policy using kubectl command. Is there a kubectl command to update quota policy eg: kubectl edit resourcequota tmc.orgp.large -n quota-mem-cpu-example (where i can pass the update cpu mem ).

enter image description here

Currently, limits.cpu is 4, can i update it to 8 using the command line?


Solution

  • Try:

    kubectl patch -p '{"spec":{"hard":{"limits.cpu":"8"}}}' resourcequota tmc.orgp.large --namespace quota-mem-cpu-example