Kubernetes VPA failed to fetch list of containers. Reason: context deadline exceeded. Last server error: <nil>

1/8/2020

Hi I am trying to deploy a VPA object for one of my deployment but when describing the conditions are failing with error

Status:
 Conditions:
   Last Transition Time:  2020-01-08T13:03:55Z
   Message:               Fetching history failed: Failed to fetch list of containers. Reason: context deadline exceeded. Last server error: <nil>
   Reason:                2020-01-08T13:03:55Z
   Status:                False
   Type:                  FetchingHistory
   Last Transition Time:  2020-01-08T13:03:55Z
   Status:                False
   Type:                  LowConfidence
   Last Transition Time:  2020-01-08T13:03:55Z
   Message:               No pods match this VPA object
   Reason:                NoPodsMatched
   Status:                True
   Type:                  NoPodsMatched
   Last Transition Time:  2020-01-08T13:03:55Z
   Status:                True
   Type:                  RecommendationProvided

Here is my VPA file:

apiVersion: autoscaling.k8s.io/v1beta2
kind: VerticalPodAutoscaler
metadata:
  name: xtenter-vpa
  namespace: mynamespace
spec:
  targetRef:
    apiVersion: "extensions/v1beta1"
    kind:       Deployment
    name:       mydeploy
  updatePolicy:
    updateMode: "Auto"

One more scenario I found is that when I run the VPA with updatePolicy mode as "Off" I got a different error in the status of VPA.

 Conditions:
    Last Transition Time:  2020-01-10T06:53:55Z
    Message:               Fetching history failed: Failed to fetch list of containers. Reason: Failed to listTimeSerises with retries. Last server error: rpc error: code = InvalidArgument desc = Name must begin with '{resource_container_type}/{resource_container_id}', got: projects/
    Reason:                2020-01-10T06:53:55Z
    Status:                False
    Type:                  FetchingHistory
    Last Transition Time:  2020-01-10T06:44:55Z
    Status:                False
    Type:                  LowConfidence
    Last Transition Time:  2020-01-10T06:44:55Z
    Message:               No pods match this VPA object
    Reason:                NoPodsMatched
    Status:                True
    Type:                  NoPodsMatched
    Last Transition Time:  2020-01-10T06:44:55Z
    Status:                True
    Type:                  RecommendationProvided

Cluster details : version: 1.13.11-gke.14 Stackdriver Kubernetes Engine Monitoring: Disabled Legacy Stackdriver Logging: Enabled

Could you please help me understand what is the root cause here?

-- Sumit Srivastava
google-kubernetes-engine
kubernetes

2 Answers

1/30/2020

Thanks Imtiaz , Will try that but there is an issue in Kubernetes autoscaler 1.13.11-gke.14 which will be fixed.. Please check below link https://github.com/kubernetes/autoscaler/issues/2725#issuecomment-575134855

-- Sumit Srivastava
Source: StackOverflow

1/14/2020

I was able to deploy VPA without any error in a GKE cluster version 1.14.7-gke.25 by following this documentation. I suggest you try the same; this will probably help you identify any issues with your current configuration.

-- Imtiaz K
Source: StackOverflow