0

before start, i'm running kubernetes on mac.

  • minikube: 1.17.0
  • metrics-server: 1.8+
  • vpa: vpa-release-0.8

my issue is vpa doesn't scale up my pod just keep recreating pods. i followed gke vpa example. i set resource requests of deployment cpu: 100m, memory: 50mi. and deploy vpa. it gave me recommendation. updatemode is Auto as well. but it keep recreating pod, doesn't change resource requests when i checked the pod what recreated by kubectl describe pod podname.
enter image description here

apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
  name: my-vpa
spec:
  targetRef:
    apiVersion: "apps/v1"
    kind: Deployment
    name: my-app-deployment
  updatePolicy:
    updateMode: "Auto"
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app-deployment
spec:
  replicas: 2
  selector:
    matchLabels:
      app: my-app-deployment
  template:
    metadata:
      labels:
        app: my-app-deployment
    spec:
      containers:
      - name: my-container
        image: k8s.gcr.io/ubuntu-slim:0.1
        resources:
          requests:
            cpu: 100m
            memory: 50Mi
        command: ["/bin/sh"]
        args: ["-c", "while true; do timeout 0.5s yes >/dev/null; sleep 0.5s; done"]
Status:
  Conditions:
    Last Transition Time:  2021-02-03T03:13:38Z
    Status:                True
    Type:                  RecommendationProvided
  Recommendation:
    Container Recommendations:
      Container Name:  my-container
      Lower Bound:
        Cpu:     25m
        Memory:  262144k
      Target:
        Cpu:     548m
        Memory:  262144k
      Uncapped Target:
        Cpu:     548m
        Memory:  262144k
      Upper Bound:
        Cpu:     100G
        Memory:  100T
Events:          <none>

i tried with kind as well. but it recreate pods with new resource request, but never run keep pending because the node's resource is not enough. and i think the reason why vpa doesn't work properly is minikube or me didn't make multiple node. you think is that relative?

변상현
  • 13
  • 3
  • Hi @변상현, What is your docker [driver](https://minikube.sigs.k8s.io/docs/drivers/)? Did you enable metrics-server addon on your minikube with `minikube addons enable metrics-server`? Could you verify if it's installed correctly with `kubectl top pods`? Could you add `kubectl describe vpa` from your gke cluster? The VerticalPodAutoscaler uses the `lowerBound` and `upperBound` recommendations to decide whether to delete a Pod and replace it with a new Pod, and your Upper Bound is very high, wondering how big is this on gke, as you mentioned it's working here out of the box. – Jakub Feb 03 '21 at 12:45
  • Hi @Jakub, i can't add the code box(?) in comment window. so i answered myself about your request.3 – 변상현 Feb 04 '21 at 01:26
  • You can edit your answer to add additional information. – Jakub Feb 04 '21 at 09:08
  • i'm not sure, it worked well with GKE. – 변상현 Feb 08 '21 at 05:35

0 Answers0