Error: horizontalpodautoscalers.autoscaling "nginx-1-hpa" already exists

6/19/2018

I am new to gcp and kubernetes and while deploying a workload in a cluster I was stuck with this error "Error: horizontalpodautoscalers.autoscaling "nginx-1-hpa" already exists". Can any one help with this?

-- Takhi Abed
deployment
google-cloud-platform
google-kubernetes-engine
kubernetes
nginx

1 Answer

6/19/2018

From the error message that you've shared, it seems that you are trying to create a Horizontal Pod Autoscaler that already exists.

To fix this, you will have to delete the Horizontal Pod Autoscaler named “nginx-1-hpa”.

The command to delete the HPA "nginx-1-hpa" is:

$ kubectl delete hpa  nginx-1-hpa

After deleting the HPA, you will be able to deploy the workload.

-- Mahmoud Sharif
Source: StackOverflow