Bug 1944587 - VPA could not take actions based on the recommendation when min-replicas=1
Summary: VPA could not take actions based on the recommendation when min-replicas=1
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 4.8
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.8.0
Assignee: Joel Smith
QA Contact: Weinan Liu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-03-30 09:54 UTC by Weinan Liu
Modified: 2021-07-27 22:56 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-07-27 22:56:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:2438 0 None None None 2021-07-27 22:56:50 UTC

Description Weinan Liu 2021-03-30 09:54:21 UTC
Description of problem:


Version-Release number of selected component (if applicable):
$ oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.8.0-0.nightly-2021-03-26-054333   True        False         22h     Cluster version is 4.8.0-0.nightly-2021-03-26-054333


How reproducible:


Steps to Reproduce:
1. Install VPA on a ocp 4.8 cluster
2. Create a dc with replica=1

oc create -f- <<EOF
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
  name: hamster
spec:
  replicas: 1
  labels:
    app: hamster
  template:
    metadata:
      labels:
        app: hamster
    spec:
      containers:
        - name: hamster
          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"
EOF
3. Create VPA and wath the scaling

oc create -f- <<EOF	
apiVersion: "autoscaling.k8s.io/v1beta2"
kind: VerticalPodAutoscaler
metadata:
  name: hamster-vpa
spec:
  targetRef:
    apiVersion: "apps.openshift.io/v1"
    kind: DeploymentConfig
    name: hamster
  updatePolicy:
    updateMode: "Auto"
  resourcePolicy:
    containerPolicies:
      - containerName: '*'
        minAllowed:
          cpu: 100m
          memory: 50Mi
        maxAllowed:
          cpu: 1
          memory: 500Mi
        controlledResources: ["cpu", "memory"]
EOF

Actual results:
VPA could not take actions based on the recommendation when min-replicas=1 

Expected results:
VPA could not take actions based on the recommendation 
Additional info:

$ oc get dc -n hamster
NAME      REVISION   DESIRED   CURRENT   TRIGGERED BY
hamster   1          1         1         config


$ paste <(oc get pods -n hamster -o="custom-columns=Name:.metadata.name,Phase:.status.phase,CPU Req:.spec.containers[0].resources.requests.cpu") <(oc get podmetrics -n hamster -o="custom-columns=CPU Used:containers[0].usage.cpu")
Name               Phase       CPU Req	CPU Used
hamster-1-deploy   Succeeded   <none>	299m
hamster-1-hjdgk    Running     100m	

$ oc get vpa -n hamster hamster-vpa --no-headers -o "custom-columns=:\
> status.recommendation.containerRecommendations[0].target.cpu"

671m

$ oc describe vpa -n hamster

...  Recommendation:
    Container Recommendations:
      Container Name:  hamster
      Lower Bound:
        Cpu:     509m
        Memory:  262144k
      Target:
        Cpu:     671m
        Memory:  262144k
      Uncapped Target:
        Cpu:     671m
        Memory:  262144k
      Upper Bound:
        Cpu:     1
        Memory:  262144k
Events:          <none>


$ oc describe deployment.apps/vpa-admission-plugin-default
...
Conditions:
  Type           Status  Reason
  ----           ------  ------
  Available      True    MinimumReplicasAvailable
  Progressing    True    NewReplicaSetAvailable
OldReplicaSets:  vpa-admission-plugin-default-75ccbdc6fd (1/1 replicas created)
NewReplicaSet:   <none>
Events:          <none>

Comment 5 errata-xmlrpc 2021-07-27 22:56:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:2438


Note You need to log in before you can comment on or make changes to this bug.