How to fix ScaleTargetRef not found in Kubernetes

KubernetesINTERMEDIATEHIGHUpdated Dec 5, 2025· 113 views

The Horizontal Pod Autoscaler cannot find the target Deployment, ReplicaSet, or StatefulSet specified in scaleTargetRef. This is typically caused by typos, namespace mismatches, or incorrect apiVersion.

Quick fix

Fixes ScaleTargetRef not found

kubectl get deployment <deployment-name> -n <namespace>
kubectl get replicaset <rs-name> -n <namespace>
kubectl get statefulset <sts-name> -n <namespace>
  1. Verify the target resource exists
  2. Check the HPA scaleTargetRef configuration
  3. Verify HPA and target are in the same namespace
  4. Use the correct apiVersion
kubernetes — error
kubectl get deployment <deployment-name> -n <namespace>
kubectl get replicaset <rs-name> -n <namespace>
kubectl get statefulset <sts-name> -n <namespace>
ScaleTargetRef not found

What this error means

The Horizontal Pod Autoscaler (HPA) requires a valid reference to a scalable workload (Deployment, ReplicaSet, or StatefulSet) in its scaleTargetRef field. When this error occurs, the HPA controller cannot locate the referenced resource, which completely prevents autoscaling from functioning. The scaleTargetRef specifies three critical fields: apiVersion, kind, and name. If any of these are incorrect, or if the target resource exists in a different namespace, the HPA will fail to find it. Kubernetes requires exact matches—there's no fuzzy matching or cross-namespace references allowed. This error often appears after renaming deployments, migrating between namespaces, or when copying HPA configurations between environments without updating the target reference.

Typical symptoms

  • HPA shows condition "AbleToScale: False" with reason "FailedGetScale"
  • kubectl describe hpa shows "target not found" or "ScaleTargetRef not found" error
  • HPA TARGETS column shows "<unknown>" or "<error>"
  • Events show "Warning FailedGetScale" with message about missing target
  • Autoscaling does not work even though the Deployment exists and has pods running
  • HPA worked previously but stopped after deployment rename or migration

Common causes

  1. Target Deployment/ReplicaSet/StatefulSet does not exist in the cluster
  2. Misspelled target name in scaleTargetRef.name field (case-sensitive)
  3. Namespace mismatch—HPA and target must be in the same namespace
  4. Wrong apiVersion (e.g., using extensions/v1beta1 instead of apps/v1)
  5. Incorrect kind specified (e.g., "Deployment" vs "ReplicaSet")
  6. Using deprecated scaleRef field instead of scaleTargetRef
  7. Multiple HPAs targeting the same resource causing conflicts

How to fix "ScaleTargetRef not found"

1Verify the target resource exists

Check if the deployment or workload referenced by the HPA actually exists:

bash
kubectl get deployment <deployment-name> -n <namespace>
kubectl get replicaset <rs-name> -n <namespace>
kubectl get statefulset <sts-name> -n <namespace>

List all deployments in the namespace to find the correct name:

bash
kubectl get deployments -n <namespace>

Note that names are case-sensitive.

2Check the HPA scaleTargetRef configuration

View the current HPA configuration to identify mismatches:

bash
kubectl get hpa <hpa-name> -n <namespace> -o yaml

Look at the scaleTargetRef section:

yaml
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: my-deployment  # Must match exactly

Compare the name field with the actual deployment name.

3Verify HPA and target are in the same namespace

HPA cannot target resources in other namespaces. Verify both are in the same namespace:

bash
kubectl get hpa <hpa-name> -n <namespace>
kubectl get deployment <deployment-name> -n <namespace>

If they're in different namespaces, either:
1. Move the HPA to the same namespace as the target
2. Move the target to the same namespace as the HPA

Create the HPA in the correct namespace:

bash
kubectl apply -f hpa.yaml -n <target-namespace>
4Use the correct apiVersion

For Kubernetes 1.16+, use apps/v1 for Deployments:

yaml
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: my-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1  # NOT extensions/v1beta1
    kind: Deployment
    name: my-deployment
  minReplicas: 1
  maxReplicas: 10
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 80

The deprecated extensions/v1beta1 was removed in Kubernetes 1.16.

5Verify the correct kind

Ensure you're using the correct kind (Deployment, ReplicaSet, or StatefulSet):

bash
# Check what type of resource you actually have
kubectl get all -n <namespace> | grep <name>

Common valid kinds for HPA:
- Deployment (most common)
- ReplicaSet
- StatefulSet

Note: You cannot target a Pod directly—only controllers that manage pods.

6Apply the corrected HPA and verify

Update the HPA with the correct scaleTargetRef:

bash
kubectl apply -f hpa.yaml -n <namespace>

Verify the HPA can now find and scale the target:

bash
kubectl describe hpa <hpa-name> -n <namespace>

Look for:
- "AbleToScale: True" in conditions
- No "FailedGetScale" events
- TARGETS showing actual utilization percentages

bash
kubectl get hpa <hpa-name> -n <namespace>

Advanced notes

Namespace isolation for HPA is intentional—it's a security feature. Cross-namespace scaling would allow HPA in one namespace to affect workloads in another, potentially violating tenant isolation.

API version deprecation history: extensions/v1beta1 was deprecated in 1.14 and removed in 1.16. apps/v1beta1 was deprecated in 1.9. Always use apps/v1 for Deployments, ReplicaSets, and StatefulSets in modern Kubernetes.

The scale subresource: HPA doesn't modify the Deployment directly. Instead, it uses the scale subresource (GET/PUT on /scale). Not all resources support the scale subresource—custom resources need to explicitly enable it in their CRD definition.

StatefulSet scaling behavior differs from Deployments: pods are scaled sequentially (one at a time) rather than in parallel, and each pod must be Ready before the next is created or deleted.

If you have multiple HPAs accidentally targeting the same resource, they may conflict. Each scalable resource should have at most one HPA.

Frequently asked questions

What does "ScaleTargetRef not found" mean?
The Horizontal Pod Autoscaler (HPA) requires a valid reference to a scalable workload (Deployment, ReplicaSet, or StatefulSet) in its scaleTargetRef field. When this error occurs, the HPA controller cannot locate the referenced resource, which completely prevents autoscaling from functioning. The scaleTargetRef specifies three critical fields: apiVersion, kind, and name.
How do I fix "ScaleTargetRef not found"?
The Horizontal Pod Autoscaler cannot find the target Deployment, ReplicaSet, or StatefulSet specified in scaleTargetRef. This is typically caused by typos, namespace mismatches, or incorrect apiVersion.
What causes "ScaleTargetRef not found"?
Target Deployment/ReplicaSet/StatefulSet does not exist in the cluster Misspelled target name in scaleTargetRef.name field (case-sensitive) Namespace mismatch—HPA and target must be in the same namespace
Is the "ScaleTargetRef not found" error serious?
Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.

Official resources & further reading